From 71dab3470f51b019e65cd7655ad220a930c62be6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 23:04:23 +0200 Subject: [PATCH 0001/2732] Rpcport field --- iguana/exchanges/mm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 91b2df3dc..ffde8b2f3 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -786,12 +786,14 @@ void marketmaker(double minask,double maxbid,char *baseaddr,char *reladdr,double void LP_main(void *ptr) { - char *passphrase; double profitmargin; cJSON *argjson = ptr; + char *passphrase; double profitmargin; uint16_t port; cJSON *argjson = ptr; if ( (passphrase= jstr(argjson,"passphrase")) != 0 ) { profitmargin = jdouble(argjson,"profitmargin"); LP_profitratio += profitmargin; - LPinit(7779,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + if ( (port= juint(argjson,"rpcport")) < 1000 ) + port = 7779; + LPinit(port,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 6d7c32bd263bfd3e048f2adc17045bc79efdf394 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 11:20:43 +0200 Subject: [PATCH 0002/2732] Test --- iguana/dpow/dpow_prices.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 5f19199ca..0db9a076f 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1429,10 +1429,11 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) { int32_t i,n,iter,seconds,datenum; uint32_t timestamp; char url[1024],url2[1024],*dstr,*str; double kmddaily=0.,btcusd=0.,ask,high,low,bid,close,vol,quotevol,open,price = 0.; - //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; + double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); + //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; cJSON *quandl,*kmdhist,*array,*item,*bitcoinave,*blockchaininfo,*btctrades,*coindesk=0; sprintf(url,"https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC&start=%u&end=%u",(uint32_t)time(NULL)-60,(uint32_t)time(NULL)); - btctrades = url_json(url); + btctrades = 0;//url_json(url); //kmdtrades = url_json("https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC"); //kmdtrades2 = url_json("https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-KMD&count=50"); *kmdbtcp = 0; @@ -1461,7 +1462,6 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) } if ( 1 ) { - double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); //aveask = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&askvol,"KMD","BTC",1,argjson); //avebid = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&bidvol,"KMD","BTC",-1,argjson); if ( 0 && avebid > SMALLVAL && aveask > SMALLVAL ) @@ -1522,6 +1522,8 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) free(btctrades); //printf("poloniex.%d\n",n); } + *btcusdp = get_theoretical(&avebid,&aveask,&highbid,&lowask,&CMC_average,changes,"bitcoin","BTC","USD",&USD_average); + printf("theoretical BTC %.2f\n",*btcusdp); if ( 0 && bitcoinave != 0 ) { if ( (price= jdouble(bitcoinave,"24h_avg")) > SMALLVAL ) From 6bc4437c73d9485f3cbf4292ddcebb9aa17cb279 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 12:18:40 +0200 Subject: [PATCH 0003/2732] Test --- iguana/dpow/dpow_prices.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 0db9a076f..0b2ebf849 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1429,17 +1429,16 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) { int32_t i,n,iter,seconds,datenum; uint32_t timestamp; char url[1024],url2[1024],*dstr,*str; double kmddaily=0.,btcusd=0.,ask,high,low,bid,close,vol,quotevol,open,price = 0.; - double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); - //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; + //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; cJSON *quandl,*kmdhist,*array,*item,*bitcoinave,*blockchaininfo,*btctrades,*coindesk=0; sprintf(url,"https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC&start=%u&end=%u",(uint32_t)time(NULL)-60,(uint32_t)time(NULL)); - btctrades = 0;//url_json(url); + btctrades = url_json(url); //kmdtrades = url_json("https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC"); //kmdtrades2 = url_json("https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-KMD&count=50"); *kmdbtcp = 0; bitcoinave = 0;//url_json("https://api.bitcoinaverage.com/ticker/USD/"); //bitcoincharts = url_json("http://api.bitcoincharts.com/v1/weighted_prices.json"); - blockchaininfo = 0;//url_json("https://blockchain.info/ticker"); + blockchaininfo = url_json("https://blockchain.info/ticker"); coindesk = 0;//url_json("http://api.coindesk.com/v1/bpi/historical/close.json"); sprintf(url,"https://poloniex.com/public?command=returnChartData¤cyPair=BTC_KMD&start=%ld&end=9999999999&period=86400",(long)(time(NULL)-3600*24)); sprintf(url2,"https://poloniex.com/public?command=returnChartData¤cyPair=BTC_BTCD&start=%ld&end=9999999999&period=86400",(long)(time(NULL)-3600*24)); @@ -1462,6 +1461,7 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) } if ( 1 ) { + double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); //aveask = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&askvol,"KMD","BTC",1,argjson); //avebid = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&bidvol,"KMD","BTC",-1,argjson); if ( 0 && avebid > SMALLVAL && aveask > SMALLVAL ) @@ -1522,8 +1522,6 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) free(btctrades); //printf("poloniex.%d\n",n); } - *btcusdp = get_theoretical(&avebid,&aveask,&highbid,&lowask,&CMC_average,changes,"bitcoin","BTC","USD",&USD_average); - printf("theoretical BTC %.2f\n",*btcusdp); if ( 0 && bitcoinave != 0 ) { if ( (price= jdouble(bitcoinave,"24h_avg")) > SMALLVAL ) @@ -1543,7 +1541,7 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) if ( (item= jobj(blockchaininfo,"USD")) != 0 && item != 0 && (price= jdouble(item,"15m")) > SMALLVAL ) { dpow_price("blockchain.info","BTCUSD",price,price); - //printf("blockchaininfo %f %f\n",btcusd,price); + printf("blockchaininfo %f %f\n",btcusd,price); dxblend(&btcusd,price,0.5); } free_json(blockchaininfo); From 6f115530c985f094b53f984148881d5931af6f78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 12:31:13 +0200 Subject: [PATCH 0004/2732] Fix btc overflow --- iguana/dpow/dpow_prices.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 0b2ebf849..f77073532 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1920,7 +1920,11 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i pvals[1] = timestamp; pvals[2] = MAX_CURRENCIES + 3; pvals[3] = PAX_val32(dp->kmdbtc * 1000); - pvals[4] = PAX_val32(dp->btcusd * .001); + double btcfactor; + if ( time(NULL) > 1503742923+24*3600*0 ) + btcfactor = .00001; + else btcfactor = .001; + pvals[4] = PAX_val32(dp->btcusd * btcfactor); pvals[5] = PAX_val32(dp->CNYUSD); if ( dispflag != 0 ) printf("KMD %.8f BTC %f CNY %f (%f)\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD); From d894bf088706ae92a4f0da8e436952b4ecd0656d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 13:28:21 +0200 Subject: [PATCH 0005/2732] Test --- iguana/dpow/dpow_prices.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index f77073532..0d966f1a7 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1832,6 +1832,9 @@ void PAX_genecbsplines(struct PAX_data *dp) portable_mutex_unlock(&mutex); } +#define BTCFACTOR_TIMESTAMP 1503746319 +#define BTCFACTOR_HEIGHT 466266 + int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t idlegap) { static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; @@ -1921,7 +1924,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i pvals[2] = MAX_CURRENCIES + 3; pvals[3] = PAX_val32(dp->kmdbtc * 1000); double btcfactor; - if ( time(NULL) > 1503742923+24*3600*0 ) + if ( time(NULL) > BTCFACTOR_TIMESTAMP ) btcfactor = .00001; else btcfactor = .001; pvals[4] = PAX_val32(dp->btcusd * btcfactor); From 663ae466e8b935d09c72a7e18476e45ba61888f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:10:17 +0200 Subject: [PATCH 0006/2732] Test --- iguana/dpow/dpow_prices.c | 8 ++++---- iguana/iguana_notary.c | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 0d966f1a7..528617b01 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1924,13 +1924,13 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i pvals[2] = MAX_CURRENCIES + 3; pvals[3] = PAX_val32(dp->kmdbtc * 1000); double btcfactor; - if ( time(NULL) > BTCFACTOR_TIMESTAMP ) + //if ( time(NULL) > BTCFACTOR_TIMESTAMP ) btcfactor = .00001; - else btcfactor = .001; + //else btcfactor = .001; pvals[4] = PAX_val32(dp->btcusd * btcfactor); pvals[5] = PAX_val32(dp->CNYUSD); - if ( dispflag != 0 ) - printf("KMD %.8f BTC %f CNY %f (%f)\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD); + //if ( dispflag != 0 ) + printf("KMD %.8f BTC %f CNY %f (%f) btcusd pval.%u\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD,pvals[4]); sprintf(fname,"/%s/.komodo/komodofeed",userhome); if ( (fp= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index fe9d14c60..a8518be7b 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -71,9 +71,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he else { freq = 1; - //minsigs = 7;//(komodo_notaries(dp->symbol,pubkeys,height) >> 1) + 1; - //if ( minsigs < DPOW_MINSIGS ) - minsigs = DPOW_MINSIGS; + minsigs = 11; } printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); From d320678659b66ffe47710e4c531e7fa94a879ee8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:23:16 +0200 Subject: [PATCH 0007/2732] Test --- iguana/dPoW.h | 2 +- iguana/dpow/dpow_network.c | 8 ++++---- iguana/dpow/dpow_prices.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index b773104c8..47e9f1642 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -137,7 +137,7 @@ struct dpow_info int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; struct pax_transaction *PAX; portable_mutex_t paxmutex,dexmutex; - uint32_t ipbits[64],numipbits; + uint32_t ipbits[128],numipbits; struct dpow_block **blocks; }; uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp); diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 33592f0b8..635930b42 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1318,7 +1318,7 @@ struct dpow_nanomsghdr { bits256 srchash,desthash; struct dpow_nanoutxo ratify,notarize; - uint32_t channel,height,size,datalen,crc32,myipbits,numipbits,ipbits[64]; + uint32_t channel,height,size,datalen,crc32,myipbits,numipbits,ipbits[128]; char symbol[16]; uint8_t senderind,version0,version1,packet[]; } PACKED; @@ -2026,10 +2026,10 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_blo printf("%d NANOSEND.%d ht.%d channel.%08x (%d) pax.%08x datalen.%d (%d %llx) (%d %llx) recv.%llx\n",i,sentbytes,np->height,np->channel,size,np->notarize.paxwdcrc,datalen,(int8_t)np->notarize.bestk,(long long)np->notarize.bestmask,bp->notaries[bp->myind].bestk,(long long)bp->notaries[bp->myind].bestmask,(long long)bp->recvmask); } -void dpow_ipbitsadd(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t *ipbits,int32_t numipbits,int32_t fromid,uint32_t senderipbits) +void dpow_ipbitsadd(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t *ipbits,int32_t numipbits,int32_t maxipbits,int32_t fromid,uint32_t senderipbits) { int32_t i,j,matched,missing,n; char ipaddr[64]; - if ( numipbits >= 64 ) + if ( numipbits >= maxipbits ) { static int32_t counter; if ( counter++ < 100 ) @@ -2112,7 +2112,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) printf("received nnpacket for (%s)\n",np->symbol); else { - dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,np->senderind,np->myipbits); + dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,sizeof(np->ipbits)/sizeof(*np->ipbits),np->senderind,np->myipbits); if ( (bp= dpow_heightfind(myinfo,dp,np->height)) != 0 && bp->state != 0xffffffff && bp->myind >= 0 ) { //char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d i.%d senderind.%d myind.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz,i,np->senderind,bp->myind); diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 528617b01..d01ea756f 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1907,8 +1907,8 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i PAX_emitprices(pvals,dp); } timestamp = (uint32_t)time(NULL); - int32_t dispflag = ((rand() % 64) == 0); - if ( dp->kmdbtc == 0 || dispflag != 0 ) + int32_t dispflag = ((rand() % 6) == 0); + if ( dp->kmdbtc == 0 || dp->btcusd == 0 || dispflag != 0 ) { PAX_update(dp,&dp->btcusd,&dp->kmdbtc); for (i=0; i Date: Sat, 26 Aug 2017 14:27:12 +0200 Subject: [PATCH 0008/2732] Test --- iguana/dpow/dpow_prices.c | 3 ++- iguana/iguana_exchanges.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index d01ea756f..01b252ae6 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1839,6 +1839,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i { static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; FILE *fp; long filesize; char fname[512]; double splineval; uint32_t pvals[128],timestamp; int32_t i,datenum,seconds,c; struct tai t; struct PAX_data *dp; uint8_t data[512]; + printf("PAX_IDLE\n"); if ( Currencymasks[0] == 0 ) return(0); if ( didinit == 0 ) @@ -1942,7 +1943,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i printf("error writing pvals to (%s)\n",fname); fclose(fp); } - if ( dispflag != 0 ) + //if ( dispflag != 0 ) { for (i=0; i<6; i++) printf("%u ",pvals[i]); diff --git a/iguana/iguana_exchanges.c b/iguana/iguana_exchanges.c index d7445f681..d2cd1c267 100755 --- a/iguana/iguana_exchanges.c +++ b/iguana/iguana_exchanges.c @@ -784,7 +784,8 @@ void exchanges777_loop(void *ptr) printf("exchanges loop.(%s)\n",exchange->name); while ( 1 ) { - PAX_idle(myinfo); + if ( strcmp("bitcoin",exchange->name) == 0 ) + PAX_idle(myinfo); flag = retval = 0; retstr = 0; if ( (req= queue_dequeue(&exchange->requestQ)) != 0 ) From ba8df3b3afa2f86881c686b0d64815aab3fde2c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:31:17 +0200 Subject: [PATCH 0009/2732] Test --- iguana/dpow/dpow_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 01b252ae6..a5b04d2b9 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1839,7 +1839,6 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i { static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; FILE *fp; long filesize; char fname[512]; double splineval; uint32_t pvals[128],timestamp; int32_t i,datenum,seconds,c; struct tai t; struct PAX_data *dp; uint8_t data[512]; - printf("PAX_IDLE\n"); if ( Currencymasks[0] == 0 ) return(0); if ( didinit == 0 ) @@ -1909,6 +1908,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i } timestamp = (uint32_t)time(NULL); int32_t dispflag = ((rand() % 6) == 0); + printf("PAX_IDLE.%d %.8f %.8f\n",dispflag,dp->kmdbtc,dp->btcusd); if ( dp->kmdbtc == 0 || dp->btcusd == 0 || dispflag != 0 ) { PAX_update(dp,&dp->btcusd,&dp->kmdbtc); From 245dcfaef3bc57e371b4d373d464cb98b6505e11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:36:05 +0200 Subject: [PATCH 0010/2732] Test --- iguana/dpow/dpow_prices.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index a5b04d2b9..944a2c855 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1908,7 +1908,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i } timestamp = (uint32_t)time(NULL); int32_t dispflag = ((rand() % 6) == 0); - printf("PAX_IDLE.%d %.8f %.8f\n",dispflag,dp->kmdbtc,dp->btcusd); + //printf("PAX_IDLE.%d %.8f %.8f\n",dispflag,dp->kmdbtc,dp->btcusd); if ( dp->kmdbtc == 0 || dp->btcusd == 0 || dispflag != 0 ) { PAX_update(dp,&dp->btcusd,&dp->kmdbtc); @@ -1930,8 +1930,6 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i //else btcfactor = .001; pvals[4] = PAX_val32(dp->btcusd * btcfactor); pvals[5] = PAX_val32(dp->CNYUSD); - //if ( dispflag != 0 ) - printf("KMD %.8f BTC %f CNY %f (%f) btcusd pval.%u\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD,pvals[4]); sprintf(fname,"/%s/.komodo/komodofeed",userhome); if ( (fp= fopen(fname,"wb")) != 0 ) { @@ -1943,11 +1941,11 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i printf("error writing pvals to (%s)\n",fname); fclose(fp); } - //if ( dispflag != 0 ) + if ( dispflag != 0 ) { for (i=0; i<6; i++) printf("%u ",pvals[i]); - printf("pvals -> %s\n",fname); + printf("KMD %.8f BTC %f CNY %f (%f) btcusd pval.%u\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD,pvals[4]); } } } From 5ebb80affea4271aae2101b4ef9ea724ccee0e7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 15:17:19 +0200 Subject: [PATCH 0011/2732] Test --- iguana/dpow/dpow_prices.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 944a2c855..d83da8dd1 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1837,11 +1837,11 @@ void PAX_genecbsplines(struct PAX_data *dp) int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t idlegap) { - static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; + static double lastupdate,lastdayupdate; static uint32_t didinit; static char *userhome; int32_t idlegap = 10; FILE *fp; long filesize; char fname[512]; double splineval; uint32_t pvals[128],timestamp; int32_t i,datenum,seconds,c; struct tai t; struct PAX_data *dp; uint8_t data[512]; if ( Currencymasks[0] == 0 ) return(0); - if ( didinit == 0 ) + if ( time(NULL) > didinit+12*3600 ) { if ( (userhome= OS_filestr(&filesize,"userhome.txt")) == 0 ) userhome = "root"; @@ -1852,15 +1852,15 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i userhome[strlen(userhome)-1] = 0; } } - myinfo->PAXDATA = calloc(1,sizeof(*dp)); - didinit = 1; + if ( myinfo->PAXDATA == 0 ) + myinfo->PAXDATA = calloc(1,sizeof(*dp)); dp = myinfo->PAXDATA; PAX_genecbsplines(dp); printf("generated splines\n"); - datenum = OS_conv_unixtime(&t,&seconds,(uint32_t)time(NULL)); + didinit = (uint32_t)time(NULL); + datenum = OS_conv_unixtime(&t,&seconds,didinit); expand_datenum(dp->edate,datenum); } - dp = myinfo->PAXDATA; /*if ( 0 && time(NULL) > dp->lastupdate+10 ) { From 0dcbd5b7f783c571e2f9ec97f3fde0bbaad6ccbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 20:59:11 +0200 Subject: [PATCH 0012/2732] Test --- iguana/dpow/dpow_network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 635930b42..d3257cbc4 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -561,7 +561,7 @@ void dex_channelsend(struct supernet_info *myinfo,bits256 srchash,bits256 destha void dpow_randipbits(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *retjson) { - int32_t m; uint32_t ipbits; char *coinstr; + int32_t m; uint32_t ipbits; char *coinstr; cJSON *infojson; if ( is_cJSON_Array(retjson) == 0 ) { if ( (m= myinfo->numdpowipbits) > 0 ) @@ -572,6 +572,11 @@ void dpow_randipbits(struct supernet_info *myinfo,struct iguana_info *coin,cJSON } if ( (coinstr= jstr(retjson,"coin")) == 0 ) jaddstr(retjson,"coin",coin->symbol); + if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 ) + { + jaddnum(retjson,"notaryheight",juint(infojson,"blocks")); + free_json(infojson); + } } } From 319b13f954a1ddc3eefeaa0055f7d18e60e26bcc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 22:35:28 +0200 Subject: [PATCH 0013/2732] CHIPS --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 2964fc4f9..9bae7a503 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 22b84e82303579296449eb18be3e4ef2632209bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:21:08 +0200 Subject: [PATCH 0014/2732] Secret addresses --- iguana/exchanges/LP_commands.c | 7 +++++++ iguana/exchanges/LP_utxos.c | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f50c73ab5..7d7e6435a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -164,6 +164,13 @@ dividends(coin, height, )\n\ { return(LP_portfolio()); } + else if ( strcmp(method,"secretaddresses") == 0 ) + { + uint8_t taddr,pubtype; + pubtype = (jobj(argjson,"pubtype") == 0) ? 60 : juint(argjson,"pubtype"); + taddr = (jobj(argjson,"taddr") == 0) ? 0 : juint(argjson,"taddr"); + return(LP_secretaddresses(ctx,jstr(argjson,"passphrase"),juint(argjson,"num"),taddr,pubtype)); + } if ( base != 0 && rel != 0 ) { double price,bid,ask; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f13b1e436..c20486f02 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -907,6 +907,41 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr return(total); } +char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) +{ + int32_t i; uint8_t tmptype,pubkey33[33]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; + retjson = cJSON_CreateArray(); + if ( passphrase == 0 || passphrase[0] == 0 ) + passphrase = "password"; + if ( n <= 0 ) + n = 16; + else if ( n > 777 ) + n = 777; + printf("secrets.[%d] <%s> t.%u p.%u\n",n,passphrase,taddr,pubtype); + for (i=0; i %s vs %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkprivkey)); + free_json(retjson); + return(clonestr("{\"error\":\"couldnt validate wifstr\"}")); + } + else if ( tmptype != pubtype ) + { + printf("checktype.%d != pubtype.%d\n",tmptype,pubtype); + free_json(retjson); + return(clonestr("{\"error\":\"couldnt validate pubtype\"}")); + } + jaddistr(retjson,coinaddr); + } + printf("retjson.(%s)\n",jprint(retjson,0)); + return(jprint(retjson,1)); +} + bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { static uint32_t counter; From ea94d549c178701f725e62bdaacdda13e65d6ebe Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:26:35 +0200 Subject: [PATCH 0015/2732] Test --- iguana/exchanges/LP_utxos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c20486f02..8a0c17397 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -923,6 +923,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint sprintf(buf,"secretaddress %s %03d",passphrase,i); conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)buf,(int32_t)strlen(buf)); bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); + bitcoin_priv2wif(0,wifstr,privkey,188); bitcoin_wif2priv(0,&tmptype,&checkprivkey,wifstr); if ( bits256_cmp(checkprivkey,privkey) != 0 ) { From 2f2d86dac5c572e1aefed30accbaed1cd7e6c640 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:29:29 +0200 Subject: [PATCH 0016/2732] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8a0c17397..8d3189a8b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { - int32_t i; uint8_t tmptype,pubkey33[33]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; + int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; retjson = cJSON_CreateArray(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; @@ -925,6 +925,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); bitcoin_priv2wif(0,wifstr,privkey,188); bitcoin_wif2priv(0,&tmptype,&checkprivkey,wifstr); + bitcoin_addr2rmd160(taddr,&tmptype,rmd160,coinaddr); if ( bits256_cmp(checkprivkey,privkey) != 0 ) { printf("WIF.(%s) error -> %s vs %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkprivkey)); From f82dd6e72ff7c947407196a2df2b321e69ffefc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:40:29 +0200 Subject: [PATCH 0017/2732] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d3189a8b..b3c4a98e9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -910,7 +910,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; - retjson = cJSON_CreateArray(); + retjson = cJSON_CreateObject(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; if ( n <= 0 ) @@ -938,9 +938,9 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint free_json(retjson); return(clonestr("{\"error\":\"couldnt validate pubtype\"}")); } - jaddistr(retjson,coinaddr); + jaddstr(retjson,coinaddr,wifstr); + printf("./komodo-cli jumblr_secret %s\n",coinaddr); } - printf("retjson.(%s)\n",jprint(retjson,0)); return(jprint(retjson,1)); } From e1f7c8ca4e254dcd26244a5777bfd6c00f142221 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:52:04 +0200 Subject: [PATCH 0018/2732] Test --- iguana/exchanges/secretaddresses | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 iguana/exchanges/secretaddresses diff --git a/iguana/exchanges/secretaddresses b/iguana/exchanges/secretaddresses new file mode 100755 index 000000000..696ccb881 --- /dev/null +++ b/iguana/exchanges/secretaddresses @@ -0,0 +1,5 @@ +source userpass +echo "usage: ./secretaddresses 'passphrase'" + +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"secretaddresses\",\"num\":10,\"passphrase\":\"$1\"}" + From 84eb8cb71c0c5824281d0fcf786875f46f160055 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 15:01:46 +0200 Subject: [PATCH 0019/2732] Test --- iguana/exchanges/LP_utxos.c | 4 +++- iguana/exchanges/install | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b3c4a98e9..4ad652cf8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -917,7 +917,9 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint n = 16; else if ( n > 777 ) n = 777; - printf("secrets.[%d] <%s> t.%u p.%u\n",n,passphrase,taddr,pubtype); + conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); + printf("generator (%s) secrets.[%d] <%s> t.%u p.%u\n",coinaddr,n,passphrase,taddr,pubtype); for (i=0; i Date: Mon, 28 Aug 2017 11:12:51 +0200 Subject: [PATCH 0020/2732] Snaploop --- iguana/exchanges/snaploop | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 iguana/exchanges/snaploop diff --git a/iguana/exchanges/snaploop b/iguana/exchanges/snaploop new file mode 100755 index 000000000..9c9190c88 --- /dev/null +++ b/iguana/exchanges/snaploop @@ -0,0 +1,10 @@ +source userpass +ht=$1 +while true +do +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=$(( $ht + 100 )) +echo next hight $ht +sleep 6000 +done + From 1fa130da9653622bbea36fa9802ae840eeed2897 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 11:41:36 +0200 Subject: [PATCH 0021/2732] Test --- iguana/exchanges/LP_commands.c | 6 +++++ iguana/exchanges/LP_scan.c | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7d7e6435a..93784bfbb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -266,6 +266,12 @@ dividends(coin, height, )\n\ return(LP_dividends(ptr,juint(argjson,"height"),argjson)); else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"balance") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + return(LP_snapshot_balance(ptr,juint(argjson,"height"),argjson)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } if ( LP_isdisabled(coin,0) != 0 ) return(clonestr("{\"error\":\"coin is disabled\"}")); if ( strcmp(method,"inventory") == 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cfbc6eb3d..caf1c8097 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -368,6 +368,53 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) return(retjson); } +char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson) +{ + cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t value,balance = 0; + retjson = cJSON_CreateObject(); + array = cJSON_CreateArray(); + if ( (snapjson= LP_snapshot(coin,height)) != 0 ) + { + if ( (addrs= jarray(&m,argjson,"addresses")) != 0 ) + { + if ( (balances= jarray(&n,snapjson,"balances")) != 0 ) + { + for (i=0; ichild) != 0 ) + { + value = (uint64_t)(child->valuedouble * SATOSHIDEN); + if ( (refaddr= get_cJSON_fieldname(child)) != 0 ) + { + for (j=0; j Date: Mon, 28 Aug 2017 11:42:27 +0200 Subject: [PATCH 0022/2732] Test --- iguana/exchanges/LP_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 93784bfbb..54b29fb63 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -121,6 +121,7 @@ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ snapshot(coin, height)\n\ +snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ \"}")); @@ -266,7 +267,7 @@ dividends(coin, height, )\n\ return(LP_dividends(ptr,juint(argjson,"height"),argjson)); else return(clonestr("{\"error\":\"cant find coind\"}")); } - else if ( strcmp(method,"balance") == 0 ) + else if ( strcmp(method,"snapshot_balance") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) return(LP_snapshot_balance(ptr,juint(argjson,"height"),argjson)); From 59c9bf25d0f64aefe5e946bf4acbd7f80c75c11b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 11:55:07 +0200 Subject: [PATCH 0023/2732] Test --- iguana/exchanges/LP_scan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index caf1c8097..fc635460a 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -387,6 +387,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson value = (uint64_t)(child->valuedouble * SATOSHIDEN); if ( (refaddr= get_cJSON_fieldname(child)) != 0 ) { + //printf("check %s %.8f against %d\n",refaddr,dstr(value),m); for (j=0; j Date: Mon, 28 Aug 2017 11:58:32 +0200 Subject: [PATCH 0024/2732] Test --- iguana/exchanges/LP_scan.c | 4 ++++ iguana/exchanges/snapshot_balance | 10 ++++++++++ iguana/exchanges/{snaploop => snapshot_loop} | 0 3 files changed, 14 insertions(+) create mode 100644 iguana/exchanges/snapshot_balance rename iguana/exchanges/{snaploop => snapshot_loop} (100%) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index fc635460a..3b54395c7 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -362,6 +362,8 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } jadd(retjson,"balances",array); + jaddstr(retjson,"coin",coin->symbol); + jaddnum(retjson,"height",height); jaddnum(retjson,"numaddresses",n); jaddnum(retjson,"total",dstr(balance)); jaddnum(retjson,"noaddr_total",dstr(noaddr_balance)); @@ -410,6 +412,8 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson free_json(snapjson); } jadd(retjson,"balances",array); + jaddstr(retjson,"coin",coin->symbol); + jaddnum(retjson,"height",height); jaddnum(retjson,"balance",dstr(balance)); return(jprint(retjson,1)); } diff --git a/iguana/exchanges/snapshot_balance b/iguana/exchanges/snapshot_balance new file mode 100644 index 000000000..d34b8ecd6 --- /dev/null +++ b/iguana/exchanges/snapshot_balance @@ -0,0 +1,10 @@ +source userpass +ht=$1 +while true +do +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" +ht=$(( $ht + 100 )) +echo next hight $ht +sleep 6000 +done + diff --git a/iguana/exchanges/snaploop b/iguana/exchanges/snapshot_loop similarity index 100% rename from iguana/exchanges/snaploop rename to iguana/exchanges/snapshot_loop From 87f8cd50482941d4a40b2f6b2c7e168d2692fb89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 12:13:28 +0200 Subject: [PATCH 0025/2732] Test --- iguana/exchanges/install | 2 +- iguana/exchanges/snapshot_balance | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index b11ec1171..0df9ec681 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir diff --git a/iguana/exchanges/snapshot_balance b/iguana/exchanges/snapshot_balance index d34b8ecd6..4cbe11cf3 100644 --- a/iguana/exchanges/snapshot_balance +++ b/iguana/exchanges/snapshot_balance @@ -1,10 +1,4 @@ source userpass ht=$1 -while true -do curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" -ht=$(( $ht + 100 )) -echo next hight $ht -sleep 6000 -done From 85f16bb89cfab2857aca0d8a3c7087e4534d01aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 12:14:56 +0200 Subject: [PATCH 0026/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 54b29fb63..ad0a07be4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -120,6 +120,7 @@ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ +secretaddresses(passphrase, num=10, pubtype=60, taddr=0)\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ From 2064dbfd1c6688b95c1cf18a5867fa54362b4375 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 13:22:41 +0200 Subject: [PATCH 0027/2732] test --- iguana/exchanges/LP_scan.c | 2 ++ iguana/exchanges/balance_loop | 11 +++++++++++ iguana/exchanges/snapshot_loop | 9 +++++---- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 iguana/exchanges/balance_loop diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 3b54395c7..315d5fb0b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -278,6 +278,8 @@ int sort_balance(void *a,void *b) return((aval == bval) ? 0 : ((aval < bval) ? 1 : -1)); } +// a primitive restore can be done by loading the previous snapshot and creating a virtual tx for all the balance at height-1. this wont allow anything but new snapshots, but for many use cases that is all that is needed + cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static char lastcoin[16]; static int32_t maxsnapht; diff --git a/iguana/exchanges/balance_loop b/iguana/exchanges/balance_loop new file mode 100755 index 000000000..fcc1b8cb5 --- /dev/null +++ b/iguana/exchanges/balance_loop @@ -0,0 +1,11 @@ +source userpass +ht=$1 +while true +do +#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` + +echo next height $ht +sleep 600 +done + diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index 9c9190c88..fcc1b8cb5 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -2,9 +2,10 @@ source userpass ht=$1 while true do -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -ht=$(( $ht + 100 )) -echo next hight $ht -sleep 6000 +#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` + +echo next height $ht +sleep 600 done From 1567560497c9f6daac7a3bb77aaac5c4f031cf51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 14:56:31 +0200 Subject: [PATCH 0028/2732] Test --- iguana/exchanges/LP_utxos.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4ad652cf8..c5880577d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { - int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; + int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson,*item; retjson = cJSON_CreateObject(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; @@ -943,6 +943,13 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint jaddstr(retjson,coinaddr,wifstr); printf("./komodo-cli jumblr_secret %s\n",coinaddr); } + printf("\"addresses\":[") + for (i=0; i Date: Mon, 28 Aug 2017 15:01:11 +0200 Subject: [PATCH 0029/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c5880577d..856c2a06c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -943,7 +943,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint jaddstr(retjson,coinaddr,wifstr); printf("./komodo-cli jumblr_secret %s\n",coinaddr); } - printf("\"addresses\":[") + printf("\"addresses\":["); for (i=0; i Date: Mon, 28 Aug 2017 15:07:00 +0200 Subject: [PATCH 0030/2732] test --- .gitignore | 2 ++ iguana/exchanges/LP_utxos.c | 2 +- iguana/exchanges/userpass | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e28d825a6..4f2ba20d2 100755 --- a/.gitignore +++ b/.gitignore @@ -484,3 +484,5 @@ iguana/client iguana/marketmaker.dSYM/Contents/Resources/DWARF/marketmaker iguana/confs/97f18454bb61e9eb7a827cfbefe42fbf7ae2832dc74c4812bdaef8bcf5c10474 + +iguana/DB/PRICES/.tmpmarker diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 856c2a06c..16931c260 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -947,7 +947,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint for (i=0; ichild != 0 ? get_cJSON_fieldname(item->child) : ""); } printf("]\n"); return(jprint(retjson,1)); diff --git a/iguana/exchanges/userpass b/iguana/exchanges/userpass index 1a8a9ad5a..d097e0445 100644 --- a/iguana/exchanges/userpass +++ b/iguana/exchanges/userpass @@ -1 +1,2 @@ -export userpass="" +#export userpass="" +export userpass="c3d8c2a364b7d18c1f9d7321d017b92e9f9c791e4f5c741214fefdea8a071256" From a5f4ce24d5c907eecc9277282b30fed3274af9cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 15:10:00 +0200 Subject: [PATCH 0031/2732] Test --- iguana/exchanges/LP_utxos.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 16931c260..534a452e7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { - int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson,*item; + int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char output[777*45],str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; retjson = cJSON_CreateObject(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; @@ -920,6 +920,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); printf("generator (%s) secrets.[%d] <%s> t.%u p.%u\n",coinaddr,n,passphrase,taddr,pubtype); + sprintf(output,"\"addresses\":["); for (i=0; ichild != 0 ? get_cJSON_fieldname(item->child) : ""); - } - printf("]\n"); + printf("%s]\n",output); return(jprint(retjson,1)); } From a6c67307c8956e1cf036cada6014ed68f68028f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 15:13:09 +0200 Subject: [PATCH 0032/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- iguana/exchanges/secretaddresses | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 534a452e7..239bdefb5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -942,7 +942,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint return(clonestr("{\"error\":\"couldnt validate pubtype\"}")); } jaddstr(retjson,coinaddr,wifstr); - sprintf(output+strlen(output),"\\\"%s\\\", ",coinaddr); + sprintf(output+strlen(output),"\\\"%s\\\"%c ",coinaddr,i Date: Mon, 28 Aug 2017 18:03:53 +0200 Subject: [PATCH 0033/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 315d5fb0b..c13b507d1 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -146,7 +146,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf } else printf("LP_txinterestvalue no addresses found?\n"); //char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); - } else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } + } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); } From a1835cfd6ec75e09f9931586f310d608db583dba Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 22:16:00 +0200 Subject: [PATCH 0034/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 239bdefb5..71134a365 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -550,7 +550,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); + //printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); return(0); } numconfirms = -1; From 4813b61f0106c467700d8883aa815275dbf70746 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 12:43:16 +0200 Subject: [PATCH 0035/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index c13b507d1..8d1a6964c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -211,7 +211,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) } free_json(txobj); return(0); - } else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); + } //else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); return(-1); } From 356d363c36f95b9e293e077b91c3a713ccb2ad60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 12:47:11 +0200 Subject: [PATCH 0036/2732] Test --- iguana/exchanges/snapshot_loop | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index fcc1b8cb5..11d1a127b 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -3,9 +3,9 @@ ht=$1 while true do #curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` - +#ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getinfo\",\"coin\":\"KMD\"}" | jq .blocks` +ht=$(( $ht + 100 )) echo next height $ht -sleep 600 +sleep 1 done From a4d1d6a88ea53f6c32f86307f61446c0208cdcef Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 22:05:53 +0200 Subject: [PATCH 0037/2732] Test --- iguana/exchanges/LP_scan.c | 4 +++- iguana/exchanges/snapshot_loop | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 8d1a6964c..c65dedb65 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -374,11 +374,12 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson) { - cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t value,balance = 0; + cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t total=0,value,balance = 0; retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); if ( (snapjson= LP_snapshot(coin,height)) != 0 ) { + total = jdouble(snapjson,"total"); if ( (addrs= jarray(&m,argjson,"addresses")) != 0 ) { if ( (balances= jarray(&n,snapjson,"balances")) != 0 ) @@ -417,6 +418,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson jaddstr(retjson,"coin",coin->symbol); jaddnum(retjson,"height",height); jaddnum(retjson,"balance",dstr(balance)); + jaddnum(retjson,"total",dstr(total)); return(jprint(retjson,1)); } diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index 11d1a127b..aef95969b 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -2,9 +2,9 @@ source userpass ht=$1 while true do -#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -#ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getinfo\",\"coin\":\"KMD\"}" | jq .blocks` -ht=$(( $ht + 100 )) +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +#ht=`komodo-cli getinfo | jq .blocks` +ht=$(( $ht + 1000 )) echo next height $ht sleep 1 done From af813baadedc98671712e27da2a335d20b5bcd10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 22:57:07 +0200 Subject: [PATCH 0038/2732] Flush stdout --- iguana/iguana_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index 554624dc2..d79aefe24 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -1170,6 +1170,7 @@ void iguana_rpcloop(void *args) sleep(3); } printf(">>>>>>>>>> iguana_rpcloop 127.0.0.1:%d bind sock.%d iguana API enabled <<<<<<<<<\n",port,bindsock); + fflush(stdout); space = calloc(1,size); while ( bindsock >= 0 ) { From 0aa51c3717904651a83778459897c43f622a7091 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 00:37:02 +0200 Subject: [PATCH 0039/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e3bf7308e..050ad3ef1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,7 +13,7 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ - +//alice only coins // // LP_nativeDEX.c // marketmaker @@ -392,9 +392,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+180 ) + if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+10 ) { - printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); + //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); lastresync = (uint32_t)time(NULL); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); From 6baba73263d38dddf51651639b989258fa95e862 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 00:42:54 +0200 Subject: [PATCH 0040/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 050ad3ef1..4c5b047bb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -392,7 +392,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+10 ) + if ( LP_mypeer != 0 && mostpeer != 0 && ((LP_mypeer->numutxos < mostutxos && time(NULL) > lastresync+10) || time(NULL) > lastresync+60) ) { //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); From 0718673a829292c2468fab72d1602d182339c178 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 09:06:43 +0200 Subject: [PATCH 0041/2732] Possible fix --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index d3257cbc4..9899b9cac 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -2093,7 +2093,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) if ( (flags & 1) == 0 && (size= signed_nn_recv(&freeptr,myinfo,myinfo->notaries,myinfo->numnotaries,myinfo->dpowsock,&np)) > 0 ) { num++; - if ( size > 0 ) + if ( size >= sizeof(*np) ) { //fprintf(stderr,"%d ",size); if ( np->version0 == (DPOW_VERSION & 0xff) && np->version1 == ((DPOW_VERSION >> 8) & 0xff) ) From d9d0a37152c60b39104f436e6528fb143ae4514c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 09:35:44 +0200 Subject: [PATCH 0042/2732] Test --- iguana/exchanges/LP_scan.c | 53 +++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index c65dedb65..5ba4c709c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -264,6 +264,42 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e return(endheight); } +char *banned_txids[] = +{ + "78cb4e21245c26b015b888b14c4f5096e18137d2741a6de9734d62b07014dfca", //233559 + "00697be658e05561febdee1aafe368b821ca33fbb89b7027365e3d77b5dfede5", //234172 + "e909465788b32047c472d73e882d79a92b0d550f90be008f76e1edaee6d742ea", //234187 + "f56c6873748a327d0b92b8108f8ec8505a2843a541b1926022883678fb24f9dc", //234188 + "abf08be07d8f5b3a433ddcca7ef539e79a3571632efd6d0294ec0492442a0204", //234213 + "3b854b996cc982fba8c06e76cf507ae7eed52ab92663f4c0d7d10b3ed879c3b0", //234367 + "fa9e474c2cda3cb4127881a40eb3f682feaba3f3328307d518589024a6032cc4", //234635 + "ca746fa13e0113c4c0969937ea2c66de036d20274efad4ce114f6b699f1bc0f3", //234662 + "43ce88438de4973f21b1388ffe66e68fda592da38c6ef939be10bb1b86387041", //234697 + "0aeb748de82f209cd5ff7d3a06f65543904c4c17387c9d87c65fd44b14ad8f8c", //234899 + "bbd3a3d9b14730991e1066bd7c626ca270acac4127131afe25f877a5a886eb25", //235252 + "fa9943525f2e6c32cbc243294b08187e314d83a2870830180380c3c12a9fd33c", //235253 + "a01671c8775328a41304e31a6693bbd35e9acbab28ab117f729eaba9cb769461", //235265 + "2ef49d2d27946ad7c5d5e4ab5c089696762ff04e855f8ab48e83bdf0cc68726d", //235295 + "c85dcffb16d5a45bd239021ad33443414d60224760f11d535ae2063e5709efee", //235296 + // all vouts banned + "c4ea1462c207547cd6fb6a4155ca6d042b22170d29801a465db5c09fec55b19d", //246748 + "305dc96d8bc23a69d3db955e03a6a87c1832673470c32fe25473a46cc473c7d1", //247204 +}; + +int32_t komodo_bannedset(int32_t *indallvoutsp,bits256 *array,int32_t max) +{ + int32_t i; + if ( sizeof(banned_txids)/sizeof(*banned_txids) > max ) + { + fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",sizeof(banned_txids)/sizeof(*banned_txids),max); + exit(-1); + } + for (i=0; isymbol,lastcoin) == 0 ) @@ -335,6 +372,16 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( tx->height < height ) { + for (j=0; jtxid) == 0 ) + break; + if ( j < numbanned ) + { + for (i=0; inumvouts; i++) + banned_balance += tx->outpoints[i].value; + char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); + continue; + } for (i=0; inumvouts; i++) { if ( (ht=tx->outpoints[i].spendheight) > 0 && ht < height ) From d10537554af39da9c06a9e25467e2829d756491c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 16:40:08 +0200 Subject: [PATCH 0043/2732] Fflush --- iguana/exchanges/LP_scan.c | 22 +++++++++++++--------- iguana/iguana_peers.c | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5ba4c709c..f6be836b0 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -319,7 +319,7 @@ int sort_balance(void *a,void *b) cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static bits256 bannedarray[64]; static int32_t numbanned,indallvouts,maxsnapht; static char lastcoin[16]; - struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t i,j,n,skipflag=0,startht,endht,ht; uint64_t banned_balance=0,balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; + struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t isKMD,i,j,n,skipflag=0,startht,endht,ht; uint64_t banned_balance=0,balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; if ( bannedarray[0].txid == 0 ) numbanned = komodo_bannedset(&indallvouts,bannedarray,(int32_t)(sizeof(bannedarray)/sizeof(*bannedarray))); startht = 1; @@ -368,19 +368,23 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { ap->balance = 0; } + isKMD = (strcmp(coin->symbol,"KMD") == 0) ? 1 : 0; HASH_ITER(hh,coin->transactions,tx,tmp) { if ( tx->height < height ) { - for (j=0; jtxid) == 0 ) - break; - if ( j < numbanned ) + if ( isKMD != 0 ) { - for (i=0; inumvouts; i++) - banned_balance += tx->outpoints[i].value; - char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); - continue; + for (j=0; jtxid) == 0 ) + break; + if ( j < numbanned ) + { + for (i=0; inumvouts; i++) + banned_balance += tx->outpoints[i].value; + char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); + continue; + } } for (i=0; inumvouts; i++) { diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index c5ed454bd..8fd57e8a7 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -488,6 +488,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) { sleep(1); printf("ERROR BINDING PORT.%d. this is normal tcp timeout, unless another process is using port\n",port); + fflush(stdout); sleep(3); printf("%s(%s) port.%d try again: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); if ( bindflag == 1 ) From 14e62961a58506a08684a588a0256518bb1bd32a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 17:27:47 +0200 Subject: [PATCH 0044/2732] Test --- iguana/exchanges/LP_scan.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f6be836b0..28570eddb 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -217,8 +217,8 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { - int32_t i,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; - if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 ) + int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; + if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && checkht == height ) { if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) { @@ -236,8 +236,24 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) tx->height = height; } if ( iter == 1 ) - LP_transactioninit(coin,txid,iter); - } else LP_transactioninit(coin,txid,iter); + for (j=0; j<10; j++) + { + if (LP_transactioninit(coin,txid,iter) == 0 ) + break; + printf("transaction ht.%d init error.%d, pause\n",height,j); + sleep(1); + } + } + else + { + for (j=0; j<10; j++) + { + if (LP_transactioninit(coin,txid,iter) == 0 ) + break; + printf("transaction ht.%d init error.%d, pause\n",height,j); + sleep(1); + } + } } } free_json(blockobj); From 29ebb2053382c875606e0452df31840e7e6a074c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 17:49:22 +0200 Subject: [PATCH 0045/2732] Test --- iguana/exchanges/LP_scan.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 28570eddb..fbf51e07b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -173,16 +173,13 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) { - //printf("%s\n",jprint(addresses,0)); if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - if ( 0 && strcmp(address,"RXzsovGBQ3W97xnVC6JnWxXsV4qb7p7iBi") == 0 ) - printf("%s %.8f at height.%d\n",address,dstr(tx->outpoints[i].value),height); - } - } + } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); + } else printf("LP_transactioninit: unexpected address.(%p)\n",jprint(addresses,0)); } } } @@ -204,7 +201,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + } else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } From 0286647976dd10847580d42e1dee8cae2670d053 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 20:50:03 +0200 Subject: [PATCH 0046/2732] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index fbf51e07b..06795f570 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -179,7 +179,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { strcpy(tx->outpoints[i].coinaddr,address); } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } else printf("LP_transactioninit: unexpected address.(%p)\n",jprint(addresses,0)); + } else printf("LP_transactioninit: unexpected address.(%p) (%s) n.%d\n",jprint(addresses,0),addresses!=0?jprint(addresses,0):"",n); } } } @@ -395,7 +395,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { for (i=0; inumvouts; i++) banned_balance += tx->outpoints[i].value; - char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); + //char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); continue; } } From d2fcdd399fca8b6e21466ededbd03457e5535547 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 21:11:48 +0200 Subject: [PATCH 0047/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 06795f570..54620fbae 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -179,7 +179,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { strcpy(tx->outpoints[i].coinaddr,address); } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } else printf("LP_transactioninit: unexpected address.(%p) (%s) n.%d\n",jprint(addresses,0),addresses!=0?jprint(addresses,0):"",n); + } else printf("LP_transactioninit: unexpected addresses ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); } } } From 14ddcdb47bdd9359b459c0fb76c5d7eac0e32ea8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 22:05:44 +0200 Subject: [PATCH 0048/2732] Remove coins without rpcports --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/coins | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4c5b047bb..4fe15c882 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,7 +13,8 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ -//alice only coins +//alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN + // // LP_nativeDEX.c // marketmaker diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 9bae7a503..672a72d67 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 9aef751c4d08a24cbca27b0eeea034636fddfe36 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 22:06:56 +0200 Subject: [PATCH 0049/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 54620fbae..123b79e92 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -201,7 +201,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } From 9187a5b0de8a545700bc2e091c7c7a8693e0a493 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 31 Aug 2017 00:02:56 +0200 Subject: [PATCH 0050/2732] Test --- iguana/exchanges/LP_scan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 123b79e92..0e91b26ca 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -178,8 +178,11 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } else printf("LP_transactioninit: unexpected addresses ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); + } else if ( tx->outpoints[i].value != 0 ) + printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); + } + //else if ( tx->outpoints[i].value != 0 ) + // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); } } } From 8100e15a3e6dd7826ecfef67eece19ed3f0ef830 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 31 Aug 2017 00:26:28 +0200 Subject: [PATCH 0051/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 0e91b26ca..60a66c006 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -446,7 +446,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson array = cJSON_CreateArray(); if ( (snapjson= LP_snapshot(coin,height)) != 0 ) { - total = jdouble(snapjson,"total"); + total = jdouble(snapjson,"total") * SATOSHIDEN; if ( (addrs= jarray(&m,argjson,"addresses")) != 0 ) { if ( (balances= jarray(&n,snapjson,"balances")) != 0 ) From 41f57c9ca67ffcb096c35ac2aff1015502b3ddae Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Sep 2017 11:52:13 +0200 Subject: [PATCH 0052/2732] Bestflag --- iguana/exchanges/LP_ordermatch.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e32930cda..3e3edf622 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -606,7 +606,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vout = jint(item,"vout"); vol = jdouble(item,"volume"); metric = price / bestprice; - if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 )//&& butxo->T.bestflag == 0 ) + if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) { @@ -662,6 +662,27 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, break; } } + if ( bestutxo == 0 ) + { + int32_t numrestraints; + for (i=numrestraints=0; iT.bestflag = 0; + pubp->numerrors = 0; + } + } + } + printf("no bob utxo found -> cleared %d restraints\n",numrestraints); + } } free_json(orderbook); } @@ -669,6 +690,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, } if ( bestutxo == 0 || *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); + bestutxo->T.bestflag = 1; int32_t changed; LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); From e70ef2e681ff4bf4c2a8a5c4f72f734b448095c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Sep 2017 13:03:51 +0200 Subject: [PATCH 0053/2732] Test --- .gitignore | 2 ++ crypto777/iguana_serdes.c | 2 ++ iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4f2ba20d2..323798336 100755 --- a/.gitignore +++ b/.gitignore @@ -486,3 +486,5 @@ iguana/marketmaker.dSYM/Contents/Resources/DWARF/marketmaker iguana/confs/97f18454bb61e9eb7a827cfbefe42fbf7ae2832dc74c4812bdaef8bcf5c10474 iguana/DB/PRICES/.tmpmarker + +iguana/DB/KMD/0/.tmpmarker diff --git a/crypto777/iguana_serdes.c b/crypto777/iguana_serdes.c index 996743c78..68531a451 100755 --- a/crypto777/iguana_serdes.c +++ b/crypto777/iguana_serdes.c @@ -13,6 +13,7 @@ * * ******************************************************************************/ +#ifndef FROM_JS #include "OS_portable.h" #include "../includes/curve25519.h" @@ -213,3 +214,4 @@ int32_t iguana_rwmem(int32_t rwflag,uint8_t *serialized,int32_t len,void *endian else memcpy(serialized,endianedp,len); return(len); } +#endif diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 71134a365..4484f9cab 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -561,7 +561,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); + //printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); } if ( dispflag != 0 ) From f3d4769e7435711a1c1767240116960561da9440 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Sep 2017 13:05:28 +0200 Subject: [PATCH 0054/2732] Test --- crypto777/iguana_serdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_serdes.c b/crypto777/iguana_serdes.c index 68531a451..a0b905bfd 100755 --- a/crypto777/iguana_serdes.c +++ b/crypto777/iguana_serdes.c @@ -17,7 +17,7 @@ #include "OS_portable.h" #include "../includes/curve25519.h" -// threadsafe +// threadsafe int32_t iguana_rwnum(int32_t rwflag,uint8_t *serialized,int32_t len,void *endianedp) { int32_t i; uint64_t x; From 8d496571fae01cebb5648de36a70abf642232777 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Sep 2017 13:07:01 +0200 Subject: [PATCH 0055/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 60a66c006..b4ff5e23e 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -307,7 +307,7 @@ int32_t komodo_bannedset(int32_t *indallvoutsp,bits256 *array,int32_t max) int32_t i; if ( sizeof(banned_txids)/sizeof(*banned_txids) > max ) { - fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",sizeof(banned_txids)/sizeof(*banned_txids),max); + fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",(long)sizeof(banned_txids)/sizeof(*banned_txids),max); exit(-1); } for (i=0; i Date: Mon, 4 Sep 2017 13:24:12 +0200 Subject: [PATCH 0056/2732] Test --- crypto777/bitcoind_RPC.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index fd27643d3..0ef7dfab0 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -13,6 +13,7 @@ * * ******************************************************************************/ +#ifndef FROM_JS #include "OS_portable.h" #define LIQUIDITY_PROVIDER 1 @@ -371,3 +372,4 @@ void *curl_post(void **cHandlep,char *url,char *userpass,char *postfields,char * return(clonestr("{\"error\":\"curl is disabled\"}")); } #endif +#endif From 4d392c3eb94276c09492a45b99a626b320b9860d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Sep 2017 13:27:57 +0200 Subject: [PATCH 0057/2732] Test --- iguana/exchanges/LP_network.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index aadc2f485..7009c4a21 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -71,6 +71,7 @@ struct LP_queue } *LP_Q; int32_t LP_Qenqueued,LP_Qerrors,LP_Qfound; +#ifndef FROM_JS void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; @@ -718,3 +719,5 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } return(pullsock); } +#endif + From c20bd854e3f24a8da123b445fb901fad0985f610 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Sep 2017 13:29:16 +0200 Subject: [PATCH 0058/2732] Test --- iguana/exchanges/LP_network.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 7009c4a21..aadc2f485 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -71,7 +71,6 @@ struct LP_queue } *LP_Q; int32_t LP_Qenqueued,LP_Qerrors,LP_Qfound; -#ifndef FROM_JS void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; @@ -719,5 +718,3 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } return(pullsock); } -#endif - From 5b42ca5e9ad6fdf65452afc4151d24fd28eb8ff9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 6 Sep 2017 10:28:00 +0200 Subject: [PATCH 0059/2732] BLOCK --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 672a72d67..b8e0dc960 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 8530f5a3dec7df3f9cf946e74ccd589e7173206e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 09:14:32 +0200 Subject: [PATCH 0060/2732] Top --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index b8e0dc960..2d84dfe6e 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 724c010f6c6d84f74c6e7417d6957171a1fc734d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 14:45:15 +0200 Subject: [PATCH 0061/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b110eb82e..205296ec0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -106,6 +106,8 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { char *retstr; cJSON *retjson = 0; + retstr = bitcoind_passthru("BTC","46.4.125.2:50002","",method,params); + printf("%s %s -> %s\n",method,params,retstr); if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); From cf1dd593eef54712a612d728ad7855c68e1e00ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 14:47:03 +0200 Subject: [PATCH 0062/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 205296ec0..1d67647b8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -106,7 +106,7 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { char *retstr; cJSON *retjson = 0; - retstr = bitcoind_passthru("BTC","46.4.125.2:50002","",method,params); + retstr = bitcoind_passthru("BTC","46.4.125.2:50001","",method,params); printf("%s %s -> %s\n",method,params,retstr); if ( coin != 0 ) { From df7300dee941eaa3e385a11533458b6be2da522a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 14:50:19 +0200 Subject: [PATCH 0063/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1d67647b8..579578611 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -106,8 +106,8 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { char *retstr; cJSON *retjson = 0; - retstr = bitcoind_passthru("BTC","46.4.125.2:50001","",method,params); - printf("%s %s -> %s\n",method,params,retstr); + //retstr = bitcoind_passthru("BTC","46.4.125.2:50001","",method,params); + //printf("%s %s -> %s\n",method,params,retstr); if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); From 1dc0377d0c50880c2b1d1c1508449600899c1f78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 18:01:56 +0200 Subject: [PATCH 0064/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 ++- iguana/exchanges/LP_rpc.c | 104 +++++++++++++++++++---------- iguana/exchanges/LP_scan.c | 19 ------ iguana/exchanges/LP_statemachine.c | 2 +- 4 files changed, 79 insertions(+), 56 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4fe15c882..dcc65a31c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -426,7 +426,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { - if ( (obj= LP_getinfo(coin->symbol)) != 0 ) + if ( (height= LP_getheight(coin)) > coin->longestchain ) + { + coin->longestchain = height; + if ( coin->firstrefht != 0 ) + printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); + } else LP_mempoolscan(coin->symbol,zero); + /*if ( (obj= LP_getinfo(coin->symbol)) != 0 ) { if ( (height= jint(obj,"blocks")) > coin->longestchain ) { @@ -435,7 +441,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); } else LP_mempoolscan(coin->symbol,zero); free_json(obj); - } else printf("error getting info.%s\n",coin->symbol); + } else printf("error getting info.%s\n",coin->symbol);*/ coin->lastgetinfo = (uint32_t)time(NULL); } if ( coin->firstrefht == 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 579578611..217f434c0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,9 +105,22 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { - char *retstr; cJSON *retjson = 0; - //retstr = bitcoind_passthru("BTC","46.4.125.2:50001","",method,params); - //printf("%s %s -> %s\n",method,params,retstr); + static uint32_t stratumid; + char *retstr,stratumreq[8192]; cJSON *retjson = 0; + // "getinfo", "getrawmempool", "paxprice", "gettxout", "getrawtransaction", "getblock", "listunspent", "listtransactions", "validateaddress", "importprivkey" + // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" + + //"server.version", "server.banner", "server.donation_address", "server.peers.subscribe", "--blockchain.numblocks.subscribe", "blockchain.headers.subscribe", "blockchain.address.subscribe", "blockchain.address.get_history", "blockchain.address.get_mempool", "blockchain.address.get_balance", "--blockchain.address.get_proof", "blockchain.address.listunspent", "--blockchain.utxo.get_address", "blockchain.block.get_header", "blockchain.block.get_chunk", "blockchain.transaction.broadcast", "blockchain.transaction.get_merkle", "blockchain.transaction.get", "blockchain.estimatefee" + + // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" + method = "server.version"; + params = "[]"; + sprintf(stratumreq,"{ \"id\": %u, \"method\":\"%s\", \"params\": %s }",stratumid++,method,params); + if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) + { + printf("%s %s -> %s\n",method,params,retstr); + free(retstr); + } if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); @@ -165,10 +178,15 @@ cJSON *LP_assethbla(char *assetid) return(retjson); } -cJSON *LP_getinfo(char *symbol) +int32_t LP_getheight(struct iguana_info *coin) { - struct iguana_info *coin = LP_coinfind(symbol); - return(bitcoin_json(coin,"getinfo","[]")); + cJSON *retjson; int32_t height = -1; //struct iguana_info *coin = LP_coinfind(symbol); + if ( (retjson= bitcoin_json(coin,"getinfo","[]")) != 0 ) + { + height = jint(retjson,"blocks"); + free_json(retjson); + } + return(height); } cJSON *LP_getmempool(char *symbol) @@ -207,6 +225,25 @@ cJSON *LP_getblock(char *symbol,bits256 txid) return(bitcoin_json(coin,"getblock",buf)); } +int32_t LP_txheight(uint32_t *timestampp,uint32_t *blocktimep,struct iguana_info *coin,bits256 txid) +{ + bits256 blockhash; cJSON *blockobj,*txobj; int32_t height = 0; + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) + { + *timestampp = juint(txobj,"locktime"); + *blocktimep = juint(txobj,"blocktime"); + blockhash = jbits256(txobj,"blockhash"); + if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) + { + height = jint(blockobj,"height"); + //printf("%s LP_txheight.%d\n",coin->symbol,height); + free_json(blockobj); + } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); + free_json(txobj); + } + return(height); +} + cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); @@ -331,6 +368,33 @@ char *LP_blockhashstr(char *symbol,int32_t height) return(retstr); } +cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t height) +{ + cJSON *json = 0; int32_t flag = 0; + if ( blockhashstr == 0 ) + blockhashstr = LP_blockhashstr(symbol,height), flag = 1; + if ( blockhashstr != 0 ) + { + if ( (json= LP_getblockhashstr(symbol,blockhashstr)) != 0 ) + { + if ( *heightp != 0 ) + { + *heightp = juint(json,"height"); + if ( height >= 0 && *heightp != height ) + { + printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); + *heightp = -1; + free_json(json); + json = 0; + } + } + } + if ( flag != 0 && blockhashstr != 0 ) + free(blockhashstr); + } + return(json); +} + char *LP_sendrawtransaction(char *symbol,char *signedtx) { cJSON *array; char *paramstr,*retstr; struct iguana_info *coin = LP_coinfind(symbol); @@ -384,31 +448,3 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * free(paramstr); return(signedtx); } - -cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t height) -{ - cJSON *json = 0; int32_t flag = 0; - if ( blockhashstr == 0 ) - blockhashstr = LP_blockhashstr(symbol,height), flag = 1; - if ( blockhashstr != 0 ) - { - if ( (json= LP_getblockhashstr(symbol,blockhashstr)) != 0 ) - { - if ( *heightp != 0 ) - { - *heightp = juint(json,"height"); - if ( height >= 0 && *heightp != height ) - { - printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); - *heightp = -1; - free_json(json); - json = 0; - } - } - } - if ( flag != 0 && blockhashstr != 0 ) - free(blockhashstr); - } - return(json); -} - diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index b4ff5e23e..4d0812a40 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -75,25 +75,6 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i return(tx); } -int32_t LP_txheight(uint32_t *timestampp,uint32_t *blocktimep,struct iguana_info *coin,bits256 txid) -{ - bits256 blockhash; cJSON *blockobj,*txobj; int32_t height = 0; - if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) - { - *timestampp = juint(txobj,"locktime"); - *blocktimep = juint(txobj,"blocktime"); - blockhash = jbits256(txobj,"blockhash"); - if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) - { - height = jint(blockobj,"height"); - //printf("%s LP_txheight.%d\n",coin->symbol,height); - free_json(blockobj); - } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); - free_json(txobj); - } - return(height); -} - int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) { int32_t i,ht,num = 0; uint32_t timestamp,blocktime; struct LP_transaction *tx,*tmp; diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index dcb67c8a9..860c796e1 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -446,7 +446,6 @@ void iguana_ensure_privkey(struct iguana_info *coin,bits256 privkey) } } } -#endif int32_t basilisk_rawtx_return(struct basilisk_rawtx *rawtx,cJSON *item,int32_t lockinputs,struct vin_info *V) @@ -484,6 +483,7 @@ int32_t basilisk_rawtx_return(struct basilisk_rawtx *rawtx,cJSON *item,int32_t l } return(retval); } +#endif cJSON *LP_createvins(struct basilisk_rawtx *dest,struct vin_info *V,struct basilisk_rawtx *rawtx,uint8_t *userdata,int32_t userdatalen,uint32_t sequenceid) { From 24d022a72ee72ead5a8f0c437b05c4a837c563d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 18:04:36 +0200 Subject: [PATCH 0065/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 217f434c0..c1392063d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -115,10 +115,10 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" method = "server.version"; params = "[]"; - sprintf(stratumreq,"{ \"id\": %u, \"method\":\"%s\", \"params\": %s }",stratumid++,method,params); + sprintf(stratumreq,"{ \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) { - printf("%s %s -> %s\n",method,params,retstr); + printf("%s -> %s\n",stratumreq,retstr); free(retstr); } if ( coin != 0 ) From 8b48896e55830c72353578d09271b66351788392 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 18:11:26 +0200 Subject: [PATCH 0066/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c1392063d..373e33356 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -115,7 +115,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" method = "server.version"; params = "[]"; - sprintf(stratumreq,"{ \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) { printf("%s -> %s\n",stratumreq,retstr); From b05c65e8587291bf3f683b3da015dd2c88ea82fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 18:15:32 +0200 Subject: [PATCH 0067/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 373e33356..5e9a91ed8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -115,7 +115,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" method = "server.version"; params = "[]"; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\" }\n",stratumid++,method);//,params); , \"params\": %s if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) { printf("%s -> %s\n",stratumreq,retstr); From 6f724a3f6bcc90f5f8f76254ecc69487a5f323fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Sep 2017 18:17:34 +0200 Subject: [PATCH 0068/2732] Test --- iguana/exchanges/LP_rpc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5e9a91ed8..cb36dd3aa 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,22 +105,22 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { - static uint32_t stratumid; - char *retstr,stratumreq[8192]; cJSON *retjson = 0; + //static uint32_t stratumid; + cJSON *retjson = 0; char *retstr;//,stratumreq[8192]; // "getinfo", "getrawmempool", "paxprice", "gettxout", "getrawtransaction", "getblock", "listunspent", "listtransactions", "validateaddress", "importprivkey" // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" //"server.version", "server.banner", "server.donation_address", "server.peers.subscribe", "--blockchain.numblocks.subscribe", "blockchain.headers.subscribe", "blockchain.address.subscribe", "blockchain.address.get_history", "blockchain.address.get_mempool", "blockchain.address.get_balance", "--blockchain.address.get_proof", "blockchain.address.listunspent", "--blockchain.utxo.get_address", "blockchain.block.get_header", "blockchain.block.get_chunk", "blockchain.transaction.broadcast", "blockchain.transaction.get_merkle", "blockchain.transaction.get", "blockchain.estimatefee" // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" - method = "server.version"; + /*method = "server.version"; params = "[]"; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\" }\n",stratumid++,method);//,params); , \"params\": %s + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) { printf("%s -> %s\n",stratumreq,retstr); free(retstr); - } + }*/ if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); From fe7ae767e07758ea86ae0be204ef4761f8211c04 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Sep 2017 13:57:19 +0200 Subject: [PATCH 0069/2732] Test --- iguana/exchanges/LP_utxos.c | 7 ++++++- iguana/main.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4484f9cab..9f003e3fb 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -952,9 +952,14 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { static uint32_t counter; - bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20]; + bits256 privkey,userpub,userpass,checkkey; char tmpstr[128],pstr[65]; cJSON *retjson; uint8_t tmptype,rmd160[20]; if ( passphrase != 0 && passphrase[0] != 0 ) + { conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + vcalc_sha256(0,checkkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + printf("SHA256.(%s) ",bits256_str(pstr,checkkey)); + printf("privkey.(%s)\n",bits256_str(pstr,privkey)); + } else { bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr); diff --git a/iguana/main.c b/iguana/main.c index 335d68baa..b3f9078f0 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -887,7 +887,7 @@ uint8_t *SuperNET_ciphercalc(void **ptrp,int32_t *cipherlenp,bits256 *privkeyp,b cJSON *SuperNET_rosettajson(struct supernet_info *myinfo,bits256 privkey,int32_t showprivs) { uint8_t rmd160[20],pub[33]; uint64_t nxt64bits; bits256 pubkey; - char str2[41],wifbuf[64],addr[64],str[128],coinwif[16]; cJSON *retjson; struct iguana_info *coin,*tmp; + char str2[41],wifbuf[64],pbuf[65],addr[64],str[128],coinwif[16]; cJSON *retjson; struct iguana_info *coin,*tmp; pubkey = acct777_pubkey(privkey); nxt64bits = acct777_nxt64bits(pubkey); retjson = cJSON_CreateObject(); @@ -900,6 +900,8 @@ cJSON *SuperNET_rosettajson(struct supernet_info *myinfo,bits256 privkey,int32_t jaddstr(retjson,"btcpubkey",str); calc_OP_HASH160(str2,rmd160,str); jaddstr(retjson,"rmd160",str2); + if ( showprivs != 0 ) + jaddstr(retjson,"privkey",bits256_str(pbuf,privkey)); HASH_ITER(hh,myinfo->allcoins,coin,tmp) { if ( coin != 0 && coin->symbol[0] != 0 ) From b501f9fb01f7d86bc6b94b9321b3578d6503db84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 18:50:57 +0200 Subject: [PATCH 0070/2732] LP_socket != test --- iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_rpc.c | 11 +- iguana/exchanges/LP_socket.c | 284 ++++++++++++++++++++++++++++++++ iguana/exchanges/LP_utxos.c | 8 +- iguana/exchanges/mm.c | 2 + 5 files changed, 299 insertions(+), 9 deletions(-) create mode 100644 iguana/exchanges/LP_socket.c diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index dcc65a31c..d788262be 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -80,6 +80,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ return(0); } +#include "LP_socket.c" #include "LP_secp.c" #include "LP_bitcoin.c" #include "LP_coins.c" @@ -419,7 +420,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - cJSON *obj; int32_t height; bits256 zero; + int32_t height; bits256 zero; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 ) continue; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cb36dd3aa..bc4027538 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,18 +105,21 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { - //static uint32_t stratumid; - cJSON *retjson = 0; char *retstr;//,stratumreq[8192]; + static uint32_t stratumid; + cJSON *retjson = 0; char *retstr,stratumreq[8192]; // "getinfo", "getrawmempool", "paxprice", "gettxout", "getrawtransaction", "getblock", "listunspent", "listtransactions", "validateaddress", "importprivkey" // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" //"server.version", "server.banner", "server.donation_address", "server.peers.subscribe", "--blockchain.numblocks.subscribe", "blockchain.headers.subscribe", "blockchain.address.subscribe", "blockchain.address.get_history", "blockchain.address.get_mempool", "blockchain.address.get_balance", "--blockchain.address.get_proof", "blockchain.address.listunspent", "--blockchain.utxo.get_address", "blockchain.block.get_header", "blockchain.block.get_chunk", "blockchain.transaction.broadcast", "blockchain.transaction.get_merkle", "blockchain.transaction.get", "blockchain.estimatefee" // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" - /*method = "server.version"; + method = "server.version"; params = "[]"; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); - if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) + LP_sendstr = stratumreq; + while ( LP_sendstr != 0 ) + usleep(10000); + /*if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) { printf("%s -> %s\n",stratumreq,retstr); free(retstr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c new file mode 100644 index 000000000..3428f8cb8 --- /dev/null +++ b/iguana/exchanges/LP_socket.c @@ -0,0 +1,284 @@ +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +/** + * - we need to include WinSock2.h header to correctly use windows structure + * as the application is still using 32bit structure from mingw so, we need to + * add the include based on checking + * @author - fadedreamz@gmail.com + * @remarks - #if (defined(_M_X64) || defined(__amd64__)) && defined(WIN32) + * is equivalent to #if defined(_M_X64) as _M_X64 is defined for MSVC only + */ +#if defined(_M_X64) +#define WIN32_LEAN_AND_MEAN +#include +#endif + +int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) +{ + int32_t opt,sock,result; char ipaddr[64],checkipaddr[64]; struct timeval timeout; + struct sockaddr_in saddr; socklen_t addrlen,slen; + addrlen = sizeof(saddr); + struct hostent *hostent; + + /** + * gethostbyname() is deprecated and cause crash on x64 windows + * the solution is to implement similar functionality by using getaddrinfo() + * it is standard posix function and is correctly supported in win32/win64/linux + * @author - fadedreamz@gmail.com + */ +#if defined(_M_X64) + struct addrinfo *addrresult = NULL; + struct addrinfo *returnptr = NULL; + struct addrinfo hints; + struct sockaddr_in * sockaddr_ipv4; + int retVal; + int found = 0; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; +#endif + + if ( parse_ipaddr(ipaddr,hostname) != 0 ) + port = parse_ipaddr(ipaddr,hostname); + +#if defined(_M_X64) + retVal = getaddrinfo(ipaddr, NULL, &hints, &addrresult); + for (returnptr = addrresult; returnptr != NULL && found == 0; returnptr = returnptr->ai_next) { + switch (returnptr->ai_family) { + case AF_INET: + sockaddr_ipv4 = (struct sockaddr_in *) returnptr->ai_addr; + // we want to break from the loop after founding the first ipv4 address + found = 1; + break; + } + } + + // if we iterate through the loop and didn't find anything, + // that means we failed in the dns lookup + if (found == 0) { + printf("getaddrinfo(%s) returned error\n", hostname); + freeaddrinfo(addrresult); + return(-1); + } +#else + hostent = gethostbyname(ipaddr); + if ( hostent == NULL ) + { + printf("gethostbyname(%s) returned error: %d port.%d ipaddr.(%s)\n",hostname,errno,port,ipaddr); + return(-1); + } +#endif + saddr.sin_family = AF_INET; + saddr.sin_port = htons(port); + //#ifdef WIN32 + // saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); + //#else + +#if defined(_M_X64) + saddr.sin_addr.s_addr = sockaddr_ipv4->sin_addr.s_addr; + // graceful cleanup + sockaddr_ipv4 = NULL; + freeaddrinfo(addrresult); +#else + memcpy(&saddr.sin_addr.s_addr,hostent->h_addr_list[0],hostent->h_length); +#endif + expand_ipbits(checkipaddr,saddr.sin_addr.s_addr); + if ( strcmp(ipaddr,checkipaddr) != 0 ) + printf("bindflag.%d iguana_socket mismatch (%s) -> (%s)?\n",bindflag,checkipaddr,ipaddr); + //#endif + if ( (sock= socket(AF_INET,SOCK_STREAM,0)) < 0 ) + { + if ( errno != ETIMEDOUT ) + printf("socket() failed: %s errno.%d", strerror(errno),errno); + return(-1); + } + opt = 1; + slen = sizeof(opt); + //printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen)); +#ifndef WIN32 + if ( 1 )//&& bindflag != 0 ) + { + opt = 0; + getsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,&slen); + opt = 1; + //printf("keepalive.%d\n",opt); + } + setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(void *)&opt,sizeof(opt)); +#ifdef __APPLE__ + setsockopt(sock,SOL_SOCKET,SO_NOSIGPIPE,&opt,sizeof(opt)); +#endif +#endif + if ( bindflag == 0 ) + { + timeout.tv_sec = 10; + timeout.tv_usec = 0; + setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); + result = connect(sock,(struct sockaddr *)&saddr,addrlen); + if ( result != 0 ) + { + if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH ) + { + //printf("%s(%s) port.%d failed: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); + } + if ( sock >= 0 ) + closesocket(sock); + return(-1); + } + timeout.tv_sec = 10000000; + timeout.tv_usec = 0; + setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); + } + else + { + while ( (result= bind(sock,(struct sockaddr*)&saddr,addrlen)) != 0 ) + { + if ( errno == EADDRINUSE ) + { + sleep(1); + printf("ERROR BINDING PORT.%d. this is normal tcp timeout, unless another process is using port\n",port); + fflush(stdout); + sleep(3); + printf("%s(%s) port.%d try again: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); + if ( bindflag == 1 ) + { + closesocket(sock); + return(-1); + } + sleep(13); + //continue; + } + if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH ) + { + printf("%s(%s) port.%d failed: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); + closesocket(sock); + return(-1); + } + } + if ( listen(sock,64) != 0 ) + { + printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); + if ( sock >= 0 ) + closesocket(sock); + return(-1); + } + } +#ifdef __APPLE__ + //timeout.tv_sec = 0; + //timeout.tv_usec = 30000; + //setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); +#endif + return(sock); +} + +int32_t LP_socketsend(int32_t sock,uint8_t *serialized,int32_t len) +{ + int32_t numsent,remains,flags = 0; +#ifndef _WIN32 + flags = MSG_NOSIGNAL; +#endif + remains = len; + while ( remains > 0 ) + { + if ( (numsent= (int32_t)send(sock,serialized,remains,flags)) < 0 ) + { + if ( errno == EAGAIN || errno == EWOULDBLOCK ) + { + sleep(1); + continue; + } + printf("(%s): numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized,numsent,remains,len,errno,strerror(errno),sock); + return(-errno); + } + else if ( remains > 0 ) + { + remains -= numsent; + serialized += numsent; + if ( remains > 0 ) + printf("%d LP_socket sent.%d remains.%d of len.%d\n",sock,numsent,remains,len); + } + } + return(len); +} + +int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) +{ + int32_t recvlen = -1; + while ( 1 ) + { + if ( (recvlen= (int32_t)recv(sock,recvbuf,maxlen,0)) < 0 ) + { + if ( errno == EAGAIN ) + { + //printf("%s recv errno.%d %s len.%d remains.%d\n",ipaddr,errno,strerror(errno),len,remains); + //printf("EAGAIN for len %d, remains.%d\n",len,remains); + sleep(1); + } else return(-errno); + } else break; + } + return(recvlen); +} + +int32_t LP_recvfunc(char *ipaddr,char *str,int32_t len) +{ + printf("RECV.(%s) from %s\n",str,ipaddr); + return(0); +} + +void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),char **sendstrp,char *ipaddr,uint16_t port) +{ + struct pollfd fds; uint8_t *buf; char *str; int32_t len,sock,bufsize,flag,timeout = 10; + bufsize = IGUANA_MAXPACKETSIZE * 2; + buf = malloc(bufsize); + sock = LP_socket(0,ipaddr,port); + while ( sock >= 0 ) + { + flag = 0; + memset(&fds,0,sizeof(fds)); + fds.fd = sock; + fds.events |= (POLLOUT | POLLIN); + if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (str= *sendstrp) != 0 ) + { + *sendstrp = 0; + if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str+1)) <= 0 ) + { + printf("%s:%u is dead\n",ipaddr,port); + closesocket(sock); + sock = -1; + break; + } + flag++; + } + if ( flag == 0 ) + { + if ( (fds.revents & POLLIN) != 0 ) + { + if ( (len= LP_socketrecv(sock,buf,bufsize)) > 0 ) + { + (*recvfunc)(ipaddr,(char *)buf,len); + flag++; + } + } + if ( flag == 0 ) + usleep(100000); + } + } + free(buf); +} + diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9f003e3fb..a3d191dcd 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -952,13 +952,13 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { static uint32_t counter; - bits256 privkey,userpub,userpass,checkkey; char tmpstr[128],pstr[65]; cJSON *retjson; uint8_t tmptype,rmd160[20]; + bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20]; if ( passphrase != 0 && passphrase[0] != 0 ) { conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); - vcalc_sha256(0,checkkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); - printf("SHA256.(%s) ",bits256_str(pstr,checkkey)); - printf("privkey.(%s)\n",bits256_str(pstr,privkey)); + //vcalc_sha256(0,checkkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + //printf("SHA256.(%s) ",bits256_str(pstr,checkkey)); + //printf("privkey.(%s)\n",bits256_str(pstr,privkey)); } else { diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index ffde8b2f3..fb00d6595 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -26,6 +26,7 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #include "stats.c" +char *LP_sendstr; void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]); //defined(__APPLE__) || @@ -816,6 +817,7 @@ int main(int argc, const char * argv[]) exit(-1); } else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; + LP_dedicatedloop(LP_recvfunc,&LP_sendstr,"46.4.125.2",50001); while ( 1 ) sleep(1); profitmargin = jdouble(retjson,"profitmargin"); From 1c94dff0abb6c45bafa18d9b0fed5b9393a9023a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 18:53:59 +0200 Subject: [PATCH 0071/2732] Test --- iguana/exchanges/LP_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3428f8cb8..6f509c4c3 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -222,6 +222,7 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) int32_t recvlen = -1; while ( 1 ) { + printf("recv on sock.%d\n",sock); if ( (recvlen= (int32_t)recv(sock,recvbuf,maxlen,0)) < 0 ) { if ( errno == EAGAIN ) @@ -256,6 +257,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (str= *sendstrp) != 0 ) { *sendstrp = 0; + printf("sending.(%s)\n",str); if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str+1)) <= 0 ) { printf("%s:%u is dead\n",ipaddr,port); From fb5f8665565b5b7db3eaef26ff856870e7e0bfae Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 18:56:59 +0200 Subject: [PATCH 0072/2732] Test --- iguana/exchanges/LP_socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6f509c4c3..46c6fda7f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -265,6 +265,11 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch sock = -1; break; } + else if ( (len= LP_socketrecv(sock,buf,bufsize)) > 0 ) + { + (*recvfunc)(ipaddr,(char *)buf,len); + flag++; + } else printf("recv.%d\n",len); flag++; } if ( flag == 0 ) From 5b638dfbad6ed59463db16cca2e13462886b1475 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 18:59:31 +0200 Subject: [PATCH 0073/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 46c6fda7f..0ef64a6c1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -213,6 +213,7 @@ int32_t LP_socketsend(int32_t sock,uint8_t *serialized,int32_t len) if ( remains > 0 ) printf("%d LP_socket sent.%d remains.%d of len.%d\n",sock,numsent,remains,len); } + printf("(%s): numsent.%d vs remains.%d len.%d sock.%d\n",serialized,numsent,remains,len,sock); } return(len); } From 1e69ffa3b2b9c35f058e089c38508216b2be89ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 19:01:19 +0200 Subject: [PATCH 0074/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index fb00d6595..d02592337 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -817,7 +817,7 @@ int main(int argc, const char * argv[]) exit(-1); } else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; - LP_dedicatedloop(LP_recvfunc,&LP_sendstr,"46.4.125.2",50001); + LP_dedicatedloop(LP_recvfunc,&LP_sendstr,"88.198.241.196",50001); while ( 1 ) sleep(1); profitmargin = jdouble(retjson,"profitmargin"); From e8dc8d7319c32b3387ef06f36a9e7e0781547600 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 19:04:25 +0200 Subject: [PATCH 0075/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0ef64a6c1..98f8c75b0 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -213,7 +213,7 @@ int32_t LP_socketsend(int32_t sock,uint8_t *serialized,int32_t len) if ( remains > 0 ) printf("%d LP_socket sent.%d remains.%d of len.%d\n",sock,numsent,remains,len); } - printf("(%s): numsent.%d vs remains.%d len.%d sock.%d\n",serialized,numsent,remains,len,sock); + printf("numsent.%d vs remains.%d len.%d sock.%d\n",numsent,remains,len,sock); } return(len); } @@ -259,7 +259,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch { *sendstrp = 0; printf("sending.(%s)\n",str); - if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str+1)) <= 0 ) + if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str)+1) <= 0 ) { printf("%s:%u is dead\n",ipaddr,port); closesocket(sock); From 3ee560f97cd6b9fd4ae28adb14e3d079795c32e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 19:05:55 +0200 Subject: [PATCH 0076/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 98f8c75b0..aee3d0ffa 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -259,7 +259,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch { *sendstrp = 0; printf("sending.(%s)\n",str); - if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str)+1) <= 0 ) + if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str)) <= 0 ) { printf("%s:%u is dead\n",ipaddr,port); closesocket(sock); From 31d027a90e680d56a70dfd7cdd2080ad250e43eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 19:17:17 +0200 Subject: [PATCH 0077/2732] Test --- iguana/exchanges/LP_socket.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index aee3d0ffa..18e7e3740 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -223,7 +223,6 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) int32_t recvlen = -1; while ( 1 ) { - printf("recv on sock.%d\n",sock); if ( (recvlen= (int32_t)recv(sock,recvbuf,maxlen,0)) < 0 ) { if ( errno == EAGAIN ) @@ -258,7 +257,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (str= *sendstrp) != 0 ) { *sendstrp = 0; - printf("sending.(%s)\n",str); + //printf("sending.(%s)\n",str); if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str)) <= 0 ) { printf("%s:%u is dead\n",ipaddr,port); @@ -266,11 +265,6 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch sock = -1; break; } - else if ( (len= LP_socketrecv(sock,buf,bufsize)) > 0 ) - { - (*recvfunc)(ipaddr,(char *)buf,len); - flag++; - } else printf("recv.%d\n",len); flag++; } if ( flag == 0 ) From 8a02324a81752762c7e0b935db2ac772dafd95f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 19:21:58 +0200 Subject: [PATCH 0078/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index bc4027538..aca59af40 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -113,7 +113,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) //"server.version", "server.banner", "server.donation_address", "server.peers.subscribe", "--blockchain.numblocks.subscribe", "blockchain.headers.subscribe", "blockchain.address.subscribe", "blockchain.address.get_history", "blockchain.address.get_mempool", "blockchain.address.get_balance", "--blockchain.address.get_proof", "blockchain.address.listunspent", "--blockchain.utxo.get_address", "blockchain.block.get_header", "blockchain.block.get_chunk", "blockchain.transaction.broadcast", "blockchain.transaction.get_merkle", "blockchain.transaction.get", "blockchain.estimatefee" // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" - method = "server.version"; + method = "server.peers.subscribe"; params = "[]"; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); LP_sendstr = stratumreq; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 18e7e3740..9bdd47cfc 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -213,7 +213,7 @@ int32_t LP_socketsend(int32_t sock,uint8_t *serialized,int32_t len) if ( remains > 0 ) printf("%d LP_socket sent.%d remains.%d of len.%d\n",sock,numsent,remains,len); } - printf("numsent.%d vs remains.%d len.%d sock.%d\n",numsent,remains,len,sock); + //printf("numsent.%d vs remains.%d len.%d sock.%d\n",numsent,remains,len,sock); } return(len); } From 7d90dfc1ef5f4e8b3dd61c8e5beb89dd9166f58a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:07:15 +0200 Subject: [PATCH 0079/2732] Test api --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_rpc.c | 18 +--- iguana/exchanges/LP_socket.c | 151 ++++++++++++++++++++++++++++++-- 3 files changed, 146 insertions(+), 24 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d788262be..f00138e94 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -568,6 +568,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #endif OS_randombytes((void *)&n,sizeof(n)); + electrum_test(); if ( jobj(argjson,"gui") != 0 ) safecopy(LP_gui,jstr(argjson,"gui"),sizeof(LP_gui)); if ( jobj(argjson,"canbind") == 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index aca59af40..60e49ae1a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,25 +105,9 @@ char *issue_LP_getprices(char *destip,uint16_t destport) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { - static uint32_t stratumid; - cJSON *retjson = 0; char *retstr,stratumreq[8192]; + cJSON *retjson = 0; char *retstr; // "getinfo", "getrawmempool", "paxprice", "gettxout", "getrawtransaction", "getblock", "listunspent", "listtransactions", "validateaddress", "importprivkey" // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" - - //"server.version", "server.banner", "server.donation_address", "server.peers.subscribe", "--blockchain.numblocks.subscribe", "blockchain.headers.subscribe", "blockchain.address.subscribe", "blockchain.address.get_history", "blockchain.address.get_mempool", "blockchain.address.get_balance", "--blockchain.address.get_proof", "blockchain.address.listunspent", "--blockchain.utxo.get_address", "blockchain.block.get_header", "blockchain.block.get_chunk", "blockchain.transaction.broadcast", "blockchain.transaction.get_merkle", "blockchain.transaction.get", "blockchain.estimatefee" - - // 1.1: "blockchain.scripthash.get_balance", "blockchain.scripthash.get_history", "blockchain.scripthash.get_mempool", "blockchain.scripthash.listunspent", "blockchain.scripthash.subscribe", "server.features", "server.add_peer" - method = "server.peers.subscribe"; - params = "[]"; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); - LP_sendstr = stratumreq; - while ( LP_sendstr != 0 ) - usleep(10000); - /*if ( (retstr= issue_curlt("46.4.125.2:50001",LP_HTTP_TIMEOUT*5)) != 0 ) - { - printf("%s -> %s\n",stratumreq,retstr); - free(retstr); - }*/ if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9bdd47cfc..b05a9bf2f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -236,17 +236,13 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) return(recvlen); } -int32_t LP_recvfunc(char *ipaddr,char *str,int32_t len) -{ - printf("RECV.(%s) from %s\n",str,ipaddr); - return(0); -} +int32_t LP_electrum_maxlen; void *LP_electrum_buf; void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),char **sendstrp,char *ipaddr,uint16_t port) { struct pollfd fds; uint8_t *buf; char *str; int32_t len,sock,bufsize,flag,timeout = 10; - bufsize = IGUANA_MAXPACKETSIZE * 2; - buf = malloc(bufsize); + LP_electrum_maxlen = bufsize = IGUANA_MAXPACKETSIZE * 2; + LP_electrum_buf = buf = malloc(bufsize); sock = LP_socket(0,ipaddr,port); while ( sock >= 0 ) { @@ -284,3 +280,144 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch free(buf); } +// create new electrum server connection, add to list of electrum servers, sendstr, Q, etc. + +int32_t LP_recvfunc(char *ipaddr,char *str,int32_t len) +{ + printf("RECV.(%s) from %s\n",str,ipaddr); + // get callback for id and callback + return(0); +} + +cJSON *electrum_submit(char *method,char *params,int32_t timeout) +{ + static uint32_t stratumid; + // queue id and string and callback + char stratumreq[16384]; + while ( LP_sendstr != 0 ) + usleep(10000); + ((char *)LP_electrum_buf)[0] = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); + LP_sendstr = stratumreq; + while ( LP_sendstr != 0 ) + usleep(10000); + if ( ((char *)LP_electrum_buf)[0] != 0 ) + return(cJSON_Parse(LP_electrum_buf)); + else return(0); +} + +cJSON *electrum_noargs(char *method,int32_t timeout) +{ + return(electrum_submit(method,"[]",timeout)); +} + +cJSON *electrum_strarg(char *method,char *arg,int32_t timeout) +{ + char params[16384]; + if ( strlen(arg) < sizeof(params) ) + { + sprintf(params,"[\"%s\"]",arg); + return(electrum_submit(method,params,timeout)); + } else return(0); +} + +cJSON *electrum_intarg(char *method,int32_t arg,int32_t timeout) +{ + char params[64]; + sprintf(params,"[\"%d\"]",arg); + return(electrum_submit(method,params,timeout)); +} + +cJSON *electrum_hasharg(char *method,bits256 arg,int32_t timeout) +{ + char params[128],str[65]; + sprintf(params,"[\"%s\"]",bits256_str(str,arg)); + return(electrum_submit(method,params,timeout)); +} + +#define ELECTRUM_TIMEOUT 2 +//" "--blockchain.numblocks.subscribe", "--blockchain.address.get_proof", "--blockchain.utxo.get_address", + +cJSON *electrum_version() { return(electrum_noargs("server.version",ELECTRUM_TIMEOUT)); } +cJSON *electrum_banner() { return(electrum_noargs("server.banner",ELECTRUM_TIMEOUT)); } +cJSON *electrum_donation() { return(electrum_noargs("server.donation_address",ELECTRUM_TIMEOUT)); } +cJSON *electrum_peers() { return(electrum_noargs("server.peers.subscribe",ELECTRUM_TIMEOUT)); } +cJSON *electrum_features() { return(electrum_noargs("server.features",ELECTRUM_TIMEOUT)); } +cJSON *electrum_headers() { return(electrum_noargs("blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } + +cJSON *electrum_script_getbalance(char *script) { return(electrum_strarg("blockchain.scripthash.get_balance",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_gethistory(char *script) { return(electrum_strarg("blockchain.scripthash.get_history",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_getmempool(char *script) { return(electrum_strarg("blockchain.scripthash.get_mempool",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_listunspent(char *script) { return(electrum_strarg("blockchain.scripthash.listunspent",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_subscribe(char *script) { return(electrum_strarg("blockchain.scripthash.subscribe",script,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_address_subscribe(char *addr) { return(electrum_strarg("blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_gethistory(char *addr) { return(electrum_strarg("blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_getmempool(char *addr) { return(electrum_strarg("blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_getbalance(char *addr) { return(electrum_strarg("blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_listunspent(char *addr) { return(electrum_strarg("blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_addpeer(char *endpoint) { return(electrum_strarg("server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } +cJSON *electrum_sendrawtransaction(char *rawtx) { return(electrum_strarg("blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_estimatefee(int32_t numblocks) { return(electrum_intarg("blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getheader(bits256 blockhash) { return(electrum_hasharg("blockchain.block.get_header",blockhash,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getchunk(bits256 blockhash) { return(electrum_hasharg("blockchain.block.get_chunk",blockhash,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getmerkle(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get_merkle",txid,ELECTRUM_TIMEOUT)); } +cJSON *electrum_transaction(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } + +void electrum_test() +{ + cJSON *retjson; bits256 hash; char *addr,*script; + if ( (retjson= electrum_version()) != 0 ) + printf("electrum_version %s\n",jprint(retjson,1)); + if ( (retjson= electrum_banner()) != 0 ) + printf("electrum_banner %s\n",jprint(retjson,1)); + if ( (retjson= electrum_donation()) != 0 ) + printf("electrum_donation %s\n",jprint(retjson,1)); + if ( (retjson= electrum_peers()) != 0 ) + printf("electrum_peers %s\n",jprint(retjson,1)); + if ( (retjson= electrum_features()) != 0 ) + printf("electrum_features %s\n",jprint(retjson,1)); + if ( (retjson= electrum_headers()) != 0 ) + printf("electrum_headers %s\n",jprint(retjson,1)); + if ( (retjson= electrum_estimatefee(6)) != 0 ) + printf("electrum_estimatefee %s\n",jprint(retjson,1)); + decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); + if ( (retjson= electrum_getheader(hash)) != 0 ) + printf("electrum_getheader %s\n",jprint(retjson,1)); + if ( (retjson= electrum_getchunk(hash)) != 0 ) + printf("electrum_getchunk %s\n",jprint(retjson,1)); + decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); + if ( (retjson= electrum_getmerkle(hash)) != 0 ) + printf("electrum_getmerkle %s\n",jprint(retjson,1)); + if ( (retjson= electrum_transaction(hash)) != 0 ) + printf("electrum_transaction %s\n",jprint(retjson,1)); + addr = "14NeevLME8UAANiTCVNgvDrynUPk1VcQKb"; + //if ( (retjson= electrum_address_subscribe(addr)) != 0 ) + // printf("electrum_address_subscribe %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_gethistory(addr)) != 0 ) + printf("electrum_address_gethistory %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_getmempool(addr)) != 0 ) + printf("electrum_address_getmempool %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_getbalance(addr)) != 0 ) + printf("electrum_address_getbalance %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_listunspent(addr)) != 0 ) + printf("electrum_address_listunspent %s\n",jprint(retjson,1)); + script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; + //if ( (retjson= electrum_script_subscribe(script)) != 0 ) + // printf("electrum_script_subscribe %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_gethistory(script)) != 0 ) + printf("electrum_script_gethistory %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_getmempool(script)) != 0 ) + printf("electrum_script_getmempool %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_getbalance(script)) != 0 ) + printf("electrum_script_getbalance %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_listunspent(script)) != 0 ) + printf("electrum_script_listunspent %s\n",jprint(retjson,1)); + + if ( (retjson= electrum_addpeer("electrum.be")) != 0 ) + printf("electrum_addpeer %s\n",jprint(retjson,1)); + if ( (retjson= electrum_sendrawtransaction("0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) + printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); +} From 065eaecc86a972c36e84eab488688318852353d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:14:24 +0200 Subject: [PATCH 0080/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b05a9bf2f..a353d0e7c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -375,8 +375,8 @@ void electrum_test() printf("electrum_banner %s\n",jprint(retjson,1)); if ( (retjson= electrum_donation()) != 0 ) printf("electrum_donation %s\n",jprint(retjson,1)); - if ( (retjson= electrum_peers()) != 0 ) - printf("electrum_peers %s\n",jprint(retjson,1)); + //if ( (retjson= electrum_peers()) != 0 ) + // printf("electrum_peers %s\n",jprint(retjson,1)); if ( (retjson= electrum_features()) != 0 ) printf("electrum_features %s\n",jprint(retjson,1)); if ( (retjson= electrum_headers()) != 0 ) From d67fdb6406a6dbaa1c015896b144b05f2fd3dd8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:18:05 +0200 Subject: [PATCH 0081/2732] Test --- iguana/exchanges/LP_socket.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a353d0e7c..e8999a062 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -294,13 +294,18 @@ cJSON *electrum_submit(char *method,char *params,int32_t timeout) static uint32_t stratumid; // queue id and string and callback char stratumreq[16384]; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); + printf("submit.(%s)\n",stratumreq); while ( LP_sendstr != 0 ) usleep(10000); + printf("clear buf\n"); ((char *)LP_electrum_buf)[0] = 0; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); LP_sendstr = stratumreq; while ( LP_sendstr != 0 ) usleep(10000); + printf("wait for return\n"); + while ( ((char *)LP_electrum_buf)[0] == 0 ) + usleep(10000); if ( ((char *)LP_electrum_buf)[0] != 0 ) return(cJSON_Parse(LP_electrum_buf)); else return(0); From fa80a23063b63cb11c8252de6bd249bbfa61cb87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:21:09 +0200 Subject: [PATCH 0082/2732] Test --- iguana/exchanges/LP_socket.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e8999a062..ec5707d41 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -284,7 +284,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch int32_t LP_recvfunc(char *ipaddr,char *str,int32_t len) { - printf("RECV.(%s) from %s\n",str,ipaddr); + //printf("RECV.(%s) from %s\n",str,ipaddr); // get callback for id and callback return(0); } @@ -295,15 +295,12 @@ cJSON *electrum_submit(char *method,char *params,int32_t timeout) // queue id and string and callback char stratumreq[16384]; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); - printf("submit.(%s)\n",stratumreq); while ( LP_sendstr != 0 ) usleep(10000); - printf("clear buf\n"); ((char *)LP_electrum_buf)[0] = 0; LP_sendstr = stratumreq; while ( LP_sendstr != 0 ) usleep(10000); - printf("wait for return\n"); while ( ((char *)LP_electrum_buf)[0] == 0 ) usleep(10000); if ( ((char *)LP_electrum_buf)[0] != 0 ) @@ -366,7 +363,7 @@ cJSON *electrum_addpeer(char *endpoint) { return(electrum_strarg("server.add_pee cJSON *electrum_sendrawtransaction(char *rawtx) { return(electrum_strarg("blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } cJSON *electrum_estimatefee(int32_t numblocks) { return(electrum_intarg("blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getheader(bits256 blockhash) { return(electrum_hasharg("blockchain.block.get_header",blockhash,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getheader(int32_t n) { return(electrum_intarg("blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } cJSON *electrum_getchunk(bits256 blockhash) { return(electrum_hasharg("blockchain.block.get_chunk",blockhash,ELECTRUM_TIMEOUT)); } cJSON *electrum_getmerkle(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get_merkle",txid,ELECTRUM_TIMEOUT)); } cJSON *electrum_transaction(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } @@ -389,7 +386,7 @@ void electrum_test() if ( (retjson= electrum_estimatefee(6)) != 0 ) printf("electrum_estimatefee %s\n",jprint(retjson,1)); decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); - if ( (retjson= electrum_getheader(hash)) != 0 ) + if ( (retjson= electrum_getheader(3)) != 0 ) printf("electrum_getheader %s\n",jprint(retjson,1)); if ( (retjson= electrum_getchunk(hash)) != 0 ) printf("electrum_getchunk %s\n",jprint(retjson,1)); From 6904cfbbd6e8e3e2558b7b36d461e40a7b00efd5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:25:24 +0200 Subject: [PATCH 0083/2732] Test --- iguana/exchanges/LP_socket.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index ec5707d41..27901ddc9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -364,10 +364,16 @@ cJSON *electrum_sendrawtransaction(char *rawtx) { return(electrum_strarg("blockc cJSON *electrum_estimatefee(int32_t numblocks) { return(electrum_intarg("blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } cJSON *electrum_getheader(int32_t n) { return(electrum_intarg("blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getchunk(bits256 blockhash) { return(electrum_hasharg("blockchain.block.get_chunk",blockhash,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getmerkle(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get_merkle",txid,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getchunk(int32_t n) { return(electrum_intarg("blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } cJSON *electrum_transaction(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getmerkle(bits256 txid,int32_t height) +{ + char params[128],str[65]; + sprintf(params,"[\"%s\", %d]",bits256_str(str,txid),height); + return(electrum_submit("blockchain.transaction.get_merkle",params,ELECTRUM_TIMEOUT)); +} + void electrum_test() { cJSON *retjson; bits256 hash; char *addr,*script; @@ -388,10 +394,10 @@ void electrum_test() decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); if ( (retjson= electrum_getheader(3)) != 0 ) printf("electrum_getheader %s\n",jprint(retjson,1)); - if ( (retjson= electrum_getchunk(hash)) != 0 ) + if ( (retjson= electrum_getchunk(3)) != 0 ) printf("electrum_getchunk %s\n",jprint(retjson,1)); decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); - if ( (retjson= electrum_getmerkle(hash)) != 0 ) + if ( (retjson= electrum_getmerkle(hash,403000)) != 0 ) printf("electrum_getmerkle %s\n",jprint(retjson,1)); if ( (retjson= electrum_transaction(hash)) != 0 ) printf("electrum_transaction %s\n",jprint(retjson,1)); From cba3fb74617b3434df851195c4d0d33844aab83d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:52:53 +0200 Subject: [PATCH 0084/2732] Test --- iguana/exchanges/LP_socket.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 27901ddc9..c506aed3f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -284,7 +284,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch int32_t LP_recvfunc(char *ipaddr,char *str,int32_t len) { - //printf("RECV.(%s) from %s\n",str,ipaddr); + printf("RECV.(%s) from %s\n",str,ipaddr); // get callback for id and callback return(0); } @@ -345,7 +345,7 @@ cJSON *electrum_banner() { return(electrum_noargs("server.banner",ELECTRUM_TIMEO cJSON *electrum_donation() { return(electrum_noargs("server.donation_address",ELECTRUM_TIMEOUT)); } cJSON *electrum_peers() { return(electrum_noargs("server.peers.subscribe",ELECTRUM_TIMEOUT)); } cJSON *electrum_features() { return(electrum_noargs("server.features",ELECTRUM_TIMEOUT)); } -cJSON *electrum_headers() { return(electrum_noargs("blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } +cJSON *electrum_headers_subscribe() { return(electrum_noargs("blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } cJSON *electrum_script_getbalance(char *script) { return(electrum_strarg("blockchain.scripthash.get_balance",script,ELECTRUM_TIMEOUT)); } cJSON *electrum_script_gethistory(char *script) { return(electrum_strarg("blockchain.scripthash.get_history",script,ELECTRUM_TIMEOUT)); } @@ -383,12 +383,8 @@ void electrum_test() printf("electrum_banner %s\n",jprint(retjson,1)); if ( (retjson= electrum_donation()) != 0 ) printf("electrum_donation %s\n",jprint(retjson,1)); - //if ( (retjson= electrum_peers()) != 0 ) - // printf("electrum_peers %s\n",jprint(retjson,1)); if ( (retjson= electrum_features()) != 0 ) printf("electrum_features %s\n",jprint(retjson,1)); - if ( (retjson= electrum_headers()) != 0 ) - printf("electrum_headers %s\n",jprint(retjson,1)); if ( (retjson= electrum_estimatefee(6)) != 0 ) printf("electrum_estimatefee %s\n",jprint(retjson,1)); decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); @@ -402,8 +398,6 @@ void electrum_test() if ( (retjson= electrum_transaction(hash)) != 0 ) printf("electrum_transaction %s\n",jprint(retjson,1)); addr = "14NeevLME8UAANiTCVNgvDrynUPk1VcQKb"; - //if ( (retjson= electrum_address_subscribe(addr)) != 0 ) - // printf("electrum_address_subscribe %s\n",jprint(retjson,1)); if ( (retjson= electrum_address_gethistory(addr)) != 0 ) printf("electrum_address_gethistory %s\n",jprint(retjson,1)); if ( (retjson= electrum_address_getmempool(addr)) != 0 ) @@ -413,8 +407,6 @@ void electrum_test() if ( (retjson= electrum_address_listunspent(addr)) != 0 ) printf("electrum_address_listunspent %s\n",jprint(retjson,1)); script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; - //if ( (retjson= electrum_script_subscribe(script)) != 0 ) - // printf("electrum_script_subscribe %s\n",jprint(retjson,1)); if ( (retjson= electrum_script_gethistory(script)) != 0 ) printf("electrum_script_gethistory %s\n",jprint(retjson,1)); if ( (retjson= electrum_script_getmempool(script)) != 0 ) @@ -428,4 +420,13 @@ void electrum_test() printf("electrum_addpeer %s\n",jprint(retjson,1)); if ( (retjson= electrum_sendrawtransaction("0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); + + if ( (retjson= electrum_headers_subscribe()) != 0 ) + printf("electrum_headers %s\n",jprint(retjson,1)); + if ( (retjson= electrum_peers()) != 0 ) + printf("electrum_peers %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_subscribe(addr)) != 0 ) + printf("electrum_address_subscribe %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_subscribe(script)) != 0 ) + printf("electrum_script_subscribe %s\n",jprint(retjson,1)); } From 20043c807108d1c9cc5621d07c60252a28efed75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:58:10 +0200 Subject: [PATCH 0085/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/mm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c506aed3f..10e689207 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -390,8 +390,8 @@ void electrum_test() decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); if ( (retjson= electrum_getheader(3)) != 0 ) printf("electrum_getheader %s\n",jprint(retjson,1)); - if ( (retjson= electrum_getchunk(3)) != 0 ) - printf("electrum_getchunk %s\n",jprint(retjson,1)); + //if ( (retjson= electrum_getchunk(3)) != 0 ) + // printf("electrum_getchunk %s\n",jprint(retjson,1)); decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); if ( (retjson= electrum_getmerkle(hash,403000)) != 0 ) printf("electrum_getmerkle %s\n",jprint(retjson,1)); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index d02592337..68459a670 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -817,7 +817,7 @@ int main(int argc, const char * argv[]) exit(-1); } else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; - LP_dedicatedloop(LP_recvfunc,&LP_sendstr,"88.198.241.196",50001); + LP_dedicatedloop(LP_recvfunc,&LP_sendstr,"46.4.125.2",50001);//88.198.241.196",50001); while ( 1 ) sleep(1); profitmargin = jdouble(retjson,"profitmargin"); From a6161a5dc300bb14f80c70439a70454c7d246587 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 23:00:05 +0200 Subject: [PATCH 0086/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 10e689207..9cf7c0e0a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -241,7 +241,7 @@ int32_t LP_electrum_maxlen; void *LP_electrum_buf; void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),char **sendstrp,char *ipaddr,uint16_t port) { struct pollfd fds; uint8_t *buf; char *str; int32_t len,sock,bufsize,flag,timeout = 10; - LP_electrum_maxlen = bufsize = IGUANA_MAXPACKETSIZE * 2; + LP_electrum_maxlen = bufsize = IGUANA_MAXPACKETSIZE * 10; LP_electrum_buf = buf = malloc(bufsize); sock = LP_socket(0,ipaddr,port); while ( sock >= 0 ) From 60929852c32389d30d7a37a490f7d84d759a354b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 23:10:27 +0200 Subject: [PATCH 0087/2732] Test --- iguana/exchanges/LP_socket.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9cf7c0e0a..73fdea64d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -293,7 +293,7 @@ cJSON *electrum_submit(char *method,char *params,int32_t timeout) { static uint32_t stratumid; // queue id and string and callback - char stratumreq[16384]; + char stratumreq[16384]; cJSON *retjson = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); while ( LP_sendstr != 0 ) usleep(10000); @@ -304,8 +304,11 @@ cJSON *electrum_submit(char *method,char *params,int32_t timeout) while ( ((char *)LP_electrum_buf)[0] == 0 ) usleep(10000); if ( ((char *)LP_electrum_buf)[0] != 0 ) - return(cJSON_Parse(LP_electrum_buf)); - else return(0); + { + retjson = cJSON_Parse(LP_electrum_buf); + memset(LP_electrum_buf,0,LP_electrum_maxlen); + } + return(retjson); } cJSON *electrum_noargs(char *method,int32_t timeout) From d1da2e21e1f5f2e97fb041a5d74f2533b17c110d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 10 Sep 2017 00:36:47 +0200 Subject: [PATCH 0088/2732] Test --- iguana/exchanges/LP_socket.c | 24 +++++++++++++----------- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 73fdea64d..f8bb008e6 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -409,17 +409,19 @@ void electrum_test() printf("electrum_address_getbalance %s\n",jprint(retjson,1)); if ( (retjson= electrum_address_listunspent(addr)) != 0 ) printf("electrum_address_listunspent %s\n",jprint(retjson,1)); - script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; - if ( (retjson= electrum_script_gethistory(script)) != 0 ) - printf("electrum_script_gethistory %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_getmempool(script)) != 0 ) - printf("electrum_script_getmempool %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_getbalance(script)) != 0 ) - printf("electrum_script_getbalance %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_listunspent(script)) != 0 ) - printf("electrum_script_listunspent %s\n",jprint(retjson,1)); - - if ( (retjson= electrum_addpeer("electrum.be")) != 0 ) + if ( 0 ) + { + script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; + if ( (retjson= electrum_script_gethistory(script)) != 0 ) + printf("electrum_script_gethistory %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_getmempool(script)) != 0 ) + printf("electrum_script_getmempool %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_getbalance(script)) != 0 ) + printf("electrum_script_getbalance %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_listunspent(script)) != 0 ) + printf("electrum_script_listunspent %s\n",jprint(retjson,1)); + } + if ( (retjson= electrum_addpeer("electrum.be:50001")) != 0 ) printf("electrum_addpeer %s\n",jprint(retjson,1)); if ( (retjson= electrum_sendrawtransaction("0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a3d191dcd..3ba7add93 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -539,7 +539,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f, value2 %.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(value2),dstr(tmpsatoshis)); + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } numconfirms = -1; From 714821f15bb599366daa0e9f8230bb3f9215db63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 10 Sep 2017 00:40:10 +0200 Subject: [PATCH 0089/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3ba7add93..0e9f9c795 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -539,7 +539,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); + //printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } numconfirms = -1; From 8a63c46a4c30a632e6dcf842a27a969ae96c85c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 09:50:59 +0200 Subject: [PATCH 0090/2732] Proper bindings --- crypto777/OS_portable.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_socket.c | 333 ++++++++++++++++++++++---------- iguana/exchanges/mm.c | 3 +- 4 files changed, 236 insertions(+), 105 deletions(-) diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 84ba44794..9ce9d368b 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -134,7 +134,7 @@ int32_t hseek(HUFF *hp,int32_t offset,int32_t mode); struct allocitem { uint32_t allocsize,type; } PACKED; struct queueitem { struct queueitem *next,*prev; uint32_t allocsize,type; } PACKED; -struct stritem { struct queueitem DL; char str[]; }; +struct stritem { struct queueitem DL; void **retptrp; uint32_t expiration; char str[]; }; typedef struct queue { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f00138e94..feb938264 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -32,7 +32,7 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex; int32_t LP_canbind; struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; @@ -607,6 +607,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_psockmutex); portable_mutex_init(&LP_coinmutex); portable_mutex_init(&LP_pubkeymutex); + portable_mutex_init(&LP_electrummutex); portable_mutex_init(&LP_messagemutex); portable_mutex_init(&LP_portfoliomutex); LP_sessionid = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f8bb008e6..86d9cbc6f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,6 +26,8 @@ #include #endif +#define ELECTRUM_TIMEOUT 2 + int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { int32_t opt,sock,result; char ipaddr[64],checkipaddr[64]; struct timeval timeout; @@ -236,40 +238,158 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) return(recvlen); } -int32_t LP_electrum_maxlen; void *LP_electrum_buf; +struct electrum_info +{ + queue_t sendQ,pendingQ; + int32_t bufsize,sock; + uint32_t stratumid,lasttime; + char ipaddr[64],symbol[16]; + uint16_t port; + uint8_t buf[]; +} *Electrums[8192]; +int32_t Num_electrums; + +// purge timedout + +struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) +{ + struct electrum_info *rbuf[128],*recent_ep; uint32_t recent,mostrecent = 0; int32_t i,n = 0; + portable_mutex_lock(&LP_electrummutex); + if ( ep != 0 ) + { + memset(rbuf,0,sizeof(rbuf)); + recent_ep = 0; + recent = (uint32_t)time(NULL) - 300; + for (i=0; isymbol) == 0 && ep->sock >= 0 ) + { + if ( ep->lasttime > recent ) + { + rbuf[n++] = ep; + if ( n == sizeof(rbuf)/sizeof(*rbuf) ) + break; + } + else if ( ep->lasttime > mostrecent ) + { + mostrecent = ep->lasttime; + recent_ep = ep; + } + } + ep = recent_ep; + if ( n > 0 ) + { + i = (rand() % n); + ep = rbuf[i]; + } + } + else if ( Num_electrums < sizeof(Electrums)/sizeof(*Electrums) ) + Electrums[Num_electrums++] = ep; + else printf("Electrum server pointer buf overflow %d\n",Num_electrums); + portable_mutex_unlock(&LP_electrummutex); + return(ep); +} + +struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) +{ + struct electrum_info *ep; struct stritem *sitem; char name[512],*str = "init string"; + ep = calloc(1,sizeof(*ep) + bufsize); + ep->sock = LP_socket(0,ipaddr,port); + safecopy(ep->symbol,symbol,sizeof(ep->symbol)); + safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); + ep->port = port; + ep->bufsize = bufsize; + sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); + queue_enqueue(name,&ep->sendQ,queueitem(str)); + if ( (sitem= queue_dequeue(&ep->sendQ)) == 0 && strcmp(sitem->str,str) != 0 ) + printf("error with string sendQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); + sprintf(name,"%s_%s_%u_electrum_pendingQ",symbol,ipaddr,port); + queue_enqueue(name,&ep->pendingQ,queueitem(str)); + if ( (sitem= queue_dequeue(&ep->pendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) + printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); + electrum_server(symbol,ep); + return(ep); +} -void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),char **sendstrp,char *ipaddr,uint16_t port) +int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - struct pollfd fds; uint8_t *buf; char *str; int32_t len,sock,bufsize,flag,timeout = 10; - LP_electrum_maxlen = bufsize = IGUANA_MAXPACKETSIZE * 10; - LP_electrum_buf = buf = malloc(bufsize); - sock = LP_socket(0,ipaddr,port); - while ( sock >= 0 ) + cJSON *strjson; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; + ep->lasttime = (uint32_t)time(NULL); + if ( (strjson= cJSON_Parse(str)) != 0 ) + { + idnum = juint(strjson,"id"); + portable_mutex_lock(&ep->pendingQ.mutex); + if ( ep->pendingQ.list != 0 ) + { + DL_FOREACH(ep->pendingQ.list,item) + { + stritem = (struct stritem *)item; + if ( item->type == idnum ) + { + printf("matched idnum.%d\n",idnum); + DL_DELETE(ep->pendingQ.list,item); + break; + } + if ( stritem->expiration < ep->lasttime ) + { + DL_DELETE(ep->pendingQ.list,item); + printf("expired (%s)\n",stritem->str); + strjson = cJSON_CreateObject(); + jaddnum(strjson,"id",item->type); + jaddstr(strjson,"error","timeout"); + if ( stritem->retptrp != 0 ) + *((cJSON **)stritem->retptrp) = strjson; + else free_json(strjson); + } + item = 0; + } + } + portable_mutex_unlock(&ep->pendingQ.mutex); + if ( item != 0 ) + { + // do callback + stritem = (struct stritem *)item; + printf("callback (%s) -> (%s)\n",stritem->str,jprint(strjson,0)); + if ( stritem->retptrp != 0 ) + *((cJSON **)stritem->retptrp) = strjson; + else free_json(strjson); + free(item); + } + if ( strjson != 0 ) + free_json(strjson); + } + return(item != 0); +} + +void LP_dedicatedloop(char *symbol,char *ipaddr,uint16_t port) +{ + struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep; + ep = LP_electrum_info(symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + while ( ep->sock >= 0 ) { flag = 0; memset(&fds,0,sizeof(fds)); - fds.fd = sock; + fds.fd = ep->sock; fds.events |= (POLLOUT | POLLIN); - if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (str= *sendstrp) != 0 ) + if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (sitem= queue_dequeue(&ep->sendQ)) != 0 ) { - *sendstrp = 0; //printf("sending.(%s)\n",str); - if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str)) <= 0 ) + if ( LP_socketsend(ep->sock,(uint8_t *)sitem->str,(int32_t)strlen(sitem->str)) <= 0 ) { printf("%s:%u is dead\n",ipaddr,port); - closesocket(sock); - sock = -1; + closesocket(ep->sock); + ep->sock = -1; break; } + queue_enqueue("pendingQ",&ep->pendingQ,(struct queueitem *)sitem); flag++; } if ( flag == 0 ) { if ( (fds.revents & POLLIN) != 0 ) { - if ( (len= LP_socketrecv(sock,buf,bufsize)) > 0 ) + if ( (len= LP_socketrecv(ep->sock,ep->buf,ep->bufsize)) > 0 ) { - (*recvfunc)(ipaddr,(char *)buf,len); + LP_recvfunc(ep,(char *)ep->buf,len); flag++; } } @@ -277,161 +397,172 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch usleep(100000); } } - free(buf); -} - -// create new electrum server connection, add to list of electrum servers, sendstr, Q, etc. - -int32_t LP_recvfunc(char *ipaddr,char *str,int32_t len) -{ - printf("RECV.(%s) from %s\n",str,ipaddr); - // get callback for id and callback - return(0); + if ( Num_electrums > 0 ) + { + portable_mutex_lock(&LP_electrummutex); + for (i=0; istratumid,method,params); + ep->buf[0] = 0; + sitem = (struct stritem *)queueitem(stratumreq); + sitem->DL.type = ep->stratumid++; + if ( retjsonp != 0 ) + sitem->retptrp = (void **)retjsonp; + else sitem->retptrp = (void **)&retjson; + queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); } return(retjson); } -cJSON *electrum_noargs(char *method,int32_t timeout) +cJSON *electrum_noargs(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t timeout) { - return(electrum_submit(method,"[]",timeout)); + return(electrum_submit(symbol,ep,retjsonp,method,"[]",timeout)); } -cJSON *electrum_strarg(char *method,char *arg,int32_t timeout) +cJSON *electrum_strarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *arg,int32_t timeout) { char params[16384]; if ( strlen(arg) < sizeof(params) ) { sprintf(params,"[\"%s\"]",arg); - return(electrum_submit(method,params,timeout)); + return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } else return(0); } -cJSON *electrum_intarg(char *method,int32_t arg,int32_t timeout) +cJSON *electrum_intarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t arg,int32_t timeout) { char params[64]; sprintf(params,"[\"%d\"]",arg); - return(electrum_submit(method,params,timeout)); + return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } -cJSON *electrum_hasharg(char *method,bits256 arg,int32_t timeout) +cJSON *electrum_hasharg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,bits256 arg,int32_t timeout) { char params[128],str[65]; sprintf(params,"[\"%s\"]",bits256_str(str,arg)); - return(electrum_submit(method,params,timeout)); + return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } -#define ELECTRUM_TIMEOUT 2 //" "--blockchain.numblocks.subscribe", "--blockchain.address.get_proof", "--blockchain.utxo.get_address", -cJSON *electrum_version() { return(electrum_noargs("server.version",ELECTRUM_TIMEOUT)); } -cJSON *electrum_banner() { return(electrum_noargs("server.banner",ELECTRUM_TIMEOUT)); } -cJSON *electrum_donation() { return(electrum_noargs("server.donation_address",ELECTRUM_TIMEOUT)); } -cJSON *electrum_peers() { return(electrum_noargs("server.peers.subscribe",ELECTRUM_TIMEOUT)); } -cJSON *electrum_features() { return(electrum_noargs("server.features",ELECTRUM_TIMEOUT)); } -cJSON *electrum_headers_subscribe() { return(electrum_noargs("blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } +cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.version",ELECTRUM_TIMEOUT)); } +cJSON *electrum_banner(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.banner",ELECTRUM_TIMEOUT)); } +cJSON *electrum_donation(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.donation_address",ELECTRUM_TIMEOUT)); } +cJSON *electrum_peers(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.peers.subscribe",ELECTRUM_TIMEOUT)); } +cJSON *electrum_features(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.features",ELECTRUM_TIMEOUT)); } +cJSON *electrum_headers_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_getbalance(char *script) { return(electrum_strarg("blockchain.scripthash.get_balance",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_gethistory(char *script) { return(electrum_strarg("blockchain.scripthash.get_history",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_getmempool(char *script) { return(electrum_strarg("blockchain.scripthash.get_mempool",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_listunspent(char *script) { return(electrum_strarg("blockchain.scripthash.listunspent",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_subscribe(char *script) { return(electrum_strarg("blockchain.scripthash.subscribe",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_balance",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_history",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_mempool",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.listunspent",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.subscribe",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_subscribe(char *addr) { return(electrum_strarg("blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_gethistory(char *addr) { return(electrum_strarg("blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_getmempool(char *addr) { return(electrum_strarg("blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_getbalance(char *addr) { return(electrum_strarg("blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_listunspent(char *addr) { return(electrum_strarg("blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_addpeer(char *endpoint) { return(electrum_strarg("server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } -cJSON *electrum_sendrawtransaction(char *rawtx) { return(electrum_strarg("blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } +cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *endpoint) { return(electrum_strarg(symbol,ep,retjsonp,"server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } +cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } -cJSON *electrum_estimatefee(int32_t numblocks) { return(electrum_intarg("blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getheader(int32_t n) { return(electrum_intarg("blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getchunk(int32_t n) { return(electrum_intarg("blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } -cJSON *electrum_transaction(bits256 txid) { return(electrum_hasharg("blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } +cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } +cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getmerkle(bits256 txid,int32_t height) +cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) { char params[128],str[65]; sprintf(params,"[\"%s\", %d]",bits256_str(str,txid),height); - return(electrum_submit("blockchain.transaction.get_merkle",params,ELECTRUM_TIMEOUT)); + return(electrum_submit(symbol,ep,retjsonp,"blockchain.transaction.get_merkle",params,ELECTRUM_TIMEOUT)); } void electrum_test() { - cJSON *retjson; bits256 hash; char *addr,*script; - if ( (retjson= electrum_version()) != 0 ) + cJSON *retjson; bits256 hash; struct electrum_info *ep = 0; char *addr,*script,*symbol = "BTC"; + if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) printf("electrum_version %s\n",jprint(retjson,1)); - if ( (retjson= electrum_banner()) != 0 ) + if ( (retjson= electrum_banner(symbol,ep,0)) != 0 ) printf("electrum_banner %s\n",jprint(retjson,1)); - if ( (retjson= electrum_donation()) != 0 ) + if ( (retjson= electrum_donation(symbol,ep,0)) != 0 ) printf("electrum_donation %s\n",jprint(retjson,1)); - if ( (retjson= electrum_features()) != 0 ) + if ( (retjson= electrum_features(symbol,ep,0)) != 0 ) printf("electrum_features %s\n",jprint(retjson,1)); - if ( (retjson= electrum_estimatefee(6)) != 0 ) + if ( (retjson= electrum_estimatefee(symbol,ep,0,6)) != 0 ) printf("electrum_estimatefee %s\n",jprint(retjson,1)); decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); - if ( (retjson= electrum_getheader(3)) != 0 ) + if ( (retjson= electrum_getheader(symbol,ep,0,3)) != 0 ) printf("electrum_getheader %s\n",jprint(retjson,1)); - //if ( (retjson= electrum_getchunk(3)) != 0 ) + //if ( (retjson= electrum_getchunk(symbol,ep,0,3)) != 0 ) // printf("electrum_getchunk %s\n",jprint(retjson,1)); decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); - if ( (retjson= electrum_getmerkle(hash,403000)) != 0 ) + if ( (retjson= electrum_getmerkle(symbol,ep,0,hash,403000)) != 0 ) printf("electrum_getmerkle %s\n",jprint(retjson,1)); - if ( (retjson= electrum_transaction(hash)) != 0 ) + if ( (retjson= electrum_transaction(symbol,ep,0,hash)) != 0 ) printf("electrum_transaction %s\n",jprint(retjson,1)); addr = "14NeevLME8UAANiTCVNgvDrynUPk1VcQKb"; - if ( (retjson= electrum_address_gethistory(addr)) != 0 ) + if ( (retjson= electrum_address_gethistory(symbol,ep,0,addr)) != 0 ) printf("electrum_address_gethistory %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_getmempool(addr)) != 0 ) + if ( (retjson= electrum_address_getmempool(symbol,ep,0,addr)) != 0 ) printf("electrum_address_getmempool %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_getbalance(addr)) != 0 ) + if ( (retjson= electrum_address_getbalance(symbol,ep,0,addr)) != 0 ) printf("electrum_address_getbalance %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_listunspent(addr)) != 0 ) + if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) printf("electrum_address_listunspent %s\n",jprint(retjson,1)); + if ( (retjson= electrum_addpeer(symbol,ep,0,"electrum.be:50001")) != 0 ) + printf("electrum_addpeer %s\n",jprint(retjson,1)); + if ( (retjson= electrum_sendrawtransaction(symbol,ep,0,"0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) + printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); + if ( 0 ) { script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; - if ( (retjson= electrum_script_gethistory(script)) != 0 ) + if ( (retjson= electrum_script_gethistory(symbol,ep,0,script)) != 0 ) printf("electrum_script_gethistory %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_getmempool(script)) != 0 ) + if ( (retjson= electrum_script_getmempool(symbol,ep,0,script)) != 0 ) printf("electrum_script_getmempool %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_getbalance(script)) != 0 ) + if ( (retjson= electrum_script_getbalance(symbol,ep,0,script)) != 0 ) printf("electrum_script_getbalance %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_listunspent(script)) != 0 ) + if ( (retjson= electrum_script_listunspent(symbol,ep,0,script)) != 0 ) printf("electrum_script_listunspent %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_subscribe(symbol,ep,0,script)) != 0 ) + printf("electrum_script_subscribe %s\n",jprint(retjson,1)); } - if ( (retjson= electrum_addpeer("electrum.be:50001")) != 0 ) - printf("electrum_addpeer %s\n",jprint(retjson,1)); - if ( (retjson= electrum_sendrawtransaction("0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) - printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); - - if ( (retjson= electrum_headers_subscribe()) != 0 ) + if ( (retjson= electrum_headers_subscribe(symbol,ep,0)) != 0 ) printf("electrum_headers %s\n",jprint(retjson,1)); - if ( (retjson= electrum_peers()) != 0 ) + if ( (retjson= electrum_peers(symbol,ep,0)) != 0 ) printf("electrum_peers %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_subscribe(addr)) != 0 ) + if ( (retjson= electrum_address_subscribe(symbol,ep,0,addr)) != 0 ) printf("electrum_address_subscribe %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_subscribe(script)) != 0 ) - printf("electrum_script_subscribe %s\n",jprint(retjson,1)); } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 68459a670..6c937b075 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -26,7 +26,6 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #include "stats.c" -char *LP_sendstr; void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]); //defined(__APPLE__) || @@ -817,7 +816,7 @@ int main(int argc, const char * argv[]) exit(-1); } else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; - LP_dedicatedloop(LP_recvfunc,&LP_sendstr,"46.4.125.2",50001);//88.198.241.196",50001); + LP_dedicatedloop("BTC","46.4.125.2",50001);//88.198.241.196",50001); while ( 1 ) sleep(1); profitmargin = jdouble(retjson,"profitmargin"); From ea9efb63b8f35c59b8dcd9f9ec5decbd35d8abd4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 09:53:23 +0200 Subject: [PATCH 0091/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 86d9cbc6f..b975302f5 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -372,7 +372,7 @@ void LP_dedicatedloop(char *symbol,char *ipaddr,uint16_t port) fds.events |= (POLLOUT | POLLIN); if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (sitem= queue_dequeue(&ep->sendQ)) != 0 ) { - //printf("sending.(%s)\n",str); + printf("sending.(%s)\n",sitem->str); if ( LP_socketsend(ep->sock,(uint8_t *)sitem->str,(int32_t)strlen(sitem->str)) <= 0 ) { printf("%s:%u is dead\n",ipaddr,port); From ad81ee3848bc22c9c52be9426803fefe91217336 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 09:55:32 +0200 Subject: [PATCH 0092/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index feb938264..29db592f7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -568,7 +568,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #endif OS_randombytes((void *)&n,sizeof(n)); + printf("call test\n"); electrum_test(); + getchar(); if ( jobj(argjson,"gui") != 0 ) safecopy(LP_gui,jstr(argjson,"gui"),sizeof(LP_gui)); if ( jobj(argjson,"canbind") == 0 ) From ad0f9fc2b5d610dbe88eac29e232f52644bc5c56 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 09:58:22 +0200 Subject: [PATCH 0093/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 --- iguana/exchanges/mm.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 29db592f7..54481f81a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -568,9 +568,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #endif OS_randombytes((void *)&n,sizeof(n)); - printf("call test\n"); - electrum_test(); - getchar(); if ( jobj(argjson,"gui") != 0 ) safecopy(LP_gui,jstr(argjson,"gui"),sizeof(LP_gui)); if ( jobj(argjson,"canbind") == 0 ) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 6c937b075..58a47495a 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,6 +803,9 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); + printf("call test\n"); + electrum_test(); + getchar(); sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); From 41e6104c229af0bbac315be9b7b53a518b98fb9d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 09:59:41 +0200 Subject: [PATCH 0094/2732] Test --- iguana/exchanges/mm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 58a47495a..350df9b67 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -805,7 +805,8 @@ int main(int argc, const char * argv[]) OS_init(); printf("call test\n"); electrum_test(); - getchar(); + while ( 1 ) + sleep(1); sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); From 516ff91b0271e8503f96ca6de9e96edafe930234 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:01:16 +0200 Subject: [PATCH 0095/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 350df9b67..1ede94037 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -804,6 +804,7 @@ int main(int argc, const char * argv[]) cJSON *retjson,*loginjson; int32_t i; OS_init(); printf("call test\n"); + LP_dedicatedloop("BTC","46.4.125.2",50001);//88.198.241.196",50001); electrum_test(); while ( 1 ) sleep(1); @@ -820,7 +821,6 @@ int main(int argc, const char * argv[]) exit(-1); } else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; - LP_dedicatedloop("BTC","46.4.125.2",50001);//88.198.241.196",50001); while ( 1 ) sleep(1); profitmargin = jdouble(retjson,"profitmargin"); From fcabca69d6d24b99a493c5d2fa7edb3334665c30 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:02:51 +0200 Subject: [PATCH 0096/2732] Test --- iguana/exchanges/LP_socket.c | 1 + iguana/exchanges/mm.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b975302f5..eef94ce7c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -364,6 +364,7 @@ void LP_dedicatedloop(char *symbol,char *ipaddr,uint16_t port) { struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep; ep = LP_electrum_info(symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + printf("ep.%p for %s:%u num.%d\n",ep,ep->ipaddr,ep->port,Num_electrums); while ( ep->sock >= 0 ) { flag = 0; diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 1ede94037..db949f192 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -805,9 +805,12 @@ int main(int argc, const char * argv[]) OS_init(); printf("call test\n"); LP_dedicatedloop("BTC","46.4.125.2",50001);//88.198.241.196",50001); - electrum_test(); - while ( 1 ) - sleep(1); + if ( (1) ) + { + electrum_test(); + while ( 1 ) + sleep(1); + } sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); @@ -821,7 +824,7 @@ int main(int argc, const char * argv[]) exit(-1); } else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; - while ( 1 ) + while ( (1) ) sleep(1); profitmargin = jdouble(retjson,"profitmargin"); minask = jdouble(retjson,"minask"); From e9e32d8694346c3ab31dcb34aaa01476bc224592 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:04:28 +0200 Subject: [PATCH 0097/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index eef94ce7c..1ac989518 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -255,7 +255,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) { struct electrum_info *rbuf[128],*recent_ep; uint32_t recent,mostrecent = 0; int32_t i,n = 0; portable_mutex_lock(&LP_electrummutex); - if ( ep != 0 ) + if ( ep == 0 ) { memset(rbuf,0,sizeof(rbuf)); recent_ep = 0; From 7165505bd8e2495e9f84e9ac2a4c156e03bc2819 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:05:35 +0200 Subject: [PATCH 0098/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1ac989518..d6c531afb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -298,6 +298,7 @@ struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,i safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); ep->port = port; ep->bufsize = bufsize; + ep->lasttime = (uint32_t)time(NULL); sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); queue_enqueue(name,&ep->sendQ,queueitem(str)); if ( (sitem= queue_dequeue(&ep->sendQ)) == 0 && strcmp(sitem->str,str) != 0 ) From 7802ad1d52279f93af083463f1ddce20021cef4f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:08:40 +0200 Subject: [PATCH 0099/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d6c531afb..508ca1f39 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -276,6 +276,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) } } ep = recent_ep; + printf("n.%d recent.%p\n",n,ep); if ( n > 0 ) { i = (rand() % n); From 0182f3ea2d0e11fa4735ccbb9cc8f499046be285 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:09:27 +0200 Subject: [PATCH 0100/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 508ca1f39..66b61a93e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -442,7 +442,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->retptrp = (void **)retjsonp; else sitem->retptrp = (void **)&retjson; queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - } + } else printf("couldnt find electrum server for (%s %s)\n",method,params); return(retjson); } From 6a2a820ce1938b82538992c980718fff2f930495 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:10:49 +0200 Subject: [PATCH 0101/2732] Test --- iguana/exchanges/LP_socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 66b61a93e..924e5253c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -514,6 +514,9 @@ cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp void electrum_test() { cJSON *retjson; bits256 hash; struct electrum_info *ep = 0; char *addr,*script,*symbol = "BTC"; + while ( Num_electrums == 0 ) + sleep(1); + printf("found electrum server\n"); if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) printf("electrum_version %s\n",jprint(retjson,1)); if ( (retjson= electrum_banner(symbol,ep,0)) != 0 ) From 5678a7c43b9c4233356399aaceec2868529634b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:14:22 +0200 Subject: [PATCH 0102/2732] Test --- iguana/exchanges/LP_socket.c | 5 ++--- iguana/exchanges/mm.c | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 924e5253c..0d5bc1671 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -362,10 +362,9 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) return(item != 0); } -void LP_dedicatedloop(char *symbol,char *ipaddr,uint16_t port) +void LP_dedicatedloop(void *arg) { - struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep; - ep = LP_electrum_info(symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep = arg; printf("ep.%p for %s:%u num.%d\n",ep,ep->ipaddr,ep->port,Num_electrums); while ( ep->sock >= 0 ) { diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index db949f192..b2c02ceb9 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -799,12 +799,17 @@ void LP_main(void *ptr) int main(int argc, const char * argv[]) { - char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; + char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; struct electrum_info *ep; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); + ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" + if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) + { + printf("error launching LP_main (%s)\n",jprint(retjson,0)); + exit(-1); + } else printf("(%s) launched.(%s)\n",argv[1],passphrase); printf("call test\n"); - LP_dedicatedloop("BTC","46.4.125.2",50001);//88.198.241.196",50001); if ( (1) ) { electrum_test(); From 60023df3a08b90e224c18037240018f5d9adde4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:15:57 +0200 Subject: [PATCH 0103/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/mm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0d5bc1671..17356d2b1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -377,7 +377,7 @@ void LP_dedicatedloop(void *arg) printf("sending.(%s)\n",sitem->str); if ( LP_socketsend(ep->sock,(uint8_t *)sitem->str,(int32_t)strlen(sitem->str)) <= 0 ) { - printf("%s:%u is dead\n",ipaddr,port); + printf("%s:%u is dead\n",ep->ipaddr,ep->port); closesocket(ep->sock); ep->sock = -1; break; diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index b2c02ceb9..d308c9350 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -806,9 +806,9 @@ int main(int argc, const char * argv[]) ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) { - printf("error launching LP_main (%s)\n",jprint(retjson,0)); + printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); exit(-1); - } else printf("(%s) launched.(%s)\n",argv[1],passphrase); + } else printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); printf("call test\n"); if ( (1) ) { From 095474d9a90abd313d418009d5a00b1b6b5bc395 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:19:06 +0200 Subject: [PATCH 0104/2732] Test --- iguana/exchanges/LP_socket.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 17356d2b1..10b71ea01 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -257,10 +257,12 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) portable_mutex_lock(&LP_electrummutex); if ( ep == 0 ) { + printf("find random electrum.%s\n",symbol); memset(rbuf,0,sizeof(rbuf)); recent_ep = 0; recent = (uint32_t)time(NULL) - 300; for (i=0; isymbol) == 0 && ep->sock >= 0 ) { if ( ep->lasttime > recent ) @@ -275,6 +277,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) recent_ep = ep; } } + } ep = recent_ep; printf("n.%d recent.%p\n",n,ep); if ( n > 0 ) @@ -365,7 +368,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep = arg; - printf("ep.%p for %s:%u num.%d\n",ep,ep->ipaddr,ep->port,Num_electrums); + printf("ep.%p sock.%d for %s:%u num.%d %p\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums); while ( ep->sock >= 0 ) { flag = 0; @@ -399,6 +402,7 @@ void LP_dedicatedloop(void *arg) usleep(100000); } } + printf("close %s:%u\n",ep->ipaddr,ep->port); if ( Num_electrums > 0 ) { portable_mutex_lock(&LP_electrummutex); @@ -434,6 +438,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch if ( ep != 0 ) { sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); + printf("stratumreq.(%s)\n",stratumreq); ep->buf[0] = 0; sitem = (struct stritem *)queueitem(stratumreq); sitem->DL.type = ep->stratumid++; @@ -514,7 +519,10 @@ void electrum_test() { cJSON *retjson; bits256 hash; struct electrum_info *ep = 0; char *addr,*script,*symbol = "BTC"; while ( Num_electrums == 0 ) + { sleep(1); + printf("Num_electrums %p -> %d\n",&Num_electrums,Num_electrums); + } printf("found electrum server\n"); if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) printf("electrum_version %s\n",jprint(retjson,1)); From 8891bc49d65f5c2a313173da0e6dae2bb69df36e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:21:23 +0200 Subject: [PATCH 0105/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 10b71ea01..fa00f68b2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -257,12 +257,13 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) portable_mutex_lock(&LP_electrummutex); if ( ep == 0 ) { - printf("find random electrum.%s\n",symbol); + printf("find random electrum.%s from %d\n",symbol,Num_electrums); memset(rbuf,0,sizeof(rbuf)); recent_ep = 0; recent = (uint32_t)time(NULL) - 300; for (i=0; isymbol) == 0 && ep->sock >= 0 ) { if ( ep->lasttime > recent ) From 8c63df9f9c5f7036a41cc76137ecce9e70e30a6d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:25:27 +0200 Subject: [PATCH 0106/2732] Test --- iguana/exchanges/LP_socket.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index fa00f68b2..7e214c290 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -242,7 +242,7 @@ struct electrum_info { queue_t sendQ,pendingQ; int32_t bufsize,sock; - uint32_t stratumid,lasttime; + uint32_t stratumid,lasttime,pending; char ipaddr[64],symbol[16]; uint16_t port; uint8_t buf[]; @@ -264,7 +264,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) for (i=0; isymbol) == 0 && ep->sock >= 0 ) + if ( strcmp(symbol,ep->symbol) == 0 && ep->sock >= 0 && ep->pending == 0 ) { if ( ep->lasttime > recent ) { @@ -376,9 +376,9 @@ void LP_dedicatedloop(void *arg) memset(&fds,0,sizeof(fds)); fds.fd = ep->sock; fds.events |= (POLLOUT | POLLIN); - if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (sitem= queue_dequeue(&ep->sendQ)) != 0 ) + if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && ep->pending == 0 && (sitem= queue_dequeue(&ep->sendQ)) != 0 ) { - printf("sending.(%s)\n",sitem->str); + ep->pending = (uint32_t)time(NULL); if ( LP_socketsend(ep->sock,(uint8_t *)sitem->str,(int32_t)strlen(sitem->str)) <= 0 ) { printf("%s:%u is dead\n",ep->ipaddr,ep->port); @@ -395,6 +395,7 @@ void LP_dedicatedloop(void *arg) { if ( (len= LP_socketrecv(ep->sock,ep->buf,ep->bufsize)) > 0 ) { + ep->pending = 0; LP_recvfunc(ep,(char *)ep->buf,len); flag++; } From fb3473a36996a789cee9ee1ccd6f8c3d939fff2d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:26:52 +0200 Subject: [PATCH 0107/2732] Test --- iguana/exchanges/LP_socket.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7e214c290..1ce073e4b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -257,14 +257,14 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) portable_mutex_lock(&LP_electrummutex); if ( ep == 0 ) { - printf("find random electrum.%s from %d\n",symbol,Num_electrums); + //printf("find random electrum.%s from %d\n",symbol,Num_electrums); memset(rbuf,0,sizeof(rbuf)); recent_ep = 0; recent = (uint32_t)time(NULL) - 300; for (i=0; isymbol) == 0 && ep->sock >= 0 && ep->pending == 0 ) + if ( strcmp(symbol,ep->symbol) == 0 && ep->sock >= 0 ) { if ( ep->lasttime > recent ) { @@ -280,7 +280,6 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) } } ep = recent_ep; - printf("n.%d recent.%p\n",n,ep); if ( n > 0 ) { i = (rand() % n); From bf1de9ab5d43ba2826f5118fd1a819a2ba4f2b41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:28:10 +0200 Subject: [PATCH 0108/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1ce073e4b..0e809f146 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -330,7 +330,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) stritem = (struct stritem *)item; if ( item->type == idnum ) { - printf("matched idnum.%d\n",idnum); + //printf("matched idnum.%d\n",idnum); DL_DELETE(ep->pendingQ.list,item); break; } @@ -439,7 +439,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch if ( ep != 0 ) { sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); - printf("stratumreq.(%s)\n",stratumreq); + //printf("stratumreq.(%s)\n",stratumreq); ep->buf[0] = 0; sitem = (struct stritem *)queueitem(stratumreq); sitem->DL.type = ep->stratumid++; From f959202aea3453d5bb5af4c71564eaa053c94ad7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Sep 2017 10:29:16 +0200 Subject: [PATCH 0109/2732] Test --- iguana/exchanges/mm.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index d308c9350..6e0e4ee60 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,18 +803,15 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); - ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" - if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) - { - printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); - exit(-1); - } else printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); - printf("call test\n"); if ( (1) ) { + ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" + if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) + { + printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); + exit(-1); + } else printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); electrum_test(); - while ( 1 ) - sleep(1); } sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); From f086858c6d52c52b12a31d673f53b1733be35f1a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:03:52 +0200 Subject: [PATCH 0110/2732] Test --- iguana/exchanges/LP_commands.c | 9 +++++++++ iguana/exchanges/LP_include.h | 7 ++++--- iguana/exchanges/LP_ordermatch.c | 25 +++++++++++++------------ iguana/exchanges/LP_remember.c | 10 ++++++---- iguana/exchanges/LP_rpc.c | 30 +++++++++++++++++++++--------- iguana/exchanges/LP_socket.c | 20 ++++++++++++++++++++ iguana/exchanges/LP_transaction.c | 6 +++--- iguana/exchanges/LP_utxos.c | 6 +++--- iguana/exchanges/electrum | 2 ++ iguana/exchanges/install | 2 +- 10 files changed, 82 insertions(+), 35 deletions(-) create mode 100755 iguana/exchanges/electrum diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ad0a07be4..3e1537ae5 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -121,6 +121,7 @@ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ secretaddresses(passphrase, num=10, pubtype=60, taddr=0)\n\ +electrum(coin, ipaddr, port)\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ @@ -256,6 +257,14 @@ dividends(coin, height, )\n\ ptr->inactive = (uint32_t)time(NULL); return(jprint(LP_coinsjson(0),1)); } + else if ( strcmp(method,"electrum") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + ptr->inactive = 0; + return(jprint(LP_electrumserver(ptr,ipaddr,port),1)); + } else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( strcmp(method,"snapshot") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e630c13ea..1c4299e05 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -188,11 +188,12 @@ struct iguana_info portable_mutex_t txmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; - uint32_t counter,inactive,lastmempool,lastgetinfo; + uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio - double price_kmd,force,perc,goal,goalperc,relvolume; + double price_kmd,force,perc,goal,goalperc,relvolume,rate; + void *electrum; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33]; }; @@ -283,7 +284,7 @@ int32_t LP_coinbus(uint16_t coin_busport); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); -uint64_t LP_txfeecalc(char *symbol,uint64_t txfee); +uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); #endif diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3e3edf622..052459d33 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -19,25 +19,26 @@ // marketmaker // -uint64_t LP_txfeecalc(char *symbol,uint64_t txfee) +uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { - struct iguana_info *coin; - if ( strcmp(symbol,"BTC") == 0 ) + if ( coin != 0 ) { - if ( txfee == 0 && (txfee= LP_getestimatedrate(symbol) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( strcmp(coin->symbol,"BTC") == 0 ) + { + if ( txfee == 0 && (txfee= LP_getestimatedrate(coin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + txfee = LP_MIN_TXFEE; + } + else txfee = coin->txfee; + if ( txfee < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } - else if ( (coin= LP_coinfind(symbol)) != 0 ) - txfee = coin->txfee; - if ( txfee < LP_MIN_TXFEE ) - txfee = LP_MIN_TXFEE; return(txfee); } void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) { - *txfeep = LP_txfeecalc(base,0); - *desttxfeep = LP_txfeecalc(rel,0); + *txfeep = LP_txfeecalc(LP_coinfind(base),0); + *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0); } double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) @@ -709,8 +710,8 @@ char *LP_bestfit(char *rel,double relvolume) char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) { struct LP_quoteinfo Q; int64_t bestsatoshis=0,bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; - txfee = LP_txfeecalc(base,txfee); - desttxfee = LP_txfeecalc(rel,desttxfee); + txfee = LP_txfeecalc(LP_coinfind(base),txfee); + desttxfee = LP_txfeecalc(LP_coinfind(rel),desttxfee); if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxopair\"}")); if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 9e25a6241..f880bcead 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -615,8 +615,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Adest = Bdest = AAdest = ABdest = 0; if ( bobcoin[0] == 0 || alicecoin[0] == 0 ) return(0); - Atxfee = LP_txfeecalc(alicecoin,Atxfee); - Btxfee = LP_txfeecalc(bobcoin,Btxfee); + alice = LP_coinfind(alicecoin); + bob = LP_coinfind(bobcoin); + Atxfee = LP_txfeecalc(alice,Atxfee); + Btxfee = LP_txfeecalc(bob,Btxfee); //printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,privBn),Bdest,ABdest); @@ -624,7 +626,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( iambob == 0 ) { - if ( (alice= LP_coinfind(alicecoin)) != 0 ) + if ( alice != 0 ) { bitcoin_address(Adestaddr,alice->taddr,alice->pubtype,pubkey33,33); AAdest = Adestaddr; @@ -637,7 +639,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } else { - if ( (bob= LP_coinfind(bobcoin)) != 0 ) + if ( bob != 0 ) { bitcoin_address(destaddr,bob->taddr,bob->pubtype,pubkey33,33); Bdest = destaddr; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 60e49ae1a..1f360baa4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -315,21 +315,33 @@ int32_t LP_importaddress(char *symbol,char *address) return(1); } -double LP_getestimatedrate(char *symbol) +char *LP_apicall(struct iguana_info *coin,char *method,char *params) { - char buf[512],*retstr; double rate = 20; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin->electrum != 0 ) + return(jprint(electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT),1)); + else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); +} + +double LP_getestimatedrate(struct iguana_info *coin) +{ + char buf[512],*retstr; double rate = 20; if ( coin != 0 && (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - sprintf(buf,"[%d]",3); - if ( (retstr= bitcoind_passthru(symbol,coin->serverport,coin->userpass,"estimatefee",buf)) != 0 ) + if ( coin->rate != 0. && time(NULL) > coin->ratetime+60 ) { - if ( retstr[0] != '-' ) + sprintf(buf,"[%d]",3); + if ( (retstr= LP_apicall(coin,"estimatefee",buf)) != 0 ) { - rate = atof(retstr) / 1024.; - //printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); + if ( retstr[0] != '-' ) + { + rate = atof(retstr) / 1024.; + coin->rate = rate; + coin->ratetime = (uint32_t)time(NULL); + printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); + } + free(retstr); } - free(retstr); - } + } else rate = coin->rate; } else return((double)coin->txfee / LP_AVETXSIZE); return(SATOSHIDEN * rate); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0e809f146..57d83e67d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -421,6 +421,26 @@ void LP_dedicatedloop(void *arg) free(ep); } +cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) +{ + struct electrum_info *ep; cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"ipaddr",ipaddr); + jaddnum(retjson,"port",port); + ep = LP_electrum_info(coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) + { + printf("error launching LP_dedicatedloop %s.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); + jaddstr(retjson,"error","couldnt launch electrum thread"); + } + else + { + printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); + jaddstr(retjson,"result","success"); + coin->electrum = ep; + } + return(retjson); +} + /* if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) you can call it like the above, where symbol is the coin, ep is the electrum server info pointer, the 0 is a callback ptr where 0 means to block till it is done diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 2fcb6d89a..f36804248 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -703,7 +703,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub if ( strcmp(coin->symbol,"BTC") != 0 ) return(retval); len = rawtx->I.datalen; - newtxfee = LP_txfeecalc(coin->symbol,0); + newtxfee = LP_txfeecalc(coin,0); printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; if ( strcmp(str,"myfee") == 0 ) @@ -742,7 +742,7 @@ int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t free(signedtx); if ( strcmp(symbol,"BTC") != 0 ) return(retval); - estimatedrate = LP_getestimatedrate(symbol); + estimatedrate = LP_getestimatedrate(LP_coinfind(symbol)); newtxfee = estimatedrate * dest->I.datalen; } else break; } @@ -786,7 +786,7 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wifta privBn.bytes[i] = rev.bytes[31 - i];*/ if ( (txfee= Atxfee) == 0 ) { - if ( (txfee= LP_getestimatedrate(symbol) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( (txfee= LP_getestimatedrate(LP_coinfind(symbol)) * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } //txfee = LP_txfee(symbol); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0e9f9c795..6d64709e4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -296,7 +296,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( bypass != 0 ) val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); - txfee = LP_txfeecalc(symbol,0); + txfee = LP_txfeecalc(LP_coinfind(symbol),0); if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : (LP_DEXFEE(satoshis) + txfee); @@ -524,7 +524,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("LP_utxoadd reject inactive %s\n",symbol); return(0); } - txfee = LP_txfeecalc(coin->symbol,0); + txfee = LP_txfeecalc(coin,0); if ( iambob != 0 && value2 < 9 * (value >> 3) + 2*txfee ) // big txfee padding { if ( value2 > 2*txfee ) @@ -817,7 +817,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { - txfee = LP_txfeecalc(coin->symbol,0); + txfee = LP_txfeecalc(coin,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (iambob=0; iambob<=1; iambob++) diff --git a/iguana/exchanges/electrum b/iguana/exchanges/electrum new file mode 100755 index 000000000..1e367e7f8 --- /dev/null +++ b/iguana/exchanges/electrum @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"88.198.241.196\",\"port\":50001}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 0df9ec681..1b7a629d9 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 9abbfcaf9b81ad66fe8649a5b2b5e77b05a3f177 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:06:11 +0200 Subject: [PATCH 0111/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 57d83e67d..925c01b83 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -426,6 +426,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) struct electrum_info *ep; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"ipaddr",ipaddr); jaddnum(retjson,"port",port); + printf("electrum server %s:%u\n",ipaddr,port); ep = LP_electrum_info(coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) { From 33a8b7abf099e9c4a1b35df981193a6f5d26f41f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:07:44 +0200 Subject: [PATCH 0112/2732] Test --- iguana/exchanges/electrum | 2 +- iguana/exchanges/mm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/electrum b/iguana/exchanges/electrum index 1e367e7f8..e59470c2f 100755 --- a/iguana/exchanges/electrum +++ b/iguana/exchanges/electrum @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"88.198.241.196\",\"port\":50001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"46.4.125.2\",\"port\":50001}" diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 6e0e4ee60..7949a8b7e 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,7 +803,7 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); - if ( (1) ) + if ( (0) ) { ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) From 828314c43dcfcd4e940ddb69eb91efbb02f20e80 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:10:33 +0200 Subject: [PATCH 0113/2732] Test --- iguana/exchanges/LP_socket.c | 49 +++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 925c01b83..4e11ff018 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -295,23 +295,38 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { - struct electrum_info *ep; struct stritem *sitem; char name[512],*str = "init string"; - ep = calloc(1,sizeof(*ep) + bufsize); - ep->sock = LP_socket(0,ipaddr,port); - safecopy(ep->symbol,symbol,sizeof(ep->symbol)); - safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); - ep->port = port; - ep->bufsize = bufsize; - ep->lasttime = (uint32_t)time(NULL); - sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); - queue_enqueue(name,&ep->sendQ,queueitem(str)); - if ( (sitem= queue_dequeue(&ep->sendQ)) == 0 && strcmp(sitem->str,str) != 0 ) - printf("error with string sendQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); - sprintf(name,"%s_%s_%u_electrum_pendingQ",symbol,ipaddr,port); - queue_enqueue(name,&ep->pendingQ,queueitem(str)); - if ( (sitem= queue_dequeue(&ep->pendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) - printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); - electrum_server(symbol,ep); + struct electrum_info *ep=0; int32_t i; struct stritem *sitem; char name[512],*str = "init string"; + portable_mutex_lock(&LP_electrummutex); + for (i=0; iipaddr,ipaddr) == 0 && ep->port == port && strcmp(ep->symbol,symbol) == 0 ) + { + printf("%s.(%s:%u) already an electrum server\n",symbol,ipaddr,port); + break; + } + ep = 0; + } + portable_mutex_unlock(&LP_electrummutex); + if ( ep == 0 ) + { + ep = calloc(1,sizeof(*ep) + bufsize); + ep->sock = LP_socket(0,ipaddr,port); + safecopy(ep->symbol,symbol,sizeof(ep->symbol)); + safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); + ep->port = port; + ep->bufsize = bufsize; + ep->lasttime = (uint32_t)time(NULL); + sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); + queue_enqueue(name,&ep->sendQ,queueitem(str)); + if ( (sitem= queue_dequeue(&ep->sendQ)) == 0 && strcmp(sitem->str,str) != 0 ) + printf("error with string sendQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); + sprintf(name,"%s_%s_%u_electrum_pendingQ",symbol,ipaddr,port); + queue_enqueue(name,&ep->pendingQ,queueitem(str)); + if ( (sitem= queue_dequeue(&ep->pendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) + printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); + electrum_server(symbol,ep); + } return(ep); } From d0f2565d657f02987c2d40feeb75d9723c842664 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:11:22 +0200 Subject: [PATCH 0114/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 4e11ff018..1f7c4b3ef 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -441,8 +441,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) struct electrum_info *ep; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"ipaddr",ipaddr); jaddnum(retjson,"port",port); - printf("electrum server %s:%u\n",ipaddr,port); ep = LP_electrum_info(coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + printf("ep.%p electrum server %s:%u\n",ep,ipaddr,port); if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) { printf("error launching LP_dedicatedloop %s.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); @@ -454,6 +454,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) jaddstr(retjson,"result","success"); coin->electrum = ep; } + printf("(%s)\n",jprint(retjson,0)); return(retjson); } From 0c44fa03ef74e4ef3692f5fc707236cd4151e282 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:13:25 +0200 Subject: [PATCH 0115/2732] Test --- iguana/exchanges/LP_socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1f7c4b3ef..d1ec5e865 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -318,13 +318,16 @@ struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,i ep->bufsize = bufsize; ep->lasttime = (uint32_t)time(NULL); sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); + printf("create queue.%s\n",name); queue_enqueue(name,&ep->sendQ,queueitem(str)); if ( (sitem= queue_dequeue(&ep->sendQ)) == 0 && strcmp(sitem->str,str) != 0 ) printf("error with string sendQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); sprintf(name,"%s_%s_%u_electrum_pendingQ",symbol,ipaddr,port); + printf("create queue.%s\n",name); queue_enqueue(name,&ep->pendingQ,queueitem(str)); if ( (sitem= queue_dequeue(&ep->pendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); + printf("call electrum server\n"); electrum_server(symbol,ep); } return(ep); From 6fa1cb9e3477da5ed96e9a3fcfd76bbdd04daf22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:16:01 +0200 Subject: [PATCH 0116/2732] Test --- iguana/exchanges/LP_socket.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d1ec5e865..bb5409fcf 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -296,10 +296,12 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { struct electrum_info *ep=0; int32_t i; struct stritem *sitem; char name[512],*str = "init string"; + printf("electrum info\n"); portable_mutex_lock(&LP_electrummutex); for (i=0; iipaddr,ipaddr) == 0 && ep->port == port && strcmp(ep->symbol,symbol) == 0 ) { printf("%s.(%s:%u) already an electrum server\n",symbol,ipaddr,port); @@ -308,6 +310,7 @@ struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,i ep = 0; } portable_mutex_unlock(&LP_electrummutex); + printf("electrum info ep.%p\n",ep); if ( ep == 0 ) { ep = calloc(1,sizeof(*ep) + bufsize); @@ -386,7 +389,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep = arg; - printf("ep.%p sock.%d for %s:%u num.%d %p\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums); + printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums); while ( ep->sock >= 0 ) { flag = 0; From b26e164e33512ed2356b52e4515f7d87b9cf0e41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:19:20 +0200 Subject: [PATCH 0117/2732] Test --- iguana/exchanges/LP_socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index bb5409fcf..173ff1ec4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -126,10 +126,12 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) #endif if ( bindflag == 0 ) { - timeout.tv_sec = 10; + timeout.tv_sec = 2; timeout.tv_usec = 0; setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); + printf("call connect\n"); result = connect(sock,(struct sockaddr *)&saddr,addrlen); + printf("called connect result.%d\n",result); if ( result != 0 ) { if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH ) @@ -140,7 +142,7 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) closesocket(sock); return(-1); } - timeout.tv_sec = 10000000; + timeout.tv_sec = 10; timeout.tv_usec = 0; setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); } From 71c3a4f254d913c1499da8d48da657476d991951 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:21:28 +0200 Subject: [PATCH 0118/2732] Test --- iguana/exchanges/LP_socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 173ff1ec4..310544aef 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -126,12 +126,12 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) #endif if ( bindflag == 0 ) { + printf("call connect sock.%d\n",sock); + result = connect(sock,(struct sockaddr *)&saddr,addrlen); + printf("called connect result.%d\n",result); timeout.tv_sec = 2; timeout.tv_usec = 0; setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); - printf("call connect\n"); - result = connect(sock,(struct sockaddr *)&saddr,addrlen); - printf("called connect result.%d\n",result); if ( result != 0 ) { if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH ) From a8edd753824700c3e99df1a539732968e8b50cbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:23:42 +0200 Subject: [PATCH 0119/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 7949a8b7e..6e0e4ee60 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,7 +803,7 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); - if ( (0) ) + if ( (1) ) { ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) From 0f152a140e24913b2df46eba625ae7f4aeb2b496 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:24:52 +0200 Subject: [PATCH 0120/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 6e0e4ee60..7949a8b7e 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,7 +803,7 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); - if ( (1) ) + if ( (0) ) { ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) From f8491862ad3e0d8fac2b02cef26938fd2e7d4b35 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:25:47 +0200 Subject: [PATCH 0121/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 7949a8b7e..6e0e4ee60 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,7 +803,7 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); - if ( (0) ) + if ( (1) ) { ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) From a22d0f84741150111f28db9a6659a697f5ae8357 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:31:50 +0200 Subject: [PATCH 0122/2732] Test --- iguana/exchanges/LP_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 310544aef..1aaff7b52 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -298,12 +298,11 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { struct electrum_info *ep=0; int32_t i; struct stritem *sitem; char name[512],*str = "init string"; - printf("electrum info\n"); portable_mutex_lock(&LP_electrummutex); for (i=0; isymbol,ep->ipaddr,ep->port,symbol,ipaddr,port); if ( strcmp(ep->ipaddr,ipaddr) == 0 && ep->port == port && strcmp(ep->symbol,symbol) == 0 ) { printf("%s.(%s:%u) already an electrum server\n",symbol,ipaddr,port); From 1c938e4ef00248717b3b0a767e4eccd126ee2998 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:33:30 +0200 Subject: [PATCH 0123/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3e1537ae5..4b5d47f79 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -262,7 +262,7 @@ dividends(coin, height, )\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { ptr->inactive = 0; - return(jprint(LP_electrumserver(ptr,ipaddr,port),1)); + return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); } else return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"snapshot") == 0 ) From 11e5aaaa084b707ba3c639db84d535ca0644e5bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:38:07 +0200 Subject: [PATCH 0124/2732] Test --- iguana/exchanges/LP_socket.c | 33 +++++++++++++++++++-------------- iguana/exchanges/mm.c | 4 ++-- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1aaff7b52..3e134eb4a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -295,23 +295,24 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } -struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) +struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { struct electrum_info *ep=0; int32_t i; struct stritem *sitem; char name[512],*str = "init string"; + *alreadyp = 0; portable_mutex_lock(&LP_electrummutex); for (i=0; isymbol,ep->ipaddr,ep->port,symbol,ipaddr,port); + //printf("i.%d %p %s %s:%u vs %s.(%s:%u)\n",i,ep,ep->symbol,ep->ipaddr,ep->port,symbol,ipaddr,port); if ( strcmp(ep->ipaddr,ipaddr) == 0 && ep->port == port && strcmp(ep->symbol,symbol) == 0 ) { + *alreadyp = 1; printf("%s.(%s:%u) already an electrum server\n",symbol,ipaddr,port); break; } ep = 0; } portable_mutex_unlock(&LP_electrummutex); - printf("electrum info ep.%p\n",ep); if ( ep == 0 ) { ep = calloc(1,sizeof(*ep) + bufsize); @@ -322,16 +323,13 @@ struct electrum_info *LP_electrum_info(char *symbol,char *ipaddr,uint16_t port,i ep->bufsize = bufsize; ep->lasttime = (uint32_t)time(NULL); sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); - printf("create queue.%s\n",name); queue_enqueue(name,&ep->sendQ,queueitem(str)); if ( (sitem= queue_dequeue(&ep->sendQ)) == 0 && strcmp(sitem->str,str) != 0 ) printf("error with string sendQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); sprintf(name,"%s_%s_%u_electrum_pendingQ",symbol,ipaddr,port); - printf("create queue.%s\n",name); queue_enqueue(name,&ep->pendingQ,queueitem(str)); if ( (sitem= queue_dequeue(&ep->pendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); - printf("call electrum server\n"); electrum_server(symbol,ep); } return(ep); @@ -445,21 +443,28 @@ void LP_dedicatedloop(void *arg) cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { - struct electrum_info *ep; cJSON *retjson = cJSON_CreateObject(); + struct electrum_info *ep; int32_t already; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"ipaddr",ipaddr); jaddnum(retjson,"port",port); - ep = LP_electrum_info(coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); - printf("ep.%p electrum server %s:%u\n",ep,ipaddr,port); - if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) + ep = LP_electrum_info(&already,coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + if ( already == 0 ) { - printf("error launching LP_dedicatedloop %s.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); - jaddstr(retjson,"error","couldnt launch electrum thread"); + if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) + { + printf("error launching LP_dedicatedloop %s.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); + jaddstr(retjson,"error","couldnt launch electrum thread"); + } + else + { + printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); + jaddstr(retjson,"result","success"); + coin->electrum = ep; + } } else { - printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); - coin->electrum = ep; + jaddstr(retjson,"status","already there"); } printf("(%s)\n",jprint(retjson,0)); return(retjson); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 6e0e4ee60..da19ce3a0 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -801,11 +801,11 @@ int main(int argc, const char * argv[]) { char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; struct electrum_info *ep; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; - cJSON *retjson,*loginjson; int32_t i; + cJSON *retjson,*loginjson; int32_t i,already; OS_init(); if ( (1) ) { - ep = LP_electrum_info("BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" + ep = LP_electrum_info(&already,"BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) { printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); From 5349caa8b6b9a179bfb77d888867382ab8292f60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 11:39:06 +0200 Subject: [PATCH 0125/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index da19ce3a0..ba1968db1 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -805,7 +805,7 @@ int main(int argc, const char * argv[]) OS_init(); if ( (1) ) { - ep = LP_electrum_info(&already,"BTC","46.4.125.2",50001,IGUANA_MAXPACKETSIZE * 10); //88.198.241.196" + ep = LP_electrum_info(&already,"BTC","88.198.241.196",50001,IGUANA_MAXPACKETSIZE * 10); if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) { printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); From fb475f76e671f5f5443b5ec9aba5c8c57bff1621 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:08:24 +0200 Subject: [PATCH 0126/2732] Test --- iguana/exchanges/LP_include.h | 4 +- iguana/exchanges/LP_rpc.c | 61 +++--- iguana/exchanges/LP_socket.c | 345 ++++++++++++++++++---------------- iguana/exchanges/mm.c | 2 +- 4 files changed, 224 insertions(+), 188 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1c4299e05..861ed28f7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -187,8 +187,8 @@ struct iguana_info UT_hash_handle hh; portable_mutex_t txmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; - int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; - uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime; + int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; + uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1f360baa4..8ec73559d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -103,6 +103,13 @@ char *issue_LP_getprices(char *destip,uint16_t destport) //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } +char *LP_apicall(struct iguana_info *coin,char *method,char *params) +{ + if ( coin->electrum != 0 ) + return(jprint(electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT),1)); + else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); +} + cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { cJSON *retjson = 0; char *retstr; @@ -113,15 +120,21 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 ) { - retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); - if ( retstr != 0 && retstr[0] != 0 ) + if ( coin->electrum == 0 ) { - //printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); - retjson = cJSON_Parse(retstr); - free(retstr); + retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); + if ( retstr != 0 && retstr[0] != 0 ) + { + //printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); + retjson = cJSON_Parse(retstr); + free(retstr); + } + } + else + { + retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT); + printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); } - //usleep(100); - //printf("dpow_gettxout.(%s)\n",retstr); } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); return(retjson); @@ -167,11 +180,17 @@ cJSON *LP_assethbla(char *assetid) int32_t LP_getheight(struct iguana_info *coin) { - cJSON *retjson; int32_t height = -1; //struct iguana_info *coin = LP_coinfind(symbol); - if ( (retjson= bitcoin_json(coin,"getinfo","[]")) != 0 ) + cJSON *retjson; char *method = "getinfo"; int32_t height = coin->height; + if ( coin->electrum == 0 && time(NULL) > coin->heighttime+60 ) { - height = jint(retjson,"blocks"); - free_json(retjson); + if ( strcmp(coin->symbol,"BTC") == 0 ) + method = "getblockchaininfo"; + if ( (retjson= bitcoin_json(coin,method,"[]")) != 0 ) + { + coin->height = height = jint(retjson,"blocks"); + free_json(retjson); + coin->heighttime = (uint32_t)time(NULL); + } } return(height); } @@ -315,16 +334,9 @@ int32_t LP_importaddress(char *symbol,char *address) return(1); } -char *LP_apicall(struct iguana_info *coin,char *method,char *params) -{ - if ( coin->electrum != 0 ) - return(jprint(electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT),1)); - else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); -} - double LP_getestimatedrate(struct iguana_info *coin) { - char buf[512],*retstr; double rate = 20; + char buf[512],*retstr,*result; cJSON *retjson = 0; double rate = 20; if ( coin != 0 && (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { if ( coin->rate != 0. && time(NULL) > coin->ratetime+60 ) @@ -332,14 +344,19 @@ double LP_getestimatedrate(struct iguana_info *coin) sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,"estimatefee",buf)) != 0 ) { - if ( retstr[0] != '-' ) + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + result = jstr(retjson,"result"); + else result = retstr; + if ( result[0] != '-' ) { - rate = atof(retstr) / 1024.; + rate = atof(result) / 1024.; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); - printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); + printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,result,rate); } free(retstr); + if ( retjson != 0 ) + free_json(retjson); } } else rate = coin->rate; } else return((double)coin->txfee / LP_AVETXSIZE); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3e134eb4a..4fc90d20c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -243,8 +243,8 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) struct electrum_info { queue_t sendQ,pendingQ; - int32_t bufsize,sock; - uint32_t stratumid,lasttime,pending; + int32_t bufsize,sock,*heightp; + uint32_t stratumid,lasttime,pending,*heighttimep; char ipaddr[64],symbol[16]; uint16_t port; uint8_t buf[]; @@ -252,6 +252,14 @@ struct electrum_info int32_t Num_electrums; // purge timedout +/* +if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) +you can call it like the above, where symbol is the coin, ep is the electrum server info pointer, the 0 is a callback ptr where 0 means to block till it is done +all the API calls have the same three args +if the callback ptr is &retjson, then on completion it will put the cJSON *ptr into it, so to spawn a bunch of calls you need to call with symbol,ep,&retjsons[i],... +default timeout is set to 2 seconds, not sure if that is enough, on each receive from any server, requests that are timeout are purged (and if a callback set, will just return and "error" timeout JSON +a null value for ep will make it choose a random server for that coin + */ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) { @@ -295,6 +303,157 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } +cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) +{ + // queue id and string and callback + char stratumreq[16384]; struct stritem *sitem; cJSON *retjson = 0; + if ( ep == 0 ) + ep = electrum_server(symbol,0); + if ( ep != 0 ) + { + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); + //printf("stratumreq.(%s)\n",stratumreq); + ep->buf[0] = 0; + sitem = (struct stritem *)queueitem(stratumreq); + sitem->DL.type = ep->stratumid++; + if ( retjsonp != 0 ) + sitem->retptrp = (void **)retjsonp; + else sitem->retptrp = (void **)&retjson; + queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); + } else printf("couldnt find electrum server for (%s %s)\n",method,params); + return(retjson); +} + +cJSON *electrum_noargs(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t timeout) +{ + return(electrum_submit(symbol,ep,retjsonp,method,"[]",timeout)); +} + +cJSON *electrum_strarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *arg,int32_t timeout) +{ + char params[16384]; + if ( strlen(arg) < sizeof(params) ) + { + sprintf(params,"[\"%s\"]",arg); + return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); + } else return(0); +} + +cJSON *electrum_intarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t arg,int32_t timeout) +{ + char params[64]; + sprintf(params,"[\"%d\"]",arg); + return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); +} + +cJSON *electrum_hasharg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,bits256 arg,int32_t timeout) +{ + char params[128],str[65]; + sprintf(params,"[\"%s\"]",bits256_str(str,arg)); + return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); +} + +//" "--blockchain.numblocks.subscribe", "--blockchain.address.get_proof", "--blockchain.utxo.get_address", + +cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.version",ELECTRUM_TIMEOUT)); } +cJSON *electrum_banner(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.banner",ELECTRUM_TIMEOUT)); } +cJSON *electrum_donation(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.donation_address",ELECTRUM_TIMEOUT)); } +cJSON *electrum_peers(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.peers.subscribe",ELECTRUM_TIMEOUT)); } +cJSON *electrum_features(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.features",ELECTRUM_TIMEOUT)); } +cJSON *electrum_headers_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } + +cJSON *electrum_script_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_balance",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_history",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_mempool",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.listunspent",script,ELECTRUM_TIMEOUT)); } +cJSON *electrum_script_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.subscribe",script,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *endpoint) { return(electrum_strarg(symbol,ep,retjsonp,"server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } +cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } +cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) +{ + char params[128],str[65]; + sprintf(params,"[\"%s\", %d]",bits256_str(str,txid),height); + return(electrum_submit(symbol,ep,retjsonp,"blockchain.transaction.get_merkle",params,ELECTRUM_TIMEOUT)); +} + +void electrum_test() +{ + cJSON *retjson; bits256 hash; struct electrum_info *ep = 0; char *addr,*script,*symbol = "BTC"; + while ( Num_electrums == 0 ) + { + sleep(1); + printf("Num_electrums %p -> %d\n",&Num_electrums,Num_electrums); + } + printf("found electrum server\n"); + if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) + printf("electrum_version %s\n",jprint(retjson,1)); + if ( (retjson= electrum_banner(symbol,ep,0)) != 0 ) + printf("electrum_banner %s\n",jprint(retjson,1)); + if ( (retjson= electrum_donation(symbol,ep,0)) != 0 ) + printf("electrum_donation %s\n",jprint(retjson,1)); + if ( (retjson= electrum_features(symbol,ep,0)) != 0 ) + printf("electrum_features %s\n",jprint(retjson,1)); + if ( (retjson= electrum_estimatefee(symbol,ep,0,6)) != 0 ) + printf("electrum_estimatefee %s\n",jprint(retjson,1)); + decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); + if ( (retjson= electrum_getheader(symbol,ep,0,3)) != 0 ) + printf("electrum_getheader %s\n",jprint(retjson,1)); + //if ( (retjson= electrum_getchunk(symbol,ep,0,3)) != 0 ) + // printf("electrum_getchunk %s\n",jprint(retjson,1)); + decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); + if ( (retjson= electrum_getmerkle(symbol,ep,0,hash,403000)) != 0 ) + printf("electrum_getmerkle %s\n",jprint(retjson,1)); + if ( (retjson= electrum_transaction(symbol,ep,0,hash)) != 0 ) + printf("electrum_transaction %s\n",jprint(retjson,1)); + addr = "14NeevLME8UAANiTCVNgvDrynUPk1VcQKb"; + if ( (retjson= electrum_address_gethistory(symbol,ep,0,addr)) != 0 ) + printf("electrum_address_gethistory %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_getmempool(symbol,ep,0,addr)) != 0 ) + printf("electrum_address_getmempool %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_getbalance(symbol,ep,0,addr)) != 0 ) + printf("electrum_address_getbalance %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) + printf("electrum_address_listunspent %s\n",jprint(retjson,1)); + if ( (retjson= electrum_addpeer(symbol,ep,0,"electrum.be:50001")) != 0 ) + printf("electrum_addpeer %s\n",jprint(retjson,1)); + if ( (retjson= electrum_sendrawtransaction(symbol,ep,0,"0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) + printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); + + if ( 0 ) + { + script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; + if ( (retjson= electrum_script_gethistory(symbol,ep,0,script)) != 0 ) + printf("electrum_script_gethistory %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_getmempool(symbol,ep,0,script)) != 0 ) + printf("electrum_script_getmempool %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_getbalance(symbol,ep,0,script)) != 0 ) + printf("electrum_script_getbalance %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_listunspent(symbol,ep,0,script)) != 0 ) + printf("electrum_script_listunspent %s\n",jprint(retjson,1)); + if ( (retjson= electrum_script_subscribe(symbol,ep,0,script)) != 0 ) + printf("electrum_script_subscribe %s\n",jprint(retjson,1)); + } + if ( (retjson= electrum_headers_subscribe(symbol,ep,0)) != 0 ) + printf("electrum_headers %s\n",jprint(retjson,1)); + if ( (retjson= electrum_peers(symbol,ep,0)) != 0 ) + printf("electrum_peers %s\n",jprint(retjson,1)); + if ( (retjson= electrum_address_subscribe(symbol,ep,0,addr)) != 0 ) + printf("electrum_address_subscribe %s\n",jprint(retjson,1)); +} + struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { struct electrum_info *ep=0; int32_t i; struct stritem *sitem; char name[512],*str = "init string"; @@ -337,10 +496,23 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; + cJSON *strjson; char *method; int32_t height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { + if ( (method= jstr(strjson,"method")) != 0 ) + { + if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) + { + printf("headers.(%s)\n",jprint(strjson,0)); + if ( (height= jint(strjson,"blocks")) > 0 && ep->heightp != 0 && ep->heighttimep != 0 ) + { + *(ep->heightp) = height; + *(ep->heighttimep) = (uint32_t)time(NULL); + printf("set height.%d\n",height); + } + } + } idnum = juint(strjson,"id"); portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) @@ -387,7 +559,13 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { - struct pollfd fds; int32_t i,len,flag,timeout = 10; struct stritem *sitem; struct electrum_info *ep = arg; + struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; + if ( (coin= LP_coinfind(ep->symbol)) != 0 ) + ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; + if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 ) + { + free_json(retjson); + } printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums); while ( ep->sock >= 0 ) { @@ -470,162 +648,3 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) return(retjson); } -/* -if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) -you can call it like the above, where symbol is the coin, ep is the electrum server info pointer, the 0 is a callback ptr where 0 means to block till it is done -all the API calls have the same three args -if the callback ptr is &retjson, then on completion it will put the cJSON *ptr into it, so to spawn a bunch of calls you need to call with symbol,ep,&retjsons[i],... -default timeout is set to 2 seconds, not sure if that is enough, on each receive from any server, requests that are timeout are purged (and if a callback set, will just return and "error" timeout JSON -a null value for ep will make it choose a random server for that coin - */ - -cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) -{ - // queue id and string and callback - char stratumreq[16384]; struct stritem *sitem; cJSON *retjson = 0; - if ( ep == 0 ) - ep = electrum_server(symbol,0); - if ( ep != 0 ) - { - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); - //printf("stratumreq.(%s)\n",stratumreq); - ep->buf[0] = 0; - sitem = (struct stritem *)queueitem(stratumreq); - sitem->DL.type = ep->stratumid++; - if ( retjsonp != 0 ) - sitem->retptrp = (void **)retjsonp; - else sitem->retptrp = (void **)&retjson; - queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - } else printf("couldnt find electrum server for (%s %s)\n",method,params); - return(retjson); -} - -cJSON *electrum_noargs(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t timeout) -{ - return(electrum_submit(symbol,ep,retjsonp,method,"[]",timeout)); -} - -cJSON *electrum_strarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *arg,int32_t timeout) -{ - char params[16384]; - if ( strlen(arg) < sizeof(params) ) - { - sprintf(params,"[\"%s\"]",arg); - return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); - } else return(0); -} - -cJSON *electrum_intarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t arg,int32_t timeout) -{ - char params[64]; - sprintf(params,"[\"%d\"]",arg); - return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); -} - -cJSON *electrum_hasharg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,bits256 arg,int32_t timeout) -{ - char params[128],str[65]; - sprintf(params,"[\"%s\"]",bits256_str(str,arg)); - return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); -} - -//" "--blockchain.numblocks.subscribe", "--blockchain.address.get_proof", "--blockchain.utxo.get_address", - -cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.version",ELECTRUM_TIMEOUT)); } -cJSON *electrum_banner(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.banner",ELECTRUM_TIMEOUT)); } -cJSON *electrum_donation(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.donation_address",ELECTRUM_TIMEOUT)); } -cJSON *electrum_peers(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.peers.subscribe",ELECTRUM_TIMEOUT)); } -cJSON *electrum_features(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.features",ELECTRUM_TIMEOUT)); } -cJSON *electrum_headers_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"blockchain.headers.subscribe",ELECTRUM_TIMEOUT)); } - -cJSON *electrum_script_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_balance",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_history",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.get_mempool",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.listunspent",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_script_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.subscribe",script,ELECTRUM_TIMEOUT)); } - -cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)); } - -cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *endpoint) { return(electrum_strarg(symbol,ep,retjsonp,"server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } -cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } - -cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } -cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } - -cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) -{ - char params[128],str[65]; - sprintf(params,"[\"%s\", %d]",bits256_str(str,txid),height); - return(electrum_submit(symbol,ep,retjsonp,"blockchain.transaction.get_merkle",params,ELECTRUM_TIMEOUT)); -} - -void electrum_test() -{ - cJSON *retjson; bits256 hash; struct electrum_info *ep = 0; char *addr,*script,*symbol = "BTC"; - while ( Num_electrums == 0 ) - { - sleep(1); - printf("Num_electrums %p -> %d\n",&Num_electrums,Num_electrums); - } - printf("found electrum server\n"); - if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) - printf("electrum_version %s\n",jprint(retjson,1)); - if ( (retjson= electrum_banner(symbol,ep,0)) != 0 ) - printf("electrum_banner %s\n",jprint(retjson,1)); - if ( (retjson= electrum_donation(symbol,ep,0)) != 0 ) - printf("electrum_donation %s\n",jprint(retjson,1)); - if ( (retjson= electrum_features(symbol,ep,0)) != 0 ) - printf("electrum_features %s\n",jprint(retjson,1)); - if ( (retjson= electrum_estimatefee(symbol,ep,0,6)) != 0 ) - printf("electrum_estimatefee %s\n",jprint(retjson,1)); - decode_hex(hash.bytes,sizeof(hash),"0000000000000000005087f8845f9ed0282559017e3c6344106de15e46c07acd"); - if ( (retjson= electrum_getheader(symbol,ep,0,3)) != 0 ) - printf("electrum_getheader %s\n",jprint(retjson,1)); - //if ( (retjson= electrum_getchunk(symbol,ep,0,3)) != 0 ) - // printf("electrum_getchunk %s\n",jprint(retjson,1)); - decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); - if ( (retjson= electrum_getmerkle(symbol,ep,0,hash,403000)) != 0 ) - printf("electrum_getmerkle %s\n",jprint(retjson,1)); - if ( (retjson= electrum_transaction(symbol,ep,0,hash)) != 0 ) - printf("electrum_transaction %s\n",jprint(retjson,1)); - addr = "14NeevLME8UAANiTCVNgvDrynUPk1VcQKb"; - if ( (retjson= electrum_address_gethistory(symbol,ep,0,addr)) != 0 ) - printf("electrum_address_gethistory %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_getmempool(symbol,ep,0,addr)) != 0 ) - printf("electrum_address_getmempool %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_getbalance(symbol,ep,0,addr)) != 0 ) - printf("electrum_address_getbalance %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) - printf("electrum_address_listunspent %s\n",jprint(retjson,1)); - if ( (retjson= electrum_addpeer(symbol,ep,0,"electrum.be:50001")) != 0 ) - printf("electrum_addpeer %s\n",jprint(retjson,1)); - if ( (retjson= electrum_sendrawtransaction(symbol,ep,0,"0100000001b7e6d69a0fd650926bd5fbe63cc8578d976c25dbdda8dd61db5e05b0de4041fe000000006b483045022100de3ae8f43a2a026bb46f6b09b890861f8aadcb16821f0b01126d70fa9ae134e4022000925a842073484f1056c7fc97399f2bbddb9beb9e49aca76835cdf6e9c91ef3012103cf5ce3233e6d6e22291ebef454edff2b37a714aed685ce94a7eb4f83d8e4254dffffffff014c4eaa0b000000001976a914b598062b55362952720718e7da584a46a27bedee88ac00000000")) != 0 ) - printf("electrum_sendrawtransaction %s\n",jprint(retjson,1)); - - if ( 0 ) - { - script = "76a914b598062b55362952720718e7da584a46a27bedee88ac"; - if ( (retjson= electrum_script_gethistory(symbol,ep,0,script)) != 0 ) - printf("electrum_script_gethistory %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_getmempool(symbol,ep,0,script)) != 0 ) - printf("electrum_script_getmempool %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_getbalance(symbol,ep,0,script)) != 0 ) - printf("electrum_script_getbalance %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_listunspent(symbol,ep,0,script)) != 0 ) - printf("electrum_script_listunspent %s\n",jprint(retjson,1)); - if ( (retjson= electrum_script_subscribe(symbol,ep,0,script)) != 0 ) - printf("electrum_script_subscribe %s\n",jprint(retjson,1)); - } - if ( (retjson= electrum_headers_subscribe(symbol,ep,0)) != 0 ) - printf("electrum_headers %s\n",jprint(retjson,1)); - if ( (retjson= electrum_peers(symbol,ep,0)) != 0 ) - printf("electrum_peers %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_subscribe(symbol,ep,0,addr)) != 0 ) - printf("electrum_address_subscribe %s\n",jprint(retjson,1)); -} diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index ba1968db1..8cfd07bdb 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,7 +803,7 @@ int main(int argc, const char * argv[]) double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i,already; OS_init(); - if ( (1) ) + if ( (0) ) { ep = LP_electrum_info(&already,"BTC","88.198.241.196",50001,IGUANA_MAXPACKETSIZE * 10); if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) From 3c63963ecaa27a8da231c480d3eec2d80b16fcc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:21:07 +0200 Subject: [PATCH 0127/2732] Test --- iguana/exchanges/LP_socket.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 4fc90d20c..81d0a0800 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -312,7 +312,6 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch if ( ep != 0 ) { sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); - //printf("stratumreq.(%s)\n",stratumreq); ep->buf[0] = 0; sitem = (struct stritem *)queueitem(stratumreq); sitem->DL.type = ep->stratumid++; @@ -320,6 +319,9 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->retptrp = (void **)retjsonp; else sitem->retptrp = (void **)&retjson; queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); + if ( sitem->retptrp == (void **)&retjson ) + while (retjson == 0 ) + usleep(10000); } else printf("couldnt find electrum server for (%s %s)\n",method,params); return(retjson); } @@ -496,16 +498,17 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson; char *method; int32_t height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; + cJSON *strjson,*errjson,*resultjson; char *method; int32_t height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { if ( (method= jstr(strjson,"method")) != 0 ) { + resultjson = jobj(strjson,"result"); if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) { - printf("headers.(%s)\n",jprint(strjson,0)); - if ( (height= jint(strjson,"blocks")) > 0 && ep->heightp != 0 && ep->heighttimep != 0 ) + printf("%p headers.(%s)\n",strjson,jprint(strjson,0)); + if ( (height= jint(resultjson,"block_height")) > 0 && ep->heightp != 0 && ep->heighttimep != 0 ) { *(ep->heightp) = height; *(ep->heighttimep) = (uint32_t)time(NULL); @@ -530,12 +533,13 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { DL_DELETE(ep->pendingQ.list,item); printf("expired (%s)\n",stritem->str); - strjson = cJSON_CreateObject(); - jaddnum(strjson,"id",item->type); - jaddstr(strjson,"error","timeout"); if ( stritem->retptrp != 0 ) - *((cJSON **)stritem->retptrp) = strjson; - else free_json(strjson); + { + errjson = cJSON_CreateObject(); + jaddnum(errjson,"id",item->type); + jaddstr(errjson,"error","timeout"); + *((cJSON **)stritem->retptrp) = errjson; + }; } item = 0; } @@ -545,10 +549,12 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { // do callback stritem = (struct stritem *)item; - printf("callback (%s) -> (%s)\n",stritem->str,jprint(strjson,0)); + printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); if ( stritem->retptrp != 0 ) + { *((cJSON **)stritem->retptrp) = strjson; - else free_json(strjson); + strjson = 0; + } free(item); } if ( strjson != 0 ) @@ -563,10 +569,8 @@ void LP_dedicatedloop(void *arg) if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 ) - { free_json(retjson); - } - printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums); + printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { flag = 0; From a9e15655700ca5c83fc7cf9c902e1f0832a806f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:24:00 +0200 Subject: [PATCH 0128/2732] Test --- iguana/exchanges/LP_socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 81d0a0800..d09b1a459 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -319,9 +319,9 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->retptrp = (void **)retjsonp; else sitem->retptrp = (void **)&retjson; queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - if ( sitem->retptrp == (void **)&retjson ) - while (retjson == 0 ) - usleep(10000); + //if ( sitem->retptrp == (void **)&retjson ) + // while (retjson == 0 ) + // usleep(10000); } else printf("couldnt find electrum server for (%s %s)\n",method,params); return(retjson); } From 66406ca9bac4e95fa0a1ed0627ec5dc60cf3d814 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:32:02 +0200 Subject: [PATCH 0129/2732] Test --- iguana/exchanges/LP_socket.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d09b1a459..16cf0f9cd 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -498,24 +498,32 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson,*errjson,*resultjson; char *method; int32_t height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; + cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { + resultjson = jobj(strjson,"result"); if ( (method= jstr(strjson,"method")) != 0 ) { - resultjson = jobj(strjson,"result"); if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) { printf("%p headers.(%s)\n",strjson,jprint(strjson,0)); - if ( (height= jint(resultjson,"block_height")) > 0 && ep->heightp != 0 && ep->heighttimep != 0 ) + if ( (paramsjson= jarray(&n,strjson,"params")) != 0 ) { - *(ep->heightp) = height; - *(ep->heighttimep) = (uint32_t)time(NULL); - printf("set height.%d\n",height); + for (i=0; i 0 && ep->heightp != 0 && ep->heighttimep != 0 ) + { + *(ep->heightp) = height; + *(ep->heighttimep) = (uint32_t)time(NULL); + printf("set height.%d\n",height); + } + } idnum = juint(strjson,"id"); portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) From 420c56abcc22ff49e4fffa42f59832df6385690d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:35:00 +0200 Subject: [PATCH 0130/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 16cf0f9cd..53b8bb4ce 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -503,6 +503,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); + printf("result.(%s)\n",jprint(resultjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 20799a1f89b3305a196224cd7c829816d08b84fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:40:40 +0200 Subject: [PATCH 0131/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ iguana/exchanges/LP_socket.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8ec73559d..eafcb6db6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -132,6 +132,8 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) } else { + if ( strcmp(method,"listunspent") == 0 ) + method = "blockchain.address.listunspent"; retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT); printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 53b8bb4ce..cd23b0178 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -503,12 +503,12 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("result.(%s)\n",jprint(resultjson,0)); + //printf("result.(%s)\n",jprint(resultjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) { - printf("%p headers.(%s)\n",strjson,jprint(strjson,0)); + //printf("%p headers.(%s)\n",strjson,jprint(strjson,0)); if ( (paramsjson= jarray(&n,strjson,"params")) != 0 ) { for (i=0; iheightp) = height; *(ep->heighttimep) = (uint32_t)time(NULL); - printf("set height.%d\n",height); + printf(">>>>>>>>> set height.%d\n",height); } } idnum = juint(strjson,"id"); From 61006ce461e618df1433a57f1b7c433e8f27b5e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 12:43:19 +0200 Subject: [PATCH 0132/2732] Test --- iguana/exchanges/LP_rpc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index eafcb6db6..0301a92f9 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -132,8 +132,6 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) } else { - if ( strcmp(method,"listunspent") == 0 ) - method = "blockchain.address.listunspent"; retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT); printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); } @@ -262,8 +260,16 @@ cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); - return(bitcoin_json(coin,"listunspent",buf)); + if ( coin->electrum == 0 ) + { + sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); + return(bitcoin_json(coin,"listunspent",buf)); + } + else + { + sprintf(buf,"[\"%s\"]",coinaddr); + return(bitcoin_json(coin,"blockchain.address.listunspent",buf)); + } } cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) From c94dd2056f025cb8adf4a9f335ffbd1231b4f576 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 13:03:31 +0200 Subject: [PATCH 0133/2732] Test --- iguana/exchanges/LP_rpc.c | 20 +++++++++++++++++--- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0301a92f9..c62e2d688 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -112,7 +112,7 @@ char *LP_apicall(struct iguana_info *coin,char *method,char *params) cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { - cJSON *retjson = 0; char *retstr; + cJSON *resultjson,*retjson = 0; char *retstr; // "getinfo", "getrawmempool", "paxprice", "gettxout", "getrawtransaction", "getblock", "listunspent", "listtransactions", "validateaddress", "importprivkey" // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" if ( coin != 0 ) @@ -134,6 +134,12 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT); printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); + if ( (resultjson= jobj(retjson,"result")) != 0 ) + { + resultjson = jduplicate(resultjson); + free_json(retjson); + retjson = resultjson; + } } } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); @@ -220,8 +226,16 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) cJSON *LP_gettx(char *symbol,bits256 txid) { char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); - return(bitcoin_json(coin,"getrawtransaction",buf)); + if ( coin->electrum == 0 ) + { + sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); + return(bitcoin_json(coin,"getrawtransaction",buf)); + } + else + { + sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); + return(bitcoin_json(coin,"blockchain.transaction.get",buf)); + } } cJSON *LP_getblock(char *symbol,bits256 txid) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cd23b0178..689d05df0 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { *(ep->heightp) = height; *(ep->heighttimep) = (uint32_t)time(NULL); - printf(">>>>>>>>> set height.%d\n",height); + printf("ELECTRUM >>>>>>>>> set height.%d\n",height); } } idnum = juint(strjson,"id"); @@ -558,7 +558,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { // do callback stritem = (struct stritem *)item; - printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); + //printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); if ( stritem->retptrp != 0 ) { *((cJSON **)stritem->retptrp) = strjson; From 95808a433cec9015961834f7ae565a39a80b77e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 13:28:50 +0200 Subject: [PATCH 0134/2732] Test --- iguana/exchanges/LP_prices.c | 18 ++++++++++++++++-- iguana/exchanges/LP_utxos.c | 10 +++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d68ae2257..fd856b572 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -52,6 +52,7 @@ struct LP_pubkeyinfo bits256 pubkey; double matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; uint32_t timestamp,istrusted,numerrors; + uint8_t rmd160[20]; } *LP_pubkeyinfos; int32_t LP_pricevalid(double price) @@ -171,7 +172,7 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { - int32_t baseid,relid; char *base; double price; cJSON *item,*array,*obj; + int32_t baseid,relid; char *base,hexstr[41]; double price; cJSON *item,*array,*obj; obj = cJSON_CreateObject(); array = cJSON_CreateArray(); for (baseid=0; baseidpubkey); + init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); + jaddstr(obj,"rmd160",hexstr); jaddnum(obj,"timestamp",pubp->timestamp); jadd(obj,"asks",array); if ( pubp->istrusted != 0 ) @@ -210,10 +213,21 @@ char *LP_prices() void LP_prices_parse(cJSON *obj) { - struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; int32_t i,n,relid; char *base,*rel; double askprice; + struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid; char *base,*rel,*hexstr; double askprice; pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { + if ( (hexstr= jstr(obj,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) + { + decode_hex(rmd160,sizeof(rmd160),hexstr); + if ( memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) + { + for (i=0; i<20; i++) + printf("%02x",pubp->rmd160[i]); + char str[65]; printf(" -> rmd160.(%s) for %s\n",hexstr,bits256_str(str,pubkey)); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + } + } if ( (timestamp= juint(obj,"timestamp")) > pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) { pubp->timestamp = timestamp; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6d64709e4..906e59811 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -567,11 +567,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,txid,vout,txid2,vout2)) >= 0 ) - { - printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); - return(0); - } if ( (utxo= LP_utxofinds(iambob,txid,vout,txid2,vout2)) != 0 ) { if ( 0 && LP_ismine(utxo) == 0 ) @@ -632,6 +627,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; else utxo->T.sessionid = sessionid; + if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,txid,vout,txid2,vout2)) >= 0 ) + { + printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); + utxo->T.spentflag = (uint32_t)time(NULL); + } printf("U.%d %s %.8f %.8f addutxo.%d pubkey.%s session.%u\n",LP_mypeer!=0?LP_mypeer->numutxos:-1,symbol,dstr(value),dstr(value2),LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); From a55e26747b0e3940fca8f676c516411ce64aada5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 15:31:45 +0200 Subject: [PATCH 0135/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_prices.c | 2 ++ iguana/exchanges/LP_socket.c | 18 +++++++++++++----- iguana/exchanges/LP_utxos.c | 6 +++--- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 54481f81a..807700fb5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -57,6 +57,7 @@ int32_t LP_pendingswaps,LP_showwif,USERPASS_COUNTER,IAMLP = 0; uint32_t LP_sessionid; double LP_profitratio = 1.; bits256 LP_mypub25519,LP_mypriv25519; +uint8_t LP_myrmd160[20]; // stubs diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index fd856b572..8ec065287 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -143,6 +143,8 @@ struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) portable_mutex_lock(&LP_pubkeymutex); pubp = calloc(1,sizeof(*pubp)); pubp->pubkey = pubkey; + if ( bits256_cmp(LP_mypub25519,pubkey) == 0 ) + memcpy(pubp->rmd160,LP_myrmd160,sizeof(pubp->rmd160)); HASH_ADD_KEYPTR(hh,LP_pubkeyinfos,&pubp->pubkey,sizeof(pubp->pubkey),pubp); portable_mutex_unlock(&LP_pubkeymutex); if ( (pubp= LP_pubkeyfind(pubkey)) == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 689d05df0..0bc03abda 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -306,7 +306,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback - char stratumreq[16384]; struct stritem *sitem; cJSON *retjson = 0; + char stratumreq[16384]; uint32_t expiration; struct stritem *sitem; cJSON *retjson = 0; if ( ep == 0 ) ep = electrum_server(symbol,0); if ( ep != 0 ) @@ -319,9 +319,17 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->retptrp = (void **)retjsonp; else sitem->retptrp = (void **)&retjson; queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - //if ( sitem->retptrp == (void **)&retjson ) - // while (retjson == 0 ) - // usleep(10000); + if ( sitem->retptrp == (void **)&retjson ) + { + expiration = (uint32_t)time(NULL) + timeout + 1; + while ( retjson == 0 && time(NULL) <= expiration ) + usleep(10000); + if ( retjson == 0 ) + { + printf("unexpected timeout with null retjson\n"); + retjson = cJSON_Parse("{\"error\":\"timeout\"}"); + } + } } else printf("couldnt find electrum server for (%s %s)\n",method,params); return(retjson); } @@ -503,7 +511,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - //printf("result.(%s)\n",jprint(resultjson,0)); + printf("result.(%s)\n",jprint(resultjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 906e59811..ebbc93ade 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -952,7 +952,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { static uint32_t counter; - bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20]; + bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype; if ( passphrase != 0 && passphrase[0] != 0 ) { conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); @@ -976,8 +976,8 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan { coin->counter++; bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); - bitcoin_addr2rmd160(coin->taddr,&tmptype,rmd160,coin->smartaddr); - LP_privkeyadd(privkey,rmd160); + bitcoin_addr2rmd160(coin->taddr,&tmptype,LP_myrmd160,coin->smartaddr); + LP_privkeyadd(privkey,LP_myrmd160); if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( counter++ == 0 ) From a3bc58c3e460a435c68682c93672ff162ec88feb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 15:39:22 +0200 Subject: [PATCH 0136/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c62e2d688..ca70e7e3c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -133,7 +133,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) else { retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT); - printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); + //printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); if ( (resultjson= jobj(retjson,"result")) != 0 ) { resultjson = jduplicate(resultjson); @@ -361,7 +361,7 @@ double LP_getestimatedrate(struct iguana_info *coin) char buf[512],*retstr,*result; cJSON *retjson = 0; double rate = 20; if ( coin != 0 && (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - if ( coin->rate != 0. && time(NULL) > coin->ratetime+60 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,"estimatefee",buf)) != 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0bc03abda..552e71c9b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -511,7 +511,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("result.(%s)\n",jprint(resultjson,0)); + //printf("result.(%s)\n",jprint(resultjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 279a9fdb98821e7c332080d1c79ff5c5deec4f65 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 15:49:32 +0200 Subject: [PATCH 0137/2732] Test --- iguana/exchanges/LP_rpc.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index ca70e7e3c..eabe4f14b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,9 +105,19 @@ char *issue_LP_getprices(char *destip,uint16_t destport) char *LP_apicall(struct iguana_info *coin,char *method,char *params) { + cJSON *retjson,*resultjson; if ( coin->electrum != 0 ) - return(jprint(electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT),1)); - else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); + { + if ( (retjson= electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT)) != 0 ) + { + if ( (resultjson= jobj(retjson,"result")) != 0 ) + { + resultjson = jduplicate(resultjson); + free_json(retjson); + return(jprint(resultjson,1)); + } else return(jprint(retjson,1)); + } return(clonestr("{\"error\":\"electrum no response\"}")); + } else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); } cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) @@ -358,27 +368,23 @@ int32_t LP_importaddress(char *symbol,char *address) double LP_getestimatedrate(struct iguana_info *coin) { - char buf[512],*retstr,*result; cJSON *retjson = 0; double rate = 20; + char buf[512],*retstr; double rate = 20; if ( coin != 0 && (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { sprintf(buf,"[%d]",3); + printf("estimate fee\n"); if ( (retstr= LP_apicall(coin,"estimatefee",buf)) != 0 ) { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - result = jstr(retjson,"result"); - else result = retstr; - if ( result[0] != '-' ) + if ( retstr[0] != '-' ) { - rate = atof(result) / 1024.; + rate = atof(retstr) / 1024.; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); - printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,result,rate); + printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); } free(retstr); - if ( retjson != 0 ) - free_json(retjson); } } else rate = coin->rate; } else return((double)coin->txfee / LP_AVETXSIZE); From 912c4d807394fc168a8265f2869ec19e4c2fb1c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 15:52:01 +0200 Subject: [PATCH 0138/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index eabe4f14b..70109a70c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -375,7 +375,7 @@ double LP_getestimatedrate(struct iguana_info *coin) { sprintf(buf,"[%d]",3); printf("estimate fee\n"); - if ( (retstr= LP_apicall(coin,"estimatefee",buf)) != 0 ) + if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { if ( retstr[0] != '-' ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 552e71c9b..031539a9f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -665,7 +665,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) jaddstr(retjson,"result","success"); jaddstr(retjson,"status","already there"); } - printf("(%s)\n",jprint(retjson,0)); + //printf("(%s)\n",jprint(retjson,0)); return(retjson); } From e4011e2ab4c0ac460d749fd5ef15294d13487387 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 17:36:18 +0200 Subject: [PATCH 0139/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_rpc.c | 149 +++++++++++++++++++++++++++--- iguana/exchanges/LP_swap.c | 4 +- iguana/exchanges/LP_transaction.c | 8 +- 5 files changed, 142 insertions(+), 22 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 861ed28f7..0786d81d3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -261,6 +261,7 @@ struct basilisk_swap }; +void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); uint32_t basilisk_requestid(struct basilisk_request *rp); uint32_t basilisk_quoteid(struct basilisk_request *rp); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f880bcead..c21a65dce 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -47,7 +47,7 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,"\",\"txid\":\"%s\"",bits256_str(str,bits256_doublesha256(0,rawtx->txbytes,rawtx->I.datalen))); if ( rawtx == &swap->bobdeposit || rawtx == &swap->bobpayment ) { - LP_swap_coinaddr(swap,&swap->bobcoin,coinaddr,rawtx->txbytes,rawtx->I.datalen); + LP_swap_coinaddr(&swap->bobcoin,coinaddr,rawtx->txbytes,rawtx->I.datalen,0); if ( coinaddr[0] != 0 ) { LP_importaddress(swap->bobcoin.symbol,coinaddr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 70109a70c..d5051a47c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -197,6 +197,8 @@ cJSON *LP_assethbla(char *assetid) int32_t LP_getheight(struct iguana_info *coin) { cJSON *retjson; char *method = "getinfo"; int32_t height = coin->height; + if ( coin == 0 ) + return(-1); if ( coin->electrum == 0 && time(NULL) > coin->heighttime+60 ) { if ( strcmp(coin->symbol,"BTC") == 0 ) @@ -214,6 +216,8 @@ int32_t LP_getheight(struct iguana_info *coin) cJSON *LP_getmempool(char *symbol) { struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); return(bitcoin_json(coin,"getrawmempool","[]")); } @@ -226,16 +230,12 @@ cJSON *LP_paxprice(char *fiat) return(bitcoin_json(coin,"paxprice",buf)); } -cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) -{ - char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"[\"%s\", %d, true]",bits256_str(str,txid),vout); - return(bitcoin_json(coin,"gettxout",buf)); -} - cJSON *LP_gettx(char *symbol,bits256 txid) { - char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); + char buf[128],str[65],*hexstr; int32_t len; bits256 checktxid; cJSON *retjson; struct iguana_info *coin; struct iguana_msgtx msgtx; uint8_t extraspace[8192],*serialized; + coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin->electrum == 0 ) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); @@ -244,13 +244,82 @@ cJSON *LP_gettx(char *symbol,bits256 txid) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - return(bitcoin_json(coin,"blockchain.transaction.get",buf)); + if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + { + hexstr = jprint(retjson,1); + if ( (len= is_hexstr(hexstr,0)) > 2 ) + { + memset(&msgtx,0,sizeof(msgtx)); + len >>= 1; + serialized = malloc(len); + decode_hex(serialized,len,hexstr); + retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,sizeof(extraspace),serialized,len,0,0); + free(serialized); + printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); + return(retjson); + } + return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); + } + return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); + } +} + +cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) +{ + char buf[128],str[65],coinaddr[64],*hexstr; uint8_t *serialized; cJSON *item,*array,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); + if ( coin->electrum == 0 ) + { + sprintf(buf,"[\"%s\", %d, true]",bits256_str(str,txid),vout); + return(bitcoin_json(coin,"gettxout",buf)); + } + else + { + sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); + if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + { + hexstr = jprint(retjson,1); + if ( (len= is_hexstr(hexstr,0)) > 2 ) + { + len >>= 1; + serialized = malloc(len); + decode_hex(serialized,len,hexstr); + LP_swap_coinaddr(coin,coinaddr,serialized,len,0); + if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) + { + if ( (array= jarray(&n,listjson,"result")) != 0 ) + { + for (i=0; isymbol,txid)) != 0 ) { *timestampp = juint(txobj,"locktime"); @@ -277,6 +348,8 @@ int32_t LP_txheight(uint32_t *timestampp,uint32_t *blocktimep,struct iguana_info cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); sprintf(buf,"[\"%s\"]",blockhashstr); return(bitcoin_json(coin,"getblock",buf)); } @@ -284,6 +357,8 @@ cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin->electrum == 0 ) { sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); @@ -299,6 +374,8 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( count == 0 ) count = 100; sprintf(buf,"[\"%s\", %d, %d, true]",coinaddr,count,skip); @@ -307,9 +384,37 @@ cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t ski cJSON *LP_validateaddress(char *symbol,char *address) { - char buf[512]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"[\"%s\"]",address); - return(bitcoin_json(coin,"validateaddress",buf)); + char buf[512],coinaddr[64],checkaddr[64],script[128]; int32_t i; uint8_t rmd160[20],addrtype; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); + if ( coin != 0 && coin->electrum != 0 ) + { + retjson = cJSON_CreateObject(); + jaddstr(retjson,"address",address); + bitcoin_addr2rmd160(coin->taddr,&addrtype,rmd160,address); + bitcoin_address(checkaddr,coin->taddr,addrtype,rmd160,20); + jadd(retjson,"isvalid",strcmp(address,checkaddr)==0? cJSON_CreateTrue() : cJSON_CreateFalse()); + if ( addrtype == coin->pubtype ) + { + strcpy(script,"76a914"); + for (i=0; i<20; i++) + sprintf(&script[i*2+6],"%02x",rmd160[i]); + script[i*2+6] = 0; + strcat(script,"88ac"); + jaddstr(retjson,"scriptPubKey",script); + } + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,LP_myrmd160,20); + if ( strcmp(address,coinaddr) == 0 ) + jadd(retjson,"ismine",cJSON_CreateTrue()); + jadd(retjson,"iswatchonly",cJSON_CreateFalse()); + jadd(retjson,"isscript",addrtype == coin->p2shtype ? cJSON_CreateTrue() : cJSON_CreateFalse()); + return(retjson); + } + else + { + sprintf(buf,"[\"%s\"]",address); + return(bitcoin_json(coin,"validateaddress",buf)); + } } cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) @@ -317,6 +422,10 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) static void *ctx; char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t doneflag = 0; coin = LP_coinfind(symbol); + if ( coin == 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); + if ( coin->electrum != 0 ) + return(cJSON_Parse("{\"result\":\"electrum should have local wallet\"}")); if ( ctx == 0 ) ctx = bitcoin_ctx(); bitcoin_wif2addr(ctx,coin->wiftaddr,coin->taddr,coin->pubtype,address,wifstr); @@ -341,9 +450,18 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) int32_t LP_importaddress(char *symbol,char *address) { - char buf[1024],*retstr; cJSON *validatejson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin = LP_coinfind(symbol); + char buf[1024],*retstr; cJSON *validatejson,*retjson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin = LP_coinfind(symbol); if ( coin == 0 ) return(-2); + if ( coin->electrum != 0 ) + { + if ( (retjson= electrum_address_subscribe(symbol,0,0,address)) != 0 ) + { + printf("importaddress.(%s) -> %s\n",address,jprint(retjson,0)); + free_json(retjson); + } + return(0); + } if ( (validatejson= LP_validateaddress(symbol,address)) != 0 ) { if ( (isvalid= is_cJSON_True(jobj(validatejson,"isvalid")) != 0) != 0 ) @@ -369,12 +487,13 @@ int32_t LP_importaddress(char *symbol,char *address) double LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; double rate = 20; - if ( coin != 0 && (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) + if ( coin == 0 ) + return(0.0001); + if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { sprintf(buf,"[%d]",3); - printf("estimate fee\n"); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { if ( retstr[0] != '-' ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 89edc2ce6..860ed0459 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -533,7 +533,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba printf("%02x",rawtx->redeemscript[i]); bitcoin_address(redeemaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->redeemscript,rawtx->I.redeemlen); printf(" received redeemscript.(%s) %s taddr.%d\n",redeemaddr,rawtx->coin->symbol,rawtx->coin->taddr); - LP_swap_coinaddr(swap,rawtx->coin,checkaddr,data,datalen); + LP_swap_coinaddr(rawtx->coin,checkaddr,data,datalen,0); if ( strcmp(redeemaddr,checkaddr) != 0 ) { printf("REDEEMADDR MISMATCH??? %s != %s\n",redeemaddr,checkaddr); @@ -592,7 +592,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( rawtx == &swap->otherfee ) { char str[65]; - LP_swap_coinaddr(swap,rawtx->coin,rawtx->p2shaddr,data,datalen); + LP_swap_coinaddr(rawtx->coin,rawtx->p2shaddr,data,datalen,0); printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index f36804248..d96adc219 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1160,7 +1160,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) return(-1); } -void LP_swap_coinaddr(struct basilisk_swap *swap,struct iguana_info *coin,char *coinaddr,uint8_t *data,int32_t datalen) +void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint8_t *data,int32_t datalen,int32_t v) { cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[8192]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) @@ -1168,7 +1168,7 @@ void LP_swap_coinaddr(struct basilisk_swap *swap,struct iguana_info *coin,char * //char str[65]; printf("got txid.%s (%s)\n",bits256_str(str,signedtxid),jprint(txobj,0)); if ( (vouts= jarray(&n,txobj,"vout")) != 0 && n > 0 ) { - vout = jitem(vouts,0); + vout = jitem(vouts,v); //printf("VOUT.(%s)\n",jprint(vout,0)); if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) { @@ -1217,7 +1217,7 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i printf("%02x",swap->bobpayment.redeemscript[j]); printf(" <- redeem.%d\n",swap->bobpayment.I.redeemlen); printf(" <- GENERATED BOB PAYMENT.%d destaddr.(%s)\n",swap->bobpayment.I.datalen,swap->bobpayment.I.destaddr); - LP_swap_coinaddr(swap,&swap->bobcoin,checkaddr,swap->bobpayment.txbytes,swap->bobpayment.I.datalen); + LP_swap_coinaddr(&swap->bobcoin,checkaddr,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); if ( strcmp(swap->bobpayment.I.destaddr,checkaddr) != 0 ) { printf("BOBPAYMENT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobpayment.I.destaddr,checkaddr); @@ -1251,7 +1251,7 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i for (j=0; jbobdeposit.I.datalen; j++) printf("%02x",swap->bobdeposit.txbytes[j]); printf(" <- GENERATED BOB DEPOSIT.%d (%s)\n",swap->bobdeposit.I.datalen,swap->bobdeposit.I.destaddr); - LP_swap_coinaddr(swap,&swap->bobcoin,checkaddr,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); + LP_swap_coinaddr(&swap->bobcoin,checkaddr,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); if ( strcmp(swap->bobdeposit.I.destaddr,checkaddr) != 0 ) { printf("BOBDEPOSIT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobdeposit.I.destaddr,checkaddr); From 45f84d907795436444e768df02833eca50683fdf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 17:56:45 +0200 Subject: [PATCH 0140/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_rpc.c | 30 +++++++++++++++++++++++++++--- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_swap.c | 4 ++-- iguana/exchanges/LP_transaction.c | 13 ++++++++++--- 6 files changed, 42 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0786d81d3..623b61dfc 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -261,7 +261,7 @@ struct basilisk_swap }; -void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint8_t *data,int32_t datalen,int32_t vout); +void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); uint32_t basilisk_requestid(struct basilisk_request *rp); uint32_t basilisk_quoteid(struct basilisk_request *rp); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c21a65dce..373d11ca1 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -47,7 +47,7 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,"\",\"txid\":\"%s\"",bits256_str(str,bits256_doublesha256(0,rawtx->txbytes,rawtx->I.datalen))); if ( rawtx == &swap->bobdeposit || rawtx == &swap->bobpayment ) { - LP_swap_coinaddr(&swap->bobcoin,coinaddr,rawtx->txbytes,rawtx->I.datalen,0); + LP_swap_coinaddr(&swap->bobcoin,coinaddr,0,rawtx->txbytes,rawtx->I.datalen,0); if ( coinaddr[0] != 0 ) { LP_importaddress(swap->bobcoin.symbol,coinaddr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d5051a47c..f68a89f96 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -266,7 +266,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint8_t *serialized; cJSON *item,*array,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -286,7 +286,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) len >>= 1; serialized = malloc(len); decode_hex(serialized,len,hexstr); - LP_swap_coinaddr(coin,coinaddr,serialized,len,0); + LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,0); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) { if ( (array= jarray(&n,listjson,"result")) != 0 ) @@ -299,9 +299,33 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) if ( v == vout && bits256_cmp(t,txid) == 0 ) { retjson = cJSON_CreateObject(); + /*{ + "bestblock": "002f7bbe3973b735f535d472501962e86ce8dbc76c73ac5a310a905931b907fa", + "confirmations": 7, + "value": 2013.10431750, + "scriptPubKey": { + "asm": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828 OP_CHECKSIG", + "hex": "2103b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828ac", + "reqSigs": 1, + "type": "pubkey", + "addresses": [ + "RNJmgYaFF5DbnrNUX6pMYz9rcnDKC2tuAc" + ] + }, + "version": 1, + "coinbase": false + }*/ + jaddnum(retjson,"value",dstr(value)); jaddbits256(retjson,"txid",t); jaddnum(retjson,"vout",v); - jaddstr(retjson,"address",coinaddr); + addresses = cJSON_CreateArray(); + jaddistr(addresses,coinaddr); + sobj = cJSON_CreateObject(); + jaddnum(sobj,"reqSigs",1); + jaddstr(sobj,"type","pubkey"); + jadd(sobj,"addresses",addresses); + jadd(retjson,"scriptPubkey",sobj); + printf("GETTXOUT.(%s)\n",jprint(retjson,0)); break; } } diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 4d0812a40..968851e3f 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -125,7 +125,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); - //char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 860ed0459..c4a95969e 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -533,7 +533,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba printf("%02x",rawtx->redeemscript[i]); bitcoin_address(redeemaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->redeemscript,rawtx->I.redeemlen); printf(" received redeemscript.(%s) %s taddr.%d\n",redeemaddr,rawtx->coin->symbol,rawtx->coin->taddr); - LP_swap_coinaddr(rawtx->coin,checkaddr,data,datalen,0); + LP_swap_coinaddr(rawtx->coin,checkaddr,0,data,datalen,0); if ( strcmp(redeemaddr,checkaddr) != 0 ) { printf("REDEEMADDR MISMATCH??? %s != %s\n",redeemaddr,checkaddr); @@ -592,7 +592,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( rawtx == &swap->otherfee ) { char str[65]; - LP_swap_coinaddr(rawtx->coin,rawtx->p2shaddr,data,datalen,0); + LP_swap_coinaddr(rawtx->coin,rawtx->p2shaddr,0,data,datalen,0); printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d96adc219..2374379c7 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1160,15 +1160,22 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) return(-1); } -void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint8_t *data,int32_t datalen,int32_t v) +void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t v) { cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[8192]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; + if ( valuep != 0 ) + *valuep = 0; if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) { //char str[65]; printf("got txid.%s (%s)\n",bits256_str(str,signedtxid),jprint(txobj,0)); if ( (vouts= jarray(&n,txobj,"vout")) != 0 && n > 0 ) { vout = jitem(vouts,v); + if ( valuep != 0 ) + { + if ( (*valuep= SATOSHIDEN * jdouble(vout,"value")) == 0 ) + *valuep= SATOSHIDEN * jdouble(vout,"amount"); + } //printf("VOUT.(%s)\n",jprint(vout,0)); if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) { @@ -1217,7 +1224,7 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i printf("%02x",swap->bobpayment.redeemscript[j]); printf(" <- redeem.%d\n",swap->bobpayment.I.redeemlen); printf(" <- GENERATED BOB PAYMENT.%d destaddr.(%s)\n",swap->bobpayment.I.datalen,swap->bobpayment.I.destaddr); - LP_swap_coinaddr(&swap->bobcoin,checkaddr,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); + LP_swap_coinaddr(&swap->bobcoin,checkaddr,0,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); if ( strcmp(swap->bobpayment.I.destaddr,checkaddr) != 0 ) { printf("BOBPAYMENT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobpayment.I.destaddr,checkaddr); @@ -1251,7 +1258,7 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i for (j=0; jbobdeposit.I.datalen; j++) printf("%02x",swap->bobdeposit.txbytes[j]); printf(" <- GENERATED BOB DEPOSIT.%d (%s)\n",swap->bobdeposit.I.datalen,swap->bobdeposit.I.destaddr); - LP_swap_coinaddr(&swap->bobcoin,checkaddr,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); + LP_swap_coinaddr(&swap->bobcoin,checkaddr,0,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); if ( strcmp(swap->bobdeposit.I.destaddr,checkaddr) != 0 ) { printf("BOBDEPOSIT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobdeposit.I.destaddr,checkaddr); From 269b95e62aa4be8f5628b0f587da74951f69709a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:05:36 +0200 Subject: [PATCH 0141/2732] Test --- iguana/exchanges/LP_rpc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f68a89f96..bf7528230 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -266,7 +266,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -278,9 +278,10 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { - hexstr = jprint(retjson,1); + printf("HEX.(%s)\n",jprint(hexobj,0)); + hexstr = jprint(hexobj,1); if ( (len= is_hexstr(hexstr,0)) > 2 ) { len >>= 1; @@ -333,6 +334,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) free_json(listjson); } } + free_json(hexobj); return(retjson); } return(cJSON_Parse("{\"error\":\"couldnt get tx\"}")); From beff429b5922eeead7344c0257dcc004a71b948e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:21:36 +0200 Subject: [PATCH 0142/2732] Test --- iguana/exchanges/LP_commands.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4b5d47f79..19e3a4265 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -379,6 +379,13 @@ dividends(coin, height, )\n\ { if ( strcmp(method,"register") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + else if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) + { + uint32_t firsttime; + if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) + firsttime = (uint32_t)(time(NULL)-30*24*3600); + return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); + } else if ( strcmp(method,"lookup") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); if ( strcmp(method,"broadcast") == 0 ) From a98677952214ce99be3c9c7b614e84f249e838b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:34:34 +0200 Subject: [PATCH 0143/2732] Test --- iguana/exchanges/LP_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index bf7528230..5b125d7b3 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -280,7 +280,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { - printf("HEX.(%s)\n",jprint(hexobj,0)); hexstr = jprint(hexobj,1); if ( (len= is_hexstr(hexstr,0)) > 2 ) { @@ -288,6 +287,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) serialized = malloc(len); decode_hex(serialized,len,hexstr); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,0); + printf("HEX.(%s) %s %.8f\n",hexstr,coinaddr,dstr(value)); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) { if ( (array= jarray(&n,listjson,"result")) != 0 ) @@ -334,7 +334,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) free_json(listjson); } } - free_json(hexobj); return(retjson); } return(cJSON_Parse("{\"error\":\"couldnt get tx\"}")); @@ -525,6 +524,8 @@ double LP_getestimatedrate(struct iguana_info *coin) if ( retstr[0] != '-' ) { rate = atof(retstr) / 1024.; + if ( rate < 20 ) + rate = 20.; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); From 3fc54a562e9a16600cb3e3d2e5024713a1d4d813 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:44:09 +0200 Subject: [PATCH 0144/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 031539a9f..5c1f1ac1b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 2 +#define ELECTRUM_TIMEOUT 5 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { @@ -326,7 +326,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch usleep(10000); if ( retjson == 0 ) { - printf("unexpected timeout with null retjson\n"); + printf("unexpected timeout with null retjson: %s %s\n",method,params); retjson = cJSON_Parse("{\"error\":\"timeout\"}"); } } From 065dd24f81dce002af2ab78323cf65458cf89426 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:53:08 +0200 Subject: [PATCH 0145/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5b125d7b3..b22f553a2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -516,7 +516,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+600 ) { sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5c1f1ac1b..be04fc43b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -566,7 +566,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { // do callback stritem = (struct stritem *)item; - //printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); + printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); if ( stritem->retptrp != 0 ) { *((cJSON **)stritem->retptrp) = strjson; @@ -604,6 +604,7 @@ void LP_dedicatedloop(void *arg) ep->sock = -1; break; } + printf("SEND.(%s) to %s:%u\n",sitem->str,ep->ipaddr,ep->port); queue_enqueue("pendingQ",&ep->pendingQ,(struct queueitem *)sitem); flag++; } From 2722ac7d9f855498bc31052de6f66d14ce600c85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:57:08 +0200 Subject: [PATCH 0146/2732] Test --- iguana/exchanges/LP_socket.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index be04fc43b..95eda05eb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -307,6 +307,13 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { // queue id and string and callback char stratumreq[16384]; uint32_t expiration; struct stritem *sitem; cJSON *retjson = 0; + if ( strcmp(method,"getrawmempool") == 0 ) + { + retjson = cJSON_Parse("{\"error\":\"unsupported method\"}"); + if ( retjsonp != 0 ) + *retjsonp = retjson; + return(retjson); + } if ( ep == 0 ) ep = electrum_server(symbol,0); if ( ep != 0 ) From e47c94d0cbaa407d3bd20d3875065f2ef690c391 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:25:30 +0200 Subject: [PATCH 0147/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++++-- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b22f553a2..61b81b988 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -295,8 +295,8 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) for (i=0; isock = -1; break; } - printf("SEND.(%s) to %s:%u\n",sitem->str,ep->ipaddr,ep->port); + //printf("SEND.(%s) to %s:%u\n",sitem->str,ep->ipaddr,ep->port); queue_enqueue("pendingQ",&ep->pendingQ,(struct queueitem *)sitem); flag++; } From 4dc87168a9af65766bf8f657cddbc76b955d5eef Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:29:08 +0200 Subject: [PATCH 0148/2732] Test --- iguana/exchanges/LP_commands.c | 14 +++++++------- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/mm.c | 2 +- iguana/exchanges/stats.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 19e3a4265..b76100e93 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -375,17 +375,17 @@ dividends(coin, height, )\n\ } else { + if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) + { + uint32_t firsttime; + if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) + firsttime = (uint32_t)(time(NULL)-30*24*3600); + return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); + } if ( IAMLP != 0 ) { if ( strcmp(method,"register") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - else if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) - { - uint32_t firsttime; - if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) - firsttime = (uint32_t)(time(NULL)-30*24*3600); - return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); - } else if ( strcmp(method,"lookup") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); if ( strcmp(method,"broadcast") == 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 623b61dfc..8dd2c1ad7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -65,6 +65,7 @@ //#define BASILISK_DISABLEWAITTX //#define BASILISK_DISABLESENDTX +#define LP_RPCPORT 7783 #define LP_PROPAGATION_SLACK 100 // txid ordering is not enforced, so getting extra recent txid #define LP_RESERVETIME 60 diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 8cfd07bdb..3a2589089 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -792,7 +792,7 @@ void LP_main(void *ptr) profitmargin = jdouble(argjson,"profitmargin"); LP_profitratio += profitmargin; if ( (port= juint(argjson,"rpcport")) < 1000 ) - port = 7779; + port = LP_RPCPORT; LPinit(port,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 3c98b48f5..2d5153695 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -561,7 +561,7 @@ void stats_rpcloop(void *args) socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space; struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; if ( (port= *(uint16_t *)args) == 0 ) - port = 7779; + port = LP_RPCPORT; if ( jsonbuf == 0 ) jsonbuf = calloc(1,IGUANA_MAXPACKETSIZE); while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) @@ -1022,7 +1022,7 @@ char *stats_update(FILE *logfp,char *destdir,char *statefname,char *komodofname) int main(int argc, const char * argv[]) { - struct tai T; uint32_t timestamp; struct DEXstats_disp prices[365]; int32_t i,n,seconds,leftdatenum; FILE *fp,*logfp; char *filestr,*retstr,*statefname,logfname[512],komodofile[512]; uint16_t port = 7779; + struct tai T; uint32_t timestamp; struct DEXstats_disp prices[365]; int32_t i,n,seconds,leftdatenum; FILE *fp,*logfp; char *filestr,*retstr,*statefname,logfname[512],komodofile[512]; uint16_t port = LP_RPCPORT; if ( argc < 2 ) { statefname = "/root/.komodo/KV/komodostate"; From 5933e8a29fe8a30114dae57a131c62fc193c09d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:33:29 +0200 Subject: [PATCH 0149/2732] Port 7783 --- iguana/exchanges/autofill | 2 +- iguana/exchanges/autoprice | 16 ++++++++-------- iguana/exchanges/autotrade | 2 +- iguana/exchanges/balance_loop | 4 ++-- iguana/exchanges/bestfit | 2 +- iguana/exchanges/cancelorder | 2 +- iguana/exchanges/deletemessages | 2 +- iguana/exchanges/disable | 2 +- iguana/exchanges/dividends | 2 +- iguana/exchanges/electrum | 2 +- iguana/exchanges/enable | 2 +- iguana/exchanges/getcoin | 2 +- iguana/exchanges/getcoins | 2 +- iguana/exchanges/getmessages | 2 +- iguana/exchanges/getpeers | 2 +- iguana/exchanges/getpeersIP | 20 ++++++++++---------- iguana/exchanges/getprices | 2 +- iguana/exchanges/getutxos | 2 +- iguana/exchanges/goal | 6 +++--- iguana/exchanges/goals | 2 +- iguana/exchanges/help | 2 +- iguana/exchanges/inv | 2 +- iguana/exchanges/loop | 2 +- iguana/exchanges/message | 2 +- iguana/exchanges/myprice | 2 +- iguana/exchanges/myprices | 2 +- iguana/exchanges/numutxos | 2 +- iguana/exchanges/orderbook | 2 +- iguana/exchanges/ordermatch | 2 +- iguana/exchanges/portfolio | 2 +- iguana/exchanges/pricearray | 2 +- iguana/exchanges/pub | 2 +- iguana/exchanges/register | 2 +- iguana/exchanges/registerall | 2 +- iguana/exchanges/secretaddresses | 2 +- iguana/exchanges/setprice | 2 +- iguana/exchanges/snapshot | 2 +- iguana/exchanges/snapshot_balance | 2 +- iguana/exchanges/snapshot_loop | 2 +- iguana/exchanges/status | 2 +- iguana/exchanges/swapstatus | 2 +- iguana/exchanges/trade | 2 +- iguana/exchanges/utxos | 2 +- 43 files changed, 62 insertions(+), 62 deletions(-) diff --git a/iguana/exchanges/autofill b/iguana/exchanges/autofill index 47afea4f1..f05962ea7 100755 --- a/iguana/exchanges/autofill +++ b/iguana/exchanges/autofill @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autofill\",\"base\":\"KMD\",\"rel\":\"BTC\",\"price\":0.0005,\"relvolume\":0.1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autofill\",\"base\":\"KMD\",\"rel\":\"BTC\",\"price\":0.0005,\"relvolume\":0.1}" diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index e612d19a9..b709aa0e4 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,9 +1,9 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"USD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"USD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" diff --git a/iguana/exchanges/autotrade b/iguana/exchanges/autotrade index f88b157bb..0ea5e5f11 100755 --- a/iguana/exchanges/autotrade +++ b/iguana/exchanges/autotrade @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autotrade\",\"base\":\"REVS\",\"rel\":\"KMD\",\"relvolume\":1.01,\"price\":1.234}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autotrade\",\"base\":\"REVS\",\"rel\":\"KMD\",\"relvolume\":1.01,\"price\":1.234}" diff --git a/iguana/exchanges/balance_loop b/iguana/exchanges/balance_loop index fcc1b8cb5..8a75e0e22 100755 --- a/iguana/exchanges/balance_loop +++ b/iguana/exchanges/balance_loop @@ -2,8 +2,8 @@ source userpass ht=$1 while true do -#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=`curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` echo next height $ht sleep 600 diff --git a/iguana/exchanges/bestfit b/iguana/exchanges/bestfit index 9ed9e4df2..c926713ff 100755 --- a/iguana/exchanges/bestfit +++ b/iguana/exchanges/bestfit @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"bestfit\",\"rel\":\"KMD\",\"relvolume\":1.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bestfit\",\"rel\":\"KMD\",\"relvolume\":1.01}" diff --git a/iguana/exchanges/cancelorder b/iguana/exchanges/cancelorder index 31f46e020..78394c4c7 100755 --- a/iguana/exchanges/cancelorder +++ b/iguana/exchanges/cancelorder @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":9999999.99}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":9999999.99}" diff --git a/iguana/exchanges/deletemessages b/iguana/exchanges/deletemessages index ad1269cd8..a65985a7e 100755 --- a/iguana/exchanges/deletemessages +++ b/iguana/exchanges/deletemessages @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"deletemessages\",\"firsti\":0,\"num\":10}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"deletemessages\",\"firsti\":0,\"num\":10}" diff --git a/iguana/exchanges/disable b/iguana/exchanges/disable index c74b84fd5..e32c24a6f 100755 --- a/iguana/exchanges/disable +++ b/iguana/exchanges/disable @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"disable\",\"coin\":\"REVS\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"disable\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/dividends b/iguana/exchanges/dividends index f3dde55a0..c5b2ac714 100755 --- a/iguana/exchanges/dividends +++ b/iguana/exchanges/dividends @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"dividends\",\"coin\":\"KMD\",\"height\":$1,\"prefix\":\"fiat/jumblr sendtoaddress\",\"suffix\":\"\",\"dividend\":50000,\"dust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"dividends\",\"coin\":\"KMD\",\"height\":$1,\"prefix\":\"fiat/jumblr sendtoaddress\",\"suffix\":\"\",\"dividend\":50000,\"dust\":1}" diff --git a/iguana/exchanges/electrum b/iguana/exchanges/electrum index e59470c2f..8bf0eb38a 100755 --- a/iguana/exchanges/electrum +++ b/iguana/exchanges/electrum @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"46.4.125.2\",\"port\":50001}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"46.4.125.2\",\"port\":50001}" diff --git a/iguana/exchanges/enable b/iguana/exchanges/enable index a974c1860..bb2b70d30 100755 --- a/iguana/exchanges/enable +++ b/iguana/exchanges/enable @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"BTC\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"BTC\"}" diff --git a/iguana/exchanges/getcoin b/iguana/exchanges/getcoin index 88ce8912e..063185f57 100755 --- a/iguana/exchanges/getcoin +++ b/iguana/exchanges/getcoin @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoin\",\"coin\":\"LTC\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoin\",\"coin\":\"LTC\"}" diff --git a/iguana/exchanges/getcoins b/iguana/exchanges/getcoins index 132e9a9c0..71778acfb 100755 --- a/iguana/exchanges/getcoins +++ b/iguana/exchanges/getcoins @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoins\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoins\"}" diff --git a/iguana/exchanges/getmessages b/iguana/exchanges/getmessages index 85d246c51..0bfadf518 100755 --- a/iguana/exchanges/getmessages +++ b/iguana/exchanges/getmessages @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getmessages\",\"firsti\":0,\"num\":10}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getmessages\",\"firsti\":0,\"num\":10}" diff --git a/iguana/exchanges/getpeers b/iguana/exchanges/getpeers index 32852ba6a..ea91cb791 100755 --- a/iguana/exchanges/getpeers +++ b/iguana/exchanges/getpeers @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getpeers\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getpeers\"}" diff --git a/iguana/exchanges/getpeersIP b/iguana/exchanges/getpeersIP index feef2e5d8..c5a7fdd74 100755 --- a/iguana/exchanges/getpeersIP +++ b/iguana/exchanges/getpeersIP @@ -1,10 +1,10 @@ -curl --url "http://5.9.253.195:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.196:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.197:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.198:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.199:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.200:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.201:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.202:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.203:7779" --data "{\"method\":\"getpeers\"}" -curl --url "http://5.9.253.204:7779" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.195:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.196:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.197:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.198:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.199:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.200:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.201:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.202:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.203:7783" --data "{\"method\":\"getpeers\"}" +curl --url "http://5.9.253.204:7783" --data "{\"method\":\"getpeers\"}" diff --git a/iguana/exchanges/getprices b/iguana/exchanges/getprices index 216b2b86c..2a0428d1c 100755 --- a/iguana/exchanges/getprices +++ b/iguana/exchanges/getprices @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getprices\",\"coin\":\"REVS\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getprices\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/getutxos b/iguana/exchanges/getutxos index a84c72fb0..38f26f654 100755 --- a/iguana/exchanges/getutxos +++ b/iguana/exchanges/getutxos @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/goal b/iguana/exchanges/goal index 3fd9dee0f..ecfd491e6 100755 --- a/iguana/exchanges/goal +++ b/iguana/exchanges/goal @@ -1,4 +1,4 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"val\":99}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"val\":10}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"val\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"val\":99}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"val\":10}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"val\":1}" diff --git a/iguana/exchanges/goals b/iguana/exchanges/goals index b9735de5f..b29e0f49f 100755 --- a/iguana/exchanges/goals +++ b/iguana/exchanges/goals @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\"}" diff --git a/iguana/exchanges/help b/iguana/exchanges/help index a5f08aa50..f51f15b8d 100755 --- a/iguana/exchanges/help +++ b/iguana/exchanges/help @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"help\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"help\"}" diff --git a/iguana/exchanges/inv b/iguana/exchanges/inv index b0b5e52b1..1a86e88f4 100755 --- a/iguana/exchanges/inv +++ b/iguana/exchanges/inv @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"KMD\"}" diff --git a/iguana/exchanges/loop b/iguana/exchanges/loop index 8703827ba..43228b96e 100755 --- a/iguana/exchanges/loop +++ b/iguana/exchanges/loop @@ -1,7 +1,7 @@ while true do source userpass -#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234}" +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234}" ./s sleep 3600 done diff --git a/iguana/exchanges/message b/iguana/exchanges/message index 701f63049..0182aa093 100755 --- a/iguana/exchanges/message +++ b/iguana/exchanges/message @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"sendmessage\",\"message\":\"some sort of message\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"sendmessage\",\"message\":\"some sort of message\"}" diff --git a/iguana/exchanges/myprice b/iguana/exchanges/myprice index cdb93dabc..8080023ed 100755 --- a/iguana/exchanges/myprice +++ b/iguana/exchanges/myprice @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"myprice\",\"base\":\"REVS\",\"rel\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"myprice\",\"base\":\"REVS\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/myprices b/iguana/exchanges/myprices index 7333d682b..3fef298b2 100755 --- a/iguana/exchanges/myprices +++ b/iguana/exchanges/myprices @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"myprices\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"myprices\"}" diff --git a/iguana/exchanges/numutxos b/iguana/exchanges/numutxos index b20de95fc..f8d921078 100755 --- a/iguana/exchanges/numutxos +++ b/iguana/exchanges/numutxos @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"numutxos\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"numutxos\"}" diff --git a/iguana/exchanges/orderbook b/iguana/exchanges/orderbook index 3ec8ffbdf..8ca15bc87 100755 --- a/iguana/exchanges/orderbook +++ b/iguana/exchanges/orderbook @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"JUMBLR\",\"rel\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"JUMBLR\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/ordermatch b/iguana/exchanges/ordermatch index 05d30ba7e..85c74cfea 100755 --- a/iguana/exchanges/ordermatch +++ b/iguana/exchanges/ordermatch @@ -1,3 +1,3 @@ source userpass #ordermatch(base, txfee=0, rel, desttxfee=0, price, txid, vout, feetxid, feevout, duration=3600)\n\ -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"ordermatch\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234,\"duration\":600,\"txfee\":0,\"desttxfee\":0,\"txid\":\"$1\",\"vout\":$2,\"feetxid\":\"$3\",\"feevout\":$4}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"ordermatch\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234,\"duration\":600,\"txfee\":0,\"desttxfee\":0,\"txid\":\"$1\",\"vout\":$2,\"feetxid\":\"$3\",\"feevout\":$4}" diff --git a/iguana/exchanges/portfolio b/iguana/exchanges/portfolio index 2265e0fc2..92bd9f236 100755 --- a/iguana/exchanges/portfolio +++ b/iguana/exchanges/portfolio @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"portfolio\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"portfolio\"}" diff --git a/iguana/exchanges/pricearray b/iguana/exchanges/pricearray index 8a01248af..f39ab51ae 100755 --- a/iguana/exchanges/pricearray +++ b/iguana/exchanges/pricearray @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"pricearray\",\"base\":\"KMD\",\"rel\":\"BTC\",\"timescale\":60}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"pricearray\",\"base\":\"KMD\",\"rel\":\"BTC\",\"timescale\":60}" diff --git a/iguana/exchanges/pub b/iguana/exchanges/pub index edafc5b98..8d9712607 100755 --- a/iguana/exchanges/pub +++ b/iguana/exchanges/pub @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"6578099f6474d9b8bd66a7a136b922029a989818ec0309aee962dd6ac1862b74\",\"method\":\"forward\",\"method2\":\"publish\",\"data\":\"nonsense\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"6578099f6474d9b8bd66a7a136b922029a989818ec0309aee962dd6ac1862b74\",\"method\":\"forward\",\"method2\":\"publish\",\"data\":\"nonsense\"}" diff --git a/iguana/exchanges/register b/iguana/exchanges/register index bbe660faa..ca64e4ace 100755 --- a/iguana/exchanges/register +++ b/iguana/exchanges/register @@ -1,2 +1,2 @@ source userpass -curl --url "http://5.9.253.195:7779" --data "{\"userpass\":\"9bb4846d24136fc7c33515e45bccbab5c8fb7b57b411aa20057b371da9358255\",\"agent\":\"stats\",\"method\":\"register\",\"client\":\"6d3332be4904feafd326609bd76b66528dc7b2e2d75a7bd110c6bf8d19c4cf58\",\"pushaddr\":\"5.9.253.195\",\"pushport\":\"10000\"}" +curl --url "http://5.9.253.195:7783" --data "{\"userpass\":\"9bb4846d24136fc7c33515e45bccbab5c8fb7b57b411aa20057b371da9358255\",\"agent\":\"stats\",\"method\":\"register\",\"client\":\"6d3332be4904feafd326609bd76b66528dc7b2e2d75a7bd110c6bf8d19c4cf58\",\"pushaddr\":\"5.9.253.195\",\"pushport\":\"10000\"}" diff --git a/iguana/exchanges/registerall b/iguana/exchanges/registerall index 9024b8230..b3cfe5f06 100755 --- a/iguana/exchanges/registerall +++ b/iguana/exchanges/registerall @@ -1,3 +1,3 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"registerall\",\"numnodes\":10}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"registerall\",\"numnodes\":10}" diff --git a/iguana/exchanges/secretaddresses b/iguana/exchanges/secretaddresses index 38088a6bc..a2d6ba2d2 100755 --- a/iguana/exchanges/secretaddresses +++ b/iguana/exchanges/secretaddresses @@ -1,5 +1,5 @@ source userpass echo "usage: ./secretaddresses 'passphrase'" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"secretaddresses\",\"num\":16,\"passphrase\":\"$1\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"secretaddresses\",\"num\":16,\"passphrase\":\"$1\"}" diff --git a/iguana/exchanges/setprice b/iguana/exchanges/setprice index e5a9c3c9c..0909118fb 100755 --- a/iguana/exchanges/setprice +++ b/iguana/exchanges/setprice @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234}" diff --git a/iguana/exchanges/snapshot b/iguana/exchanges/snapshot index 2b875af59..e9056f1cf 100755 --- a/iguana/exchanges/snapshot +++ b/iguana/exchanges/snapshot @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$1}" diff --git a/iguana/exchanges/snapshot_balance b/iguana/exchanges/snapshot_balance index 4cbe11cf3..88b0f9823 100644 --- a/iguana/exchanges/snapshot_balance +++ b/iguana/exchanges/snapshot_balance @@ -1,4 +1,4 @@ source userpass ht=$1 -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index aef95969b..38a0c3156 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -2,7 +2,7 @@ source userpass ht=$1 while true do -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" #ht=`komodo-cli getinfo | jq .blocks` ht=$(( $ht + 1000 )) echo next height $ht diff --git a/iguana/exchanges/status b/iguana/exchanges/status index 7e7b4bb0e..a05aa72ee 100755 --- a/iguana/exchanges/status +++ b/iguana/exchanges/status @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\"}" diff --git a/iguana/exchanges/swapstatus b/iguana/exchanges/swapstatus index e7ba89318..ce9dbbed0 100755 --- a/iguana/exchanges/swapstatus +++ b/iguana/exchanges/swapstatus @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\",\"requestid\":2291973695,\"quoteid\":3387529385}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\",\"requestid\":2291973695,\"quoteid\":3387529385}" diff --git a/iguana/exchanges/trade b/iguana/exchanges/trade index cf7d9ec2f..155de037a 100755 --- a/iguana/exchanges/trade +++ b/iguana/exchanges/trade @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"trade\",\"price\":1.234,\"base\":\"REVS\",\"rel\":\"KMD\",\"quote\":{}}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"trade\",\"price\":1.234,\"base\":\"REVS\",\"rel\":\"KMD\",\"quote\":{}}" diff --git a/iguana/exchanges/utxos b/iguana/exchanges/utxos index a84c72fb0..38f26f654 100755 --- a/iguana/exchanges/utxos +++ b/iguana/exchanges/utxos @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" From fb06a853908194e029c1b601d62df7943771aae0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:41:54 +0200 Subject: [PATCH 0150/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2d5153695..81562a46c 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -561,7 +561,7 @@ void stats_rpcloop(void *args) socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space; struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; if ( (port= *(uint16_t *)args) == 0 ) - port = LP_RPCPORT; + port = 7779; if ( jsonbuf == 0 ) jsonbuf = calloc(1,IGUANA_MAXPACKETSIZE); while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) From a7f60d43dc07557e14f7df940ab1c6c5ce3fc8ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:46:12 +0200 Subject: [PATCH 0151/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 968851e3f..4d0812a40 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -125,7 +125,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); - char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + //char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); From b8e2468bc4b734a3f7a68b7ae157fefced6bf09d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:49:39 +0200 Subject: [PATCH 0152/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8dd2c1ad7..3cca90e1b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,7 +21,7 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H -//#define LP_STRICTPEERS +#define LP_STRICTPEERS #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL From 83467db592d5b08c0c7f748ccefc3cda64e4fa55 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:55:04 +0200 Subject: [PATCH 0153/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 3a2589089..57c56fdee 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -793,7 +793,7 @@ void LP_main(void *ptr) LP_profitratio += profitmargin; if ( (port= juint(argjson,"rpcport")) < 1000 ) port = LP_RPCPORT; - LPinit(port,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(port,LP_RPCPORT+1,LP_RPCPORT+2,LP_RPCPORT+3,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From deb066acc7e7ddad05f45db3469124ee4dd9f7ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 19:57:44 +0200 Subject: [PATCH 0154/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3cca90e1b..8dd2c1ad7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,7 +21,7 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H -#define LP_STRICTPEERS +//#define LP_STRICTPEERS #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL From a139d1b992135e7caeb1ca23cd5b5e2085674770 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 20:03:56 +0200 Subject: [PATCH 0155/2732] Test --- iguana/exchanges/LP_prices.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8ec065287..6216a9324 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -215,6 +215,7 @@ char *LP_prices() void LP_prices_parse(cJSON *obj) { + static uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid; char *base,*rel,*hexstr; double askprice; pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) @@ -222,7 +223,7 @@ void LP_prices_parse(cJSON *obj) if ( (hexstr= jstr(obj,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) { decode_hex(rmd160,sizeof(rmd160),hexstr); - if ( memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) + if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 && memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) { for (i=0; i<20; i++) printf("%02x",pubp->rmd160[i]); From 7ed99b955c423fde7741012f570e883941b39fab Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 20:43:26 +0200 Subject: [PATCH 0156/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++-- iguana/exchanges/LP_utxos.c | 62 ++++++++++++++++++++++++++++--------- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 61b81b988..16a30ccac 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -383,7 +383,7 @@ cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) cJSON *LP_listunspent(char *symbol,char *coinaddr) { - char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); + char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin->electrum == 0 ) @@ -394,7 +394,9 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) else { sprintf(buf,"[\"%s\"]",coinaddr); - return(bitcoin_json(coin,"blockchain.address.listunspent",buf)); + if ( (retjson= bitcoin_json(coin,"blockchain.address.listunspent",buf)) != 0 ) + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + return(retjson); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ebbc93ade..e35e7a0a3 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -808,7 +808,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,targetval,value,total = 0; + char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,targetval,value,total = 0; if ( coin == 0 ) { printf("coin not active\n"); @@ -831,14 +831,27 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr for (i=0; i 0 ) + if ( coin->electrum == 0 ) { - //printf("%s\n",jprint(item,0)); - values[i] = satoshis; - } else used++; + satoshis = SATOSHIDEN * jdouble(item,"amount"); + if ( satoshis == 0 ) + satoshis = SATOSHIDEN * jdouble(item,"value"); + if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) + { + //printf("%s\n",jprint(item,0)); + values[i] = satoshis; + } else used++; + } + else + { + //{"value":1000000,"tx_hash":"4e4f818c53486c0576693b4cd379849e5ff95538b38e4100f48884073a4e7636","tx_pos":0,"height":484877} + satoshis = j64bits(item,"value"); + if ( LP_inventory_prevent(iambob,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) + { + printf("%s\n",jprint(item,0)); + values[i] = satoshis; + } else used++; + } //printf("%.8f ",dstr(satoshis)); } //printf("array.%d\n",n); @@ -850,9 +863,18 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( (i= LP_maxvalue(values,n)) >= 0 ) { item = jitem(array,i); - deposittxid = jbits256(item,"txid"); - depositvout = juint(item,"vout"); - script = jstr(item,"scriptPubKey"); + if ( coin->electrum == 0 ) + { + deposittxid = jbits256(item,"txid"); + depositvout = juint(item,"vout"); + script = jstr(item,"scriptPubKey"); + } + else + { + deposittxid = jbits256(item,"tx_hash"); + depositvout = juint(item,"tx_pos"); + script = coin->smartaddr; + } depositval = values[i]; values[i] = 0, used++; if ( iambob == 0 ) @@ -872,9 +894,21 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( i >= 0 || (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { item = jitem(array,i); - txid = jbits256(item,"txid"); - vout = juint(item,"vout"); - if ( jstr(item,"scriptPubKey") != 0 && strcmp(script,jstr(item,"scriptPubKey")) == 0 ) + cmpflag = 0; + if ( coin->electrum == 0 ) + { + txid = jbits256(item,"txid"); + vout = juint(item,"vout"); + if ( jstr(item,"scriptPubKey") != 0 && strcmp(script,jstr(item,"scriptPubKey")) == 0 ) + cmpflag = 1; + } + else + { + txid = jbits256(item,"tx_hash"); + vout = juint(item,"tx_pos"); + cmpflag = 1; + } + if ( cmpflag != 0 ) { value = values[i]; values[i] = 0, used++; From 6604899edb1380a63cad49cb49e27c704dfe44ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 21:06:22 +0200 Subject: [PATCH 0157/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cddd7b109..640d2ed44 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -573,7 +573,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { // do callback stritem = (struct stritem *)item; - printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); + //printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); if ( stritem->retptrp != 0 ) { *((cJSON **)stritem->retptrp) = strjson; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e35e7a0a3..5b7a36c22 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -893,6 +893,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } if ( i >= 0 || (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { + printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); item = jitem(array,i); cmpflag = 0; if ( coin->electrum == 0 ) @@ -921,6 +922,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } else { + printf("call utxoadd\n"); if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) { } From 1edd79ce634e6f3ed8e523855a8eabdc0bf89129 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 21:16:37 +0200 Subject: [PATCH 0158/2732] BSD coin --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 2d84dfe6e..0a7680a30 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 4cf388aebab1705f639194e8a6516b452f0f6ddc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 21:19:12 +0200 Subject: [PATCH 0159/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 640d2ed44..cddd7b109 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -573,7 +573,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { // do callback stritem = (struct stritem *)item; - //printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); + printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); if ( stritem->retptrp != 0 ) { *((cJSON **)stritem->retptrp) = strjson; From c9f57f3d451d45309b001198d565e7054d912061 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 21:31:59 +0200 Subject: [PATCH 0160/2732] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5b7a36c22..b6cf77989 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -857,9 +857,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - //for (i=0; i= 0 ) { item = jitem(array,i); @@ -880,9 +880,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( iambob == 0 ) targetval = (depositval / 776) + txfee; else targetval = (depositval / 9) * 8 + 2*txfee; + printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { From 4cc9ef1030ee4b53ad5d5e4eb5efd1d3ebe720dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 21:39:12 +0200 Subject: [PATCH 0161/2732] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 16a30ccac..caf24a3a2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -515,7 +515,7 @@ int32_t LP_importaddress(char *symbol,char *address) double LP_getestimatedrate(struct iguana_info *coin) { - char buf[512],*retstr; double rate = 20; + char buf[512],*retstr; double rate = 0.00000020; if ( coin == 0 ) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) @@ -528,8 +528,8 @@ double LP_getestimatedrate(struct iguana_info *coin) if ( retstr[0] != '-' ) { rate = atof(retstr) / 1024.; - if ( rate < 20 ) - rate = 20.; + if ( rate < 0.00000020 ) + rate = 0.00000020; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); From 7d849076d7357afe3624077dc686bb579d2b8e0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 21:51:15 +0200 Subject: [PATCH 0162/2732] Test --- iguana/exchanges/LP_rpc.c | 8 +++++--- iguana/exchanges/LP_utxos.c | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index caf24a3a2..188820a79 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -257,9 +257,9 @@ cJSON *LP_gettx(char *symbol,bits256 txid) free(serialized); printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); return(retjson); - } + } else printf("non-hex tx.(%s)\n",hexstr); return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); - } + } else printf("failed blockcjhain.transaction.get\n"); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); } } @@ -395,7 +395,9 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) { sprintf(buf,"[\"%s\"]",coinaddr); if ( (retjson= bitcoin_json(coin,"blockchain.address.listunspent",buf)) != 0 ) - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + { + //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + } return(retjson); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b6cf77989..6638d7ff9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -539,7 +539,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { - //printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } numconfirms = -1; @@ -550,7 +550,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - //printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); + printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); return(0); } numconfirms = -1; @@ -561,7 +561,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - //printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); + printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); } if ( dispflag != 0 ) From 5411d3a6eef678db88d786b9c173207bf1e0c423 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 22:07:15 +0200 Subject: [PATCH 0163/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 188820a79..58d7e49c4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -281,11 +281,11 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(hexobj,1); - if ( (len= is_hexstr(hexstr,0)) > 2 ) + if ( (len= is_hexstr(hexstr+1,0)) > 2 ) { len >>= 1; serialized = malloc(len); - decode_hex(serialized,len,hexstr); + decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,0); printf("HEX.(%s) %s %.8f\n",hexstr,coinaddr,dstr(value)); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) From 9b8a8048e91c88be451295e597a76a967d1c357c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 22:25:45 +0200 Subject: [PATCH 0164/2732] Test --- iguana/exchanges/LP_rpc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 58d7e49c4..3967bc889 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -283,11 +283,14 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) hexstr = jprint(hexobj,1); if ( (len= is_hexstr(hexstr+1,0)) > 2 ) { - len >>= 1; + len = (int32_t)strlen(hexstr+1); + if ( hexstr[len] == '"' ) + hexstr[len] = 0; + len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,0); - printf("HEX.(%s) %s %.8f\n",hexstr,coinaddr,dstr(value)); + printf("HEX.(%s) len.%d %s %.8f\n",hexstr,len,coinaddr,dstr(value)); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) { if ( (array= jarray(&n,listjson,"result")) != 0 ) From 45b0e8c6743cd1c2a0ad40c49881718cb112aa81 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 22:33:52 +0200 Subject: [PATCH 0165/2732] Test --- iguana/exchanges/LP_rpc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3967bc889..615da3391 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -281,16 +281,15 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(hexobj,1); + if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) + hexstr[strlen(hexstr)-1] = 0; if ( (len= is_hexstr(hexstr+1,0)) > 2 ) { - len = (int32_t)strlen(hexstr+1); - if ( hexstr[len] == '"' ) - hexstr[len] = 0; len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,0); - printf("HEX.(%s) len.%d %s %.8f\n",hexstr,len,coinaddr,dstr(value)); + printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) { if ( (array= jarray(&n,listjson,"result")) != 0 ) From 507b79c792c733a0dee2f9f179e904fc8b837951 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 22:40:22 +0200 Subject: [PATCH 0166/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 615da3391..6bd3a331c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -247,10 +247,12 @@ cJSON *LP_gettx(char *symbol,bits256 txid) if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); - if ( (len= is_hexstr(hexstr,0)) > 2 ) + if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) + hexstr[strlen(hexstr)-1] = 0; + if ( (len= is_hexstr(hexstr+1,0)) > 2 ) { memset(&msgtx,0,sizeof(msgtx)); - len >>= 1; + len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); decode_hex(serialized,len,hexstr); retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,sizeof(extraspace),serialized,len,0,0); From 41fa68b91ebe3d256e6e7981cd406fa5bef535a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 22:40:38 +0200 Subject: [PATCH 0167/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cddd7b109..640d2ed44 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -573,7 +573,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { // do callback stritem = (struct stritem *)item; - printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); + //printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); if ( stritem->retptrp != 0 ) { *((cJSON **)stritem->retptrp) = strjson; From 1eff45c82ab8a6e346b5db1a66b40eb29e47934b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 22:57:18 +0200 Subject: [PATCH 0168/2732] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 6bd3a331c..a555ef764 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -254,7 +254,8 @@ cJSON *LP_gettx(char *symbol,bits256 txid) memset(&msgtx,0,sizeof(msgtx)); len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); - decode_hex(serialized,len,hexstr); + decode_hex(serialized,len,hexstr+1); + printf("DATA.(%s)\n",hexstr+1); retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,sizeof(extraspace),serialized,len,0,0); free(serialized); printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); From 2c8b5abbe299707f9af168c38befa6bc652d4646 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 23:15:17 +0200 Subject: [PATCH 0169/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a555ef764..afa702e53 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -255,10 +255,10 @@ cJSON *LP_gettx(char *symbol,bits256 txid) len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); decode_hex(serialized,len,hexstr+1); - printf("DATA.(%s)\n",hexstr+1); + //printf("DATA.(%s)\n",hexstr+1); retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,sizeof(extraspace),serialized,len,0,0); free(serialized); - printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); + //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); return(retjson); } else printf("non-hex tx.(%s)\n",hexstr); return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 4d0812a40..0037619aa 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -125,7 +125,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); - //char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6638d7ff9..4e3b85f38 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -291,7 +291,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol //struct LP_utxoinfo *utxo; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; - if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) + if ( coin != 0 && ((IAMLP != 0 && coin->inactive != 0) || coin->electrum != 0) ) bypass = 1; if ( bypass != 0 ) val = satoshis; From 7eb9211f85df7fdb0049d8ee33a738bb3eef4a5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 23:21:52 +0200 Subject: [PATCH 0170/2732] Test --- iguana/exchanges/LP_scan.c | 6 ++++-- iguana/exchanges/LP_utxos.c | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 0037619aa..5ac552aee 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -125,7 +125,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); - char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + //char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); @@ -682,7 +682,9 @@ int32_t LP_numconfirms(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx,i numconfirms = -1; if ( (txobj= LP_gettx(rawtx->coin->symbol,rawtx->I.signedtxid)) != 0 ) { - numconfirms = jint(txobj,"confirmations"); + if ( coin->electrum == 0 ) + numconfirms = jint(txobj,"confirmations"); + else numconfirms = coin->height - jint(txobj,"height"); free_json(txobj); } else if ( mempool != 0 && LP_mempoolscan(rawtx->coin->symbol,rawtx->I.signedtxid) >= 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4e3b85f38..69132b326 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -545,7 +545,9 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit numconfirms = -1; if ( (txobj= LP_gettx(symbol,txid)) != 0 ) { - numconfirms = jint(txobj,"confirmations"); + if ( coin->electrum == 0 ) + numconfirms = jint(txobj,"confirmations"); + else numconfirms = coin->height - jint(txobj,"height"); free_json(txobj); } if ( numconfirms <= 0 ) @@ -556,7 +558,9 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit numconfirms = -1; if ( (txobj= LP_gettx(symbol,txid2)) != 0 ) { - numconfirms = jint(txobj,"confirmations"); + if ( coin->electrum == 0 ) + numconfirms = jint(txobj,"confirmations"); + else numconfirms = coin->height - jint(txobj,"height"); free_json(txobj); } if ( numconfirms <= 0 ) From 3a05357f1bae839c063ce2dfb38647c01dabbc72 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 23:26:48 +0200 Subject: [PATCH 0171/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index afa702e53..74b69ef9e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -291,7 +291,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); decode_hex(serialized,len,hexstr+1); - LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,0); + LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) { From acb8997d8580ed7b57c2840f16f692a83352ffeb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 23:34:17 +0200 Subject: [PATCH 0172/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_utxos.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 74b69ef9e..6b40b3077 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -292,7 +292,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) serialized = malloc(len); decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); - printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); + //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) { if ( (array= jarray(&n,listjson,"result")) != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 69132b326..f330d4df1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -852,7 +852,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr satoshis = j64bits(item,"value"); if ( LP_inventory_prevent(iambob,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) { - printf("%s\n",jprint(item,0)); + //printf("%s\n",jprint(item,0)); values[i] = satoshis; } else used++; } @@ -883,7 +883,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr values[i] = 0, used++; if ( iambob == 0 ) targetval = (depositval / 776) + txfee; - else targetval = (depositval / 9) * 8 + 2*txfee; + else targetval = (depositval / 10) * 8 - 2*txfee; printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; From 2d0a3534bbf269c410b977564709ac83bc2b379a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 23:38:21 +0200 Subject: [PATCH 0173/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f330d4df1..61a9cc872 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -883,7 +883,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr values[i] = 0, used++; if ( iambob == 0 ) targetval = (depositval / 776) + txfee; - else targetval = (depositval / 10) * 8 - 2*txfee; + else targetval = (depositval / 9) * 8 - 2*txfee; printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; From 9130c8f8b54ff025242fdd122a645cad58524d8f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 23:48:40 +0200 Subject: [PATCH 0174/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 6b40b3077..adcc19491 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -232,7 +232,7 @@ cJSON *LP_paxprice(char *fiat) cJSON *LP_gettx(char *symbol,bits256 txid) { - char buf[128],str[65],*hexstr; int32_t len; bits256 checktxid; cJSON *retjson; struct iguana_info *coin; struct iguana_msgtx msgtx; uint8_t extraspace[8192],*serialized; + char buf[128],str[65],*hexstr; int32_t len; bits256 checktxid; cJSON *retjson; struct iguana_info *coin; struct iguana_msgtx msgtx; uint8_t *extraspace,*serialized; coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -256,8 +256,10 @@ cJSON *LP_gettx(char *symbol,bits256 txid) serialized = malloc(len); decode_hex(serialized,len,hexstr+1); //printf("DATA.(%s)\n",hexstr+1); - retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,sizeof(extraspace),serialized,len,0,0); + extraspace = calloc(1,100000); + retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,100000,serialized,len,0,0); free(serialized); + free(extraspace); //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); return(retjson); } else printf("non-hex tx.(%s)\n",hexstr); From 4ec2ebaf9110bd31430c091c8d1925a368e85ae3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 00:06:16 +0200 Subject: [PATCH 0175/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 2374379c7..1c77d9bdf 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1162,7 +1162,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t v) { - cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[8192]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; + cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; if ( valuep != 0 ) *valuep = 0; if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) From 5157eef1d80aff351d1dd2233f8a90d04f25c534 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 00:31:21 +0200 Subject: [PATCH 0176/2732] Test --- iguana/exchanges/LP_socket.c | 45 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 640d2ed44..e2971cdd6 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -541,34 +541,37 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) } } idnum = juint(strjson,"id"); - portable_mutex_lock(&ep->pendingQ.mutex); - if ( ep->pendingQ.list != 0 ) + if ( 0 ) // crashes cipi's node { - DL_FOREACH(ep->pendingQ.list,item) + portable_mutex_lock(&ep->pendingQ.mutex); + if ( ep->pendingQ.list != 0 ) { - stritem = (struct stritem *)item; - if ( item->type == idnum ) + DL_FOREACH(ep->pendingQ.list,item) { - //printf("matched idnum.%d\n",idnum); - DL_DELETE(ep->pendingQ.list,item); - break; - } - if ( stritem->expiration < ep->lasttime ) - { - DL_DELETE(ep->pendingQ.list,item); - printf("expired (%s)\n",stritem->str); - if ( stritem->retptrp != 0 ) + stritem = (struct stritem *)item; + if ( item->type == idnum ) + { + //printf("matched idnum.%d\n",idnum); + DL_DELETE(ep->pendingQ.list,item); + break; + } + if ( stritem->expiration < ep->lasttime ) { - errjson = cJSON_CreateObject(); - jaddnum(errjson,"id",item->type); - jaddstr(errjson,"error","timeout"); - *((cJSON **)stritem->retptrp) = errjson; - }; + DL_DELETE(ep->pendingQ.list,item); + printf("expired (%s)\n",stritem->str); + if ( stritem->retptrp != 0 ) + { + errjson = cJSON_CreateObject(); + jaddnum(errjson,"id",item->type); + jaddstr(errjson,"error","timeout"); + *((cJSON **)stritem->retptrp) = errjson; + }; + } + item = 0; } - item = 0; } + portable_mutex_unlock(&ep->pendingQ.mutex); } - portable_mutex_unlock(&ep->pendingQ.mutex); if ( item != 0 ) { // do callback From b7e0b6e34b4329dbede871c345a3b23792f3b1c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 00:39:53 +0200 Subject: [PATCH 0177/2732] Test --- iguana/exchanges/LP_socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e2971cdd6..2afbbdc62 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -541,7 +541,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) } } idnum = juint(strjson,"id"); - if ( 0 ) // crashes cipi's node + //if ( 0 ) // crashes cipi's node { portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) @@ -551,14 +551,14 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) stritem = (struct stritem *)item; if ( item->type == idnum ) { - //printf("matched idnum.%d\n",idnum); + printf("matched idnum.%d\n",idnum); DL_DELETE(ep->pendingQ.list,item); break; } - if ( stritem->expiration < ep->lasttime ) + if ( 0 && stritem->expiration < ep->lasttime ) { - DL_DELETE(ep->pendingQ.list,item); printf("expired (%s)\n",stritem->str); + DL_DELETE(ep->pendingQ.list,item); if ( stritem->retptrp != 0 ) { errjson = cJSON_CreateObject(); From 6b93f2f3ed8fdb32e3130ce4363f8735669ccd12 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 00:40:36 +0200 Subject: [PATCH 0178/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2afbbdc62..33b7177a9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -548,6 +548,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { DL_FOREACH(ep->pendingQ.list,item) { + printf("idnum.%d\n",item->type); stritem = (struct stritem *)item; if ( item->type == idnum ) { From 728570e8f998af118d0ed6622da14e3c69687018 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 21:43:53 +0200 Subject: [PATCH 0179/2732] Address utxo --- iguana/exchanges/LP_include.h | 26 +++++++++----- iguana/exchanges/LP_nativeDEX.c | 28 ++++++++++++--- iguana/exchanges/LP_prices.c | 64 +++++++++++++++++++++++++++++++++ iguana/exchanges/LP_scan.c | 24 ------------- iguana/exchanges/LP_socket.c | 54 +++++++++++++++++----------- iguana/exchanges/LP_utxos.c | 5 +++ 6 files changed, 144 insertions(+), 57 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8dd2c1ad7..9a21b5392 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -176,20 +176,13 @@ struct LP_transaction struct LP_outpoint outpoints[]; }; -struct LP_address -{ - UT_hash_handle hh; - int64_t balance; - char coinaddr[40]; -}; - struct iguana_info { UT_hash_handle hh; portable_mutex_t txmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime; + uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio @@ -223,6 +216,22 @@ struct LP_utxoinfo char coin[16],coinaddr[64],spendscript[256],gui[16]; }; +struct LP_address_utxo +{ + struct LP_address_utxo *next,*prev; + struct _LP_utxoinfo U; + uint32_t height,SPV,spentflag; +}; + +struct LP_address +{ + UT_hash_handle hh; + struct LP_address_utxo *utxos; + int64_t balance; + uint32_t monitor; + char coinaddr[40]; +}; + struct LP_peerinfo { UT_hash_handle hh; @@ -287,6 +296,7 @@ struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); +struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 807700fb5..0dcb86446 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,9 +23,7 @@ // bittrex balancing // detect port conflicts on enable // stats -// PoW, JS -// verify actual pricing -// autoutxo, if < 10*txfee and > 10 utxo: combine smallest utxo into dexfee; autosplit if imbalanced +// dynamic txid2 allocation // unduplicated bugs: // swap cancel should cleanly cancel @@ -421,10 +419,30 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; + int32_t height; bits256 zero; struct LP_address *ap,*atmp; struct LP_address_utxo *up; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - if ( coin->inactive != 0 ) + if ( coin->inactive != 0 || coin->electrum != 0 ) continue; + if ( time(NULL) > coin->lastmonitor+60 ) + { + portable_mutex_lock(&coin->txmutex); + HASH_ITER(hh,coin->addresses,ap,atmp) + { + if ( ap->monitor != 0 ) + { + DL_FOREACH(ap->utxos,up) + { + if ( up->spentflag == 0 ) + { + if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) + up->spentflag = (uint32_t)time(NULL); + } + } + } + } + portable_mutex_unlock(&coin->txmutex); + coin->lastmonitor = (uint32_t)time(NULL); + } memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6216a9324..2955f7a21 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -55,6 +55,69 @@ struct LP_pubkeyinfo uint8_t rmd160[20]; } *LP_pubkeyinfos; + +struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); + return(ap); +} + +struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + ap = calloc(1,sizeof(*ap)); + safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); + HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); + return(ap); +} + +struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) + ap = _LP_addressadd(coin,coinaddr); + return(ap); +} + +void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value) +{ + struct LP_address *ap; struct LP_address_utxo *up; + portable_mutex_lock(&coin->txmutex); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + up = calloc(1,sizeof(*up)); + up->U.txid = txid; + up->U.vout = vout; + up->U.value = value; + DL_APPEND(ap->utxos,up); + } + portable_mutex_unlock(&coin->txmutex); +} + +void LP_address_monitor(struct LP_pubkeyinfo *pubp) +{ + struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; + HASH_ITER(hh,LP_coins,coin,tmp) + { + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + portable_mutex_lock(&coin->txmutex); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + ap->monitor = (uint32_t)time(NULL); + } + portable_mutex_unlock(&coin->txmutex); + if ( coin->electrum != 0 ) + { + if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,0,coinaddr)) != 0 ) + { + printf("%s MONITOR.(%s)\n",coin->symbol,coinaddr); + free_json(retjson); + } + } + } +} + int32_t LP_pricevalid(double price) { if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) @@ -229,6 +292,7 @@ void LP_prices_parse(cJSON *obj) printf("%02x",pubp->rmd160[i]); char str[65]; printf(" -> rmd160.(%s) for %s\n",hexstr,bits256_str(str,pubkey)); memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + LP_address_monitor(pubp); } } if ( (timestamp= juint(obj,"timestamp")) > pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5ac552aee..9cbadd53b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -19,30 +19,6 @@ // -struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); - return(ap); -} - -struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - ap = calloc(1,sizeof(*ap)); - safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); - HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); - return(ap); -} - -struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) - ap = _LP_addressadd(coin,coinaddr); - return(ap); -} - struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) { struct LP_transaction *tx; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 33b7177a9..1a73ac60c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -321,6 +321,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); ep->buf[0] = 0; sitem = (struct stritem *)queueitem(stratumreq); + sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; if ( retjsonp != 0 ) sitem->retptrp = (void **)retjsonp; @@ -541,25 +542,33 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) } } idnum = juint(strjson,"id"); - //if ( 0 ) // crashes cipi's node + //if ( 0 ) // crashes cipi's node likely due to mutex across threads { portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { DL_FOREACH(ep->pendingQ.list,item) { - printf("idnum.%d\n",item->type); + if ( item->type == 0xffffffff ) + continue; stritem = (struct stritem *)item; if ( item->type == idnum ) { printf("matched idnum.%d\n",idnum); - DL_DELETE(ep->pendingQ.list,item); + item->type = 0xffffffff; + if ( stritem->retptrp != 0 ) + { + *((cJSON **)stritem->retptrp) = strjson; + strjson = 0; + } + //DL_DELETE(ep->pendingQ.list,item); break; } - if ( 0 && stritem->expiration < ep->lasttime ) + if ( stritem->expiration < ep->lasttime ) { printf("expired (%s)\n",stritem->str); - DL_DELETE(ep->pendingQ.list,item); + item->type = 0xffffffff; + //DL_DELETE(ep->pendingQ.list,item); if ( stritem->retptrp != 0 ) { errjson = cJSON_CreateObject(); @@ -568,23 +577,10 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) *((cJSON **)stritem->retptrp) = errjson; }; } - item = 0; } } portable_mutex_unlock(&ep->pendingQ.mutex); } - if ( item != 0 ) - { - // do callback - stritem = (struct stritem *)item; - //printf("callback.%p (%s) -> (%s)\n",strjson,stritem->str,jprint(strjson,0)); - if ( stritem->retptrp != 0 ) - { - *((cJSON **)stritem->retptrp) = strjson; - strjson = 0; - } - free(item); - } if ( strjson != 0 ) free_json(strjson); } @@ -593,7 +589,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { - struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; + struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct queueitem *item = 0; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 ) @@ -615,8 +611,26 @@ void LP_dedicatedloop(void *arg) ep->sock = -1; break; } + if ( sitem->expiration != 0 ) + sitem->expiration += (uint32_t)time(NULL); + else sitem->expiration = (uint32_t)time(NULL) + ELECTRUM_TIMEOUT; //printf("SEND.(%s) to %s:%u\n",sitem->str,ep->ipaddr,ep->port); - queue_enqueue("pendingQ",&ep->pendingQ,(struct queueitem *)sitem); + //queue_enqueue("pendingQ",&ep->pendingQ,(struct queueitem *)sitem); + portable_mutex_lock(&ep->pendingQ.mutex); + if ( ep->pendingQ.list != 0 ) + { + DL_FOREACH(ep->pendingQ.list,item) + { + if ( item->type == 0xffffffff ) + { + printf("purge %s\n",((struct stritem *)item)->str); + DL_DELETE(ep->pendingQ.list,item); + free(item); + } + } + } + DL_APPEND(ep->pendingQ.list,&sitem->DL); + portable_mutex_unlock(&ep->pendingQ.mutex); flag++; } if ( flag == 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 61a9cc872..c91ba0f53 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -642,6 +642,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) HASH_ADD_KEYPTR(hh2,LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); + if ( coin->electrum == 0 ) + { + LP_address_utxoadd(coin,coinaddr,txid,vout,value); + LP_address_utxoadd(coin,coinaddr,txid2,vout2,value2); + } if ( iambob != 0 ) { if ( LP_mypeer != 0 ) From 55234beabcd65dd3ca352503511d07102c89c535 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 21:48:27 +0200 Subject: [PATCH 0180/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1a73ac60c..658f1f0d0 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -623,7 +623,7 @@ void LP_dedicatedloop(void *arg) { if ( item->type == 0xffffffff ) { - printf("purge %s\n",((struct stritem *)item)->str); + printf("purge %s",((struct stritem *)item)->str); DL_DELETE(ep->pendingQ.list,item); free(item); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c91ba0f53..7c6a7431a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -817,7 +817,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,targetval,value,total = 0; + char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; if ( coin == 0 ) { printf("coin not active\n"); @@ -889,6 +889,8 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( iambob == 0 ) targetval = (depositval / 776) + txfee; else targetval = (depositval / 9) * 8 - 2*txfee; + if ( targetval < txfee*2 ) + targetval = txfee*2 printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; From d2bb5c0a602538f0aabee4b3417ed0d1b8814ec4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 21:49:23 +0200 Subject: [PATCH 0181/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 658f1f0d0..d57a05c01 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -554,7 +554,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) stritem = (struct stritem *)item; if ( item->type == idnum ) { - printf("matched idnum.%d\n",idnum); + //printf("matched idnum.%d\n",idnum); item->type = 0xffffffff; if ( stritem->retptrp != 0 ) { From a7a4f6a4b5e5d4a2a9a897b3558609fd5963fad8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 21:51:03 +0200 Subject: [PATCH 0182/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7c6a7431a..7b463769a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -890,7 +890,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr targetval = (depositval / 776) + txfee; else targetval = (depositval / 9) * 8 - 2*txfee; if ( targetval < txfee*2 ) - targetval = txfee*2 + targetval = txfee*2; printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; From e4fb3c8f0028283156365ddd36bcba5cad023b94 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 22:31:56 +0200 Subject: [PATCH 0183/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7b463769a..6b03c3630 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -642,7 +642,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) HASH_ADD_KEYPTR(hh2,LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); - if ( coin->electrum == 0 ) + if ( 0 && coin->electrum == 0 ) { LP_address_utxoadd(coin,coinaddr,txid,vout,value); LP_address_utxoadd(coin,coinaddr,txid2,vout2,value2); From 1132b2548bfc6f92c3cfe18b73f38addfd9290d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 22:39:20 +0200 Subject: [PATCH 0184/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6b03c3630..0ccbac536 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -521,7 +521,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( (coin= LP_coinfind(symbol)) == 0 || (IAMLP == 0 && coin->inactive != 0) ) { - printf("LP_utxoadd reject inactive %s\n",symbol); + //printf("LP_utxoadd reject inactive %s\n",symbol); return(0); } txfee = LP_txfeecalc(coin,0); From 6acdc625b18f0824ebe4486c225ddb1a6084e916 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 22:39:58 +0200 Subject: [PATCH 0185/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2955f7a21..4fbf60738 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -924,7 +924,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) pubp->timestamp = (uint32_t)time(NULL); } else printf("error creating pubkey entry\n"); } - else if ( (rand() % 100) == 0 ) - printf("error finding %s/%s %.8f\n",base,rel,price); + //else if ( (rand() % 100) == 0 ) + // printf("error finding %s/%s %.8f\n",base,rel,price); } From 24ca2bb07d9b76441e39b7afe575e24141f66b46 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 23:01:35 +0200 Subject: [PATCH 0186/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7b463769a..830092313 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -642,7 +642,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) HASH_ADD_KEYPTR(hh2,LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); - if ( coin->electrum == 0 ) + if ( 0 && coin->electrum == 0 ) { LP_address_utxoadd(coin,coinaddr,txid,vout,value); LP_address_utxoadd(coin,coinaddr,txid2,vout2,value2); @@ -888,7 +888,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr values[i] = 0, used++; if ( iambob == 0 ) targetval = (depositval / 776) + txfee; - else targetval = (depositval / 9) * 8 - 2*txfee; + else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); From a89ef61df9990bed77a41ef4e320b81cfaba706a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Sep 2017 23:01:49 +0200 Subject: [PATCH 0187/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0ccbac536..2b7bfda5f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -888,7 +888,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr values[i] = 0, used++; if ( iambob == 0 ) targetval = (depositval / 776) + txfee; - else targetval = (depositval / 9) * 8 - 2*txfee; + else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); From 071f26939459ca888001bb5843bb699519d22763 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 11:43:27 +0200 Subject: [PATCH 0188/2732] Test --- iguana/exchanges/LP_socket.c | 99 +++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d57a05c01..04a6f05f8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -243,6 +243,7 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) struct electrum_info { queue_t sendQ,pendingQ; + cJSON *retjson; int32_t bufsize,sock,*heightp; uint32_t stratumid,lasttime,pending,*heighttimep; char ipaddr[64],symbol[16]; @@ -303,21 +304,27 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } +// overlapped execution not debugged cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback - char stratumreq[16384]; uint32_t expiration; struct stritem *sitem; cJSON *retjson = 0; - if ( strcmp(method,"getrawmempool") == 0 ) - { - retjson = cJSON_Parse("{\"error\":\"unsupported method\"}"); - if ( retjsonp != 0 ) - *retjsonp = retjson; - return(retjson); - } + char stratumreq[16384]; uint32_t expiration; struct stritem *sitem; if ( ep == 0 ) ep = electrum_server(symbol,0); if ( ep != 0 ) { + if ( ep->retjson != 0 ) + { + free_json(ep->retjson); + ep->retjson = 0; + } + if ( strcmp(method,"getrawmempool") == 0 ) + { + ep->retjson = cJSON_Parse("{\"error\":\"unsupported method\"}"); + if ( retjsonp != 0 ) + *retjsonp = ep->retjson; + return(ep->retjson); + } sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); ep->buf[0] = 0; sitem = (struct stritem *)queueitem(stratumreq); @@ -325,21 +332,21 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->DL.type = ep->stratumid++; if ( retjsonp != 0 ) sitem->retptrp = (void **)retjsonp; - else sitem->retptrp = (void **)&retjson; + else sitem->retptrp = (void **)&ep->retjson; queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - if ( sitem->retptrp == (void **)&retjson ) + if ( sitem->retptrp == (void **)&ep->retjson ) { expiration = (uint32_t)time(NULL) + timeout + 1; - while ( retjson == 0 && time(NULL) <= expiration ) + while ( ep->retjson == 0 && time(NULL) <= expiration ) usleep(10000); - if ( retjson == 0 ) + if ( ep->retjson == 0 ) { printf("unexpected timeout with null retjson: %s %s\n",method,params); - retjson = cJSON_Parse("{\"error\":\"timeout\"}"); + ep->retjson = cJSON_Parse("{\"error\":\"timeout\"}"); } } } else printf("couldnt find electrum server for (%s %s)\n",method,params); - return(retjson); + return(ep->retjson); } cJSON *electrum_noargs(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t timeout) @@ -542,45 +549,42 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) } } idnum = juint(strjson,"id"); - //if ( 0 ) // crashes cipi's node likely due to mutex across threads + portable_mutex_lock(&ep->pendingQ.mutex); + if ( ep->pendingQ.list != 0 ) { - portable_mutex_lock(&ep->pendingQ.mutex); - if ( ep->pendingQ.list != 0 ) + DL_FOREACH(ep->pendingQ.list,item) { - DL_FOREACH(ep->pendingQ.list,item) + if ( item->type == 0xffffffff ) + continue; + stritem = (struct stritem *)item; + if ( item->type == idnum ) { - if ( item->type == 0xffffffff ) - continue; - stritem = (struct stritem *)item; - if ( item->type == idnum ) + //printf("matched idnum.%d\n",idnum); + item->type = 0xffffffff; + if ( stritem->retptrp != 0 ) { - //printf("matched idnum.%d\n",idnum); - item->type = 0xffffffff; - if ( stritem->retptrp != 0 ) - { - *((cJSON **)stritem->retptrp) = strjson; - strjson = 0; - } - //DL_DELETE(ep->pendingQ.list,item); - break; + *((cJSON **)stritem->retptrp) = strjson; + strjson = 0; } - if ( stritem->expiration < ep->lasttime ) + //DL_DELETE(ep->pendingQ.list,item); + break; + } + if ( stritem->expiration < ep->lasttime ) + { + printf("expired (%s)\n",stritem->str); + item->type = 0xffffffff; + //DL_DELETE(ep->pendingQ.list,item); + if ( stritem->retptrp != 0 ) { - printf("expired (%s)\n",stritem->str); - item->type = 0xffffffff; - //DL_DELETE(ep->pendingQ.list,item); - if ( stritem->retptrp != 0 ) - { - errjson = cJSON_CreateObject(); - jaddnum(errjson,"id",item->type); - jaddstr(errjson,"error","timeout"); - *((cJSON **)stritem->retptrp) = errjson; - }; - } + errjson = cJSON_CreateObject(); + jaddnum(errjson,"id",item->type); + jaddstr(errjson,"error","timeout"); + *((cJSON **)stritem->retptrp) = errjson; + }; } } - portable_mutex_unlock(&ep->pendingQ.mutex); } + portable_mutex_unlock(&ep->pendingQ.mutex); if ( strjson != 0 ) free_json(strjson); } @@ -614,21 +618,22 @@ void LP_dedicatedloop(void *arg) if ( sitem->expiration != 0 ) sitem->expiration += (uint32_t)time(NULL); else sitem->expiration = (uint32_t)time(NULL) + ELECTRUM_TIMEOUT; - //printf("SEND.(%s) to %s:%u\n",sitem->str,ep->ipaddr,ep->port); - //queue_enqueue("pendingQ",&ep->pendingQ,(struct queueitem *)sitem); portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { + printf("list %p\n",ep->pendingQ.list); DL_FOREACH(ep->pendingQ.list,item) { + printf("item.%p\n",item); if ( item->type == 0xffffffff ) { - printf("purge %s",((struct stritem *)item)->str); + printf("%p purge %s",item,((struct stritem *)item)->str); DL_DELETE(ep->pendingQ.list,item); free(item); } } } + printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); DL_APPEND(ep->pendingQ.list,&sitem->DL); portable_mutex_unlock(&ep->pendingQ.mutex); flag++; From 93d7af62f2e0a0f9da60b7590deb4c609a4a374d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 11:52:00 +0200 Subject: [PATCH 0189/2732] Test --- iguana/exchanges/LP_socket.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 04a6f05f8..2aca4a128 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -313,11 +313,6 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch ep = electrum_server(symbol,0); if ( ep != 0 ) { - if ( ep->retjson != 0 ) - { - free_json(ep->retjson); - ep->retjson = 0; - } if ( strcmp(method,"getrawmempool") == 0 ) { ep->retjson = cJSON_Parse("{\"error\":\"unsupported method\"}"); From 52f2659276b4131165eb4dee4faf0cf4e8fbc5b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 12:13:45 +0200 Subject: [PATCH 0190/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_rpc.c | 20 ++++---- iguana/exchanges/LP_socket.c | 90 +++++++++++++++++------------------- 3 files changed, 54 insertions(+), 58 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2955f7a21..0a5e004f4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -109,7 +109,7 @@ void LP_address_monitor(struct LP_pubkeyinfo *pubp) portable_mutex_unlock(&coin->txmutex); if ( coin->electrum != 0 ) { - if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,0,coinaddr)) != 0 ) + if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) { printf("%s MONITOR.(%s)\n",coin->symbol,coinaddr); free_json(retjson); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index adcc19491..2f14a9d5b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -108,7 +108,7 @@ char *LP_apicall(struct iguana_info *coin,char *method,char *params) cJSON *retjson,*resultjson; if ( coin->electrum != 0 ) { - if ( (retjson= electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT)) != 0 ) + if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) { if ( (resultjson= jobj(retjson,"result")) != 0 ) { @@ -142,13 +142,15 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) } else { - retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT); - //printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); - if ( (resultjson= jobj(retjson,"result")) != 0 ) + if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) { - resultjson = jduplicate(resultjson); - free_json(retjson); - retjson = resultjson; + //printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); + if ( (resultjson= jobj(retjson,"result")) != 0 ) + { + resultjson = jduplicate(resultjson); + free_json(retjson); + retjson = resultjson; + } } } } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); @@ -295,7 +297,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); - if ( (listjson= electrum_address_listunspent(coin->symbol,0,0,coinaddr)) != 0 ) + if ( (listjson= electrum_address_listunspent(coin->symbol,0,&listjson,coinaddr)) != 0 ) { if ( (array= jarray(&n,listjson,"result")) != 0 ) { @@ -493,7 +495,7 @@ int32_t LP_importaddress(char *symbol,char *address) return(-2); if ( coin->electrum != 0 ) { - if ( (retjson= electrum_address_subscribe(symbol,0,0,address)) != 0 ) + if ( (retjson= electrum_address_subscribe(symbol,0,&retjson,address)) != 0 ) { printf("importaddress.(%s) -> %s\n",address,jprint(retjson,0)); free_json(retjson); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2aca4a128..86fdcf7cd 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 5 +#define ELECTRUM_TIMEOUT 3 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { @@ -243,7 +243,6 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) struct electrum_info { queue_t sendQ,pendingQ; - cJSON *retjson; int32_t bufsize,sock,*heightp; uint32_t stratumid,lasttime,pending,*heighttimep; char ipaddr[64],symbol[16]; @@ -254,7 +253,7 @@ int32_t Num_electrums; // purge timedout /* -if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) +if ( (retjson= electrum_address_listunspent(symbol,ep,&retjson,addr)) != 0 ) you can call it like the above, where symbol is the coin, ep is the electrum server info pointer, the 0 is a callback ptr where 0 means to block till it is done all the API calls have the same three args if the callback ptr is &retjson, then on completion it will put the cJSON *ptr into it, so to spawn a bunch of calls you need to call with symbol,ep,&retjsons[i],... @@ -304,56 +303,54 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } -// overlapped execution not debugged cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback char stratumreq[16384]; uint32_t expiration; struct stritem *sitem; if ( ep == 0 ) ep = electrum_server(symbol,0); - if ( ep != 0 ) + if ( ep != 0 && retjsonp != 0 ) { if ( strcmp(method,"getrawmempool") == 0 ) { - ep->retjson = cJSON_Parse("{\"error\":\"unsupported method\"}"); - if ( retjsonp != 0 ) - *retjsonp = ep->retjson; - return(ep->retjson); + *retjsonp = cJSON_Parse("{\"error\":\"unsupported method\"}"); + return(*retjsonp); } sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); ep->buf[0] = 0; sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; - if ( retjsonp != 0 ) - sitem->retptrp = (void **)retjsonp; - else sitem->retptrp = (void **)&ep->retjson; + sitem->retptrp = (void **)retjsonp; queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - if ( sitem->retptrp == (void **)&ep->retjson ) + expiration = (uint32_t)time(NULL) + timeout + 1; + while ( *retjsonp == 0 && time(NULL) <= expiration ) + usleep(10000); + if ( *retjsonp == 0 ) { - expiration = (uint32_t)time(NULL) + timeout + 1; - while ( ep->retjson == 0 && time(NULL) <= expiration ) - usleep(10000); - if ( ep->retjson == 0 ) - { - printf("unexpected timeout with null retjson: %s %s\n",method,params); - ep->retjson = cJSON_Parse("{\"error\":\"timeout\"}"); - } + printf("unexpected timeout with null retjson: %s %s\n",method,params); + *retjsonp = cJSON_Parse("{\"error\":\"timeout\"}"); } - } else printf("couldnt find electrum server for (%s %s)\n",method,params); - return(ep->retjson); + return(*retjsonp); + } else printf("couldnt find electrum server for (%s %s) or no retjsonp.%p\n",method,params,retjsonp); + return(0); } cJSON *electrum_noargs(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t timeout) { + cJSON *retjson; + if ( retjsonp == 0 ) + retjsonp = &retjson; return(electrum_submit(symbol,ep,retjsonp,method,"[]",timeout)); } cJSON *electrum_strarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *arg,int32_t timeout) { - char params[16384]; + char params[16384]; cJSON *retjson; if ( strlen(arg) < sizeof(params) ) { + if ( retjsonp == 0 ) + retjsonp = &retjson; sprintf(params,"[\"%s\"]",arg); return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } else return(0); @@ -361,14 +358,18 @@ cJSON *electrum_strarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch cJSON *electrum_intarg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,int32_t arg,int32_t timeout) { - char params[64]; + char params[64]; cJSON *retjson; + if ( retjsonp == 0 ) + retjsonp = &retjson; sprintf(params,"[\"%d\"]",arg); return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } cJSON *electrum_hasharg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,bits256 arg,int32_t timeout) { - char params[128],str[65]; + char params[128],str[65]; cJSON *retjson; + if ( retjsonp == 0 ) + retjsonp = &retjson; sprintf(params,"[\"%s\"]",bits256_str(str,arg)); return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } @@ -549,33 +550,25 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { DL_FOREACH(ep->pendingQ.list,item) { - if ( item->type == 0xffffffff ) - continue; stritem = (struct stritem *)item; if ( item->type == idnum ) { + DL_DELETE(ep->pendingQ.list,item); //printf("matched idnum.%d\n",idnum); - item->type = 0xffffffff; - if ( stritem->retptrp != 0 ) - { - *((cJSON **)stritem->retptrp) = strjson; - strjson = 0; - } - //DL_DELETE(ep->pendingQ.list,item); + *((cJSON **)stritem->retptrp) = strjson; + strjson = 0; + free(item); break; } if ( stritem->expiration < ep->lasttime ) { + DL_DELETE(ep->pendingQ.list,item); printf("expired (%s)\n",stritem->str); - item->type = 0xffffffff; - //DL_DELETE(ep->pendingQ.list,item); - if ( stritem->retptrp != 0 ) - { - errjson = cJSON_CreateObject(); - jaddnum(errjson,"id",item->type); - jaddstr(errjson,"error","timeout"); - *((cJSON **)stritem->retptrp) = errjson; - }; + errjson = cJSON_CreateObject(); + jaddnum(errjson,"id",item->type); + jaddstr(errjson,"error","timeout"); + *((cJSON **)stritem->retptrp) = errjson; + free(item); } } } @@ -588,7 +581,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { - struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct queueitem *item = 0; struct electrum_info *ep = arg; + struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 ) @@ -613,7 +606,7 @@ void LP_dedicatedloop(void *arg) if ( sitem->expiration != 0 ) sitem->expiration += (uint32_t)time(NULL); else sitem->expiration = (uint32_t)time(NULL) + ELECTRUM_TIMEOUT; - portable_mutex_lock(&ep->pendingQ.mutex); + /*portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { printf("list %p\n",ep->pendingQ.list); @@ -628,9 +621,10 @@ void LP_dedicatedloop(void *arg) } } } - printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); DL_APPEND(ep->pendingQ.list,&sitem->DL); - portable_mutex_unlock(&ep->pendingQ.mutex); + portable_mutex_unlock(&ep->pendingQ.mutex);*/ + printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); + queue_enqueue("pendingQ",&ep->pendingQ,&sitem->DL); flag++; } if ( flag == 0 ) From 9813ff2a59148e523e1e3f03567ec43f04ba1c19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 12:19:06 +0200 Subject: [PATCH 0191/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0a5e004f4..0d2cbf037 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -111,7 +111,7 @@ void LP_address_monitor(struct LP_pubkeyinfo *pubp) { if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) { - printf("%s MONITOR.(%s)\n",coin->symbol,coinaddr); + printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); free_json(retjson); } } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 86fdcf7cd..9e4bac00c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - //printf("result.(%s)\n",jprint(resultjson,0)); + printf("result.(%s)\n",jprint(resultjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) @@ -553,8 +553,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) stritem = (struct stritem *)item; if ( item->type == idnum ) { + printf("matched idnum.%d\n",idnum); DL_DELETE(ep->pendingQ.list,item); - //printf("matched idnum.%d\n",idnum); *((cJSON **)stritem->retptrp) = strjson; strjson = 0; free(item); From da6d515c504b0b656f0920349df6f48343c330c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 12:28:28 +0200 Subject: [PATCH 0192/2732] Test --- iguana/exchanges/LP_rpc.c | 7 ++++--- iguana/exchanges/LP_socket.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2f14a9d5b..cc9675953 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,16 +105,17 @@ char *issue_LP_getprices(char *destip,uint16_t destport) char *LP_apicall(struct iguana_info *coin,char *method,char *params) { - cJSON *retjson,*resultjson; + cJSON *retjson,*resultjson; char *retstr; if ( coin->electrum != 0 ) { if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) { + printf("got.%p (%s)\n",retjson,jprint(retjson,0)); if ( (resultjson= jobj(retjson,"result")) != 0 ) { - resultjson = jduplicate(resultjson); + retstr = jprint(resultjson,0); free_json(retjson); - return(jprint(resultjson,1)); + return(retstr); } else return(jprint(retjson,1)); } return(clonestr("{\"error\":\"electrum no response\"}")); } else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9e4bac00c..3dee1e185 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -553,10 +553,10 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) stritem = (struct stritem *)item; if ( item->type == idnum ) { - printf("matched idnum.%d\n",idnum); + printf("matched idnum.%d result.%p\n",idnum,resultjson); DL_DELETE(ep->pendingQ.list,item); - *((cJSON **)stritem->retptrp) = strjson; - strjson = 0; + *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : strjson); + resultjson = strjson = 0; free(item); break; } From 735854cf384e89bd90af9f64aaed1d2b5fc98f64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 12:31:58 +0200 Subject: [PATCH 0193/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_socket.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0d2cbf037..699e3e8b4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -111,7 +111,7 @@ void LP_address_monitor(struct LP_pubkeyinfo *pubp) { if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) { - printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); + printf("%s MONITOR.(%s) -> %p\n",coin->symbol,coinaddr,retjson); free_json(retjson); } } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3dee1e185..8b3bbe0b3 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -311,6 +311,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch ep = electrum_server(symbol,0); if ( ep != 0 && retjsonp != 0 ) { + *retjsonp = 0; if ( strcmp(method,"getrawmempool") == 0 ) { *retjsonp = cJSON_Parse("{\"error\":\"unsupported method\"}"); From 4d13ab5c1311b8d58394cc4bd3f4960065d3cba9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 12:42:56 +0200 Subject: [PATCH 0194/2732] Test --- iguana/exchanges/LP_rpc.c | 18 +++++++----------- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cc9675953..a1ef113ff 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,25 +105,21 @@ char *issue_LP_getprices(char *destip,uint16_t destport) char *LP_apicall(struct iguana_info *coin,char *method,char *params) { - cJSON *retjson,*resultjson; char *retstr; + cJSON *retjson; char *retstr; if ( coin->electrum != 0 ) { if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) { - printf("got.%p (%s)\n",retjson,jprint(retjson,0)); - if ( (resultjson= jobj(retjson,"result")) != 0 ) - { - retstr = jprint(resultjson,0); - free_json(retjson); - return(retstr); - } else return(jprint(retjson,1)); + retstr = jprint(retjson,0); + //printf("got.%p (%s)\n",retjson,retstr); + return(retstr); } return(clonestr("{\"error\":\"electrum no response\"}")); } else return(bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params)); } cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { - cJSON *resultjson,*retjson = 0; char *retstr; + cJSON *retjson = 0; char *retstr; // "getinfo", "getrawmempool", "paxprice", "gettxout", "getrawtransaction", "getblock", "listunspent", "listtransactions", "validateaddress", "importprivkey" // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" if ( coin != 0 ) @@ -146,12 +142,12 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) { //printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); - if ( (resultjson= jobj(retjson,"result")) != 0 ) + /*if ( (resultjson= jobj(retjson,"result")) != 0 ) { resultjson = jduplicate(resultjson); free_json(retjson); retjson = resultjson; - } + }*/ } } } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8b3bbe0b3..4637ca3fb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -523,7 +523,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("result.(%s)\n",jprint(resultjson,0)); + printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From be91ecf1d27ca0956f8ae745caf1ad3874a52440 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 12:49:25 +0200 Subject: [PATCH 0195/2732] Test --- iguana/exchanges/LP_rpc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a1ef113ff..a938c66d8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -270,7 +270,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -284,6 +284,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { + printf("hexobj.(%s)\n",jprint(hexobj,0)); hexstr = jprint(hexobj,1); if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) hexstr[strlen(hexstr)-1] = 0; @@ -293,10 +294,11 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) serialized = malloc(len); decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); - //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); - if ( (listjson= electrum_address_listunspent(coin->symbol,0,&listjson,coinaddr)) != 0 ) + printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); + if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) { - if ( (array= jarray(&n,listjson,"result")) != 0 ) + printf("array.(%s)\n",jprint(array,0)); + if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; i Date: Thu, 14 Sep 2017 12:53:14 +0200 Subject: [PATCH 0196/2732] Test --- iguana/exchanges/LP_rpc.c | 5 ++--- iguana/exchanges/LP_socket.c | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a938c66d8..50addb5df 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -284,7 +284,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { - printf("hexobj.(%s)\n",jprint(hexobj,0)); hexstr = jprint(hexobj,1); if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) hexstr[strlen(hexstr)-1] = 0; @@ -294,10 +293,10 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) serialized = malloc(len); decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); - printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); + //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) { - printf("array.(%s)\n",jprint(array,0)); + //printf("array.(%s)\n",jprint(array,0)); if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; itype == idnum ) { - printf("matched idnum.%d result.%p\n",idnum,resultjson); + //printf("matched idnum.%d result.%p\n",idnum,resultjson); DL_DELETE(ep->pendingQ.list,item); *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : strjson); resultjson = strjson = 0; @@ -624,7 +624,7 @@ void LP_dedicatedloop(void *arg) } DL_APPEND(ep->pendingQ.list,&sitem->DL); portable_mutex_unlock(&ep->pendingQ.mutex);*/ - printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); + //printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); queue_enqueue("pendingQ",&ep->pendingQ,&sitem->DL); flag++; } From 78c704bb97f9f5cf2ecb592fedfaeadb91d109c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:04:49 +0200 Subject: [PATCH 0197/2732] Test --- iguana/exchanges/LP_coins.c | 1 + iguana/exchanges/LP_include.h | 9 +- iguana/exchanges/LP_ordermatch.c | 4 +- iguana/exchanges/LP_remember.c | 4 +- iguana/exchanges/LP_rpc.c | 338 +++++++++++++++++++----------- iguana/exchanges/LP_scan.c | 78 +++---- iguana/exchanges/LP_socket.c | 75 ++++++- iguana/exchanges/LP_swap.c | 10 +- iguana/exchanges/LP_transaction.c | 97 +-------- iguana/exchanges/LP_utxos.c | 23 +- 10 files changed, 359 insertions(+), 280 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index a5fd82434..be84416ad 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -265,6 +265,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->wiftype = wiftype; coin->inactive = (uint32_t)time(NULL); coin->bussock = LP_coinbus(busport); + coin->ctx = bitcoin_ctx(); if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 9a21b5392..61b159db7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -172,7 +172,7 @@ struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvi struct LP_transaction { UT_hash_handle hh; - bits256 txid; int32_t height,numvouts,numvins; uint32_t timestamp; + bits256 txid; int32_t height,numvouts,numvins; //uint32_t timestamp; struct LP_outpoint outpoints[]; }; @@ -187,7 +187,7 @@ struct iguana_info char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; - void *electrum; + void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33]; }; @@ -297,6 +297,11 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); +int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); +int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration); +struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); +int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); +int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); #endif diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 052459d33..b0a7bc083 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -244,12 +244,12 @@ char *LP_postedprice(cJSON *argjson) int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp) { int32_t selector,spendvini; bits256 spendtxid; - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->srccoin,qp->txid,qp->vout,qp->txid2,qp->vout2)) >= 0 ) + if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->srccoin,qp->coinaddr,qp->txid,qp->vout,qp->txid2,qp->vout2)) >= 0 ) { char str[65]; printf("LP_tradecommand selector.%d in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); return(-1); } - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->destcoin,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) >= 0 ) + if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) >= 0 ) { char str[65]; printf("LP_tradecommand dest selector.%d in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); return(-1); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 373d11ca1..1abeca945 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -584,9 +584,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } else { - struct iguana_info *coin; int32_t ht = -1; uint32_t locktime,blocktime; + struct iguana_info *coin; int32_t ht = -1; checktxid = jbits256(sentobj,"txid"); - if ( (coin= LP_coinfind(symbol)) != 0 && (ht= LP_txheight(&locktime,&blocktime,coin,txid)) > 0 && ht > 0 ) + if ( (coin= LP_coinfind(symbol)) != 0 && (ht= LP_txheight(coin,txid)) > 0 && ht > 0 ) { if ( coin->firstrefht == 0 || ht < coin->firstrefht ) coin->firstrefht = ht; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 50addb5df..065414f1d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -212,12 +212,14 @@ int32_t LP_getheight(struct iguana_info *coin) return(height); } -cJSON *LP_getmempool(char *symbol) +cJSON *LP_getmempool(char *symbol,char *coinaddr) { - struct iguana_info *coin = LP_coinfind(symbol); - if ( coin == 0 ) - return(cJSON_Parse("{\"error\":\"no coin\"}")); - return(bitcoin_json(coin,"getrawmempool","[]")); + cJSON *array; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 || (coin->electrum != 0 && coinaddr == 0) ) + return(cJSON_Parse("{\"error\":\"no native coin\"}")); + if ( coin->electrum == 0 ) + return(bitcoin_json(coin,"getrawmempool","[]")); + else return(electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)); } cJSON *LP_paxprice(char *fiat) @@ -349,45 +351,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) } } -cJSON *LP_getblock(char *symbol,bits256 txid) -{ - char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin == 0 ) - return(cJSON_Parse("{\"error\":\"no coin\"}")); - sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - return(bitcoin_json(coin,"getblock",buf)); -} - -int32_t LP_txheight(uint32_t *timestampp,uint32_t *blocktimep,struct iguana_info *coin,bits256 txid) -{ - bits256 blockhash; cJSON *blockobj,*txobj; int32_t height = 0; - if ( coin == 0 ) - return(-1); - if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) - { - *timestampp = juint(txobj,"locktime"); - *blocktimep = juint(txobj,"blocktime"); - blockhash = jbits256(txobj,"blockhash"); - if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) - { - height = jint(blockobj,"height"); - //printf("%s LP_txheight.%d\n",coin->symbol,height); - free_json(blockobj); - } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); - free_json(txobj); - } - return(height); -} - -cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) -{ - char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin == 0 ) - return(cJSON_Parse("{\"error\":\"no coin\"}")); - sprintf(buf,"[\"%s\"]",blockhashstr); - return(bitcoin_json(coin,"getblock",buf)); -} - cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); @@ -397,19 +360,10 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) { sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); return(bitcoin_json(coin,"listunspent",buf)); - } - else - { - sprintf(buf,"[\"%s\"]",coinaddr); - if ( (retjson= bitcoin_json(coin,"blockchain.address.listunspent",buf)) != 0 ) - { - //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); - } - return(retjson); - } + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)); } -cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) +/*cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); if ( coin == 0 ) @@ -418,7 +372,7 @@ cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t ski count = 100; sprintf(buf,"[\"%s\", %d, %d, true]",coinaddr,count,skip); return(bitcoin_json(coin,"listtransactions",buf)); -} +}*/ cJSON *LP_validateaddress(char *symbol,char *address) { @@ -493,33 +447,36 @@ int32_t LP_importaddress(char *symbol,char *address) return(-2); if ( coin->electrum != 0 ) { - if ( (retjson= electrum_address_subscribe(symbol,0,&retjson,address)) != 0 ) + if ( (retjson= electrum_address_subscribe(symbol,coin->electrum,&retjson,address)) != 0 ) { printf("importaddress.(%s) -> %s\n",address,jprint(retjson,0)); free_json(retjson); } return(0); } - if ( (validatejson= LP_validateaddress(symbol,address)) != 0 ) + else { - if ( (isvalid= is_cJSON_True(jobj(validatejson,"isvalid")) != 0) != 0 ) + if ( (validatejson= LP_validateaddress(symbol,address)) != 0 ) { - if ( is_cJSON_True(jobj(validatejson,"iswatchonly")) != 0 || is_cJSON_True(jobj(validatejson,"ismine")) != 0 ) - doneflag = 1; + if ( (isvalid= is_cJSON_True(jobj(validatejson,"isvalid")) != 0) != 0 ) + { + if ( is_cJSON_True(jobj(validatejson,"iswatchonly")) != 0 || is_cJSON_True(jobj(validatejson,"ismine")) != 0 ) + doneflag = 1; + } + free_json(validatejson); } - free_json(validatejson); + if ( isvalid == 0 ) + return(-1); + if ( doneflag != 0 ) + return(0); // success + sprintf(buf,"[\"%s\", \"%s\", false]",address,address); + if ( (retstr= bitcoind_passthru(symbol,coin->serverport,coin->userpass,"importaddress",buf)) != 0 ) + { + //printf("importaddress.(%s %s) -> (%s)\n",symbol,address,retstr); + free(retstr); + } //else printf("importaddress.(%s %s)\n",symbol,address); + return(1); } - if ( isvalid == 0 ) - return(-1); - if ( doneflag != 0 ) - return(0); // success - sprintf(buf,"[\"%s\", \"%s\", false]",address,address); - if ( (retstr= bitcoind_passthru(symbol,coin->serverport,coin->userpass,"importaddress",buf)) != 0 ) - { - //printf("importaddress.(%s %s) -> (%s)\n",symbol,address,retstr); - free(retstr); - } //else printf("importaddress.(%s %s)\n",symbol,address); - return(1); } double LP_getestimatedrate(struct iguana_info *coin) @@ -550,71 +507,43 @@ double LP_getestimatedrate(struct iguana_info *coin) return(SATOSHIDEN * rate); } -uint64_t LP_txfee(char *symbol) -{ - uint64_t txfee = 0; - if ( strcmp(symbol,"BTC") != 0 ) - txfee = LP_MIN_TXFEE; - return(txfee); -} - -char *LP_blockhashstr(char *symbol,int32_t height) +char *LP_sendrawtransaction(char *symbol,char *signedtx) { - cJSON *array; char *paramstr,*retstr; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *array; char *paramstr,*tmpstr,*retstr=0; int32_t n; cJSON *retjson; struct iguana_info *coin; + coin = LP_coinfind(symbol); if ( coin == 0 ) return(0); - array = cJSON_CreateArray(); - jaddinum(array,height); - paramstr = jprint(array,1); - retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"getblockhash",paramstr); - free(paramstr); - return(retstr); -} - -cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t height) -{ - cJSON *json = 0; int32_t flag = 0; - if ( blockhashstr == 0 ) - blockhashstr = LP_blockhashstr(symbol,height), flag = 1; - if ( blockhashstr != 0 ) + if ( coin->electrum == 0 ) { - if ( (json= LP_getblockhashstr(symbol,blockhashstr)) != 0 ) + array = cJSON_CreateArray(); + jaddistr(array,signedtx); + paramstr = jprint(array,1); + retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"sendrawtransaction",paramstr); + //printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr); + free(paramstr); + } + else + { + if ( (retjson= electrum_sendrawtransaction(symbol,coin->electrum,&retjson,signedtx)) != 0 ) { - if ( *heightp != 0 ) + retstr = jprint(retjson,1); + printf("electrum sendrawtx.(%s) -> %s\n",signedtx,retstr); + n = (int32_t)strlen(retstr); + if ( retstr[0] == '"' && retstr[n-1] == '"' ) { - *heightp = juint(json,"height"); - if ( height >= 0 && *heightp != height ) - { - printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); - *heightp = -1; - free_json(json); - json = 0; - } + retstr[n-1] = 0; + tmpstr = clonestr(retstr+1); + free(retstr); + retstr = tmpstr; } } - if ( flag != 0 && blockhashstr != 0 ) - free(blockhashstr); } - return(json); -} - -char *LP_sendrawtransaction(char *symbol,char *signedtx) -{ - cJSON *array; char *paramstr,*retstr; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin == 0 ) - return(0); - array = cJSON_CreateArray(); - jaddistr(array,signedtx); - paramstr = jprint(array,1); - retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"sendrawtransaction",paramstr); - //printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr); - free(paramstr); return(retstr); } char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON *vins,char *rawtx,cJSON *privkeys,struct vin_info *V) { - cJSON *array,*json; int32_t len; uint8_t *data; char *paramstr,*retstr,*hexstr,*signedtx=0; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *array,*json,*retjson; int32_t len; uint8_t *data; char str[65],*paramstr,*retstr,*hexstr,*signedtx=0; struct iguana_msgtx msgtx; struct iguana_info *coin = LP_coinfind(symbol); memset(signedtxidp,0,sizeof(*signedtxidp)); *completedp = 0; if ( coin == 0 ) @@ -622,6 +551,32 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * printf("LP_signrawtx cant find coin.(%s)\n",symbol); return(0); } + //int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) + memset(&msgtx,0,sizeof(msgtx)); + signedtx = 0; + memset(signedtxidp,0,sizeof(*signedtxidp)); + //printf("locktime.%u sequenceid.%x rawtx.(%s) vins.(%s)\n",locktime,sequenceid,rawtxbytes,jprint(vins,0)); + if ( (*completedp= iguana_signrawtransaction(coin->ctx,symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,16,rawtx,vins,privkeys)) < 0 ) + //if ( (signedtx= LP_signrawtx(symbol,signedtxidp,&completed,vins,rawtxbytes,privkeys,V)) == 0 ) + printf("couldnt sign transaction.%s %s\n",rawtx,bits256_str(str,*signedtxidp)); + else if ( *completedp == 0 ) + { + printf("incomplete signing %s (%s)\n",rawtx,jprint(vins,0)); + if ( signedtx != 0 ) + free(signedtx), signedtx = 0; + } else printf("basilisk_swap_bobtxspend %s -> %s\n",rawtx,bits256_str(str,*signedtxidp)); + if ( signedtx == 0 ) + { + retjson = cJSON_CreateObject(); + jaddstr(retjson,"error","couldnt sign tx"); + jaddstr(retjson,"coin",coin->symbol); + jaddstr(retjson,"rawtx",rawtx); + jadd(retjson,"vins",vins); + jadd(retjson,"privkeys",privkeys); + return(jprint(retjson,1)); + } + return(signedtx); + array = cJSON_CreateArray(); jaddistr(array,rawtx); jaddi(array,jduplicate(vins)); @@ -643,7 +598,7 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * *signedtxidp = bits256_doublesha256(0,data,len >> 1); } //else - printf("%s signrawtransaction.(%s) params.(%s)\n",coin->symbol,retstr,paramstr); + printf("%s signrawtransaction.(%s) params.(%s)\n",coin->symbol,retstr,paramstr); free_json(json); } free(retstr); @@ -651,3 +606,136 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * free(paramstr); return(signedtx); } + +cJSON *LP_getblock(char *symbol,bits256 txid) +{ + char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 || coin->electrum != 0 ) + return(cJSON_Parse("{\"error\":\"no native coin\"}")); + sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); + return(bitcoin_json(coin,"getblock",buf)); +} + +int32_t LP_txheight(struct iguana_info *coin,bits256 txid) +{ + bits256 blockhash; struct LP_transaction *tx; cJSON *blockobj,*txobj; int32_t height = 0; + if ( coin == 0 ) + return(-1); + if ( coin->electrum == 0 ) + { + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) + { + //*timestampp = juint(txobj,"locktime"); + //*blocktimep = juint(txobj,"blocktime"); + blockhash = jbits256(txobj,"blockhash"); + if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) + { + height = jint(blockobj,"height"); + //printf("%s LP_txheight.%d\n",coin->symbol,height); + free_json(blockobj); + } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); + free_json(txobj); + } + } + else + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + height = tx->height; + } + return(height); +} + +int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) +{ + struct iguana_info *coin; int32_t ht,numconfirms = 100; + //#ifndef BASILISK_DISABLEWAITTX + cJSON *txobj; + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(-1); + if ( coin->electrum == 0 ) + { + numconfirms = -1; + if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + { + if ( coin->electrum == 0 ) + numconfirms = jint(txobj,"confirmations"); + else numconfirms = coin->height - jint(txobj,"height"); + free_json(txobj); + } + else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) + numconfirms = 0; + } + else + { + if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) + numconfirms = (coin->height - ht); + else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) + numconfirms = 0; + } + //#endif + return(numconfirms); +} + +// not in electrum path +uint64_t LP_txfee(char *symbol) +{ + uint64_t txfee = 0; + if ( strcmp(symbol,"BTC") != 0 ) + txfee = LP_MIN_TXFEE; + return(txfee); +} + +char *LP_blockhashstr(char *symbol,int32_t height) +{ + cJSON *array; char *paramstr,*retstr; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 || coin->electrum != 0 ) + return(0); + array = cJSON_CreateArray(); + jaddinum(array,height); + paramstr = jprint(array,1); + retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"getblockhash",paramstr); + free(paramstr); + return(retstr); +} + +cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) +{ + char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 || coin->electrum != 0 ) + return(cJSON_Parse("{\"error\":\"no native coin daemon\"}")); + sprintf(buf,"[\"%s\"]",blockhashstr); + return(bitcoin_json(coin,"getblock",buf)); +} + +cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t height) +{ + cJSON *json = 0; int32_t flag = 0; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin == 0 || coin->electrum != 0 ) + { + printf("unexpected electrum path for %s\n",symbol); + return(0); + } + if ( blockhashstr == 0 ) + blockhashstr = LP_blockhashstr(symbol,height), flag = 1; + if ( blockhashstr != 0 ) + { + if ( (json= LP_getblockhashstr(symbol,blockhashstr)) != 0 ) + { + if ( *heightp != 0 ) + { + *heightp = juint(json,"height"); + if ( height >= 0 && *heightp != height ) + { + printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); + *heightp = -1; + free_json(json); + json = 0; + } + } + } + if ( flag != 0 && blockhashstr != 0 ) + free(blockhashstr); + } + return(json); +} + diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 9cbadd53b..cbb383dfe 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -28,7 +28,7 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) return(tx); } -struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins,uint32_t timestamp) +struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins) { struct LP_transaction *tx; int32_t i; if ( (tx= LP_transactionfind(coin,txid)) == 0 ) @@ -42,7 +42,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i tx->height = height; tx->numvouts = numvouts; tx->numvins = numvins; - tx->timestamp = timestamp; + //tx->timestamp = timestamp; tx->txid = txid; portable_mutex_lock(&coin->txmutex); HASH_ADD_KEYPTR(hh,coin->transactions,tx->txid.bytes,sizeof(tx->txid),tx); @@ -53,7 +53,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) { - int32_t i,ht,num = 0; uint32_t timestamp,blocktime; struct LP_transaction *tx,*tmp; + int32_t i,ht,num = 0; struct LP_transaction *tx,*tmp; HASH_ITER(hh,coin->transactions,tx,tmp) { for (i=0; inumvouts; i++) @@ -62,7 +62,7 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) continue; if ( (ht= tx->outpoints[i].spendheight) == 0 ) { - tx->outpoints[i].spendheight = LP_txheight(×tamp,&blocktime,coin,tx->outpoints[i].spendtxid); + tx->outpoints[i].spendheight = LP_txheight(coin,tx->outpoints[i].spendtxid); } if ( (ht= tx->outpoints[i].spendheight) != 0 && ht > lastheight ) { @@ -109,16 +109,14 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { - struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; + struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { //printf("TX.(%s)\n",jprint(txobj,0)); - height = LP_txheight(×tamp,&blocktime,coin,txid); - if ( timestamp == 0 && height > 0 ) - timestamp = blocktime; + height = LP_txheight(coin,txid); vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); - if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins,timestamp)) != 0 ) + if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { for (i=0; iinactive != 0 ) + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 || coin->electrum != 0 ) return(-1); - if ( (array= LP_getmempool(symbol)) != 0 ) + if ( (array= LP_getmempool(symbol,0)) != 0 ) { if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { @@ -648,40 +646,46 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) return(-1); } -int32_t LP_numconfirms(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx,int32_t mempool) +int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration) { - struct iguana_info *coin; int32_t numconfirms = 100; -//#ifndef BASILISK_DISABLEWAITTX - cJSON *txobj; - if ( (coin= LP_coinfind(rawtx->coin->symbol)) == 0 || coin->inactive != 0 ) + struct iguana_info *coin; cJSON *array; uint32_t expiration,i,n; + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(-1); - numconfirms = -1; - if ( (txobj= LP_gettx(rawtx->coin->symbol,rawtx->I.signedtxid)) != 0 ) + expiration = (uint32_t)time(NULL) + duration; + while ( 1 ) { if ( coin->electrum == 0 ) - numconfirms = jint(txobj,"confirmations"); - else numconfirms = coin->height - jint(txobj,"height"); - free_json(txobj); - } - else if ( mempool != 0 && LP_mempoolscan(rawtx->coin->symbol,rawtx->I.signedtxid) >= 0 ) - numconfirms = 0; -//#endif - return(numconfirms); -} - -int32_t LP_waitmempool(char *symbol,bits256 txid,int32_t duration) -{ - uint32_t expiration = (uint32_t)time(NULL) + duration; - while ( time(NULL) < expiration ) - { - if ( LP_mempoolscan(symbol,txid) >= 0 ) - return(0); + { + if ( LP_mempoolscan(symbol,txid) >= 0 ) + return(0); + } + else + { + if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i coin->lastmempool+LP_MEMPOOL_TIMEINCR ) { - if ( (array= LP_getmempool(symbol)) != 0 ) + if ( (array= LP_getmempool(symbol,coinaddr)) != 0 ) { free_json(array); coin->lastmempool = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2630a2742..b0e04d5d6 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -244,6 +244,7 @@ struct electrum_info { queue_t sendQ,pendingQ; int32_t bufsize,sock,*heightp; + struct iguana_info *coin; uint32_t stratumid,lasttime,pending,*heighttimep; char ipaddr[64],symbol[16]; uint16_t port; @@ -303,6 +304,26 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } +void electrum_process_array(struct iguana_info *coin,cJSON *array) +{ + int32_t i,n; bits256 txid; cJSON *item; struct LP_transaction *tx; + if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; iheight <= 0 ) + tx->height = jint(item,"height"); + } + } +} + cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -390,11 +411,49 @@ cJSON *electrum_script_getmempool(char *symbol,struct electrum_info *ep,cJSON ** cJSON *electrum_script_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.listunspent",script,ELECTRUM_TIMEOUT)); } cJSON *electrum_script_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *script) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.scripthash.subscribe",script,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); } -cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)); } +cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) +{ + cJSON *retjson; + if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.subscribe",addr,ELECTRUM_TIMEOUT)) != 0 ) + { + printf("subscribe.(%s)\n",jprint(retjson,0)); + } + return(retjson); +} + +cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) +{ + cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT); + printf("history.(%s)\n",jprint(retjson,0)); + electrum_process_array(coin,retjson); + return(retjson); +} + +cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) +{ + cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT); + printf("MEMPOOL.(%s)\n",jprint(retjson,0)); + electrum_process_array(coin,retjson); + return(retjson); +} + +cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) +{ + cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) + { + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + electrum_process_array(coin,retjson); + } + return(retjson); +} + +cJSON *electrum_address_getbalance(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) +{ + return(electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_balance",addr,ELECTRUM_TIMEOUT)); +} cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *endpoint) { return(electrum_strarg(symbol,ep,retjsonp,"server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } @@ -502,6 +561,7 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); ep->port = port; ep->bufsize = bufsize; + ep->coin = LP_coinfind(symbol); ep->lasttime = (uint32_t)time(NULL); sprintf(name,"%s_%s_%u_electrum_sendQ",symbol,ipaddr,port); queue_enqueue(name,&ep->sendQ,queueitem(str)); @@ -535,6 +595,11 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) resultjson = jitem(paramsjson,i); } } + else if ( strcmp(method,"blockchain.address.subscribe") == 0 ) + { + printf("recv addr subscribe.(%s)\n",jprint(resultjson,0)); + electrum_process_array(ep->coin,resultjson); + } } if ( resultjson != 0 ) { diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index c4a95969e..0f1cbd6ae 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -635,7 +635,7 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 if ( suppress_swapsend == 0 ) { retval = LP_swapsend(pairsock,swap,msgbits,sendbuf,sendlen,nextbits,rawtx->I.crcs); - if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.signedtxid,LP_SWAPSTEP_TIMEOUT) < 0 ) + if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,LP_SWAPSTEP_TIMEOUT) < 0 ) { char str[65]; printf("failed to find %s %s in the mempool?\n",rawtx->name,bits256_str(str,rawtx->I.actualtxid)); retval = -1; @@ -731,7 +731,7 @@ void LP_bobloop(void *_swap) if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) m = 0; else m = 1; - while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < m ) // sync with alice + while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,1)) < m ) // sync with alice { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); @@ -784,7 +784,7 @@ void LP_aliceloop(void *_swap) if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) m = 0; else m = 1; - while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < m ) + while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,1)) < m ) { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); @@ -794,14 +794,14 @@ void LP_aliceloop(void *_swap) printf("error waiting for bobpayment\n"); else { - while ( (n= LP_numconfirms(swap,&swap->bobpayment,1)) < swap->I.bobconfirms ) + while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,1)) < swap->I.bobconfirms ) { char str[65];printf("%d waiting for bobpayment to be confirmed.%d %s %s\n",n,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); - while ( (n= LP_numconfirms(swap,&swap->alicespend,1)) < swap->I.aliceconfirms ) + while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,1)) < swap->I.aliceconfirms ) { char str[65];printf("%d waiting for alicespend to be confirmed.%d %s %s\n",n,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 1c77d9bdf..811303264 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -904,7 +904,7 @@ bits256 _LP_swap_spendtxid(char *symbol,char *destaddr,char *coinaddr,bits256 ut bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t vout) { - bits256 spendtxid,txid; char *catstr,*addr; cJSON *array,*item,*item2,*txobj,*vins; int32_t i,n,m,spendvin; char coinaddr[64],str[65]; + bits256 spendtxid; int32_t spendvin; char coinaddr[64],str[65]; // listtransactions or listspents destaddr[0] = 0; coinaddr[0] = 0; @@ -913,95 +913,6 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t v printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); return(spendtxid); //char str[65]; printf("swap %s spendtxid.(%s)\n",symbol,bits256_str(str,utxotxid)); - if ( (0) && strcmp("BTC",symbol) == 0 ) - { - //[{"type":"sent","confirmations":379,"height":275311,"timestamp":1492084664,"txid":"8703c5517bc57db38134058370a14e99b8e662b99ccefa2061dea311bbd02b8b","vout":0,"amount":117.50945263,"spendtxid":"cf2509e076fbb9b22514923df916b7aacb1391dce9c7e1460b74947077b12510","vin":0,"paid":{"type":"paid","txid":"cf2509e076fbb9b22514923df916b7aacb1391dce9c7e1460b74947077b12510","height":275663,"timestamp":1492106024,"vouts":[{"RUDpN6PEBsE7ZFbGjUxk1W3QVsxnjBLYw6":117.50935263}]}}] - /*LP_swap_getcoinaddr(symbol,coinaddr,utxotxid,vout); - if ( coinaddr[0] != 0 ) - spendtxid = _LP_swap_spendtxid(symbol,destaddr,coinaddr,utxotxid,vout);*/ - } - else - { - if ( (array= LP_listtransactions(symbol,destaddr,1000,0)) != 0 ) - { - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; i 0 ) - { - for (i=0; i jint(item,"vout") ) - { - item2 = jitem(vins,jint(item,"vout")); - if ( bits256_cmp(utxotxid,jbits256(item2,"txid")) == 0 && vout == jint(item2,"vout") ) - { - spendtxid = txid; - break; - } - } - } - } - } - if ( i == n ) - printf("dpowlist: native couldnt find spendtxid for %s\n",bits256_str(str,utxotxid)); - } - free_json(array); - } - if ( bits256_nonz(spendtxid) != 0 ) - return(spendtxid); - } - /*if ( iguana_isnotarychain(symbol) >= 0 ) - { - LP_swap_getcoinaddr(symbol,coinaddr,utxotxid,vout); - printf("fallback use DEX for native (%s) (%s)\n",coinaddr,bits256_str(str,utxotxid)); - if ( coinaddr[0] != 0 ) - { - spendtxid = _LP_swap_spendtxid(symbol,destaddr,coinaddr,utxotxid,vout); - printf("spendtxid.(%s)\n",bits256_str(str,spendtxid)); - } - }*/ - } - return(spendtxid); } int32_t basilisk_swap_bobredeemscript(int32_t depositflag,int32_t *secretstartp,uint8_t *redeemscript,uint32_t locktime,bits256 pubA0,bits256 pubB0,bits256 pubB1,bits256 privAm,bits256 privBn,uint8_t *secretAm,uint8_t *secretAm256,uint8_t *secretBn,uint8_t *secretBn256) @@ -1424,7 +1335,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->aliceclaim.txbytes[i]); printf(" <- aliceclaim\n");*/ //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.signedtxid,10)); + return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,10)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); } printf("error with bobdeposit\n"); @@ -1442,7 +1353,7 @@ int32_t LP_verify_alicepayment(struct basilisk_swap *swap,uint8_t *data,int32_t if ( bits256_nonz(swap->alicepayment.I.signedtxid) != 0 ) swap->aliceunconf = 1; basilisk_dontforget_update(swap,&swap->alicepayment); - return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.signedtxid,10)); + return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,10)); //printf("import alicepayment address.(%s)\n",swap->alicepayment.p2shaddr); //LP_importaddress(swap->alicecoin.symbol,swap->alicepayment.p2shaddr); return(0); @@ -1489,7 +1400,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->alicespend.txbytes[i]); printf(" <- alicespend\n\n");*/ swap->I.alicespent = 1; - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.signedtxid,10)); + return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,10)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->alicespend.I.suppress_pubkeys,swap->bobpayment.I.destaddr); } printf("error validating bobpayment\n"); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 830092313..c982368ac 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -513,7 +513,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { - uint64_t val,val2=0,tmpsatoshis,txfee; cJSON *txobj; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); @@ -542,7 +542,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } - numconfirms = -1; + /*numconfirms = -1; if ( (txobj= LP_gettx(symbol,txid)) != 0 ) { if ( coin->electrum == 0 ) @@ -550,11 +550,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit else numconfirms = coin->height - jint(txobj,"height"); free_json(txobj); } - if ( numconfirms <= 0 ) - { - printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); - return(0); - } numconfirms = -1; if ( (txobj= LP_gettx(symbol,txid2)) != 0 ) { @@ -564,6 +559,16 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit free_json(txobj); } if ( numconfirms <= 0 ) + { + printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); + return(0); + }*/ + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,0)) <= 0 ) + { + printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); + return(0); + } + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,0)) <= 0 ) { printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); @@ -631,7 +636,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; else utxo->T.sessionid = sessionid; - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,txid,vout,txid2,vout2)) >= 0 ) + if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,coinaddr,txid,vout,txid2,vout2)) >= 0 ) { printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); @@ -1041,7 +1046,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan userpub = curve25519(userpass,curve25519_basepoint9()); printf("userpass.(%s)\n",bits256_str(USERPASS,userpub)); } - if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) + if ( coin->electrum == 0 && (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) { if ( jobj(retjson,"error") != 0 ) { From f72da2275cacb8e6537ed169f0381fbbf561ab97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:13:13 +0200 Subject: [PATCH 0198/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_socket.c | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 61b159db7..1e74e9507 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -182,9 +182,9 @@ struct iguana_info portable_mutex_t txmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor; + uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; - char symbol[16],smartaddr[64],userpass[1024],serverport[128]; + char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; void *electrum; void *ctx; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b0e04d5d6..81387cbcc 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -319,7 +319,10 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) LP_transactioninit(coin,txid,1); } if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height <= 0 ) + { tx->height = jint(item,"height"); + char str[65]; printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); + } } } } @@ -441,11 +444,16 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { - cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); - if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) + cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); + if ( strcmp(coin->lastunspent,addr) == 0 && time(NULL) > coin->unspenttime+10 ) { - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,retjson); + strcpy(coin->lastunspent,addr); + if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) + { + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + electrum_process_array(coin,retjson); + } + coin->unspenttime = (uint32_t)time(NULL); } return(retjson); } @@ -461,7 +469,12 @@ cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } -cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); } + +cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) +{ + char str[65]; printf("%s TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); + return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); +} cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) { From 2105db826d9bb793153de3853ec2d64592aa410a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:16:22 +0200 Subject: [PATCH 0199/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 81387cbcc..a76cce032 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -447,13 +447,13 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); if ( strcmp(coin->lastunspent,addr) == 0 && time(NULL) > coin->unspenttime+10 ) { - strcpy(coin->lastunspent,addr); if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,retjson); + strcpy(coin->lastunspent,addr); + coin->unspenttime = (uint32_t)time(NULL); } - coin->unspenttime = (uint32_t)time(NULL); } return(retjson); } From a5dd4ce71e43a1f828c172eda8ab4f3c825d02f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:21:31 +0200 Subject: [PATCH 0200/2732] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 065414f1d..f80667c22 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -354,7 +354,8 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin == 0 ) + printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); + if ( coin == 0 || coin->inactive != 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin->electrum == 0 ) { From 6e20a23493a4f94c6d156bd07a0f1679a6e6d72f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:23:44 +0200 Subject: [PATCH 0201/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a76cce032..b7057fec9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -445,7 +445,8 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); - if ( strcmp(coin->lastunspent,addr) == 0 && time(NULL) > coin->unspenttime+10 ) + printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); + if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { From 6bb705ffd5bcfa5ab9f14f0db9623ee262319283 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:32:10 +0200 Subject: [PATCH 0202/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f80667c22..a1048157b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -354,7 +354,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); - printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); + //printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); if ( coin == 0 || coin->inactive != 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin->electrum == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b7057fec9..4f10a6386 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -445,7 +445,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); - printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); + //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c982368ac..07f4fa761 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -291,7 +291,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol //struct LP_utxoinfo *utxo; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; - if ( coin != 0 && ((IAMLP != 0 && coin->inactive != 0) || coin->electrum != 0) ) + if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) bypass = 1; if ( bypass != 0 ) val = satoshis; From 4283b1c56426e8aa02c46bb386970d3a8173f099 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:38:00 +0200 Subject: [PATCH 0203/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_scan.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a1048157b..ea918243a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -336,7 +336,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) jaddnum(sobj,"reqSigs",1); jaddstr(sobj,"type","pubkey"); jadd(sobj,"addresses",addresses); - jadd(retjson,"scriptPubkey",sobj); + jadd(retjson,"scriptPubKey",sobj); printf("GETTXOUT.(%s)\n",jprint(retjson,0)); break; } diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cbb383dfe..e3743e7e3 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -83,6 +83,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf destaddr[0] = 0; if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) { + // GETTXOUT.({"value":0.01200000,"txid":"6f5adfefad102e39f62a6bacb222ebace6ce5c084116c08a62cac1182729dd46","vout":1,"scriptPubkey":{"reqSigs":1,"type":"pubkey","addresses":["19Cq6MBaD8LY7trqs99ypqKAms3GcLs6J9"]}}) if ( (value= jdouble(txobj,"amount")*SATOSHIDEN) == 0 && (value= jdouble(txobj,"value")*SATOSHIDEN) == 0 ) { char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); From 5ec88a2e15653b28e3dd3cd79372d1fb03f7d904 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:45:43 +0200 Subject: [PATCH 0204/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_scan.c | 10 ++++++++-- iguana/exchanges/LP_transaction.c | 9 ++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index ea918243a..16901dae3 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -326,7 +326,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) "coinbase": false }*/ if ( value != j64bits(item,"value") ) - printf("value %llu != %llu\n",(long long)value,(long long)j64bits(item,"value")); + printf("LP_gettxout: value %llu != %llu\n",(long long)value,(long long)j64bits(item,"value")); jaddnum(retjson,"value",dstr(value)); jaddbits256(retjson,"txid",t); jaddnum(retjson,"vout",v); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index e3743e7e3..1dce3fee0 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -78,13 +78,18 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) { - uint64_t interest,value = 0; cJSON *txobj,*sobj,*array; int32_t n=0; + uint64_t interest,value = 0; double val; cJSON *txobj,*sobj,*array; int32_t n=0; *interestp = 0; destaddr[0] = 0; if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) { // GETTXOUT.({"value":0.01200000,"txid":"6f5adfefad102e39f62a6bacb222ebace6ce5c084116c08a62cac1182729dd46","vout":1,"scriptPubkey":{"reqSigs":1,"type":"pubkey","addresses":["19Cq6MBaD8LY7trqs99ypqKAms3GcLs6J9"]}}) - if ( (value= jdouble(txobj,"amount")*SATOSHIDEN) == 0 && (value= jdouble(txobj,"value")*SATOSHIDEN) == 0 ) + if ( (val= jdouble(txobj,"amount")) < SMALLVAL ) + val = jdouble(txobj,"value"); + if ( val > SMALLVAL ) + value = (val * SATOSHIDEN + 0.0000000049); + else value = 0; + if ( value == 0 ) { char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); } @@ -99,6 +104,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( (sobj= jobj(txobj,"scriptPubKey")) != 0 && (array= jarray(&n,sobj,"addresses")) != 0 ) { strcpy(destaddr,jstri(array,0)); + printf("set destaddr.(%s)\n",destaddr); if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 811303264..3cdafe59b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1073,7 +1073,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t v) { - cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; + cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; double val; int32_t n,m,suppress_pubkeys = 0; if ( valuep != 0 ) *valuep = 0; if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) @@ -1084,8 +1084,11 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u vout = jitem(vouts,v); if ( valuep != 0 ) { - if ( (*valuep= SATOSHIDEN * jdouble(vout,"value")) == 0 ) - *valuep= SATOSHIDEN * jdouble(vout,"amount"); + *valuep = 0; + if ( (val= jdouble(vout,"value")) < SMALLVAL ) + val = jdouble(vout,"amount"); + if ( val > SMALLVAL ) + *valuep = (val * SATOSHIDEN + 0.0000000049); } //printf("VOUT.(%s)\n",jprint(vout,0)); if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) From f69044fb3e7fdc2bd0288530458864e6e6ea770a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 16:53:53 +0200 Subject: [PATCH 0205/2732] Test --- iguana/exchanges/LP_scan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 1dce3fee0..f45cac18c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -587,8 +587,10 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) else { if ( coinaddr != 0 ) + { value = LP_txinterestvalue(&tx->outpoints[vout].interest,coinaddr,coin,txid,vout); - //printf("return value %.8f + interest %.8f\n",dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + } return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } } else printf("vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); @@ -601,7 +603,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( coinaddr == 0 ) coinaddr = _coinaddr; value = LP_txinterestvalue(&interest,coinaddr,coin,txid,vout); - //printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); + printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); return(value + interest); } From 5b8f784dd6e26368c2734b708d8c3f1d75bdd243 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 17:00:21 +0200 Subject: [PATCH 0206/2732] Test --- iguana/exchanges/LP_scan.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f45cac18c..cc975bfe7 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -575,6 +575,11 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) return(0); if ( coinaddr != 0 ) coinaddr[0] = 0; + if ( (tx= LP_transactionfind(coin,txid)) == 0 ) + { + LP_transactioninit(coin,txid,0); + LP_transactioninit(coin,txid,1); + } if ( (tx= LP_transactionfind(coin,txid)) != 0 ) { if ( vout < tx->numvouts ) @@ -588,23 +593,16 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( coinaddr != 0 ) { - value = LP_txinterestvalue(&tx->outpoints[vout].interest,coinaddr,coin,txid,vout); + if ( tx->outpoints[vout].coinaddr[0] == 0 ) + LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); + strcpy(coinaddr,tx->outpoints[vout].coinaddr); printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); } return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } } else printf("vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); } - if ( tx == 0 ) - { - LP_transactioninit(coin,txid,0); - LP_transactioninit(coin,txid,1); - } - if ( coinaddr == 0 ) - coinaddr = _coinaddr; - value = LP_txinterestvalue(&interest,coinaddr,coin,txid,vout); - printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); - return(value + interest); + return(0); } int32_t LP_spendsearch(bits256 *spendtxidp,int32_t *indp,char *symbol,bits256 searchtxid,int32_t searchvout) From 6ee62dff70455dcc43a1e1affa879a3aaae38947 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 17:18:18 +0200 Subject: [PATCH 0207/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cc975bfe7..e56fe0494 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -596,7 +596,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( tx->outpoints[vout].coinaddr[0] == 0 ) LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); strcpy(coinaddr,tx->outpoints[vout].coinaddr); - printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); } return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } From a21a5db225bce823f83b3159bbdd049f309832e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 17:21:48 +0200 Subject: [PATCH 0208/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_utxos.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index e56fe0494..892865da1 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -570,7 +570,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; char _coinaddr[64]; uint64_t interest = 0,value = 0; struct iguana_info *coin; + struct LP_transaction *tx; struct iguana_info *coin; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(0); if ( coinaddr != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 07f4fa761..cd2178d49 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -565,7 +565,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit }*/ if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,0)) <= 0 ) { - printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); + printf("LP_utxoadd reject numconfirms.%d %s.%s\n",numconfirms,symbol,bits256_str(str,txid)); return(0); } if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,0)) <= 0 ) @@ -871,9 +871,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - for (i=0; i= 0 ) { item = jitem(array,i); @@ -896,7 +896,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } if ( i >= 0 || (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { - printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); item = jitem(array,i); cmpflag = 0; if ( coin->electrum == 0 ) @@ -938,7 +938,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } else { - printf("call utxoadd\n"); + //printf("call utxoadd\n"); if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) { } From 9b1960fe3054afce4393903ab63408b849e2bbeb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 17:26:17 +0200 Subject: [PATCH 0209/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_utxos.c | 32 ++++++++++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 892865da1..ba1ce83c9 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -104,7 +104,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( (sobj= jobj(txobj,"scriptPubKey")) != 0 && (array= jarray(&n,sobj,"addresses")) != 0 ) { strcpy(destaddr,jstri(array,0)); - printf("set destaddr.(%s)\n",destaddr); + //printf("set destaddr.(%s)\n",destaddr); if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index cd2178d49..d9cde9716 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -537,11 +537,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("trying to add Alice utxo when not mine? %s/v%d\n",bits256_str(str,txid),vout); return(0); } - if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) - { - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); - return(0); - } /*numconfirms = -1; if ( (txobj= LP_gettx(symbol,txid)) != 0 ) { @@ -563,15 +558,28 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); }*/ - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,0)) <= 0 ) + if ( coin->inactive == 0 ) { - printf("LP_utxoadd reject numconfirms.%d %s.%s\n",numconfirms,symbol,bits256_str(str,txid)); - return(0); + if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) + { + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); + return(0); + } + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,0)) <= 0 ) + { + printf("LP_utxoadd reject numconfirms.%d %s.%s\n",numconfirms,symbol,bits256_str(str,txid)); + return(0); + } + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,0)) <= 0 ) + { + printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); + return(0); + } } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,0)) <= 0 ) + else { - printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); - return(0); + val = value; + val2 = value2; } if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); @@ -636,7 +644,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; else utxo->T.sessionid = sessionid; - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,coinaddr,txid,vout,txid2,vout2)) >= 0 ) + if ( coin->inactive == 0 && (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,coinaddr,txid,vout,txid2,vout2)) >= 0 ) { printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); From fc2066495ad0c9534f64577cd9ad8bcbc466a18c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 17:45:10 +0200 Subject: [PATCH 0210/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_swap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 4f10a6386..2671f79fc 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -437,7 +437,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * { cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT); - printf("MEMPOOL.(%s)\n",jprint(retjson,0)); + //printf("MEMPOOL.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,retjson); return(retjson); } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 0f1cbd6ae..0d7e47615 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -635,9 +635,9 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 if ( suppress_swapsend == 0 ) { retval = LP_swapsend(pairsock,swap,msgbits,sendbuf,sendlen,nextbits,rawtx->I.crcs); - if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,LP_SWAPSTEP_TIMEOUT) < 0 ) + if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,LP_SWAPSTEP_TIMEOUT*10) < 0 ) { - char str[65]; printf("failed to find %s %s in the mempool?\n",rawtx->name,bits256_str(str,rawtx->I.actualtxid)); + char str[65]; printf("failed to find %s %s %s in the mempool?\n",rawtx->name,rawtx->I.destaddr,bits256_str(str,rawtx->I.actualtxid)); retval = -1; } return(retval); From f435e264f3e049ef42be458846e72bb63d5eb328 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:13:29 +0200 Subject: [PATCH 0211/2732] Test --- iguana/exchanges/LP_scan.c | 14 +++++++++++--- iguana/exchanges/LP_socket.c | 5 +++-- iguana/exchanges/LP_swap.c | 10 +++++----- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index ba1ce83c9..41c7308ec 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -120,7 +120,9 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { //printf("TX.(%s)\n",jprint(txobj,0)); - height = LP_txheight(coin,txid); + if ( coin->electrum == 0 ) + height = LP_txheight(coin,txid); + else height = -1; vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) @@ -655,7 +657,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration) { - struct iguana_info *coin; cJSON *array; uint32_t expiration,i,n; + struct iguana_info *coin; struct LP_transaction *tx; cJSON *array,*item; uint32_t expiration,i,n; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(-1); expiration = (uint32_t)time(NULL) + duration; @@ -668,13 +670,19 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration } else { + if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height >= 0 ) + { + char str[65]; printf("LP_waitmempool found %s %s\n",symbol,bits256_str(str,txid)); + return(tx->height); + } if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; iheight <= 0 ) + if ( tx != 0 && tx->height <= 0 ) { tx->height = jint(item,"height"); char str[65]; printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 0d7e47615..5c024221c 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -716,11 +716,11 @@ void LP_bobloop(void *_swap) basilisk_bobdeposit_refund(swap,swap->I.putduration); //printf("depositlen.%d\n",swap->bobdeposit.I.datalen); LP_swapsfp_update(&swap->I.req); - if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_otherfee) < 0 ) + if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_otherfee) < 0 ) printf("error waiting for alicefee\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) == 0 ) printf("error sending bobdeposit\n"); - else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_alicepayment) < 0 ) + else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_alicepayment) < 0 ) printf("error waiting for alicepayment\n"); else { @@ -775,7 +775,7 @@ void LP_aliceloop(void *_swap) LP_swapsfp_update(&swap->I.req); if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x80,data,maxlen,&swap->myfee,0x40,0) == 0 ) printf("error sending alicefee\n"); - else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_bobdeposit) < 0 ) + else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_bobdeposit) < 0 ) printf("error waiting for bobdeposit\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x1000,data,maxlen,&swap->alicepayment,0x800,0) == 0 ) printf("error sending alicepayment\n"); @@ -787,10 +787,10 @@ void LP_aliceloop(void *_swap) while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,1)) < m ) { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); - sleep(LP_SWAPSTEP_TIMEOUT); + sleep(10); } swap->sentflag = 1; - if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_bobpayment) < 0 ) + if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_bobpayment) < 0 ) printf("error waiting for bobpayment\n"); else { From 991b58637196c1d1590125f073c46cc0d5c0ebe5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:32:31 +0200 Subject: [PATCH 0212/2732] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index d9cde9716..22d3db438 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -879,9 +879,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - //for (i=0; i= 0 ) { item = jitem(array,i); @@ -904,7 +904,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; From 99ddf09a5447e82353907c2f5ab6324ff76b8639 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:39:51 +0200 Subject: [PATCH 0213/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 22d3db438..1c7ec0ddc 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -385,7 +385,7 @@ int32_t LP_inventory_prevent(int32_t iambob,bits256 txid,int32_t vout) { //if ( utxo->T.spentflag != 0 ) { - //char str[65]; printf("prevent adding %s/v%d to inventory\n",bits256_str(str,txid),vout); + char str[65]; printf("prevent adding %s/v%d to inventory\n",bits256_str(str,txid),vout); return(1); } } From e2fccb2ee0237637bbd3660e3b83a6e545ee1ad3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:45:40 +0200 Subject: [PATCH 0214/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 1c7ec0ddc..c52bfc6e7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -779,7 +779,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) else myipaddr = "127.0.0.1"; HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) { - //char str[65]; printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); + char str[65]; printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); if ( LP_isunspent(utxo) != 0 && strcmp(symbol,utxo->coin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) > 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; @@ -793,7 +793,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) LP_utxo_clientpublish(utxo); jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } - //else printf("skip %s %d %d %d %d\n",bits256_str(str,utxo->pubkey),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); + else printf("skip %s %d %d %d %d\n",bits256_str(str,utxo->pubkey),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); } return(array); } From 93548b818ca1d381eba547c3f89bd6d4accfe7d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:49:39 +0200 Subject: [PATCH 0215/2732] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c52bfc6e7..83adff265 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -793,7 +793,8 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) LP_utxo_clientpublish(utxo); jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } - else printf("skip %s %d %d %d %d\n",bits256_str(str,utxo->pubkey),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); + else if ( LP_ismine(utxo) > 0 ) + printf("skip %s %s %d %d %d %d\n",utxo->coin,bits256_str(str,u.txid),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); } return(array); } From 7113bd84508ebec6c2b959c3c2bc6606bbf626f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:51:52 +0200 Subject: [PATCH 0216/2732] Test --- iguana/exchanges/LP_utxos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 83adff265..b33ae0bc6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -779,7 +779,8 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) else myipaddr = "127.0.0.1"; HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) { - char str[65]; printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); + char str[65]; + printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); if ( LP_isunspent(utxo) != 0 && strcmp(symbol,utxo->coin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) > 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; @@ -787,6 +788,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) { if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); + printf("ineligible %.8f %.8f\n",dstr(val),dstr(val2)); continue; } if ( iambob != 0 ) From b322b16f4c159210ab513a911f05c5d1696bb8d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:54:53 +0200 Subject: [PATCH 0217/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 536700a3e..2e39663f8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -447,7 +447,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) + //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b33ae0bc6..7fd9845f0 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -788,7 +788,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) { if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); - printf("ineligible %.8f %.8f\n",dstr(val),dstr(val2)); + printf("%s %s ineligible %.8f %.8f\n",utxo->coin,bits256_str(str,u.txid),dstr(val),dstr(val2)); continue; } if ( iambob != 0 ) From c941ed0b9bb1776ad5f13d9eb6814e869caf716b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 18:58:37 +0200 Subject: [PATCH 0218/2732] Test --- iguana/exchanges/LP_scan.c | 1 + iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 41c7308ec..24586897f 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -127,6 +127,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) vouts = jarray(&numvouts,txobj,"vout"); if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { + printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); for (i=0; icoin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) > 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; From e1977fc1904f40aafc7837baad23a9f4ce5e4e24 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:02:44 +0200 Subject: [PATCH 0219/2732] Test --- iguana/exchanges/LP_utxos.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index dbd1badbf..9b5e760e5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -385,7 +385,7 @@ int32_t LP_inventory_prevent(int32_t iambob,bits256 txid,int32_t vout) { //if ( utxo->T.spentflag != 0 ) { - char str[65]; printf("prevent adding %s/v%d to inventory\n",bits256_str(str,txid),vout); + char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); return(1); } } @@ -875,7 +875,12 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - } else used++; + } + else + { + printf("skip.(%s)\n",jprint(item,0)); + used++; + } } //printf("%.8f ",dstr(satoshis)); } From b2db5bbd4b07a7bbba0caf340b76f914bc6262b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:05:32 +0200 Subject: [PATCH 0220/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9b5e760e5..1fa9a1a7d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -878,7 +878,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } else { - printf("skip.(%s)\n",jprint(item,0)); + printf("skip.(%s) coinht.%d\n",jprint(item,0),coin->height); used++; } } From f8dc5b24e4e617c0752f2247670c23008ed98425 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:10:41 +0200 Subject: [PATCH 0221/2732] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 1fa9a1a7d..1f7a53aa6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -786,8 +786,8 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) u = (iambob != 0) ? utxo->deposit : utxo->fee; if ( LP_iseligible(&val,&val2,iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); + //if ( utxo->T.spentflag == 0 ) + // utxo->T.spentflag = (uint32_t)time(NULL); printf("%s %s ineligible %.8f %.8f\n",utxo->coin,bits256_str(str,u.txid),dstr(val),dstr(val2)); continue; } @@ -796,7 +796,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } else if ( LP_ismine(utxo) > 0 ) - printf("skip %s %s %d %d %d %d\n",utxo->coin,bits256_str(str,u.txid),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); + printf("skip %s %s %d %d %d %d\n",utxo->coin,bits256_str(str,utxo->payment.txid),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); } return(array); } From 9a2d38d9f42946020e69b9e618e95e1cea5d416c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:14:50 +0200 Subject: [PATCH 0222/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 1f7a53aa6..5ce06ba46 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -383,7 +383,7 @@ int32_t LP_inventory_prevent(int32_t iambob,bits256 txid,int32_t vout) struct LP_utxoinfo *utxo; if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 || (utxo= LP_utxo2find(iambob,txid,vout)) != 0 ) { - //if ( utxo->T.spentflag != 0 ) + if ( utxo->T.spentflag != 0 ) { char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); return(1); From 4c763f559080e5d97df3b5c51045d5d727e0b1d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:18:54 +0200 Subject: [PATCH 0223/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_utxos.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b0a7bc083..52d4f418d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -644,8 +644,8 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, else { printf("ineligible.(%.8f %.8f)\n",price,dstr(butxo->S.satoshis)); - if ( butxo->T.spentflag == 0 ) - butxo->T.spentflag = (uint32_t)time(NULL); + //if ( butxo->T.spentflag == 0 ) + // butxo->T.spentflag = (uint32_t)time(NULL); } } else diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5ce06ba46..d0c778cd1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -471,7 +471,7 @@ char *LP_spentcheck(cJSON *argjson) LP_mypeer->numutxos--; utxo->T.spentflag = (uint32_t)time(NULL); retval++; - //printf("indeed txid was spent\n"); + printf("indeed txid was spent\n"); } } } @@ -598,8 +598,8 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit char str[65],str2[65],str3[65],str4[65],str5[65],str6[65]; if ( utxo->T.spentflag != 0 || LP_txvalue(0,utxo->coin,utxo->payment.txid,utxo->payment.vout) < utxo->payment.value || LP_txvalue(0,utxo->coin,u.txid,u.vout) < u.value ) { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); + //if ( utxo->T.spentflag == 0 ) + // utxo->T.spentflag = (uint32_t)time(NULL); printf("original utxo pair not valid\n"); if ( dispflag != 0 ) printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(spendscript,utxo->spendscript) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); From e03fd632551a329fae73458e2cc234afd616bf6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:53:35 +0200 Subject: [PATCH 0224/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 699e3e8b4..0d2cbf037 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -111,7 +111,7 @@ void LP_address_monitor(struct LP_pubkeyinfo *pubp) { if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) { - printf("%s MONITOR.(%s) -> %p\n",coin->symbol,coinaddr,retjson); + printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); free_json(retjson); } } From 5f2b5f4c477bff9d24514e15229392713b9d5fa9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 19:55:19 +0200 Subject: [PATCH 0225/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2e39663f8..4cac73c10 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -598,7 +598,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - //printf("strjson.(%s)\n",jprint(strjson,0)); + printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 319110dcab1a24263bf3d58b6d43e33651214eba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:22:38 +0200 Subject: [PATCH 0226/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_utxos.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 24586897f..534c76548 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -127,7 +127,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) vouts = jarray(&numvouts,txobj,"vout"); if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { - printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); + //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); for (i=0; ioutpoints[vout].spendheight > 0 ) + utxo->T.spentflag = tx->outpoints[vout].spendheight; + else utxo->T.spentflag = 0; + } if ( utxo->T.spentflag != 0 ) { char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); From b68d0806024c3ef2a9167b806652700983c316fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:25:15 +0200 Subject: [PATCH 0227/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 79b64b2ee..900c7451d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -867,7 +867,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr satoshis = SATOSHIDEN * jdouble(item,"amount"); if ( satoshis == 0 ) satoshis = SATOSHIDEN * jdouble(item,"value"); - if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) + if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) { //printf("%s\n",jprint(item,0)); values[i] = satoshis; @@ -877,7 +877,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //{"value":1000000,"tx_hash":"4e4f818c53486c0576693b4cd379849e5ff95538b38e4100f48884073a4e7636","tx_pos":0,"height":484877} satoshis = j64bits(item,"value"); - if ( LP_inventory_prevent(iambob,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) + if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) { //printf("%s\n",jprint(item,0)); values[i] = satoshis; From afdfc2e13188cebda9d2ac766622cfb1317eda97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:29:11 +0200 Subject: [PATCH 0228/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 534c76548..7bd375d93 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -597,7 +597,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( coinaddr != 0 ) { if ( tx->outpoints[vout].coinaddr[0] == 0 ) - LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); + tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); strcpy(coinaddr,tx->outpoints[vout].coinaddr); //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); } From b441fdf0220eaf329d8987f1e69d2fc73f03c3fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:37:03 +0200 Subject: [PATCH 0229/2732] Test --- iguana/exchanges/LP_scan.c | 7 ++++--- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 7bd375d93..bef4b3ecd 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -582,8 +582,9 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { LP_transactioninit(coin,txid,0); LP_transactioninit(coin,txid,1); + tx = LP_transactionfind(coin,txid); } - if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + if ( tx != 0 ) { if ( vout < tx->numvouts ) { @@ -596,8 +597,8 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( coinaddr != 0 ) { - if ( tx->outpoints[vout].coinaddr[0] == 0 ) - tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); + //if ( tx->outpoints[vout].coinaddr[0] == 0 ) + // tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); strcpy(coinaddr,tx->outpoints[vout].coinaddr); //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 900c7451d..c0763b76e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -317,7 +317,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); + char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); /*for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) From e8271b72f8e256e94f0694b919b11674ef513a21 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:40:01 +0200 Subject: [PATCH 0230/2732] Test --- iguana/exchanges/LP_scan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index bef4b3ecd..4b669efa4 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -143,6 +143,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); + printf("(%s %.8f) ",address,dstr(tx->outpoints[i].value)); } else if ( tx->outpoints[i].value != 0 ) printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); } @@ -150,6 +151,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); } } + printf("numvouts.%d\n",numvouts); } if ( iter == 1 && vins != 0 ) { From f7b059addc010997eee9e2e1bc0d281b68eadeec Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:51:52 +0200 Subject: [PATCH 0231/2732] Test --- iguana/exchanges/LP_socket.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 4cac73c10..54116d0df 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -306,7 +306,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) void electrum_process_array(struct iguana_info *coin,cJSON *array) { - int32_t i,n; bits256 txid; cJSON *item; struct LP_transaction *tx; + int32_t i,v,n; char str[65]; uint64_t value; bits256 txid; cJSON *item; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; iheight <= 0 ) + if ( tx != 0 ) { - tx->height = jint(item,"height"); - char str[65]; printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); + if (tx->height <= 0 ) + { + tx->height = jint(item,"height"); + printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); + } + if ( (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts ) + { + value = j64bits(item,"value"); + if ( value != tx->outpoints[v].value ) + { + printf(">>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); + tx->outpoints[v].value = value; + } + } } } } From f142f310c5bde3eda40ac67a50567119ca29f835 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:59:11 +0200 Subject: [PATCH 0232/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 54116d0df..282e85b9e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -335,6 +335,7 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) tx->outpoints[v].value = value; } } + printf("v.%d numvouts.%d %.8f\n",v,tx->numvouts,dstr(tx->outpoints[v].value)); } } } From a6aede751cdfb6f1f0dbfcec7005bcf7fabf5697 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:01:59 +0200 Subject: [PATCH 0233/2732] Test --- iguana/exchanges/LP_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 282e85b9e..62aa7315f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -326,7 +326,7 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) tx->height = jint(item,"height"); printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); } - if ( (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts ) + if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts ) { value = j64bits(item,"value"); if ( value != tx->outpoints[v].value ) @@ -335,7 +335,6 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) tx->outpoints[v].value = value; } } - printf("v.%d numvouts.%d %.8f\n",v,tx->numvouts,dstr(tx->outpoints[v].value)); } } } From 10492ffd443366b532c9c8b7521511c17888559b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:03:38 +0200 Subject: [PATCH 0234/2732] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 4b669efa4..12c2c6c74 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -143,7 +143,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - printf("(%s %.8f) ",address,dstr(tx->outpoints[i].value)); + //printf("(%s %.8f) ",address,dstr(tx->outpoints[i].value)); } else if ( tx->outpoints[i].value != 0 ) printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); } @@ -151,7 +151,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); } } - printf("numvouts.%d\n",numvouts); + //printf("numvouts.%d\n",numvouts); } if ( iter == 1 && vins != 0 ) { From 0f502937614e99443f0b8b0a2bc2b51c9159dd3f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:06:43 +0200 Subject: [PATCH 0235/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 62aa7315f..3357b8ea9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -335,6 +335,7 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) tx->outpoints[v].value = value; } } + printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[v].value),jprint(item,0)); } } } From da0c247fe65d039f08ce87201322053facbbfbf2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:06:56 +0200 Subject: [PATCH 0236/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3357b8ea9..789ee331e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -335,7 +335,7 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) tx->outpoints[v].value = value; } } - printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[v].value),jprint(item,0)); + printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } } } From 55545761ed4da36d6185e29842800c28a0ae3cba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:12:26 +0200 Subject: [PATCH 0237/2732] Test --- iguana/exchanges/LP_scan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 12c2c6c74..1826c9d84 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -575,7 +575,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; struct iguana_info *coin; + struct LP_transaction *tx; struct iguana_info *coin; char str[65]; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(0); if ( coinaddr != 0 ) @@ -592,7 +592,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) { - //char str[65]; printf("%s/v%d is spent\n",bits256_str(str,txid),vout); + printf("LP_txvalue %s/v%d is spent\n",bits256_str(str,txid),vout); return(0); } else @@ -606,8 +606,8 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) } return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } - } else printf("vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); - } + } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); + } else printf("LP_txvalue couldnt find tx %s\n",bits256_str(str,txid)); return(0); } From b3500342de863937ac5e144bb5c34ef6c24d557c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:23:14 +0200 Subject: [PATCH 0238/2732] Test --- iguana/exchanges/LP_scan.c | 4 ++-- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 1826c9d84..088a85cb7 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -575,7 +575,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; struct iguana_info *coin; char str[65]; + struct LP_transaction *tx; struct iguana_info *coin; char str[65],str2[65]; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(0); if ( coinaddr != 0 ) @@ -592,7 +592,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) { - printf("LP_txvalue %s/v%d is spent\n",bits256_str(str,txid),vout); + printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); return(0); } else diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 789ee331e..698932c8e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -451,7 +451,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * { cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT); - //printf("MEMPOOL.(%s)\n",jprint(retjson,0)); + printf("MEMPOOL.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,retjson); return(retjson); } From a0d4d80b559a4eee962f33a748c7065637858de2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:52:26 +0200 Subject: [PATCH 0239/2732] Test --- iguana/exchanges/LP_utxos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c0763b76e..43b0951f5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -839,7 +839,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; + char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; if ( coin == 0 ) { printf("coin not active\n"); @@ -877,7 +877,8 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //{"value":1000000,"tx_hash":"4e4f818c53486c0576693b4cd379849e5ff95538b38e4100f48884073a4e7636","tx_pos":0,"height":484877} satoshis = j64bits(item,"value"); - if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) + satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")); + if ( satoshis > 0 && LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) { //printf("%s\n",jprint(item,0)); values[i] = satoshis; From 67e7280a1c0f8cacd38ccae387b103587c41868b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 22:55:24 +0200 Subject: [PATCH 0240/2732] Test --- iguana/exchanges/LP_utxos.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 43b0951f5..c0763b76e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -839,7 +839,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; + char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; if ( coin == 0 ) { printf("coin not active\n"); @@ -877,8 +877,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //{"value":1000000,"tx_hash":"4e4f818c53486c0576693b4cd379849e5ff95538b38e4100f48884073a4e7636","tx_pos":0,"height":484877} satoshis = j64bits(item,"value"); - satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")); - if ( satoshis > 0 && LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) + if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) { //printf("%s\n",jprint(item,0)); values[i] = satoshis; From f87d2afe48e2bdf5b67ea8d6a64410e747e72dd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 23:07:53 +0200 Subject: [PATCH 0241/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 698932c8e..9753d588d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -462,7 +462,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { - if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) + if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)) != 0 ) { printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,retjson); From 97b8163dc6edf600087655f8c4ce3d18d92a510b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 23:09:46 +0200 Subject: [PATCH 0242/2732] Test --- iguana/exchanges/LP_prices.c | 1 + iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0d2cbf037..57ee9c54a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -98,6 +98,7 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int void LP_address_monitor(struct LP_pubkeyinfo *pubp) { struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; + return; HASH_ITER(hh,LP_coins,coin,tmp) { bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9753d588d..0eeb4f0eb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -462,7 +462,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { - if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT)) != 0 ) + if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.history",addr,ELECTRUM_TIMEOUT)) != 0 ) { printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,retjson); From 632b27629b261fe2b11341e94ea3d3debb0da6f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 23:12:48 +0200 Subject: [PATCH 0243/2732] Test --- iguana/exchanges/LP_socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0eeb4f0eb..44f108277 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -488,7 +488,9 @@ cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp, cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char str[65]; printf("%s TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); - return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); + if ( bits256_nonz(txid) != 0 ) + return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); + else return(cJSON_Parse("{\"error\":\"null txid\"}")); } cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) From b925ad362a141cf957000973be2350ea3a8ca7f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 23:15:44 +0200 Subject: [PATCH 0244/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 44f108277..d5c44ff59 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -462,7 +462,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { - if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.history",addr,ELECTRUM_TIMEOUT)) != 0 ) + if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,retjson); From 9ea27975b3c164fe202cc714ae4faff3eb61a434 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 23:21:17 +0200 Subject: [PATCH 0245/2732] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c0763b76e..e24ebc77f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -839,7 +839,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; + char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; if ( coin == 0 ) { printf("coin not active\n"); @@ -877,6 +877,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //{"value":1000000,"tx_hash":"4e4f818c53486c0576693b4cd379849e5ff95538b38e4100f48884073a4e7636","tx_pos":0,"height":484877} satoshis = j64bits(item,"value"); + satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")); if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) { //printf("%s\n",jprint(item,0)); From 02171bc3ea4389ae792b9b2f8d9b6a78225a99d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 00:18:18 +0200 Subject: [PATCH 0246/2732] Test --- iguana/exchanges/LP_peers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 5e7a26cc3..0a6de49a6 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -57,6 +57,7 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; + printf("addpeer (%s:%u)\n",ipaddr,port); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) return(0); From fa5f451d640964c6db55bdddef9fea3521568c0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 00:19:33 +0200 Subject: [PATCH 0247/2732] Test --- iguana/exchanges/LP_peers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 0a6de49a6..806572415 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -58,6 +58,8 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; printf("addpeer (%s:%u)\n",ipaddr,port); + if ( port > 10000 ) + return(0); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) return(0); From 10fead0ad6c8f098d8594d0395bd268784d2cee9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 00:29:56 +0200 Subject: [PATCH 0248/2732] Test --- iguana/exchanges/LP_utxos.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e24ebc77f..8d9118e25 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -864,9 +864,10 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr item = jitem(array,i); if ( coin->electrum == 0 ) { - satoshis = SATOSHIDEN * jdouble(item,"amount"); - if ( satoshis == 0 ) - satoshis = SATOSHIDEN * jdouble(item,"value"); + //satoshis = SATOSHIDEN * jdouble(item,"amount"); + //if ( satoshis == 0 ) + // satoshis = SATOSHIDEN * jdouble(item,"value"); + satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"hash"),juint(item,"vout")); if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) { //printf("%s\n",jprint(item,0)); From 65898972c1a6fd278c81d37e2e7932b0fd2c7969 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 09:10:43 +0200 Subject: [PATCH 0249/2732] Test --- iguana/exchanges/LP_socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d5c44ff59..cbc6821d7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -647,6 +647,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) DL_FOREACH(ep->pendingQ.list,item) { stritem = (struct stritem *)item; + if ( *stritem->retptrp != 0 ) + continue; if ( item->type == idnum ) { //printf("matched idnum.%d result.%p\n",idnum,resultjson); @@ -658,13 +660,13 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) } if ( stritem->expiration < ep->lasttime ) { - DL_DELETE(ep->pendingQ.list,item); + //DL_DELETE(ep->pendingQ.list,item); printf("expired (%s)\n",stritem->str); errjson = cJSON_CreateObject(); jaddnum(errjson,"id",item->type); jaddstr(errjson,"error","timeout"); *((cJSON **)stritem->retptrp) = errjson; - free(item); + //free(item); } } } From f916d963cbf9186fb5b9c9328e8a949ce38db903 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 10:53:58 +0200 Subject: [PATCH 0250/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_scan.c | 2 ++ iguana/exchanges/LP_utxos.c | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0dcb86446..1d107e0b0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -423,7 +423,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 || coin->electrum != 0 ) continue; - if ( time(NULL) > coin->lastmonitor+60 ) + /*if ( time(NULL) > coin->lastmonitor+60 ) { portable_mutex_lock(&coin->txmutex); HASH_ITER(hh,coin->addresses,ap,atmp) @@ -442,7 +442,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } portable_mutex_unlock(&coin->txmutex); coin->lastmonitor = (uint32_t)time(NULL); - } + }*/ memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 088a85cb7..b48d17b09 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -576,6 +576,8 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { struct LP_transaction *tx; struct iguana_info *coin; char str[65],str2[65]; + if ( bits256_nonz(txid) == 0 ) + return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(0); if ( coinaddr != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d9118e25..33aaca9bb 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -290,6 +290,11 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol { //struct LP_utxoinfo *utxo; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); + if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) + { + printf("null txid not eligible\n"); + return(-1); + } destaddr[0] = destaddr2[0] = 0; if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) bypass = 1; @@ -867,7 +872,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //satoshis = SATOSHIDEN * jdouble(item,"amount"); //if ( satoshis == 0 ) // satoshis = SATOSHIDEN * jdouble(item,"value"); - satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"hash"),juint(item,"vout")); + satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"txid"),juint(item,"vout")); if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) { //printf("%s\n",jprint(item,0)); From f3a1c2224c2fef7a38bfa226e0d61c4165e74a47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 10:54:13 +0200 Subject: [PATCH 0251/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1d107e0b0..9a095a3e6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -419,7 +419,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; struct LP_address *ap,*atmp; struct LP_address_utxo *up; + int32_t height; bits256 zero; //struct LP_address *ap,*atmp; struct LP_address_utxo *up; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 || coin->electrum != 0 ) continue; From b5eefcfafb2c2166f0f07834c0fad5ca2aa1ca9b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 11:00:59 +0200 Subject: [PATCH 0252/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index b48d17b09..c791f2ae1 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -609,7 +609,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); - } else printf("LP_txvalue couldnt find tx %s\n",bits256_str(str,txid)); + } else printf("LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); return(0); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 33aaca9bb..ecdbb9bf8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -806,7 +806,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) LP_utxo_clientpublish(utxo); jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } - else if ( LP_ismine(utxo) > 0 ) + else if ( LP_ismine(utxo) > 0 && strcmp(symbol,utxo->coin) == 0 ) printf("skip %s %s %d %d %d %d\n",utxo->coin,bits256_str(str,utxo->payment.txid),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); } return(array); From 62ee99ce15dde626924f183959379e7747fb64da Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 11:26:26 +0200 Subject: [PATCH 0253/2732] Test --- iguana/exchanges/LP_scan.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index c791f2ae1..f070f874d 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -575,7 +575,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; struct iguana_info *coin; char str[65],str2[65]; + struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65]; if ( bits256_nonz(txid) == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) @@ -609,7 +609,17 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); - } else printf("LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); + } + else + { + printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); + if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) + { + value = SATOSHIDEN * jdouble(txobj,"value"); + free_json(txobj); + return(value); + } + } return(0); } From bd9ded4ea34fe5509a7fd9181546644b357fff85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 11:39:10 +0200 Subject: [PATCH 0254/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_prices.c | 6 +- iguana/exchanges/LP_rpc.c | 60 --------- iguana/exchanges/LP_scan.c | 231 +++++++++++++++++++++------------- 4 files changed, 150 insertions(+), 148 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1e74e9507..2a113134d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -302,6 +302,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); +int32_t LP_txheight(struct iguana_info *coin,bits256 txid); #endif diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 57ee9c54a..c4e011a15 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -80,7 +80,7 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) return(ap); } -void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value) +/*void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value) { struct LP_address *ap; struct LP_address_utxo *up; portable_mutex_lock(&coin->txmutex); @@ -117,7 +117,7 @@ void LP_address_monitor(struct LP_pubkeyinfo *pubp) } } } -} +}*/ int32_t LP_pricevalid(double price) { @@ -293,7 +293,7 @@ void LP_prices_parse(cJSON *obj) printf("%02x",pubp->rmd160[i]); char str[65]; printf(" -> rmd160.(%s) for %s\n",hexstr,bits256_str(str,pubkey)); memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - LP_address_monitor(pubp); + //LP_address_monitor(pubp); } } if ( (timestamp= juint(obj,"timestamp")) > pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 16901dae3..641d547ab 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -617,66 +617,6 @@ cJSON *LP_getblock(char *symbol,bits256 txid) return(bitcoin_json(coin,"getblock",buf)); } -int32_t LP_txheight(struct iguana_info *coin,bits256 txid) -{ - bits256 blockhash; struct LP_transaction *tx; cJSON *blockobj,*txobj; int32_t height = 0; - if ( coin == 0 ) - return(-1); - if ( coin->electrum == 0 ) - { - if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) - { - //*timestampp = juint(txobj,"locktime"); - //*blocktimep = juint(txobj,"blocktime"); - blockhash = jbits256(txobj,"blockhash"); - if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) - { - height = jint(blockobj,"height"); - //printf("%s LP_txheight.%d\n",coin->symbol,height); - free_json(blockobj); - } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); - free_json(txobj); - } - } - else - { - if ( (tx= LP_transactionfind(coin,txid)) != 0 ) - height = tx->height; - } - return(height); -} - -int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) -{ - struct iguana_info *coin; int32_t ht,numconfirms = 100; - //#ifndef BASILISK_DISABLEWAITTX - cJSON *txobj; - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) - return(-1); - if ( coin->electrum == 0 ) - { - numconfirms = -1; - if ( (txobj= LP_gettx(symbol,txid)) != 0 ) - { - if ( coin->electrum == 0 ) - numconfirms = jint(txobj,"confirmations"); - else numconfirms = coin->height - jint(txobj,"height"); - free_json(txobj); - } - else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) - numconfirms = 0; - } - else - { - if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) - numconfirms = (coin->height - ht); - else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) - numconfirms = 0; - } - //#endif - return(numconfirms); -} - // not in electrum path uint64_t LP_txfee(char *symbol) { diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f070f874d..d5ae10c80 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -51,31 +51,6 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i return(tx); } -int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) -{ - int32_t i,ht,num = 0; struct LP_transaction *tx,*tmp; - HASH_ITER(hh,coin->transactions,tx,tmp) - { - for (i=0; inumvouts; i++) - { - if ( bits256_nonz(tx->outpoints[i].spendtxid) == 0 ) - continue; - if ( (ht= tx->outpoints[i].spendheight) == 0 ) - { - tx->outpoints[i].spendheight = LP_txheight(coin,tx->outpoints[i].spendtxid); - } - if ( (ht= tx->outpoints[i].spendheight) != 0 && ht > lastheight ) - { - char str[65]; printf("clear spend %s/v%d at ht.%d > lastheight.%d\n",bits256_str(str,tx->txid),i,ht,lastheight); - tx->outpoints[i].spendheight = 0; - tx->outpoints[i].spendvini = -1; - memset(tx->outpoints[i].spendtxid.bytes,0,sizeof(bits256)); - } - } - } - return(num); -} - uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) { uint64_t interest,value = 0; double val; cJSON *txobj,*sobj,*array; int32_t n=0; @@ -182,6 +157,152 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) return(-1); } +int32_t LP_txheight(struct iguana_info *coin,bits256 txid) +{ + bits256 blockhash; struct LP_transaction *tx; cJSON *blockobj,*txobj; int32_t height = 0; + if ( coin == 0 ) + return(-1); + if ( coin->electrum == 0 ) + { + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) + { + //*timestampp = juint(txobj,"locktime"); + //*blocktimep = juint(txobj,"blocktime"); + blockhash = jbits256(txobj,"blockhash"); + if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) + { + height = jint(blockobj,"height"); + //printf("%s LP_txheight.%d\n",coin->symbol,height); + free_json(blockobj); + } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); + free_json(txobj); + } + } + else + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + height = tx->height; + } + return(height); +} + +int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) +{ + struct iguana_info *coin; int32_t ht,numconfirms = 100; + //#ifndef BASILISK_DISABLEWAITTX + cJSON *txobj; + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(-1); + if ( coin->electrum == 0 ) + { + numconfirms = -1; + if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + { + if ( coin->electrum == 0 ) + numconfirms = jint(txobj,"confirmations"); + else numconfirms = coin->height - jint(txobj,"height"); + free_json(txobj); + } + else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) + numconfirms = 0; + } + else + { + if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) + numconfirms = (coin->height - ht); + else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) + numconfirms = 0; + } + //#endif + return(numconfirms); +} + +int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) +{ + char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(0); + //char str[65]; printf("%s txvalue.(%s)\n",symbol,bits256_str(str,txid)); + value = LP_txinterestvalue(&interest,destaddr,coin,txid,vout); + return(value + interest); +} + +uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) +{ + struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65]; + if ( bits256_nonz(txid) == 0 ) + return(0); + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(0); + if ( coinaddr != 0 ) + coinaddr[0] = 0; + if ( (tx= LP_transactionfind(coin,txid)) == 0 ) + { + LP_transactioninit(coin,txid,0); + LP_transactioninit(coin,txid,1); + tx = LP_transactionfind(coin,txid); + } + if ( tx != 0 ) + { + if ( vout < tx->numvouts ) + { + if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) + { + printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); + return(0); + } + else + { + if ( coinaddr != 0 ) + { + //if ( tx->outpoints[vout].coinaddr[0] == 0 ) + // tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); + strcpy(coinaddr,tx->outpoints[vout].coinaddr); + //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + } + return(tx->outpoints[vout].value + tx->outpoints[vout].interest); + } + } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); + } + else + { + if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) + { + value = SATOSHIDEN * jdouble(txobj,"value"); + free_json(txobj); + printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); + return(value); + } + printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); + } + return(0); +} + +int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) +{ + int32_t i,ht,num = 0; struct LP_transaction *tx,*tmp; + HASH_ITER(hh,coin->transactions,tx,tmp) + { + for (i=0; inumvouts; i++) + { + if ( bits256_nonz(tx->outpoints[i].spendtxid) == 0 ) + continue; + if ( (ht= tx->outpoints[i].spendheight) == 0 ) + { + tx->outpoints[i].spendheight = LP_txheight(coin,tx->outpoints[i].spendtxid); + } + if ( (ht= tx->outpoints[i].spendheight) != 0 && ht > lastheight ) + { + char str[65]; printf("clear spend %s/v%d at ht.%d > lastheight.%d\n",bits256_str(str,tx->txid),i,ht,lastheight); + tx->outpoints[i].spendheight = 0; + tx->outpoints[i].spendvini = -1; + memset(tx->outpoints[i].spendtxid.bytes,0,sizeof(bits256)); + } + } + } + return(num); +} + int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; @@ -563,66 +684,6 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) return(clonestr("{\"error\":\"symbol not found\"}")); } -int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) -{ - char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) - return(0); - //char str[65]; printf("%s txvalue.(%s)\n",symbol,bits256_str(str,txid)); - value = LP_txinterestvalue(&interest,destaddr,coin,txid,vout); - return(value + interest); -} - -uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) -{ - struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65]; - if ( bits256_nonz(txid) == 0 ) - return(0); - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) - return(0); - if ( coinaddr != 0 ) - coinaddr[0] = 0; - if ( (tx= LP_transactionfind(coin,txid)) == 0 ) - { - LP_transactioninit(coin,txid,0); - LP_transactioninit(coin,txid,1); - tx = LP_transactionfind(coin,txid); - } - if ( tx != 0 ) - { - if ( vout < tx->numvouts ) - { - if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) - { - printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); - return(0); - } - else - { - if ( coinaddr != 0 ) - { - //if ( tx->outpoints[vout].coinaddr[0] == 0 ) - // tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); - strcpy(coinaddr,tx->outpoints[vout].coinaddr); - //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); - } - return(tx->outpoints[vout].value + tx->outpoints[vout].interest); - } - } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); - } - else - { - printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); - if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) - { - value = SATOSHIDEN * jdouble(txobj,"value"); - free_json(txobj); - return(value); - } - } - return(0); -} - int32_t LP_spendsearch(bits256 *spendtxidp,int32_t *indp,char *symbol,bits256 searchtxid,int32_t searchvout) { struct LP_transaction *tx; struct iguana_info *coin; From b8898f875cd11718607488edf183deb827b595ac Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 11:53:29 +0200 Subject: [PATCH 0255/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_portfolio.c | 4 +- iguana/exchanges/LP_remember.c | 4 +- iguana/exchanges/LP_scan.c | 284 ------------------- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_transaction.c | 10 +- iguana/exchanges/LP_utxo.c | 436 ++++++++++++++++++++++++++++++ iguana/exchanges/LP_utxos.c | 133 +-------- 8 files changed, 444 insertions(+), 430 deletions(-) create mode 100644 iguana/exchanges/LP_utxo.c diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9a095a3e6..15296bcd6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -85,6 +85,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_coins.c" #include "LP_rpc.c" #include "LP_prices.c" +#include "LP_utxo.c" #include "LP_scan.c" #include "LP_transaction.c" #include "LP_remember.c" diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index a5982444d..a3e656e70 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -57,9 +57,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) for (i=0; i>= 1; decode_hex(Dredeemscript,Dredeemlen,rstr); } - if ( (value= jdouble(txobj,"amount") * SATOSHIDEN) == 0 ) - value = jdouble(txobj,"value") * SATOSHIDEN; - values[i] = value; + values[i] = value = LP_value_extract(txobj); if ( (symbol= jstr(txobj,"coin")) != 0 ) { if ( i == BASILISK_ALICESPEND || i == BASILISK_BOBPAYMENT || i == BASILISK_BOBDEPOSIT || i == BASILISK_BOBREFUND || i == BASILISK_BOBRECLAIM || i == BASILISK_ALICECLAIM ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index d5ae10c80..ddd95f458 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -19,290 +19,6 @@ // -struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) -{ - struct LP_transaction *tx; - portable_mutex_lock(&coin->txmutex); - HASH_FIND(hh,coin->transactions,txid.bytes,sizeof(txid),tx); - portable_mutex_unlock(&coin->txmutex); - return(tx); -} - -struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins) -{ - struct LP_transaction *tx; int32_t i; - if ( (tx= LP_transactionfind(coin,txid)) == 0 ) - { - //char str[65]; printf("%s ht.%d u.%u NEW TXID.(%s) vouts.[%d]\n",coin->symbol,height,timestamp,bits256_str(str,txid),numvouts); - //if ( bits256_nonz(txid) == 0 && tx->height == 0 ) - // getchar(); - tx = calloc(1,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts)); - for (i=0; ioutpoints[i].spendvini = -1; - tx->height = height; - tx->numvouts = numvouts; - tx->numvins = numvins; - //tx->timestamp = timestamp; - tx->txid = txid; - portable_mutex_lock(&coin->txmutex); - HASH_ADD_KEYPTR(hh,coin->transactions,tx->txid.bytes,sizeof(tx->txid),tx); - portable_mutex_unlock(&coin->txmutex); - } // else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid)); - return(tx); -} - -uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) -{ - uint64_t interest,value = 0; double val; cJSON *txobj,*sobj,*array; int32_t n=0; - *interestp = 0; - destaddr[0] = 0; - if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) - { - // GETTXOUT.({"value":0.01200000,"txid":"6f5adfefad102e39f62a6bacb222ebace6ce5c084116c08a62cac1182729dd46","vout":1,"scriptPubkey":{"reqSigs":1,"type":"pubkey","addresses":["19Cq6MBaD8LY7trqs99ypqKAms3GcLs6J9"]}}) - if ( (val= jdouble(txobj,"amount")) < SMALLVAL ) - val = jdouble(txobj,"value"); - if ( val > SMALLVAL ) - value = (val * SATOSHIDEN + 0.0000000049); - else value = 0; - if ( value == 0 ) - { - char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); - } - else if ( strcmp(coin->symbol,"KMD") == 0 ) - { - if ( (interest= jdouble(txobj,"interest")) != 0. ) - { - //printf("add interest of %.8f to %.8f\n",interest,dstr(value)); - *interestp = SATOSHIDEN * interest; - } - } - if ( (sobj= jobj(txobj,"scriptPubKey")) != 0 && (array= jarray(&n,sobj,"addresses")) != 0 ) - { - strcpy(destaddr,jstri(array,0)); - //printf("set destaddr.(%s)\n",destaddr); - if ( n > 1 ) - printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); - } else printf("LP_txinterestvalue no addresses found?\n"); - //char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); - free_json(txobj); - } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } - return(value); -} - -int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) -{ - struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; - if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) - { - //printf("TX.(%s)\n",jprint(txobj,0)); - if ( coin->electrum == 0 ) - height = LP_txheight(coin,txid); - else height = -1; - vins = jarray(&numvins,txobj,"vin"); - vouts = jarray(&numvouts,txobj,"vout"); - if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) - { - //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); - for (i=0; ioutpoints[i].value= SATOSHIDEN * jdouble(vout,"value")) == 0 ) - tx->outpoints[i].value = SATOSHIDEN * jdouble(vout,"amount"); - tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); - if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) - { - if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) - { - if ( n > 1 ) - printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); - if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) - { - strcpy(tx->outpoints[i].coinaddr,address); - //printf("(%s %.8f) ",address,dstr(tx->outpoints[i].value)); - } else if ( tx->outpoints[i].value != 0 ) - printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } - //else if ( tx->outpoints[i].value != 0 ) - // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); - } - } - //printf("numvouts.%d\n",numvouts); - } - if ( iter == 1 && vins != 0 ) - { - for (i=0; inumvouts ) - { - tx->outpoints[spentvout].spendtxid = txid; - tx->outpoints[spentvout].spendvini = i; - tx->outpoints[spentvout].spendheight = height; - //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); - } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); - if ( bits256_cmp(spenttxid,txid) == 0 ) - printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); - } - } - free_json(txobj); - return(0); - } //else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); - return(-1); -} - -int32_t LP_txheight(struct iguana_info *coin,bits256 txid) -{ - bits256 blockhash; struct LP_transaction *tx; cJSON *blockobj,*txobj; int32_t height = 0; - if ( coin == 0 ) - return(-1); - if ( coin->electrum == 0 ) - { - if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) - { - //*timestampp = juint(txobj,"locktime"); - //*blocktimep = juint(txobj,"blocktime"); - blockhash = jbits256(txobj,"blockhash"); - if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) - { - height = jint(blockobj,"height"); - //printf("%s LP_txheight.%d\n",coin->symbol,height); - free_json(blockobj); - } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); - free_json(txobj); - } - } - else - { - if ( (tx= LP_transactionfind(coin,txid)) != 0 ) - height = tx->height; - } - return(height); -} - -int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) -{ - struct iguana_info *coin; int32_t ht,numconfirms = 100; - //#ifndef BASILISK_DISABLEWAITTX - cJSON *txobj; - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) - return(-1); - if ( coin->electrum == 0 ) - { - numconfirms = -1; - if ( (txobj= LP_gettx(symbol,txid)) != 0 ) - { - if ( coin->electrum == 0 ) - numconfirms = jint(txobj,"confirmations"); - else numconfirms = coin->height - jint(txobj,"height"); - free_json(txobj); - } - else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) - numconfirms = 0; - } - else - { - if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) - numconfirms = (coin->height - ht); - else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) - numconfirms = 0; - } - //#endif - return(numconfirms); -} - -int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) -{ - char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) - return(0); - //char str[65]; printf("%s txvalue.(%s)\n",symbol,bits256_str(str,txid)); - value = LP_txinterestvalue(&interest,destaddr,coin,txid,vout); - return(value + interest); -} - -uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) -{ - struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65]; - if ( bits256_nonz(txid) == 0 ) - return(0); - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) - return(0); - if ( coinaddr != 0 ) - coinaddr[0] = 0; - if ( (tx= LP_transactionfind(coin,txid)) == 0 ) - { - LP_transactioninit(coin,txid,0); - LP_transactioninit(coin,txid,1); - tx = LP_transactionfind(coin,txid); - } - if ( tx != 0 ) - { - if ( vout < tx->numvouts ) - { - if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) - { - printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); - return(0); - } - else - { - if ( coinaddr != 0 ) - { - //if ( tx->outpoints[vout].coinaddr[0] == 0 ) - // tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); - strcpy(coinaddr,tx->outpoints[vout].coinaddr); - //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); - } - return(tx->outpoints[vout].value + tx->outpoints[vout].interest); - } - } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); - } - else - { - if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) - { - value = SATOSHIDEN * jdouble(txobj,"value"); - free_json(txobj); - printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); - return(value); - } - printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); - } - return(0); -} - -int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) -{ - int32_t i,ht,num = 0; struct LP_transaction *tx,*tmp; - HASH_ITER(hh,coin->transactions,tx,tmp) - { - for (i=0; inumvouts; i++) - { - if ( bits256_nonz(tx->outpoints[i].spendtxid) == 0 ) - continue; - if ( (ht= tx->outpoints[i].spendheight) == 0 ) - { - tx->outpoints[i].spendheight = LP_txheight(coin,tx->outpoints[i].spendtxid); - } - if ( (ht= tx->outpoints[i].spendheight) != 0 && ht > lastheight ) - { - char str[65]; printf("clear spend %s/v%d at ht.%d > lastheight.%d\n",bits256_str(str,tx->txid),i,ht,lastheight); - tx->outpoints[i].spendheight = 0; - tx->outpoints[i].spendvini = -1; - memset(tx->outpoints[i].spendtxid.bytes,0,sizeof(bits256)); - } - } - } - return(num); -} - int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cbc6821d7..2866205a8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -329,7 +329,7 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts ) { value = j64bits(item,"value"); - if ( value != tx->outpoints[v].value ) + if ( tx->outpoints[v].value == 0 && value != tx->outpoints[v].value ) { printf(">>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); tx->outpoints[v].value = value; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3cdafe59b..71bde88e4 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1073,7 +1073,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t v) { - cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; double val; int32_t n,m,suppress_pubkeys = 0; + cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; if ( valuep != 0 ) *valuep = 0; if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) @@ -1083,13 +1083,7 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u { vout = jitem(vouts,v); if ( valuep != 0 ) - { - *valuep = 0; - if ( (val= jdouble(vout,"value")) < SMALLVAL ) - val = jdouble(vout,"amount"); - if ( val > SMALLVAL ) - *valuep = (val * SATOSHIDEN + 0.0000000049); - } + *valuep = LP_value_extract(vout); //printf("VOUT.(%s)\n",jprint(vout,0)); if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c new file mode 100644 index 000000000..5c327dc99 --- /dev/null +++ b/iguana/exchanges/LP_utxo.c @@ -0,0 +1,436 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_utxo.c +// marketmaker +// + +uint64_t LP_value_extract(cJSON *obj) +{ + double val = 0.; uint64_t value; + if ( (val= jdouble(obj,"amount")) < SMALLVAL ) + val = jdouble(obj,"value"); + if ( val > SMALLVAL ) + value = (val * SATOSHIDEN + 0.0000000049); + else value = 0; + return(value); +} + +void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) +{ + memcpy(key,txid.bytes,sizeof(txid)); + memcpy(&key[sizeof(txid)],&vout,sizeof(vout)); +} + +struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo=0; uint8_t key[sizeof(txid) + sizeof(vout)]; + LP_utxosetkey(key,txid,vout); + HASH_FIND(hh,LP_utxoinfos[iambob],key,sizeof(key),utxo); + return(utxo); +} + +struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) +{ + struct LP_utxoinfo *utxo=0; uint8_t key2[sizeof(txid2) + sizeof(vout2)]; + LP_utxosetkey(key2,txid2,vout2); + HASH_FIND(hh2,LP_utxoinfos2[iambob],key2,sizeof(key2),utxo); + return(utxo); +} + +struct LP_utxoinfo *LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo=0; + portable_mutex_lock(&LP_utxomutex); + utxo = _LP_utxofind(iambob,txid,vout); + portable_mutex_unlock(&LP_utxomutex); + return(utxo); +} + +struct LP_utxoinfo *LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) +{ + struct LP_utxoinfo *utxo=0; + portable_mutex_lock(&LP_utxomutex); + utxo = _LP_utxo2find(iambob,txid2,vout2); + portable_mutex_unlock(&LP_utxomutex); + return(utxo); +} + +struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) +{ + struct LP_transaction *tx; + portable_mutex_lock(&coin->txmutex); + HASH_FIND(hh,coin->transactions,txid.bytes,sizeof(txid),tx); + portable_mutex_unlock(&coin->txmutex); + return(tx); +} + +struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins) +{ + struct LP_transaction *tx; int32_t i; + if ( (tx= LP_transactionfind(coin,txid)) == 0 ) + { + //char str[65]; printf("%s ht.%d u.%u NEW TXID.(%s) vouts.[%d]\n",coin->symbol,height,timestamp,bits256_str(str,txid),numvouts); + //if ( bits256_nonz(txid) == 0 && tx->height == 0 ) + // getchar(); + tx = calloc(1,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts)); + for (i=0; ioutpoints[i].spendvini = -1; + tx->height = height; + tx->numvouts = numvouts; + tx->numvins = numvins; + //tx->timestamp = timestamp; + tx->txid = txid; + portable_mutex_lock(&coin->txmutex); + HASH_ADD_KEYPTR(hh,coin->transactions,tx->txid.bytes,sizeof(tx->txid),tx); + portable_mutex_unlock(&coin->txmutex); + } // else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid)); + return(tx); +} + +uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) +{ + uint64_t interest,value = 0; cJSON *txobj,*sobj,*array; int32_t n=0; + *interestp = 0; + destaddr[0] = 0; + if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) + { + if ( (value= LP_value_extract(txobj)) == 0 ) + { + char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); + } + else if ( strcmp(coin->symbol,"KMD") == 0 ) + { + if ( (interest= jdouble(txobj,"interest")) != 0. ) + { + //printf("add interest of %.8f to %.8f\n",interest,dstr(value)); + *interestp = SATOSHIDEN * interest; + } + } + if ( (sobj= jobj(txobj,"scriptPubKey")) != 0 && (array= jarray(&n,sobj,"addresses")) != 0 ) + { + strcpy(destaddr,jstri(array,0)); + //printf("set destaddr.(%s)\n",destaddr); + if ( n > 1 ) + printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); + } else printf("LP_txinterestvalue no addresses found?\n"); + //char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + free_json(txobj); + } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } + return(value); +} + +int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) +{ + struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) + { + //printf("TX.(%s)\n",jprint(txobj,0)); + if ( coin->electrum == 0 ) + height = LP_txheight(coin,txid); + else height = -1; + vins = jarray(&numvins,txobj,"vin"); + vouts = jarray(&numvouts,txobj,"vout"); + if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) + { + //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); + for (i=0; ioutpoints[i].value = LP_value_extract(vout); + tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); + if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) + { + if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) + { + if ( n > 1 ) + printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); + if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) + { + strcpy(tx->outpoints[i].coinaddr,address); + //printf("(%s %.8f) ",address,dstr(tx->outpoints[i].value)); + } else if ( tx->outpoints[i].value != 0 ) + printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); + } + //else if ( tx->outpoints[i].value != 0 ) + // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); + } + } + //printf("numvouts.%d\n",numvouts); + } + if ( iter == 1 && vins != 0 ) + { + for (i=0; inumvouts ) + { + tx->outpoints[spentvout].spendtxid = txid; + tx->outpoints[spentvout].spendvini = i; + tx->outpoints[spentvout].spendheight = height; + //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); + } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); + } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + if ( bits256_cmp(spenttxid,txid) == 0 ) + printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); + } + } + free_json(txobj); + return(0); + } //else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); + return(-1); +} + +int32_t LP_txheight(struct iguana_info *coin,bits256 txid) +{ + bits256 blockhash; struct LP_transaction *tx; cJSON *blockobj,*txobj; int32_t height = 0; + if ( coin == 0 ) + return(-1); + if ( coin->electrum == 0 ) + { + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) + { + //*timestampp = juint(txobj,"locktime"); + //*blocktimep = juint(txobj,"blocktime"); + blockhash = jbits256(txobj,"blockhash"); + if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) + { + height = jint(blockobj,"height"); + //printf("%s LP_txheight.%d\n",coin->symbol,height); + free_json(blockobj); + } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); + free_json(txobj); + } + } + else + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + height = tx->height; + } + return(height); +} + +int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) +{ + struct iguana_info *coin; int32_t ht,numconfirms = 100; + //#ifndef BASILISK_DISABLEWAITTX + cJSON *txobj; + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(-1); + if ( coin->electrum == 0 ) + { + numconfirms = -1; + if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + { + if ( coin->electrum == 0 ) + numconfirms = jint(txobj,"confirmations"); + else numconfirms = coin->height - jint(txobj,"height"); + free_json(txobj); + } + else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) + numconfirms = 0; + } + else + { + if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) + numconfirms = (coin->height - ht); + else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) + numconfirms = 0; + } + //#endif + return(numconfirms); +} + +int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) +{ + char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(0); + //char str[65]; printf("%s txvalue.(%s)\n",symbol,bits256_str(str,txid)); + value = LP_txinterestvalue(&interest,destaddr,coin,txid,vout); + return(value + interest); +} + +uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) +{ + struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65]; + if ( bits256_nonz(txid) == 0 ) + return(0); + if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + return(0); + if ( coinaddr != 0 ) + coinaddr[0] = 0; + if ( (tx= LP_transactionfind(coin,txid)) == 0 ) + { + LP_transactioninit(coin,txid,0); + LP_transactioninit(coin,txid,1); + tx = LP_transactionfind(coin,txid); + } + if ( tx != 0 ) + { + if ( vout < tx->numvouts ) + { + if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) + { + printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); + return(0); + } + else + { + if ( coinaddr != 0 ) + { + //if ( tx->outpoints[vout].coinaddr[0] == 0 ) + // tx->outpoints[vout].value = LP_txinterestvalue(&tx->outpoints[vout].interest,tx->outpoints[vout].coinaddr,coin,txid,vout); + strcpy(coinaddr,tx->outpoints[vout].coinaddr); + //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + } + return(tx->outpoints[vout].value + tx->outpoints[vout].interest); + } + } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); + } + else + { + if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) + { + value = SATOSHIDEN * jdouble(txobj,"value"); + free_json(txobj); + printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); + return(value); + } + printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); + } + return(0); +} + +int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) +{ + //struct LP_utxoinfo *utxo; + uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); + if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) + { + printf("null txid not eligible\n"); + return(-1); + } + destaddr[0] = destaddr2[0] = 0; + if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) + bypass = 1; + if ( bypass != 0 ) + val = satoshis; + else val = LP_txvalue(destaddr,symbol,txid,vout); + txfee = LP_txfeecalc(LP_coinfind(symbol),0); + if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) + { + threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : (LP_DEXFEE(satoshis) + txfee); + if ( bypass != 0 ) + val2 = threshold; + else val2 = LP_txvalue(destaddr2,symbol,txid2,vout2); + if ( val2 >= threshold ) + { + if ( bypass == 0 && strcmp(destaddr,destaddr2) != 0 ) + printf("mismatched %s destaddr (%s) vs (%s)\n",symbol,destaddr,destaddr2); + else if ( bypass == 0 && ((iambob == 0 && val2 > val) || (iambob != 0 && val2 <= satoshis)) ) + printf("iambob.%d ineligible due to offsides: val %.8f and val2 %.8f vs %.8f diff %lld\n",iambob,dstr(val),dstr(val2),dstr(satoshis),(long long)(val2 - val)); + else + { + *valp = val; + *val2p = val2; + return(1); + } + } // else printf("no val2\n"); + } + char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); + /*for (iter=0; iter<2; iter++) + { + if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) + { + //printf("iambob.%d case 00\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxo2find(iter,txid,vout)) != 0 ) + { + //printf("iambob.%d case 01\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxofind(iter,txid2,vout2)) != 0 ) + { + //printf("iambob.%d case 10\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxo2find(iter,txid2,vout2)) != 0 ) + { + //printf("iambob.%d case 11\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + }*/ + *valp = val; + *val2p = val2; + return(0); +} + +int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo; struct LP_transaction *tx; struct iguana_info *coin; + if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 || (utxo= LP_utxo2find(iambob,txid,vout)) != 0 ) + { + if ( (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 ) + { + if ( tx->outpoints[vout].spendheight > 0 ) + utxo->T.spentflag = tx->outpoints[vout].spendheight; + else utxo->T.spentflag = 0; + } + if ( utxo->T.spentflag != 0 ) + { + char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); + return(1); + } + } + return(0); +} + +int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) +{ + int32_t i,ht,num = 0; struct LP_transaction *tx,*tmp; + HASH_ITER(hh,coin->transactions,tx,tmp) + { + for (i=0; inumvouts; i++) + { + if ( bits256_nonz(tx->outpoints[i].spendtxid) == 0 ) + continue; + if ( (ht= tx->outpoints[i].spendheight) == 0 ) + { + tx->outpoints[i].spendheight = LP_txheight(coin,tx->outpoints[i].spendtxid); + } + if ( (ht= tx->outpoints[i].spendheight) != 0 && ht > lastheight ) + { + char str[65]; printf("clear spend %s/v%d at ht.%d > lastheight.%d\n",bits256_str(str,tx->txid),i,ht,lastheight); + tx->outpoints[i].spendheight = 0; + tx->outpoints[i].spendvini = -1; + memset(tx->outpoints[i].spendtxid.bytes,0,sizeof(bits256)); + } + } + } + return(num); +} diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ecdbb9bf8..bf985cae1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -41,37 +41,6 @@ int32_t LP_isunspent(struct LP_utxoinfo *utxo) else return(0); } -void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) -{ - memcpy(key,txid.bytes,sizeof(txid)); - memcpy(&key[sizeof(txid)],&vout,sizeof(vout)); -} - -struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) -{ - struct LP_utxoinfo *utxo=0; uint8_t key[sizeof(txid) + sizeof(vout)]; - LP_utxosetkey(key,txid,vout); - HASH_FIND(hh,LP_utxoinfos[iambob],key,sizeof(key),utxo); - return(utxo); -} - -struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) -{ - struct LP_utxoinfo *utxo=0; uint8_t key2[sizeof(txid2) + sizeof(vout2)]; - LP_utxosetkey(key2,txid2,vout2); - HASH_FIND(hh2,LP_utxoinfos2[iambob],key2,sizeof(key2),utxo); - return(utxo); -} - -struct LP_utxoinfo *LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) -{ - struct LP_utxoinfo *utxo=0; - portable_mutex_lock(&LP_utxomutex); - utxo = _LP_utxofind(iambob,txid,vout); - portable_mutex_unlock(&LP_utxomutex); - return(utxo); -} - struct LP_utxoinfo *LP_utxopairfind(int32_t iambob,bits256 txid,int32_t vout,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; struct _LP_utxoinfo u; @@ -84,15 +53,6 @@ struct LP_utxoinfo *LP_utxopairfind(int32_t iambob,bits256 txid,int32_t vout,bit return(0); } -struct LP_utxoinfo *LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) -{ - struct LP_utxoinfo *utxo=0; - portable_mutex_lock(&LP_utxomutex); - utxo = _LP_utxo2find(iambob,txid2,vout2); - portable_mutex_unlock(&LP_utxomutex); - return(utxo); -} - struct LP_utxoinfo *LP_utxofinds(int32_t iambob,bits256 txid,int32_t vout,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo; @@ -286,75 +246,6 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) return(item); } -int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) -{ - //struct LP_utxoinfo *utxo; - uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); - if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) - { - printf("null txid not eligible\n"); - return(-1); - } - destaddr[0] = destaddr2[0] = 0; - if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) - bypass = 1; - if ( bypass != 0 ) - val = satoshis; - else val = LP_txvalue(destaddr,symbol,txid,vout); - txfee = LP_txfeecalc(LP_coinfind(symbol),0); - if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) - { - threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : (LP_DEXFEE(satoshis) + txfee); - if ( bypass != 0 ) - val2 = threshold; - else val2 = LP_txvalue(destaddr2,symbol,txid2,vout2); - if ( val2 >= threshold ) - { - if ( bypass == 0 && strcmp(destaddr,destaddr2) != 0 ) - printf("mismatched %s destaddr (%s) vs (%s)\n",symbol,destaddr,destaddr2); - else if ( bypass == 0 && ((iambob == 0 && val2 > val) || (iambob != 0 && val2 <= satoshis)) ) - printf("iambob.%d ineligible due to offsides: val %.8f and val2 %.8f vs %.8f diff %lld\n",iambob,dstr(val),dstr(val2),dstr(satoshis),(long long)(val2 - val)); - else - { - *valp = val; - *val2p = val2; - return(1); - } - } // else printf("no val2\n"); - } - char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); - /*for (iter=0; iter<2; iter++) - { - if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) - { - //printf("iambob.%d case 00\n",iter); - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - if ( (utxo= LP_utxo2find(iter,txid,vout)) != 0 ) - { - //printf("iambob.%d case 01\n",iter); - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - if ( (utxo= LP_utxofind(iter,txid2,vout2)) != 0 ) - { - //printf("iambob.%d case 10\n",iter); - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - if ( (utxo= LP_utxo2find(iter,txid2,vout2)) != 0 ) - { - //printf("iambob.%d case 11\n",iter); - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - }*/ - *valp = val; - *val2p = val2; - return(0); -} - char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn) { int32_t i,n,m; uint64_t val,val2; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); @@ -383,26 +274,6 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la return(jprint(utxosjson,1)); } -int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vout) -{ - struct LP_utxoinfo *utxo; struct LP_transaction *tx; struct iguana_info *coin; - if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 || (utxo= LP_utxo2find(iambob,txid,vout)) != 0 ) - { - if ( (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 ) - { - if ( tx->outpoints[vout].spendheight > 0 ) - utxo->T.spentflag = tx->outpoints[vout].spendheight; - else utxo->T.spentflag = 0; - } - if ( utxo->T.spentflag != 0 ) - { - char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); - return(1); - } - } - return(0); -} - struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; @@ -666,11 +537,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) HASH_ADD_KEYPTR(hh2,LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); - if ( 0 && coin->electrum == 0 ) + /*if ( 0 && coin->electrum == 0 ) { LP_address_utxoadd(coin,coinaddr,txid,vout,value); LP_address_utxoadd(coin,coinaddr,txid2,vout2,value2); - } + }*/ if ( iambob != 0 ) { if ( LP_mypeer != 0 ) From 84bd4d730be065b9e39bf7ff3d188e05def37bef Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 13:49:58 +0200 Subject: [PATCH 0256/2732] Test --- crypto777/iguana_OS.c | 12 +-- iguana/exchanges/LP_include.h | 4 +- iguana/exchanges/LP_nativeDEX.c | 17 ++--- iguana/exchanges/LP_prices.c | 64 ---------------- iguana/exchanges/LP_socket.c | 25 +++---- iguana/exchanges/LP_transaction.c | 22 +----- iguana/exchanges/LP_utxo.c | 118 +++++++++++++++++++++++++++++- iguana/exchanges/LP_utxos.c | 49 +++++-------- 8 files changed, 163 insertions(+), 148 deletions(-) diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 504905ee1..9b218f130 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -297,11 +297,11 @@ void *queue_dequeue(queue_t *queue)//,int32_t offsetflag) void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_t freeitem) { struct allocitem *ptr; - struct queueitem *item = 0; + struct queueitem *tmp,*item = 0; lock_queue(queue); if ( queue->list != 0 ) { - DL_FOREACH(queue->list,item) + DL_FOREACH_SAFE(queue->list,item,tmp) { ptr = (void *)((long)item - sizeof(struct allocitem)); if ( item == copy || (ptr->allocsize == copysize && memcmp((void *)((long)item + sizeof(struct queueitem)),(void *)((long)item + sizeof(struct queueitem)),copysize) == 0) ) @@ -321,11 +321,11 @@ void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_ void *queue_free(queue_t *queue) { - struct queueitem *item = 0; + struct queueitem *tmp,*item = 0; lock_queue(queue); if ( queue->list != 0 ) { - DL_FOREACH(queue->list,item) + DL_FOREACH_SAFE(queue->list,item,tmp) { DL_DELETE(queue->list,item); myfree(item,sizeof(struct queueitem)); @@ -338,11 +338,11 @@ void *queue_free(queue_t *queue) void *queue_clone(queue_t *clone,queue_t *queue,int32_t size) { - struct queueitem *ptr,*item = 0; + struct queueitem *ptr,*tmp,*item = 0; lock_queue(queue); if ( queue->list != 0 ) { - DL_FOREACH(queue->list,item) + DL_FOREACH_SAFE(queue->list,item,tmp) { ptr = mycalloc('c',1,sizeof(*ptr)); memcpy(ptr,item,size); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2a113134d..0c8eb2411 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -192,7 +192,7 @@ struct iguana_info uint8_t pubkey33[33]; }; -struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout; }; +struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout,height; }; struct LP_utxostats { uint32_t sessionid,lasttime,errors,swappending,spentflag,lastspentcheck,bestflag; }; @@ -209,7 +209,6 @@ struct LP_utxoinfo struct _LP_utxoinfo payment,deposit,fee; struct LP_utxostats T; struct LP_utxoswap S; - //struct LP_utxonetwork N; int32_t iambob,iamlp; uint8_t key[sizeof(bits256) + sizeof(int32_t)]; uint8_t key2[sizeof(bits256) + sizeof(int32_t)]; @@ -303,6 +302,7 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); +void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 15296bcd6..cc43a25d3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -420,30 +420,27 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; //struct LP_address *ap,*atmp; struct LP_address_utxo *up; + int32_t height; bits256 zero; struct LP_address *ap,*atmp; struct LP_address_utxo *up,*utmp; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 || coin->electrum != 0 ) continue; - /*if ( time(NULL) > coin->lastmonitor+60 ) + if ( time(NULL) > coin->lastmonitor+60 ) { portable_mutex_lock(&coin->txmutex); HASH_ITER(hh,coin->addresses,ap,atmp) { - if ( ap->monitor != 0 ) + DL_FOREACH_SAFE(ap->utxos,up,utmp) { - DL_FOREACH(ap->utxos,up) + if ( up->spentflag == 0 ) { - if ( up->spentflag == 0 ) - { - if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) - up->spentflag = (uint32_t)time(NULL); - } + if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) + up->spentflag = (uint32_t)time(NULL); } } } portable_mutex_unlock(&coin->txmutex); coin->lastmonitor = (uint32_t)time(NULL); - }*/ + } memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c4e011a15..eb1df8867 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -55,70 +55,6 @@ struct LP_pubkeyinfo uint8_t rmd160[20]; } *LP_pubkeyinfos; - -struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); - return(ap); -} - -struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - ap = calloc(1,sizeof(*ap)); - safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); - HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); - return(ap); -} - -struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) - ap = _LP_addressadd(coin,coinaddr); - return(ap); -} - -/*void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value) -{ - struct LP_address *ap; struct LP_address_utxo *up; - portable_mutex_lock(&coin->txmutex); - if ( (ap= _LP_address(coin,coinaddr)) != 0 ) - { - up = calloc(1,sizeof(*up)); - up->U.txid = txid; - up->U.vout = vout; - up->U.value = value; - DL_APPEND(ap->utxos,up); - } - portable_mutex_unlock(&coin->txmutex); -} - -void LP_address_monitor(struct LP_pubkeyinfo *pubp) -{ - struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; - return; - HASH_ITER(hh,LP_coins,coin,tmp) - { - bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - portable_mutex_lock(&coin->txmutex); - if ( (ap= _LP_address(coin,coinaddr)) != 0 ) - { - ap->monitor = (uint32_t)time(NULL); - } - portable_mutex_unlock(&coin->txmutex); - if ( coin->electrum != 0 ) - { - if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) - { - printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); - free_json(retjson); - } - } - } -}*/ - int32_t LP_pricevalid(double price) { if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2866205a8..688a7f870 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -304,7 +304,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } -void electrum_process_array(struct iguana_info *coin,cJSON *array) +void electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *array) { int32_t i,v,n; char str[65]; uint64_t value; bits256 txid; cJSON *item; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) @@ -333,6 +333,7 @@ void electrum_process_array(struct iguana_info *coin,cJSON *array) { printf(">>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); tx->outpoints[v].value = value; + LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height); } } printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); @@ -443,7 +444,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT); printf("history.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,retjson); + electrum_process_array(coin,addr,retjson); return(retjson); } @@ -452,7 +453,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT); printf("MEMPOOL.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,retjson); + electrum_process_array(coin,addr,retjson); return(retjson); } @@ -465,7 +466,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,retjson); + electrum_process_array(coin,addr,retjson); strcpy(coin->lastunspent,addr); coin->unspenttime = (uint32_t)time(NULL); } @@ -608,7 +609,7 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *item = 0; + cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *tmp,*item = 0; ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { @@ -625,11 +626,11 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) resultjson = jitem(paramsjson,i); } } - else if ( strcmp(method,"blockchain.address.subscribe") == 0 ) + /*else if ( strcmp(method,"blockchain.address.subscribe") == 0 ) never is called { printf("recv addr subscribe.(%s)\n",jprint(resultjson,0)); electrum_process_array(ep->coin,resultjson); - } + }*/ } if ( resultjson != 0 ) { @@ -644,11 +645,9 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { - DL_FOREACH(ep->pendingQ.list,item) + DL_FOREACH_SAFE(ep->pendingQ.list,item,tmp) { stritem = (struct stritem *)item; - if ( *stritem->retptrp != 0 ) - continue; if ( item->type == idnum ) { //printf("matched idnum.%d result.%p\n",idnum,resultjson); @@ -660,13 +659,13 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) } if ( stritem->expiration < ep->lasttime ) { - //DL_DELETE(ep->pendingQ.list,item); + DL_DELETE(ep->pendingQ.list,item); printf("expired (%s)\n",stritem->str); errjson = cJSON_CreateObject(); jaddnum(errjson,"id",item->type); jaddstr(errjson,"error","timeout"); *((cJSON **)stritem->retptrp) = errjson; - //free(item); + free(item); } } } @@ -708,7 +707,7 @@ void LP_dedicatedloop(void *arg) if ( ep->pendingQ.list != 0 ) { printf("list %p\n",ep->pendingQ.list); - DL_FOREACH(ep->pendingQ.list,item) + DL_FOREACH_SAFE(ep->pendingQ.list,item,tmp) { printf("item.%p\n",item); if ( item->type == 0xffffffff ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 71bde88e4..86c06f84d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -795,33 +795,13 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wifta return(signedtx); } -int32_t LP_swap_txdestaddr(char *destaddr,bits256 txid,int32_t vout,cJSON *txobj) -{ - int32_t n,m,retval = -1; cJSON *vouts,*item,*addresses,*skey; char *addr; - if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n ) - { - item = jitem(vouts,vout); - if ( (skey= jobj(item,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) - { - item = jitem(addresses,0); - if ( (addr= jstr(item,0)) != 0 ) - { - safecopy(destaddr,addr,64); - retval = 0; - } - //printf("item.(%s) -> dest.(%s)\n",jprint(item,0),destaddr); - } - } - return(retval); -} - int32_t LP_swap_getcoinaddr(char *symbol,char *coinaddr,bits256 txid,int32_t vout) { cJSON *retjson; coinaddr[0] = 0; if ( (retjson= LP_gettx(symbol,txid)) != 0 ) { - LP_swap_txdestaddr(coinaddr,txid,vout,retjson); + LP_txdestaddr(coinaddr,txid,vout,retjson); free_json(retjson); } return(coinaddr[0] != 0); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 5c327dc99..79ef1d862 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -18,6 +18,16 @@ // marketmaker // +// listunspent: valid for local node, mostly valid for electrum + +// full node + electrum for external listunspent, gettxout to validate +// pruned node + electrum for external listunspent, gettxout to validate +// full node, network for external listunspent, gettxout to validate +// pruned node, network for external listunspent, gettxout to validate +// electrum only, network for gettxout + +// locally track spends, height + uint64_t LP_value_extract(cJSON *obj) { double val = 0.; uint64_t value; @@ -29,6 +39,85 @@ uint64_t LP_value_extract(cJSON *obj) return(value); } +struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); + return(ap); +} + +struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + ap = calloc(1,sizeof(*ap)); + safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); + HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); + return(ap); +} + +struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) + ap = _LP_addressadd(coin,coinaddr); + return(ap); +} + +void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height) +{ + struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag; + portable_mutex_lock(&coin->txmutex); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + flag = 0; + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) + { + if ( up->U.height <= 0 && height > 0 ) + up->U.height = height; + flag = 1; + break; + } + } + if ( flag == 0 ) + { + up = calloc(1,sizeof(*up)); + up->U.txid = txid; + up->U.vout = vout; + up->U.height = height; + up->U.value = value; + DL_APPEND(ap->utxos,up); + } + } + portable_mutex_unlock(&coin->txmutex); +} + +/*void LP_address_monitor(struct LP_pubkeyinfo *pubp) +{ + struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; + return; + HASH_ITER(hh,LP_coins,coin,tmp) + { + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + portable_mutex_lock(&coin->txmutex); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + ap->monitor = (uint32_t)time(NULL); + } + portable_mutex_unlock(&coin->txmutex); + if ( coin->electrum != 0 ) + { + if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + { + printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); + free_json(retjson); + } + } + } +} +*/ + void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) { memcpy(key,txid.bytes,sizeof(txid)); @@ -270,9 +359,33 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) return(value + interest); } +int32_t LP_destaddr(char *destaddr,cJSON *item) +{ + int32_t m,retval = -1; cJSON *addresses,*skey; char *addr; + if ( (skey= jobj(item,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) + { + item = jitem(addresses,0); + if ( (addr= jstr(item,0)) != 0 ) + { + safecopy(destaddr,addr,64); + retval = 0; + } + //printf("item.(%s) -> dest.(%s)\n",jprint(item,0),destaddr); + } + return(retval); +} + +int32_t LP_txdestaddr(char *destaddr,bits256 txid,int32_t vout,cJSON *txobj) +{ + int32_t n,retval = -1; cJSON *vouts; + if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n ) + retval = LP_destaddr(destaddr,jitem(vouts,vout)); + return(retval); +} + uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65]; + struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65],_coinaddr[65]; if ( bits256_nonz(txid) == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) @@ -312,6 +425,9 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) { value = SATOSHIDEN * jdouble(txobj,"value"); + if ( coinaddr == 0 ) + coinaddr = _coinaddr; + LP_destaddr(coinaddr,txobj); free_json(txobj); printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); return(value); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index bf985cae1..955cdaff8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -537,11 +537,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) HASH_ADD_KEYPTR(hh2,LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); - /*if ( 0 && coin->electrum == 0 ) - { - LP_address_utxoadd(coin,coinaddr,txid,vout,value); - LP_address_utxoadd(coin,coinaddr,txid2,vout2,value2); - }*/ if ( iambob != 0 ) { if ( LP_mypeer != 0 ) @@ -715,7 +710,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; + char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; if ( coin == 0 ) { printf("coin not active\n"); @@ -732,41 +727,33 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( iambob == 0 ) values = calloc(n,sizeof(*values)); else memset(values,0,n * sizeof(*values)); - //if ( iambob == 0 && IAMLP != 0 ) - // continue; used = 0; for (i=0; ielectrum == 0 ) { - //satoshis = SATOSHIDEN * jdouble(item,"amount"); - //if ( satoshis == 0 ) - // satoshis = SATOSHIDEN * jdouble(item,"value"); - satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"txid"),juint(item,"vout")); - if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) - { - //printf("%s\n",jprint(item,0)); - values[i] = satoshis; - } else used++; + txid = jbits256(item,"txid"); + vout = juint(item,"vout"); + value = LP_value_extract(item); + height = coin->height - jint(item,"confirmations"); } else { - //{"value":1000000,"tx_hash":"4e4f818c53486c0576693b4cd379849e5ff95538b38e4100f48884073a4e7636","tx_pos":0,"height":484877} - satoshis = j64bits(item,"value"); - satoshis = LP_txvalue(destaddr,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")); - if ( LP_inventory_prevent(iambob,coin->symbol,jbits256(item,"tx_hash"),juint(item,"tx_pos")) == 0 && jint(item,"height") < coin->height ) - { - //printf("%s\n",jprint(item,0)); - values[i] = satoshis; - } - else - { - printf("skip.(%s) coinht.%d\n",jprint(item,0),coin->height); - used++; - } + txid = jbits256(item,"tx_hash"); + vout = juint(item,"tx_pos"); + value = j64bits(item,"value"); + height = jint(item,"height"); } - //printf("%.8f ",dstr(satoshis)); + satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); + if ( satoshis != value ) + printf("unexpected privkey_init value mismatch %.8f vs %.8f (%s)\n",dstr(satoshis),dstr(value),jprint(item,0)); + if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) + { + //printf("%s\n",jprint(item,0)); + values[i] = satoshis; + LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height); + } else used++; } //printf("array.%d\n",n); while ( used < n-1 ) From de569dec826d48f546647a72606f265fb5689a3f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 14:19:43 +0200 Subject: [PATCH 0257/2732] Test --- iguana/exchanges/LP_include.h | 4 +- iguana/exchanges/LP_nativeDEX.c | 4 +- iguana/exchanges/LP_socket.c | 4 +- iguana/exchanges/LP_transaction.c | 7 +-- iguana/exchanges/LP_utxo.c | 77 +++++++++++++++---------------- iguana/exchanges/LP_utxos.c | 2 +- 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0c8eb2411..1de4733c5 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -219,7 +219,7 @@ struct LP_address_utxo { struct LP_address_utxo *next,*prev; struct _LP_utxoinfo U; - uint32_t height,SPV,spentflag; + uint32_t height,SPV,spendheight; }; struct LP_address @@ -302,7 +302,7 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); -void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height); +void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cc43a25d3..9bc79a954 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -431,10 +431,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { DL_FOREACH_SAFE(ap->utxos,up,utmp) { - if ( up->spentflag == 0 ) + if ( up->spendheight <= 0 ) { if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) - up->spentflag = (uint32_t)time(NULL); + up->spendheight = 1; } } } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 688a7f870..78f83a387 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -333,7 +333,7 @@ void electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *array { printf(">>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); tx->outpoints[v].value = value; - LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height); + LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); } } printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); @@ -461,7 +461,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) + if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 86c06f84d..19169356d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1053,7 +1053,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t v) { - cJSON *txobj,*vouts,*vout,*addresses,*item,*skey; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0; + cJSON *txobj,*vouts,*vout; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; int32_t n,suppress_pubkeys = 0; if ( valuep != 0 ) *valuep = 0; if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) @@ -1065,7 +1065,7 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u if ( valuep != 0 ) *valuep = LP_value_extract(vout); //printf("VOUT.(%s)\n",jprint(vout,0)); - if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) + /*if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) { item = jitem(addresses,0); //printf("item.(%s)\n",jprint(item,0)); @@ -1074,7 +1074,8 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u safecopy(coinaddr,addr,64); //printf("extracted.(%s)\n",coinaddr); } - } + }*/ + LP_destaddr(coinaddr,vout); } free_json(txobj); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 79ef1d862..6d0ffdc58 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -39,6 +39,30 @@ uint64_t LP_value_extract(cJSON *obj) return(value); } +int32_t LP_destaddr(char *destaddr,cJSON *item) +{ + int32_t m,retval = -1; cJSON *addresses,*skey; char *addr; + if ( (skey= jobj(item,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) + { + item = jitem(addresses,0); + if ( (addr= jstr(item,0)) != 0 ) + { + safecopy(destaddr,addr,64); + retval = 0; + } + //printf("item.(%s) -> dest.(%s)\n",jprint(item,0),destaddr); + } + return(retval); +} + +int32_t LP_txdestaddr(char *destaddr,bits256 txid,int32_t vout,cJSON *txobj) +{ + int32_t n,retval = -1; cJSON *vouts; + if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n ) + retval = LP_destaddr(destaddr,jitem(vouts,vout)); + return(retval); +} + struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) { struct LP_address *ap; @@ -63,7 +87,7 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) return(ap); } -void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height) +void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag; portable_mutex_lock(&coin->txmutex); @@ -76,6 +100,8 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int { if ( up->U.height <= 0 && height > 0 ) up->U.height = height; + if ( spendheight > 0 ) + up->spendheight = spendheight; flag = 1; break; } @@ -87,6 +113,7 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int up->U.vout = vout; up->U.height = height; up->U.value = value; + up->spendheight = spendheight; DL_APPEND(ap->utxos,up); } } @@ -192,7 +219,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) { - uint64_t interest,value = 0; cJSON *txobj,*sobj,*array; int32_t n=0; + uint64_t interest,value = 0; cJSON *txobj; *interestp = 0; destaddr[0] = 0; if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) @@ -209,13 +236,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf *interestp = SATOSHIDEN * interest; } } - if ( (sobj= jobj(txobj,"scriptPubKey")) != 0 && (array= jarray(&n,sobj,"addresses")) != 0 ) - { - strcpy(destaddr,jstri(array,0)); - //printf("set destaddr.(%s)\n",destaddr); - if ( n > 1 ) - printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); - } else printf("LP_txinterestvalue no addresses found?\n"); + LP_destaddr(destaddr,txobj); //char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } @@ -224,7 +245,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { - struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; + struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { //printf("TX.(%s)\n",jprint(txobj,0)); @@ -241,7 +262,8 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) vout = jitem(vouts,i); tx->outpoints[i].value = LP_value_extract(vout); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); - if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) + LP_destaddr(tx->outpoints[i].coinaddr,vout); + /*if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) { if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) { @@ -256,7 +278,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) } //else if ( tx->outpoints[i].value != 0 ) // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); - } + }*/ } //printf("numvouts.%d\n",numvouts); } @@ -271,12 +293,13 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) continue; if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) { - if ( spentvout < tx->numvouts ) + if ( spentvout < tx->numvouts && tx->outpoints[spentvout].spendheight <= 0 ) { tx->outpoints[spentvout].spendtxid = txid; tx->outpoints[spentvout].spendvini = i; - tx->outpoints[spentvout].spendheight = height; - //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); + tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; + LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) @@ -359,30 +382,6 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) return(value + interest); } -int32_t LP_destaddr(char *destaddr,cJSON *item) -{ - int32_t m,retval = -1; cJSON *addresses,*skey; char *addr; - if ( (skey= jobj(item,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) - { - item = jitem(addresses,0); - if ( (addr= jstr(item,0)) != 0 ) - { - safecopy(destaddr,addr,64); - retval = 0; - } - //printf("item.(%s) -> dest.(%s)\n",jprint(item,0),destaddr); - } - return(retval); -} - -int32_t LP_txdestaddr(char *destaddr,bits256 txid,int32_t vout,cJSON *txobj) -{ - int32_t n,retval = -1; cJSON *vouts; - if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n ) - retval = LP_destaddr(destaddr,jitem(vouts,vout)); - return(retval); -} - uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65],_coinaddr[65]; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 955cdaff8..e98ef55e1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -752,7 +752,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height); + LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } //printf("array.%d\n",n); From 73832d71cd79872a8a4ee752a9f53b8532d6e504 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 14:24:41 +0200 Subject: [PATCH 0258/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e98ef55e1..0cd46a170 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -752,7 +752,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); + //LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } //printf("array.%d\n",n); From 0e9a92ccc3e42a62363b990da8a29d76e9dfcd95 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 14:26:24 +0200 Subject: [PATCH 0259/2732] Test --- iguana/exchanges/LP_utxo.c | 1 + iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6d0ffdc58..409a13f9a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -90,6 +90,7 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag; + return; portable_mutex_lock(&coin->txmutex); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0cd46a170..e98ef55e1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -752,7 +752,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - //LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); + LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } //printf("array.%d\n",n); From 389d8fda803d87c25dcff6f875118f3e0a35a001 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 14:30:45 +0200 Subject: [PATCH 0260/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1de4733c5..201cb492d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -167,7 +167,7 @@ struct basilisk_swapinfo uint8_t userdata_bobrefund[256],userdata_bobrefundlen; }; -struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; char coinaddr[40]; }; +struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; char coinaddr[64]; }; struct LP_transaction { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 409a13f9a..89ed0c8dc 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -249,7 +249,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { - //printf("TX.(%s)\n",jprint(txobj,0)); + printf("TX.(%s)\n",jprint(txobj,0)); if ( coin->electrum == 0 ) height = LP_txheight(coin,txid); else height = -1; @@ -257,7 +257,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) vouts = jarray(&numvouts,txobj,"vout"); if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { - //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); + printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); for (i=0; i Date: Fri, 15 Sep 2017 14:31:50 +0200 Subject: [PATCH 0261/2732] Test --- iguana/exchanges/LP_utxo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 89ed0c8dc..6d0ffdc58 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -90,7 +90,6 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag; - return; portable_mutex_lock(&coin->txmutex); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { @@ -249,7 +248,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { - printf("TX.(%s)\n",jprint(txobj,0)); + //printf("TX.(%s)\n",jprint(txobj,0)); if ( coin->electrum == 0 ) height = LP_txheight(coin,txid); else height = -1; @@ -257,7 +256,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) vouts = jarray(&numvouts,txobj,"vout"); if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { - printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); + //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); for (i=0; i Date: Fri, 15 Sep 2017 14:44:48 +0200 Subject: [PATCH 0262/2732] Test --- iguana/exchanges/LP_rpc.c | 50 +++++++++++++++++++++++++++---------- iguana/exchanges/LP_utxos.c | 8 +++--- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 641d547ab..db062d6bc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -351,19 +351,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) } } -cJSON *LP_listunspent(char *symbol,char *coinaddr) -{ - char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); - //printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); - if ( coin == 0 || coin->inactive != 0 ) - return(cJSON_Parse("{\"error\":\"no coin\"}")); - if ( coin->electrum == 0 ) - { - sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); - return(bitcoin_json(coin,"listunspent",buf)); - } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)); -} - /*cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); @@ -410,6 +397,43 @@ cJSON *LP_validateaddress(char *symbol,char *address) } } +int32_t LP_address_ismine(char *symbol,char *address) +{ + int32_t doneflag = 0; cJSON *retjson; + if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) + { + if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) + { + doneflag = 1; + //printf("%s already ismine\n",address); + } + //printf("%s\n",jprint(retjson,0)); + free_json(retjson); + } + return(doneflag); +} + +cJSON *LP_listunspent(char *symbol,char *coinaddr) +{ + char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + //printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); + if ( coin == 0 || coin->inactive != 0 ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); + if ( coin->electrum == 0 ) + { + if ( LP_address_ismine(symbol,coinaddr) > 0 ) + { + sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); + return(bitcoin_json(coin,"listunspent",buf)); + } + else + { + printf("return local RAM listunspent\n"); + return(0); + } + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)); +} + cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { static void *ctx; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e98ef55e1..4b09a772b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -758,9 +758,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - for (i=0; i= 0 ) { item = jitem(array,i); @@ -783,7 +783,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; From 4a3172ee06b6970dd026b3b06808c8506552d574 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 15:13:49 +0200 Subject: [PATCH 0263/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_rpc.c | 7 +----- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 42 +++++++++++++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 201cb492d..b623c71a2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -303,6 +303,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); +cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); #endif diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index db062d6bc..7d23f6f0a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -425,12 +425,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) { sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); return(bitcoin_json(coin,"listunspent",buf)); - } - else - { - printf("return local RAM listunspent\n"); - return(0); - } + } else return(LP_address_utxos(coin,coinaddr,0)); } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 78f83a387..f92fb7bb0 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -470,7 +470,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON strcpy(coin->lastunspent,addr); coin->unspenttime = (uint32_t)time(NULL); } - } + } else retjson = LP_address_utxos(coin,addr,1); return(retjson); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6d0ffdc58..0c013bfe6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -34,7 +34,7 @@ uint64_t LP_value_extract(cJSON *obj) if ( (val= jdouble(obj,"amount")) < SMALLVAL ) val = jdouble(obj,"value"); if ( val > SMALLVAL ) - value = (val * SATOSHIDEN + 0.0000000049); + value = ((val + jdouble(obj,"interest")) * SATOSHIDEN + 0.0000000049); else value = 0; return(value); } @@ -120,6 +120,44 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int portable_mutex_unlock(&coin->txmutex); } +cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32_t electrumret) +{ + cJSON *item = cJSON_CreateObject(); + if ( electrumret == 0 ) + { + jaddbits256(item,"txid",up->U.txid); + jaddnum(item,"vout",up->U.vout); + jaddnum(item,"confirmations",coin->height - up->U.height); + jaddnum(item,"amount",dstr(up->U.value)); + jaddstr(item,"scriptPubKey",""); + } + else + { + jaddbits256(item,"tx_hash",up->U.txid); + jaddnum(item,"tx_pos",up->U.vout); + jaddnum(item,"height",up->U.height); + jadd64bits(item,"value",up->U.value); + } + return(item); +} + +cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) +{ + cJSON *array; struct LP_address *ap; struct LP_address_utxo *up,*tmp; + array = cJSON_CreateArray(); + portable_mutex_lock(&coin->txmutex); + if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) + { + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->spendheight <= 0 ) + jaddi(array,LP_address_item(up,electrumret)); + } + } + portable_mutex_unlock(&coin->txmutex); + return(array); +} + /*void LP_address_monitor(struct LP_pubkeyinfo *pubp) { struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; @@ -423,7 +461,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) { - value = SATOSHIDEN * jdouble(txobj,"value"); + value = SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); if ( coinaddr == 0 ) coinaddr = _coinaddr; LP_destaddr(coinaddr,txobj); From 783399dd233395400d2e80f587c3fc0fb07b480f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 15:21:15 +0200 Subject: [PATCH 0264/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4b09a772b..442a21df8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -747,7 +747,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); if ( satoshis != value ) - printf("unexpected privkey_init value mismatch %.8f vs %.8f (%s)\n",dstr(satoshis),dstr(value),jprint(item,0)); + printf("unexpected privkey_init value mismatch %.8f vs %.8f (%s) %.8f %.8f\n",dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) { //printf("%s\n",jprint(item,0)); From a448036217be3ce83bb317daad13055129374dbc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 15:23:59 +0200 Subject: [PATCH 0265/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/LP_utxo.c | 8 ++++---- iguana/exchanges/LP_utxos.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index a3e656e70..15263a593 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -57,7 +57,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) for (i=0; i>= 1; decode_hex(Dredeemscript,Dredeemlen,rstr); } - values[i] = value = LP_value_extract(txobj); + values[i] = value = LP_value_extract(txobj,1); if ( (symbol= jstr(txobj,"coin")) != 0 ) { if ( i == BASILISK_ALICESPEND || i == BASILISK_BOBPAYMENT || i == BASILISK_BOBDEPOSIT || i == BASILISK_BOBREFUND || i == BASILISK_BOBRECLAIM || i == BASILISK_ALICECLAIM ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 19169356d..51b6b2ec7 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1063,7 +1063,7 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u { vout = jitem(vouts,v); if ( valuep != 0 ) - *valuep = LP_value_extract(vout); + *valuep = LP_value_extract(vout,1); //printf("VOUT.(%s)\n",jprint(vout,0)); /*if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0c013bfe6..7a70268fe 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -28,13 +28,13 @@ // locally track spends, height -uint64_t LP_value_extract(cJSON *obj) +uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { double val = 0.; uint64_t value; if ( (val= jdouble(obj,"amount")) < SMALLVAL ) val = jdouble(obj,"value"); if ( val > SMALLVAL ) - value = ((val + jdouble(obj,"interest")) * SATOSHIDEN + 0.0000000049); + value = ((val + jdouble(obj,"interest")*addinterest) * SATOSHIDEN + 0.0000000049); else value = 0; return(value); } @@ -262,7 +262,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf destaddr[0] = 0; if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) { - if ( (value= LP_value_extract(txobj)) == 0 ) + if ( (value= LP_value_extract(txobj,0)) == 0 ) { char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); } @@ -298,7 +298,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) for (i=0; ioutpoints[i].value = LP_value_extract(vout); + tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); /*if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 442a21df8..01843bd29 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -735,7 +735,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { txid = jbits256(item,"txid"); vout = juint(item,"vout"); - value = LP_value_extract(item); + value = LP_value_extract(item,0); height = coin->height - jint(item,"confirmations"); } else From d82840481572f875e1cd831581c69abb1d6ef979 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 15:26:55 +0200 Subject: [PATCH 0266/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7a70268fe..a83d64b8f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -151,7 +151,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->spendheight <= 0 ) - jaddi(array,LP_address_item(up,electrumret)); + jaddi(array,LP_address_item(coin,up,electrumret)); } } portable_mutex_unlock(&coin->txmutex); From 13fa5392f07d34395312d822c60fe5b84c3f5528 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 15 Sep 2017 15:37:05 +0200 Subject: [PATCH 0267/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a83d64b8f..3ede8623e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -453,7 +453,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) strcpy(coinaddr,tx->outpoints[vout].coinaddr); //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); } - return(tx->outpoints[vout].value + tx->outpoints[vout].interest); + return(tx->outpoints[vout].value + 0*tx->outpoints[vout].interest); } } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); } From 223f1b3306a38fb97d6390d5b7fecb2af129ee73 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 11:30:18 +0200 Subject: [PATCH 0268/2732] Fix crash --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3ede8623e..b8926cf4d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -336,7 +336,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendtxid = txid; tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; - LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); From 6d80af2598f28a01eaa74724b249887b198324c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 13:36:47 +0200 Subject: [PATCH 0269/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++ iguana/exchanges/LP_nativeDEX.c | 40 +++++++-------- iguana/exchanges/LP_utxo.c | 90 ++++++++++++++++++++++++++++++--- iguana/exchanges/LP_utxos.c | 47 ++--------------- 4 files changed, 117 insertions(+), 68 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b76100e93..754dd6d3d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -351,6 +351,8 @@ dividends(coin, height, )\n\ return(LP_numutxos()); else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); + else if ( strcmp(method,"postutxos") == 0 ) + retstr = LP_postedutxos(argjson); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); else if ( strcmp(method,"getprices") == 0 ) @@ -388,6 +390,12 @@ dividends(coin, height, )\n\ return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); else if ( strcmp(method,"lookup") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + else if ( strcmp(method,"listunspent") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } if ( strcmp(method,"broadcast") == 0 ) { bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9bc79a954..fb492573f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -325,6 +325,7 @@ void command_rpcloop(void *myipaddr) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase) { + int32_t enable_utxos = 0; static uint32_t counter,numpeers,lastresync; //lastforward struct LP_utxoinfo *utxo,*utmp; cJSON *retjson; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp,*mostpeer; uint32_t id,now; int32_t mostutxos,nonz = 0,n=0,num,lastn=-1; now = (uint32_t)time(NULL); @@ -332,7 +333,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int origipaddr = "127.0.0.1"; if ( mypeer == 0 ) myipaddr = "127.0.0.1"; - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d peers\n",counter,LP_canbind); numpeers = LP_numpeers(); mostutxos = 0; mostpeer = 0; @@ -357,7 +357,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int // printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); if ( strcmp(peer->ipaddr,myipaddr) != 0 ) LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - if ( IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) + if ( enable_utxos && IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) { if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) { @@ -379,7 +379,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->diduquery == 0 ) { - if ( lastn != n || n < 20 ) + if ( enable_utxos && (lastn != n || n < 20) ) { lastn = n; n = LP_peer_utxosquery(mypeer,myport,pubsock,peer,now,60,100); @@ -394,14 +394,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && mostpeer != 0 && ((LP_mypeer->numutxos < mostutxos && time(NULL) > lastresync+10) || time(NULL) > lastresync+60) ) + if ( enable_utxos && LP_mypeer != 0 && mostpeer != 0 && ((LP_mypeer->numutxos < mostutxos && time(NULL) > lastresync+10) || time(NULL) > lastresync+60) ) { //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); lastresync = (uint32_t)time(NULL); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } - if ( (counter % 6000) == 10 ) + if ( enable_utxos && (counter % 6000) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase); HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) @@ -422,25 +422,35 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { int32_t height; bits256 zero; struct LP_address *ap,*atmp; struct LP_address_utxo *up,*utmp; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - if ( coin->inactive != 0 || coin->electrum != 0 ) + if ( coin->inactive != 0 ) continue; if ( time(NULL) > coin->lastmonitor+60 ) { portable_mutex_lock(&coin->txmutex); HASH_ITER(hh,coin->addresses,ap,atmp) { - DL_FOREACH_SAFE(ap->utxos,up,utmp) + if ( coin->electrum == 0 ) { - if ( up->spendheight <= 0 ) + DL_FOREACH_SAFE(ap->utxos,up,utmp) { - if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) - up->spendheight = 1; + if ( up->spendheight <= 0 ) + { + if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) + up->spendheight = 1; + } } } + else + { + if ( (retjson= electrum_address_listunspent(coin->symbol,coin->electrum,&retjson,ap->coinaddr)) != 0 ) + free_json(retjson); + } } portable_mutex_unlock(&coin->txmutex); coin->lastmonitor = (uint32_t)time(NULL); } + if ( coin->electrum != 0 ) + continue; memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { @@ -450,16 +460,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->firstrefht != 0 ) printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); } else LP_mempoolscan(coin->symbol,zero); - /*if ( (obj= LP_getinfo(coin->symbol)) != 0 ) - { - if ( (height= jint(obj,"blocks")) > coin->longestchain ) - { - coin->longestchain = height; - if ( coin->firstrefht != 0 ) - printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); - } else LP_mempoolscan(coin->symbol,zero); - free_json(obj); - } else printf("error getting info.%s\n",coin->symbol);*/ coin->lastgetinfo = (uint32_t)time(NULL); } if ( coin->firstrefht == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b8926cf4d..e47c2768e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -87,6 +87,15 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) return(ap); } +struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + portable_mutex_lock(&coin->txmutex); + ap = _LP_addressfind(coin,coinaddr); + portable_mutex_unlock(&coin->txmutex); + return(ap); +} + void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag; @@ -145,19 +154,88 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { cJSON *array; struct LP_address *ap; struct LP_address_utxo *up,*tmp; array = cJSON_CreateArray(); - portable_mutex_lock(&coin->txmutex); - if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) + if ( coinaddr != 0 && coinaddr[0] != 0 ) { - DL_FOREACH_SAFE(ap->utxos,up,tmp) + portable_mutex_lock(&coin->txmutex); + if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) { - if ( up->spendheight <= 0 ) - jaddi(array,LP_address_item(coin,up,electrumret)); + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->spendheight <= 0 ) + jaddi(array,LP_address_item(coin,up,electrumret)); + } } + portable_mutex_unlock(&coin->txmutex); } - portable_mutex_unlock(&coin->txmutex); return(array); } +void LP_postutxos(int32_t pubsock,char *symbol) +{ + bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); + if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + if ( cJSON_GetArraySize(array) == 0 ) + free_json(array); + else + { + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","postutxos"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"coinaddr",coin->smartaddr); + jadd(reqjson,"utxos",array); + msg = jprint(reqjson,1); + printf("post (%s)\n",msg); + LP_broadcast_message(pubsock,symbol,symbol,zero,msg); + } + } +} + +char *LP_postedutxos(cJSON *argjson) +{ + int32_t i,n,v,ht,errs,height; uint64_t value,val; cJSON *array,*item,*txobj; bits256 txid; char str[65],*symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; + if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig + { + printf("posted.(%s)\n",jprint(argjson,0)); + if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) + { + if ( (array= jarray(&n,argjson,"utxos")) != 0 ) + { + for (i=0; ielectrum == 0 && (txobj= LP_gettxout(symbol,txid,v)) != 0 ) + { + value = LP_value_extract(txobj,0); + if ( value != val ) + { + printf("%s %s/v%d value.%llu vs %llu\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val); + errs++; + } + ht = coin->height - jint(txobj,"confirmations"); + if ( ht != height ) + { + printf("%s %s/v%d ht.%d vs %d\n",symbol,bits256_str(str,txid),v,ht,height); + errs++; + } + free_json(txobj); + } + if ( errs == 0 ) + LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); + } + } + } + else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr)) != 0 ) + free_json(array); + } + return(clonestr("{\"result\":\"success\"}")); +} + /*void LP_address_monitor(struct LP_pubkeyinfo *pubp) { struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 01843bd29..124e813d4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -249,6 +249,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn) { int32_t i,n,m; uint64_t val,val2; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); + printf("deprecated! LP_utxos\n"); //n = mypeer != 0 ? mypeer->numutxos : 0; if ( lastn <= 0 ) lastn = LP_PROPAGATION_SLACK * 2; @@ -365,32 +366,12 @@ char *LP_spentcheck(cJSON *argjson) void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) { bits256 zero; char *msg; - if ( LP_isunspent(utxo) > 0 ) + if ( 0 && LP_isunspent(utxo) > 0 ) { memset(zero.bytes,0,sizeof(zero)); msg = jprint(LP_utxojson(utxo),1); LP_broadcast_message(LP_mypubsock,utxo->coin,"",zero,msg); } - /*struct LP_peerinfo *peer,*tmp; cJSON *retjson; char *retstr; int32_t n = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( (retstr= issue_LP_notifyutxo(peer->ipaddr,peer->port,utxo)) != 0 ) - { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( jobj(retjson,"error") == 0 ) - { - utxo->T.lasttime = (uint32_t)time(NULL); - n++; - } - free_json(retjson); - } - free(retstr); - } - //if ( utxo->T.lasttime != 0 ) - // return(0); - } - return(n);*/ } struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) @@ -419,27 +400,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("trying to add Alice utxo when not mine? %s/v%d\n",bits256_str(str,txid),vout); return(0); } - /*numconfirms = -1; - if ( (txobj= LP_gettx(symbol,txid)) != 0 ) - { - if ( coin->electrum == 0 ) - numconfirms = jint(txobj,"confirmations"); - else numconfirms = coin->height - jint(txobj,"height"); - free_json(txobj); - } - numconfirms = -1; - if ( (txobj= LP_gettx(symbol,txid2)) != 0 ) - { - if ( coin->electrum == 0 ) - numconfirms = jint(txobj,"confirmations"); - else numconfirms = coin->height - jint(txobj,"height"); - free_json(txobj); - } - if ( numconfirms <= 0 ) - { - printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); - return(0); - }*/ if ( coin->inactive == 0 ) { if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) @@ -612,6 +572,8 @@ int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t n int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport,int32_t maxentries) { char *retstr; struct LP_peerinfo *peer; uint32_t now; int32_t retval = -1; + printf("deprecated LP_utxosquery\n"); + return(-1); peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); if ( coin == 0 ) coin = ""; @@ -841,6 +803,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } } free_json(array); + LP_postutxos(mypubsock,coin->symbol); } //printf("privkey.%s %.8f\n",symbol,dstr(total)); return(total); From abab098a254e8538aa31d6eb880c9a61bbf81356 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 13:44:56 +0200 Subject: [PATCH 0270/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 754dd6d3d..1f907a3b7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -371,9 +371,11 @@ dividends(coin, height, )\n\ return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); else if ( strcmp(method,"utxo") == 0 ) { - if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) - retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); - else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); + printf("deprecated utxo received\n"); + //if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) + // retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); + //else + retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); } else { From a829b2006b747939f59d61e7c61f447f0fde083f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 13:51:47 +0200 Subject: [PATCH 0271/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++++++ iguana/exchanges/LP_utxos.c | 18 ------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7d23f6f0a..3add08caf 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -60,6 +60,8 @@ char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t por char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { char url[512],*retstr; + printf("deprecated issue_LP_numutxos\n"); + return(0); sprintf(url,"http://%s:%u/api/stats/numutxos?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); retstr = LP_issue_curl("numutxos",destip,port,url); //printf("%s -> getpeers.(%s)\n",destip,retstr); @@ -69,6 +71,8 @@ char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t por char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { char url[512]; + printf("deprecated issue_LP_getutxos\n"); + return(0); sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,numpeers,numutxos); return(LP_issue_curl("getutxos",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); @@ -77,6 +81,8 @@ char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn, char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t lastn) { char url[512];//,*retstr; + printf("deprecated issue_LP_clientgetutxos\n"); + return(0); sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=127.0.0.1&port=0",destip,destport,coin,lastn); return(LP_issue_curl("clientgetutxos",destip,destport,url)); //retstr = issue_curlt(url,LP_HTTP_TIMEOUT); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 124e813d4..b15793ce5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -587,24 +587,6 @@ int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa retval = LP_utxosparse(destipaddr,destport,retstr,now); //printf("got.(%s)\n",retstr); free(retstr); - /*i = 0; - if ( lastn >= mypeer->numutxos ) - firsti = -1; - else firsti = (mypeer->numutxos - lastn); - HASH_ITER(hh,LP_utxoinfos,utxo,tmp) - { - if ( i++ < firsti ) - continue; - if ( utxo->lasttime != now && strcmp(utxo->ipaddr,"127.0.0.1") != 0 ) - { - char str[65]; printf("{%s:%u %s} ",utxo->ipaddr,utxo->port,bits256_str(str,utxo->txid)); - flag++; - if ( (retstr= issue_LP_notifyutxo(destipaddr,destport,utxo)) != 0 ) - free(retstr); - } - } - if ( flag != 0 ) - printf(" <- missing utxos\n");*/ } return(retval); } From dbad241c598ca89f3b493832d9c6d87e3646b826 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 13:53:11 +0200 Subject: [PATCH 0272/2732] Test --- iguana/exchanges/LP_commands.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 1f907a3b7..f3155e3f9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -348,7 +348,11 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"getcoins") == 0 ) return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"numutxos") == 0 ) - return(LP_numutxos()); + { + printf("deprecated numutxos received\n"); + retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); + //return(LP_numutxos()); + } else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); else if ( strcmp(method,"postutxos") == 0 ) @@ -368,7 +372,11 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"getpeers") == 0 ) return(LP_peers()); else if ( strcmp(method,"getutxos") == 0 ) - return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); + { + printf("deprecated getutxos received\n"); + retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); + //return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); + } else if ( strcmp(method,"utxo") == 0 ) { printf("deprecated utxo received\n"); From 5fc8d634770ee69bd0de4975368d9030aab95076 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 13:54:41 +0200 Subject: [PATCH 0273/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e47c2768e..50ea4303e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -539,12 +539,12 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) { - value = SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); + value = LP_value_extract(txobj,0);//SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); if ( coinaddr == 0 ) coinaddr = _coinaddr; LP_destaddr(coinaddr,txobj); free_json(txobj); - printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); + //printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); return(value); } printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); From 3955dcc17bb2f07dbcc892acf9730a123af311dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:04:03 +0200 Subject: [PATCH 0274/2732] Test --- iguana/exchanges/LP_swap.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 8 +++----- iguana/exchanges/LP_utxos.c | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 5c024221c..bcfe946cd 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -731,7 +731,7 @@ void LP_bobloop(void *_swap) if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) m = 0; else m = 1; - while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,1)) < m ) // sync with alice + while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); @@ -784,7 +784,7 @@ void LP_aliceloop(void *_swap) if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) m = 0; else m = 1; - while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,1)) < m ) + while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); @@ -794,14 +794,14 @@ void LP_aliceloop(void *_swap) printf("error waiting for bobpayment\n"); else { - while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,1)) < swap->I.bobconfirms ) + while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { char str[65];printf("%d waiting for bobpayment to be confirmed.%d %s %s\n",n,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); - while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,1)) < swap->I.aliceconfirms ) + while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) { char str[65];printf("%d waiting for alicespend to be confirmed.%d %s %s\n",n,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 50ea4303e..c4f4a992c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -457,7 +457,7 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) return(height); } -int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) +int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t mempool) { struct iguana_info *coin; int32_t ht,numconfirms = 100; //#ifndef BASILISK_DISABLEWAITTX @@ -467,11 +467,9 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t mempool) if ( coin->electrum == 0 ) { numconfirms = -1; - if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + if ( (txobj= LP_gettxout(symbol,txid,vout)) != 0 ) { - if ( coin->electrum == 0 ) - numconfirms = jint(txobj,"confirmations"); - else numconfirms = coin->height - jint(txobj,"height"); + numconfirms = jint(txobj,"confirmations"); free_json(txobj); } else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b15793ce5..c123b7303 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -407,12 +407,12 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,0)) <= 0 ) + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) { printf("LP_utxoadd reject numconfirms.%d %s.%s\n",numconfirms,symbol,bits256_str(str,txid)); return(0); } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,0)) <= 0 ) + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,vout2,0)) <= 0 ) { printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); From 910506b89a9f946cbb9a3717eb5f52d4194c830c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:19:04 +0200 Subject: [PATCH 0275/2732] Test --- iguana/exchanges/LP_commands.c | 4 +++- iguana/exchanges/LP_utxo.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f3155e3f9..9b016a4ef 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -379,7 +379,9 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"utxo") == 0 ) { - printf("deprecated utxo received\n"); + static uint32_t counter; + if ( counter++ < 3 ) + printf("deprecated utxo received\n"); //if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) // retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); //else diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c4f4a992c..54981e51f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -173,6 +173,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum void LP_postutxos(int32_t pubsock,char *symbol) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); + printf("LP_postutxos\n"); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( cJSON_GetArraySize(array) == 0 ) From 80a7bb1613727595d854c0423d5f1297b23ec4e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:22:12 +0200 Subject: [PATCH 0276/2732] Test --- iguana/exchanges/LP_utxo.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 54981e51f..abf1a9bca 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -371,6 +371,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) else height = -1; vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); + // maybe filter so only addresses we care about are using RAM if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); @@ -380,22 +381,6 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); - /*if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) - { - if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) - { - if ( n > 1 ) - printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); - if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) - { - strcpy(tx->outpoints[i].coinaddr,address); - //printf("(%s %.8f) ",address,dstr(tx->outpoints[i].value)); - } else if ( tx->outpoints[i].value != 0 ) - printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } - //else if ( tx->outpoints[i].value != 0 ) - // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); - }*/ } //printf("numvouts.%d\n",numvouts); } @@ -416,7 +401,8 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); - printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); + if ( strcmp(coin->symbol,"BTC") != 0 ) + printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) From 8298fe598250ea2cd7d5da38660ee9d65fa75fb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:27:57 +0200 Subject: [PATCH 0277/2732] Test --- iguana/exchanges/LP_utxo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index abf1a9bca..06f28f819 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -124,6 +124,7 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int up->U.value = value; up->spendheight = spendheight; DL_APPEND(ap->utxos,up); + char str[65]; printf(">>>>>>>>>> %s %s/v%d ht.%d %.8f\n",coin->symbol,bits256_str(str,txid),vout,height,dstr(value)); } } portable_mutex_unlock(&coin->txmutex); @@ -173,7 +174,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum void LP_postutxos(int32_t pubsock,char *symbol) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); - printf("LP_postutxos\n"); + printf("LP_postutxos pubsock.%d %s\n",pubsock,symbol); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( cJSON_GetArraySize(array) == 0 ) From a7d39411e812712c599d26f4cdcee291f22f9629 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:31:32 +0200 Subject: [PATCH 0278/2732] Test --- iguana/exchanges/LP_utxo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 06f28f819..b79a851c4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -124,7 +124,9 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int up->U.value = value; up->spendheight = spendheight; DL_APPEND(ap->utxos,up); - char str[65]; printf(">>>>>>>>>> %s %s/v%d ht.%d %.8f\n",coin->symbol,bits256_str(str,txid),vout,height,dstr(value)); + char str[65]; + if ( height > 0 ) + printf(">>>>>>>>>> %s %s/v%d ht.%d %.8f\n",coin->symbol,bits256_str(str,txid),vout,height,dstr(value)); } } portable_mutex_unlock(&coin->txmutex); From 71b9e3f3f3e4990c65e02f4dba0960321d6110d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:33:14 +0200 Subject: [PATCH 0279/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b79a851c4..3d3429703 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -126,7 +126,7 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int DL_APPEND(ap->utxos,up); char str[65]; if ( height > 0 ) - printf(">>>>>>>>>> %s %s/v%d ht.%d %.8f\n",coin->symbol,bits256_str(str,txid),vout,height,dstr(value)); + printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } portable_mutex_unlock(&coin->txmutex); @@ -176,9 +176,9 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum void LP_postutxos(int32_t pubsock,char *symbol) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); - printf("LP_postutxos pubsock.%d %s\n",pubsock,symbol); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { + printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); if ( cJSON_GetArraySize(array) == 0 ) free_json(array); else From 588f0dd2a41a511e7fc110caa26ec3ce93a3cb52 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:35:52 +0200 Subject: [PATCH 0280/2732] Test --- iguana/exchanges/LP_utxo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3d3429703..71668b3d9 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -170,6 +170,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } portable_mutex_unlock(&coin->txmutex); } + printf("%s %s utxos.(%s)\n",coin->symbol,coinaddr,jprint(array,0)); return(array); } From 05853e58228c3073a532b8eb581659853c499086 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:40:22 +0200 Subject: [PATCH 0281/2732] Test --- iguana/exchanges/LP_utxo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 71668b3d9..ddf85de98 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -155,7 +155,7 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array; struct LP_address *ap; struct LP_address_utxo *up,*tmp; + cJSON *array; struct LP_address *ap=0; struct LP_address_utxo *up,*tmp; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -164,13 +164,14 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { DL_FOREACH_SAFE(ap->utxos,up,tmp) { + char str[65]; printf("%s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->height,up->spendheight); if ( up->spendheight <= 0 ) jaddi(array,LP_address_item(coin,up,electrumret)); } } portable_mutex_unlock(&coin->txmutex); } - printf("%s %s utxos.(%s)\n",coin->symbol,coinaddr,jprint(array,0)); + printf("%s %s utxos.(%s) ap.%p\n",coin->symbol,coinaddr,jprint(array,0),ap); return(array); } From e0b2d43a2daf11379429043e460a5d60d6f7c5bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:49:38 +0200 Subject: [PATCH 0282/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxo.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b623c71a2..e80e60318 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -219,7 +219,7 @@ struct LP_address_utxo { struct LP_address_utxo *next,*prev; struct _LP_utxoinfo U; - uint32_t height,SPV,spendheight; + uint32_t SPV,spendheight; }; struct LP_address diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ddf85de98..1f0cfcfda 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -164,9 +164,12 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("%s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->height,up->spendheight); + char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); if ( up->spendheight <= 0 ) + { jaddi(array,LP_address_item(coin,up,electrumret)); + printf("new array %s\n",jprint(array,0)); + } } } portable_mutex_unlock(&coin->txmutex); From 44e914d4fcace954b6ad2f41167516b04722d9fa Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 14:53:04 +0200 Subject: [PATCH 0283/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e80e60318..4f150531a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -219,7 +219,7 @@ struct LP_address_utxo { struct LP_address_utxo *next,*prev; struct _LP_utxoinfo U; - uint32_t SPV,spendheight; + int32_t SPV,spendheight; }; struct LP_address From 063c997045bcbedbae38b8d942e3a96d8e22167f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:01:02 +0200 Subject: [PATCH 0284/2732] Test --- iguana/exchanges/LP_utxo.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1f0cfcfda..2bace101c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -124,9 +124,9 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int up->U.value = value; up->spendheight = spendheight; DL_APPEND(ap->utxos,up); - char str[65]; - if ( height > 0 ) - printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + //char str[65]; + //if ( height > 0 ) + // printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } portable_mutex_unlock(&coin->txmutex); @@ -164,17 +164,17 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); + //char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); if ( up->spendheight <= 0 ) { jaddi(array,LP_address_item(coin,up,electrumret)); - printf("new array %s\n",jprint(array,0)); + //printf("new array %s\n",jprint(array,0)); } } } portable_mutex_unlock(&coin->txmutex); } - printf("%s %s utxos.(%s) ap.%p\n",coin->symbol,coinaddr,jprint(array,0),ap); + //printf("%s %s utxos.(%s) ap.%p\n",coin->symbol,coinaddr,jprint(array,0),ap); return(array); } @@ -183,7 +183,7 @@ void LP_postutxos(int32_t pubsock,char *symbol) bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { - printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); + //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); if ( cJSON_GetArraySize(array) == 0 ) free_json(array); else From e56abd45628e9903d949157ffd1f14adb0a80588 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:11:05 +0200 Subject: [PATCH 0285/2732] Test --- iguana/exchanges/LP_include.h | 3 ++- iguana/exchanges/LP_socket.c | 16 +++++++++------- iguana/exchanges/LP_utxo.c | 6 ++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4f150531a..6e9dffa92 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -302,8 +302,9 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); -void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); +int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); +void LP_postutxos(int32_t pubsock,char *symbol); #endif diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f92fb7bb0..9d825da63 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -304,9 +304,9 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } -void electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *array) +int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *array) { - int32_t i,v,n; char str[65]; uint64_t value; bits256 txid; cJSON *item; struct LP_transaction *tx; + int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; i>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); tx->outpoints[v].value = value; - LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); + flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); } } printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } } } + return(flag); } cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) @@ -452,7 +453,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * { cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT); - printf("MEMPOOL.(%s)\n",jprint(retjson,0)); + //printf("MEMPOOL.(%s)\n",jprint(retjson,0)); electrum_process_array(coin,addr,retjson); return(retjson); } @@ -465,8 +466,9 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,addr,retjson); + //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + if ( electrum_process_array(coin,addr,retjson) != 0 ) + LP_postutxos(LP_mypubsock,coin->symbol); strcpy(coin->lastunspent,addr); coin->unspenttime = (uint32_t)time(NULL); } @@ -614,7 +616,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("strjson.(%s)\n",jprint(strjson,0)); + //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2bace101c..a9acf863e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -96,9 +96,9 @@ struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr) return(ap); } -void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) +int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { - struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag; + struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; portable_mutex_lock(&coin->txmutex); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { @@ -124,12 +124,14 @@ void LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int up->U.value = value; up->spendheight = spendheight; DL_APPEND(ap->utxos,up); + retval = 1; //char str[65]; //if ( height > 0 ) // printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } portable_mutex_unlock(&coin->txmutex); + return(retval); } cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32_t electrumret) From f9f2252b141f62a052f2faa14755aec4e83179d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:18:20 +0200 Subject: [PATCH 0286/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9b016a4ef..8e81a5a5e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -356,7 +356,7 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); else if ( strcmp(method,"postutxos") == 0 ) - retstr = LP_postedutxos(argjson); + return(LP_postedutxos(argjson)); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); else if ( strcmp(method,"getprices") == 0 ) From 4f89f224f0c74d73bd5f3b72113b971c14bad0f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:31:26 +0200 Subject: [PATCH 0287/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 6 +++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fb492573f..a81626a0b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -51,6 +51,7 @@ uint16_t LP_fixed_pairport,LP_publicport; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; +int32_t LP_mypushsock = -1; int32_t LP_pendingswaps,LP_showwif,USERPASS_COUNTER,IAMLP = 0; uint32_t LP_sessionid; double LP_profitratio = 1.; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index aadc2f485..7686d816d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -311,7 +311,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9d825da63..d92fc720a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) - LP_postutxos(LP_mypubsock,coin->symbol); + LP_postutxos(LP_mypushsock,coin->symbol); strcpy(coin->lastunspent,addr); coin->unspenttime = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a9acf863e..543167a4b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -180,7 +180,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum return(array); } -void LP_postutxos(int32_t pubsock,char *symbol) +void LP_postutxos(int32_t sock,char *symbol) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) @@ -196,8 +196,8 @@ void LP_postutxos(int32_t pubsock,char *symbol) jaddstr(reqjson,"coinaddr",coin->smartaddr); jadd(reqjson,"utxos",array); msg = jprint(reqjson,1); - printf("post (%s)\n",msg); - LP_broadcast_message(pubsock,symbol,symbol,zero,msg); + printf("post (%s) -> %d\n",msg,LP_mypubsock); + LP_broadcast_message(LP_mypubsock,symbol,symbol,zero,msg); } } } From d2e4a8eb732dafb8b7d5e87813a86c15debbbd1d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:40:52 +0200 Subject: [PATCH 0288/2732] Test --- iguana/exchanges/LP_utxo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 543167a4b..864586544 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -191,7 +191,8 @@ void LP_postutxos(int32_t sock,char *symbol) else { memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","postutxos"); + jaddstr(reqjson,"method","sendmessage"); + jaddstr(reqjson,"method2","postutxos"); jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"coinaddr",coin->smartaddr); jadd(reqjson,"utxos",array); From b93fcaeefcd1dfedb25056d84f0203774cc57a1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:46:27 +0200 Subject: [PATCH 0289/2732] Test --- iguana/exchanges/LP_utxo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 864586544..543167a4b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -191,8 +191,7 @@ void LP_postutxos(int32_t sock,char *symbol) else { memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","sendmessage"); - jaddstr(reqjson,"method2","postutxos"); + jaddstr(reqjson,"method","postutxos"); jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"coinaddr",coin->smartaddr); jadd(reqjson,"utxos",array); From 46893adbc367bb569e03c5d0140de298cf0a7d65 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:51:30 +0200 Subject: [PATCH 0290/2732] Test --- iguana/exchanges/LP_commands.c | 3 ++- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8e81a5a5e..c0840b6c9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -356,7 +356,7 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); else if ( strcmp(method,"postutxos") == 0 ) - return(LP_postedutxos(argjson)); + retstr = LP_postedutxos(argjson); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); else if ( strcmp(method,"getprices") == 0 ) @@ -425,6 +425,7 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); + printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 543167a4b..7368580e6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -205,9 +205,9 @@ void LP_postutxos(int32_t sock,char *symbol) char *LP_postedutxos(cJSON *argjson) { int32_t i,n,v,ht,errs,height; uint64_t value,val; cJSON *array,*item,*txobj; bits256 txid; char str[65],*symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; + printf("posted.(%s)\n",jprint(argjson,0)); if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig { - printf("posted.(%s)\n",jprint(argjson,0)); if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (array= jarray(&n,argjson,"utxos")) != 0 ) From c8b8ce05463546c6acf3011ba64883ab1ed9b5d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:57:27 +0200 Subject: [PATCH 0291/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 7686d816d..aadc2f485 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -311,7 +311,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); From 73e4b247bab25b74971403a03bae22f518d09f8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 16:00:00 +0200 Subject: [PATCH 0292/2732] Test --- iguana/exchanges/LP_commands.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c0840b6c9..f6e8ea920 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -361,6 +361,12 @@ dividends(coin, height, )\n\ retstr = clonestr("{\"result\":\"success\"}"); else if ( strcmp(method,"getprices") == 0 ) return(LP_prices()); + else if ( strcmp(method,"listunspent") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); else if ( strcmp(method,"registerall") == 0 ) @@ -402,12 +408,6 @@ dividends(coin, height, )\n\ return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); else if ( strcmp(method,"lookup") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - else if ( strcmp(method,"listunspent") == 0 ) - { - if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) - return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); - else return(clonestr("{\"error\":\"cant find coind\"}")); - } if ( strcmp(method,"broadcast") == 0 ) { bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; From f798253eb0c85803b5c5ad616ca51471907309e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 16:00:30 +0200 Subject: [PATCH 0293/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f6e8ea920..d96ccf52e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -425,7 +425,7 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); - printf("broadcast.(%s)\n",jprint(reqjson,0)); + //printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); From ce95a2067380f0d35b0a35dea802e0ce76d3da08 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 16:07:51 +0200 Subject: [PATCH 0294/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 24 +++++++++++++----------- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 18 ++++++++++++------ 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6e9dffa92..50117b1b8 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -304,7 +304,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); -void LP_postutxos(int32_t pubsock,char *symbol); +void LP_postutxos(char *symbol); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a81626a0b..12fdbf2b0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -51,7 +51,6 @@ uint16_t LP_fixed_pairport,LP_publicport; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; -int32_t LP_mypushsock = -1; int32_t LP_pendingswaps,LP_showwif,USERPASS_COUNTER,IAMLP = 0; uint32_t LP_sessionid; double LP_profitratio = 1.; @@ -402,20 +401,23 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int lastresync = (uint32_t)time(NULL); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } - if ( enable_utxos && (counter % 6000) == 10 ) + if ( (counter % 6000) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase); - HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) + if ( enable_utxos ) { - LP_utxo_spentcheck(pubsock,utxo); - } - HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) - { - LP_utxo_spentcheck(pubsock,utxo); - if ( LP_isunspent(utxo) > 0 && utxo->T.lasttime == 0 && LP_ismine(utxo) > 0 ) + HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) + { + LP_utxo_spentcheck(pubsock,utxo); + } + HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) { - char str[65]; printf("publish mybob %s\n",bits256_str(str,utxo->payment.txid)); - LP_utxo_clientpublish(utxo); + LP_utxo_spentcheck(pubsock,utxo); + if ( LP_isunspent(utxo) > 0 && utxo->T.lasttime == 0 && LP_ismine(utxo) > 0 ) + { + char str[65]; printf("publish mybob %s\n",bits256_str(str,utxo->payment.txid)); + LP_utxo_clientpublish(utxo); + } } } } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d92fc720a..a0d875503 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) - LP_postutxos(LP_mypushsock,coin->symbol); + LP_postutxos(coin->symbol); strcpy(coin->lastunspent,addr); coin->unspenttime = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7368580e6..bfe7fa206 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -180,7 +180,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum return(array); } -void LP_postutxos(int32_t sock,char *symbol) +void LP_postutxos(char *symbol) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c123b7303..1989b3f94 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -652,9 +652,10 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe return(mini); } -uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) +int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; + int32_t enable_utxos = 0; + char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,flag=0,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; if ( coin == 0 ) { printf("coin not active\n"); @@ -696,9 +697,11 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); + flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } + if ( enable_utxos == 0 ) + continue; //printf("array.%d\n",n); while ( used < n-1 ) { @@ -785,10 +788,10 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } } free_json(array); - LP_postutxos(mypubsock,coin->symbol); + LP_postutxos(coin->symbol); } //printf("privkey.%s %.8f\n",symbol,dstr(total)); - return(total); + return(flag); } char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) @@ -904,7 +907,10 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito if ( bits256_nonz(privkey) == 0 || coin->smartaddr[0] == 0 ) privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); if ( coin->inactive == 0 && initonly == 0 ) - LP_privkey_init(pubsock,coin,privkey,pubkey); + { + if ( LP_privkey_init(pubsock,coin,privkey,pubkey) > 0 ) + LP_postutxos(coin->symbol); + } } } From 7863f8c55b2b91666bed32de606c585a323b5ca8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 16:46:19 +0200 Subject: [PATCH 0295/2732] Test --- iguana/exchanges/LP_commands.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d96ccf52e..3ad0e7473 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -113,8 +113,7 @@ getcoins()\n\ getcoin(coin)\n\ portfolio()\n\ getpeers()\n\ -getutxos()\n\ -getutxos(coin, lastn)\n\ +listunspent(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ From d593091d824fbef2bbeafda1632b7ea6c435d36c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 16:52:30 +0200 Subject: [PATCH 0296/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 1989b3f94..369823855 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -700,8 +700,6 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } - if ( enable_utxos == 0 ) - continue; //printf("array.%d\n",n); while ( used < n-1 ) { @@ -785,6 +783,8 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } if ( iambob == 1 ) free(values); + if ( enable_utxos == 0 ) + break; } } free_json(array); From 917d48ce6aa504d4350ec6f550577de8559aee84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 22:11:51 +0200 Subject: [PATCH 0297/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 369823855..b5846edc7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -788,7 +788,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } } free_json(array); - LP_postutxos(coin->symbol); + //LP_postutxos(coin->symbol); } //printf("privkey.%s %.8f\n",symbol,dstr(total)); return(flag); From 5f131801c0ad2ac336298d67a7ca6c593f4e85d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 22:24:15 +0200 Subject: [PATCH 0298/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b5846edc7..0b6deaa0d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -665,7 +665,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0); - if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) + if ( 0 && is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (iambob=0; iambob<=1; iambob++) { From 2637fcf122f353d499629311dddbe692691668a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 22:26:53 +0200 Subject: [PATCH 0299/2732] Test --- iguana/exchanges/LP_utxos.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0b6deaa0d..ad4cdfee2 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -665,7 +665,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0); - if ( 0 && is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) + if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (iambob=0; iambob<=1; iambob++) { @@ -701,7 +701,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } else used++; } //printf("array.%d\n",n); - while ( used < n-1 ) + while ( 0 && used < n-1 ) { //for (i=0; isymbol); + if ( flag != 0 ) + LP_postutxos(coin->symbol); } //printf("privkey.%s %.8f\n",symbol,dstr(total)); return(flag); From c2d15a3c71c29500e851c7737b83634ef444fd75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 22:49:43 +0200 Subject: [PATCH 0300/2732] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ad4cdfee2..8d0d99753 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -697,11 +697,11 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); + //flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } //printf("array.%d\n",n); - while ( 0 && used < n-1 ) + while ( used < n-1 ) { //for (i=0; i Date: Sat, 16 Sep 2017 23:16:37 +0200 Subject: [PATCH 0301/2732] test --- iguana/exchanges/LP_utxo.c | 12 +++++++----- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bfe7fa206..da4b15b63 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -99,7 +99,7 @@ struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr) int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; - portable_mutex_lock(&coin->txmutex); + printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { flag = 0; @@ -123,14 +123,16 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->U.height = height; up->U.value = value; up->spendheight = spendheight; + portable_mutex_lock(&coin->txmutex); DL_APPEND(ap->utxos,up); + portable_mutex_unlock(&coin->txmutex); retval = 1; - //char str[65]; - //if ( height > 0 ) - // printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + char str[65]; + if ( height > 0 ) + printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } - portable_mutex_unlock(&coin->txmutex); + printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); return(retval); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d0d99753..ccb18e6b1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -697,7 +697,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - //flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); + flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } //printf("array.%d\n",n); From d362561a33cbeff29692f3d67d9f4c64fe13cd13 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:20:59 +0200 Subject: [PATCH 0302/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3ad0e7473..17293f33c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -//printf("stats_JSON(%s)\n",jprint(argjson,0)); +printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From c56e4d2913d6be769334b4bd09f59abeefa26120 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:29:54 +0200 Subject: [PATCH 0303/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index aadc2f485..4f84b0dab 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -232,17 +232,16 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 peerind = 1; sock0 = LP_peerindsock(&peerind); } - portable_mutex_lock(&LP_networkmutex); if ( sock0 >= 0 ) _LP_sendqueueadd(crc32,sock0,msg,msglen,needack * peerind); if ( sock1 >= 0 ) _LP_sendqueueadd(crc32,sock1,msg,msglen,needack); - portable_mutex_unlock(&LP_networkmutex); } void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) { //struct iguana_info *coin; int32_t flag=0,socks[2]; + portable_mutex_lock(&LP_networkmutex); if ( pubsock >= 0 ) { //socks[0] = socks[1] = -1; @@ -254,6 +253,7 @@ void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *m _LP_queuesend(crc32,pubsock,-1,msg,msglen,0); //else _LP_queuesend(socks[0],socks[1],msg,msglen,0); } else _LP_queuesend(crc32,-1,-1,msg,msglen,1); + portable_mutex_unlock(&LP_networkmutex); } // first 2 bytes == (crc32 & 0xffff) if encrypted, then nonce is next crypto_box_NONCEBYTES From 415351f36c9b518d01cdeae7a8d9f67cd3f01dad Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:33:39 +0200 Subject: [PATCH 0304/2732] Test --- iguana/exchanges/LP_coins.c | 1 + iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_scan.c | 2 ++ iguana/exchanges/LP_utxo.c | 20 ++++++++++---------- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index be84416ad..6f0b1d76d 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -243,6 +243,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) //printf("%s: (%s) (%s)\n",symbol,cdata.serverport,cdata.userpass); *coin = *cdata; portable_mutex_init(&coin->txmutex); + portable_mutex_init(&coin->addrmutex); portable_mutex_lock(&LP_coinmutex); HASH_ADD_KEYPTR(hh,LP_coins,coin->symbol,strlen(coin->symbol),coin); portable_mutex_unlock(&LP_coinmutex); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 50117b1b8..fe016e027 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -179,7 +179,7 @@ struct LP_transaction struct iguana_info { UT_hash_handle hh; - portable_mutex_t txmutex; struct LP_transaction *transactions; struct LP_address *addresses; + portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 12fdbf2b0..da09bfff5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -429,7 +429,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; if ( time(NULL) > coin->lastmonitor+60 ) { - portable_mutex_lock(&coin->txmutex); + portable_mutex_lock(&coin->addrmutex); HASH_ITER(hh,coin->addresses,ap,atmp) { if ( coin->electrum == 0 ) @@ -449,7 +449,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free_json(retjson); } } - portable_mutex_unlock(&coin->txmutex); + portable_mutex_unlock(&coin->addrmutex); coin->lastmonitor = (uint32_t)time(NULL); } if ( coin->electrum != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index ddd95f458..5f0b4175b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -184,6 +184,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } portable_mutex_lock(&coin->txmutex); + portable_mutex_lock(&coin->addrmutex); HASH_ITER(hh,coin->addresses,ap,atmp) { ap->balance = 0; @@ -220,6 +221,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } HASH_SORT(coin->addresses,sort_balance); + portable_mutex_unlock(&coin->addrmutex); portable_mutex_unlock(&coin->txmutex); printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); array = cJSON_CreateArray(); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index da4b15b63..23486304a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -90,16 +90,16 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr) { struct LP_address *ap; - portable_mutex_lock(&coin->txmutex); + portable_mutex_lock(&coin->addrmutex); ap = _LP_addressfind(coin,coinaddr); - portable_mutex_unlock(&coin->txmutex); + portable_mutex_unlock(&coin->addrmutex); return(ap); } int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; - printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { flag = 0; @@ -123,16 +123,16 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->U.height = height; up->U.value = value; up->spendheight = spendheight; - portable_mutex_lock(&coin->txmutex); + portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); - portable_mutex_unlock(&coin->txmutex); + portable_mutex_unlock(&coin->addrmutex); retval = 1; char str[65]; if ( height > 0 ) printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } - printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); return(retval); } @@ -163,7 +163,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { - portable_mutex_lock(&coin->txmutex); + portable_mutex_lock(&coin->addrmutex); if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -176,7 +176,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } } } - portable_mutex_unlock(&coin->txmutex); + portable_mutex_unlock(&coin->addrmutex); } //printf("%s %s utxos.(%s) ap.%p\n",coin->symbol,coinaddr,jprint(array,0),ap); return(array); @@ -256,12 +256,12 @@ char *LP_postedutxos(cJSON *argjson) HASH_ITER(hh,LP_coins,coin,tmp) { bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - portable_mutex_lock(&coin->txmutex); + portable_mutex_lock(&coin->addrmutex); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { ap->monitor = (uint32_t)time(NULL); } - portable_mutex_unlock(&coin->txmutex); + portable_mutex_unlock(&coin->addrmutex); if ( coin->electrum != 0 ) { if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) From 3a0d70cdd260a92cec8e9c0b80cfb0673ea07de6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:35:47 +0200 Subject: [PATCH 0305/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 17293f33c..3ad0e7473 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -printf("stats_JSON(%s)\n",jprint(argjson,0)); +//printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From fc1ae40804ff4120f8eba155fb2ebfdfa9250dbf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:39:00 +0200 Subject: [PATCH 0306/2732] Fixed hang --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 23486304a..087ed766e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -128,7 +128,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, portable_mutex_unlock(&coin->addrmutex); retval = 1; char str[65]; - if ( height > 0 ) + if ( 0 && height > 0 ) printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } From 923f13dfbd86e636783500d2a7e7d24ecf58bea9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:55:42 +0200 Subject: [PATCH 0307/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 087ed766e..af3dab692 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -163,7 +163,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { - portable_mutex_lock(&coin->addrmutex); + //portable_mutex_lock(&coin->addrmutex); if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -176,7 +176,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } } } - portable_mutex_unlock(&coin->addrmutex); + //portable_mutex_unlock(&coin->addrmutex); } //printf("%s %s utxos.(%s) ap.%p\n",coin->symbol,coinaddr,jprint(array,0),ap); return(array); From faacb59dd0641ae02aac62a758a60b46d4bb776c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 23:59:55 +0200 Subject: [PATCH 0308/2732] Listunspent script --- iguana/exchanges/listunspent | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/listunspent diff --git a/iguana/exchanges/listunspent b/iguana/exchanges/listunspent new file mode 100755 index 000000000..98c5b137d --- /dev/null +++ b/iguana/exchanges/listunspent @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"BTC\",\"address\":\"1DPDsPCNNCF5SHhPPrddXcJe78rM6CBcH3\"}" From f841465d1aaf2634fb8b3ae753da110c72f2c524 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 00:09:11 +0200 Subject: [PATCH 0309/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index af3dab692..fa2c411d4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -231,7 +231,7 @@ char *LP_postedutxos(cJSON *argjson) errs++; } ht = coin->height - jint(txobj,"confirmations"); - if ( ht != height ) + if ( ht != height && ht+1 != height ) { printf("%s %s/v%d ht.%d vs %d\n",symbol,bits256_str(str,txid),v,ht,height); errs++; From 966c9b74fa0780ba784e3ccdd74e22b334dd4707 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 00:09:37 +0200 Subject: [PATCH 0310/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fa2c411d4..935ab0527 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -227,13 +227,13 @@ char *LP_postedutxos(cJSON *argjson) value = LP_value_extract(txobj,0); if ( value != val ) { - printf("%s %s/v%d value.%llu vs %llu\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val); + printf("REJECT %s %s/v%d value.%llu vs %llu\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val); errs++; } ht = coin->height - jint(txobj,"confirmations"); if ( ht != height && ht+1 != height ) { - printf("%s %s/v%d ht.%d vs %d\n",symbol,bits256_str(str,txid),v,ht,height); + printf("REJECT %s %s/v%d ht.%d vs %d\n",symbol,bits256_str(str,txid),v,ht,height); errs++; } free_json(txobj); From a9a333c4eb0b52169cedfa2e451fc99b0dcd7a35 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 00:13:20 +0200 Subject: [PATCH 0311/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 935ab0527..7f9a2b778 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -231,7 +231,7 @@ char *LP_postedutxos(cJSON *argjson) errs++; } ht = coin->height - jint(txobj,"confirmations"); - if ( ht != height && ht+1 != height ) + if ( ht < height-2 ) { printf("REJECT %s %s/v%d ht.%d vs %d\n",symbol,bits256_str(str,txid),v,ht,height); errs++; From 7435f2070c8b009576a900411906db71a05dd98e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 00:28:32 +0200 Subject: [PATCH 0312/2732] Test --- iguana/exchanges/LP_commands.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3ad0e7473..ec67242fc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -334,7 +334,11 @@ dividends(coin, height, )\n\ argjson = reqjson; } } - if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) + if ( strcmp(method,"postprice") == 0 ) + retstr = LP_postedprice(argjson); + else if ( strcmp(method,"postutxos") == 0 ) + retstr = LP_postedutxos(argjson); + else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"result\":\"at least one of coins disabled\"}")); else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) retstr = clonestr("{\"result\":\"coin is disabled\"}"); @@ -352,10 +356,6 @@ dividends(coin, height, )\n\ retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); //return(LP_numutxos()); } - else if ( strcmp(method,"postprice") == 0 ) - retstr = LP_postedprice(argjson); - else if ( strcmp(method,"postutxos") == 0 ) - retstr = LP_postedutxos(argjson); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); else if ( strcmp(method,"getprices") == 0 ) From 9caeff592a1bc74b88ce97385eedb2bb02854234 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 00:29:41 +0200 Subject: [PATCH 0313/2732] Test --- iguana/exchanges/LP_commands.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ec67242fc..8dd2fc418 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -338,6 +338,16 @@ dividends(coin, height, )\n\ retstr = LP_postedprice(argjson); else if ( strcmp(method,"postutxos") == 0 ) retstr = LP_postedutxos(argjson); + else if ( strcmp(method,"getprices") == 0 ) + return(LP_prices()); + else if ( strcmp(method,"orderbook") == 0 ) + return(LP_orderbook(base,rel,jint(argjson,"duration"))); + else if ( strcmp(method,"listunspent") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"result\":\"at least one of coins disabled\"}")); else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) @@ -358,16 +368,6 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); - else if ( strcmp(method,"getprices") == 0 ) - return(LP_prices()); - else if ( strcmp(method,"listunspent") == 0 ) - { - if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) - return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); - else return(clonestr("{\"error\":\"cant find coind\"}")); - } - else if ( strcmp(method,"orderbook") == 0 ) - return(LP_orderbook(base,rel,jint(argjson,"duration"))); else if ( strcmp(method,"registerall") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); else if ( strcmp(method,"forward") == 0 ) From ef58f97c6915ecaca964f390bff344d056fc038e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 16:45:19 +0200 Subject: [PATCH 0314/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_peers.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index fe016e027..7bb843f13 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,6 +23,7 @@ //#define LP_STRICTPEERS +#define LP_ELECTRUM_MINPORT 8777 #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 806572415..e4551f0ac 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -58,7 +58,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; printf("addpeer (%s:%u)\n",ipaddr,port); - if ( port > 10000 ) + if ( port >= LP_ELECTRUM_MINPORT ) return(0); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) From cdc82faa26135d3a23a36da5372062ab519a3d50 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 16:48:28 +0200 Subject: [PATCH 0315/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a0d875503..ec819f99d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -616,7 +616,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - //printf("strjson.(%s)\n",jprint(strjson,0)); + printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 1631276c0f4fdd414190974e957886fa1c767a70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Sep 2017 16:49:01 +0200 Subject: [PATCH 0316/2732] Test --- iguana/exchanges/electrum.kmd | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/electrum.kmd diff --git a/iguana/exchanges/electrum.kmd b/iguana/exchanges/electrum.kmd new file mode 100755 index 000000000..747fba203 --- /dev/null +++ b/iguana/exchanges/electrum.kmd @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"96.44.166.176\",\"port\":8777}" From d1a4b07f07acf2a60b2dbef3716aec709b78efda Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 09:16:05 +0200 Subject: [PATCH 0317/2732] Test --- iguana/exchanges/LP_rpc.c | 11 ++++++----- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/electrum.kmd2 | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100755 iguana/exchanges/electrum.kmd2 diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3add08caf..b8bb2f969 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -263,8 +263,8 @@ cJSON *LP_gettx(char *symbol,bits256 txid) serialized = malloc(len); decode_hex(serialized,len,hexstr+1); //printf("DATA.(%s)\n",hexstr+1); - extraspace = calloc(1,100000); - retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,100000,serialized,len,0,0); + extraspace = calloc(1,1000000); + retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); free(serialized); free(extraspace); //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); @@ -619,9 +619,10 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * signedtx = calloc(1,len+1); strcpy(signedtx,hexstr); *completedp = is_cJSON_True(jobj(json,"complete")); - data = malloc(len >> 1); - decode_hex(data,len>>1,hexstr); - *signedtxidp = bits256_doublesha256(0,data,len >> 1); + len >>= 1; + data = malloc(len); + decode_hex(data,len,hexstr); + *signedtxidp = bits256_doublesha256(0,data,len); } //else printf("%s signrawtransaction.(%s) params.(%s)\n",coin->symbol,retstr,paramstr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index ec819f99d..854d52ec3 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -469,7 +469,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) LP_postutxos(coin->symbol); - strcpy(coin->lastunspent,addr); + safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); } } else retjson = LP_address_utxos(coin,addr,1); diff --git a/iguana/exchanges/electrum.kmd2 b/iguana/exchanges/electrum.kmd2 new file mode 100755 index 000000000..46b11276b --- /dev/null +++ b/iguana/exchanges/electrum.kmd2 @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"173.212.225.176\",\"port\":50011}" From 041963d66b46e079dae28e0ce5ece65e3db7c11a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:09:32 +0200 Subject: [PATCH 0318/2732] New orderbook --- iguana/exchanges/LP_nativeDEX.c | 5 ++- iguana/exchanges/LP_prices.c | 71 ++++++++++++++++++++++----------- iguana/exchanges/LP_utxo.c | 18 +++++++++ 3 files changed, 70 insertions(+), 24 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index da09bfff5..4c7d61328 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -84,8 +84,8 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_bitcoin.c" #include "LP_coins.c" #include "LP_rpc.c" -#include "LP_prices.c" #include "LP_utxo.c" +#include "LP_prices.c" #include "LP_scan.c" #include "LP_transaction.c" #include "LP_remember.c" @@ -356,7 +356,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //if ( IAMLP != 0 && peer->numpeers != numpeers ) // printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); if ( strcmp(peer->ipaddr,myipaddr) != 0 ) + { LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + LP_peer_pricesquery(peer->ipaddr,peer->port); + } if ( enable_utxos && IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) { if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index eb1df8867..f0b20b3de 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -18,7 +18,7 @@ // marketmaker // -struct LP_orderbookentry { bits256 txid,txid2,pubkey; double price; uint64_t basesatoshis; int32_t vout,vout2,age; }; +struct LP_orderbookentry { bits256 pubkey; double price; uint64_t basesatoshis,maxsatoshis; int32_t age,numutxos; char coinaddr[64]; }; #define LP_MAXPRICEINFOS 256 struct LP_priceinfo @@ -513,8 +513,8 @@ static int _cmp_orderbook(const void *a,const void *b) { #undef ptr_a #undef ptr_b -#define ptr_a ((struct LP_orderbookentry *)a)->basesatoshis -#define ptr_b ((struct LP_orderbookentry *)b)->basesatoshis +#define ptr_a ((struct LP_orderbookentry *)a)->maxsatoshis +#define ptr_b ((struct LP_orderbookentry *)b)->maxsatoshis if ( ptr_b > ptr_a ) return(-1); else if ( ptr_b < ptr_a ) @@ -531,60 +531,83 @@ cJSON *LP_orderbookjson(struct LP_orderbookentry *op) cJSON *item = cJSON_CreateObject(); if ( LP_pricevalid(op->price) > 0 ) { + jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); - jaddnum(item,"volume",dstr(op->basesatoshis)); - jaddbits256(item,"txid",op->txid); - jaddnum(item,"vout",op->vout); + jaddnum(item,"numutxos",op->numutxos); + jaddnum(item,"minvolume",dstr(op->basesatoshis)); + jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); + //jaddbits256(item,"txid",op->txid); + //jaddnum(item,"vout",op->vout); jaddbits256(item,"pubkey",op->pubkey); jaddnum(item,"age",op->age); } return(item); } -struct LP_orderbookentry *LP_orderbookentry(char *base,char *rel,bits256 txid,int32_t vout,bits256 txid2,int32_t vout2,double price,uint64_t basesatoshis,bits256 pubkey,int32_t age) +struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,int32_t age) { struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) { - op->txid = txid; - op->vout = vout; - op->txid2 = txid2; - op->vout2 = vout2; + //op->txid = txid; + //op->vout = vout; + //op->txid2 = txid2; + //op->vout2 = vout2; + safecopy(op->coinaddr,address,sizeof(op->coinaddr)); op->price = price; + op->numutxos = numutxos; op->basesatoshis = basesatoshis; + op->maxsatoshis = maxsatoshis; op->pubkey = pubkey; op->age = age; } return(op); } -int32_t LP_orderbookfind(struct LP_orderbookentry **array,int32_t num,bits256 txid,int32_t vout) +/*int32_t LP_orderbookfind(struct LP_orderbookentry **array,int32_t num,bits256 txid,int32_t vout) { int32_t i; for (i=0; ivout == vout && bits256_cmp(array[i]->txid,txid) == 0) || (array[i]->vout2 == vout && bits256_cmp(array[i]->txid2,txid) == 0) ) return(i); return(-1); -} +}*/ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - struct LP_utxoinfo *utxo,*tmp; struct LP_pubkeyinfo *pubp=0; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; uint32_t oldest; double price; int32_t baseid,relid; uint64_t basesatoshis,val,val2; + char coinaddr[64]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t basesatoshis,maxsatoshis; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); + if ( (basecoin= LP_coinfind(base)) == 0 ) + return(-1); now = (uint32_t)time(NULL); oldest = now - duration; - HASH_ITER(hh,LP_utxoinfos[1],utxo,tmp) + HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { - if ( pubp == 0 || bits256_cmp(pubp->pubkey,utxo->pubkey) != 0 ) - pubp = LP_pubkeyfind(utxo->pubkey); - if ( pubp != 0 && pubp->numerrors >= LP_MAXPUBKEY_ERRORS ) + if ( pubp->timestamp < oldest ) continue; + bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + basesatoshis = maxsatoshis = 0; //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); - if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamp > oldest && pubp->timestamp <= now ) + if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { - if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) + n = LP_address_minmax(&basesatoshis,&maxsatoshis,ap); + //if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL ) + //if ( polarity > 0 ) + // basesatoshis = utxo->S.satoshis; + //else basesatoshis = utxo->S.satoshis * price; + if ( polarity < 0 ) + { + basesatoshis *= price; + maxsatoshis *= price; + } + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,basesatoshis,maxsatoshis,pubp->pubkey,now - pubp->timestamp)) != 0 ) + { + *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); + (*arrayp)[num++] = op; + } + /*if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) { if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) continue; @@ -599,7 +622,8 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) LP_utxo_clientpublish(utxo); } - } + }*/ + } } return(num); @@ -851,9 +875,10 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - if ( (rand() % 100) == 0 && fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) - printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); + if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { + if ( (rand() % 100) == 0 ) + printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->matrix[basepp->ind][relpp->ind] = price; dxblend(&basepp->relvals[relpp->ind],price,0.9); dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7f9a2b778..7cbfdd91b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -96,6 +96,24 @@ struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr) return(ap); } +int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) +{ + struct LP_address_utxo *up,*tmp; int32_t n = 0; + *minp = *maxp = 0; + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->spendheight <= 0 ) + { + if ( up->U.value > *maxp ) + *maxp = up->U.value; + if ( *minp == 0 || up->U.value < *minp ) + *minp = up->U.value; + n++; + } + } + return(n); +} + int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; From 3f9c935a6f125f75a457dcd3d25dad7915641948 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:12:48 +0200 Subject: [PATCH 0319/2732] Test --- iguana/exchanges/LP_prices.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f0b20b3de..c39fcc898 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -575,7 +575,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - char coinaddr[64]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t basesatoshis,maxsatoshis; + char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t basesatoshis,maxsatoshis; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); @@ -583,9 +583,12 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * return(-1); now = (uint32_t)time(NULL); oldest = now - duration; + memset(zeroes,0,sizeof(zeroes)); HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { - if ( pubp->timestamp < oldest ) + //if ( pubp->timestamp < oldest ) + // continue; + if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); basesatoshis = maxsatoshis = 0; From 40abdf0aa76ab346baa20602cfb5a2cd4e2f2778 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:18:05 +0200 Subject: [PATCH 0320/2732] Test --- iguana/exchanges/LP_prices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c39fcc898..eaf278b3f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -592,6 +592,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); basesatoshis = maxsatoshis = 0; + printf("pubp.(%s)\n",coinaddr); //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { From 685abda748fa78ce0c0d0237fe19dd3792fdbaaf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:20:01 +0200 Subject: [PATCH 0321/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index eaf278b3f..2066af15a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -592,7 +592,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); basesatoshis = maxsatoshis = 0; - printf("pubp.(%s)\n",coinaddr); + ap = 0; //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { @@ -627,8 +627,8 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * LP_utxo_clientpublish(utxo); } }*/ - } + printf("pubp.(%s) %.8f %p\n",coinaddr,price,ap); } return(num); } From a7e1bdb26ffcb935c0d03c0a9f55c3ef3fef5dcf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:23:25 +0200 Subject: [PATCH 0322/2732] Test --- iguana/exchanges/LP_prices.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2066af15a..8fd07633d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -591,20 +591,23 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - basesatoshis = maxsatoshis = 0; + basesatoshis = maxsatoshis = n = 0; ap = 0; //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); - if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) + //if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL ) + //if ( polarity > 0 ) + // basesatoshis = utxo->S.satoshis; + //else basesatoshis = utxo->S.satoshis * price; + if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL ) { - n = LP_address_minmax(&basesatoshis,&maxsatoshis,ap); - //if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL ) - //if ( polarity > 0 ) - // basesatoshis = utxo->S.satoshis; - //else basesatoshis = utxo->S.satoshis * price; - if ( polarity < 0 ) + if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { - basesatoshis *= price; - maxsatoshis *= price; + n = LP_address_minmax(&basesatoshis,&maxsatoshis,ap); + if ( polarity < 0 ) + { + basesatoshis *= price; + maxsatoshis *= price; + } } if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,basesatoshis,maxsatoshis,pubp->pubkey,now - pubp->timestamp)) != 0 ) { From afd6476a5ffd53a187f5c018b9aee25aa86b742c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:26:11 +0200 Subject: [PATCH 0323/2732] Test --- iguana/exchanges/LP_prices.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8fd07633d..5a32af338 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -18,7 +18,7 @@ // marketmaker // -struct LP_orderbookentry { bits256 pubkey; double price; uint64_t basesatoshis,maxsatoshis; int32_t age,numutxos; char coinaddr[64]; }; +struct LP_orderbookentry { bits256 pubkey; double price; uint64_t basesatoshis,maxsatoshis; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; #define LP_MAXPRICEINFOS 256 struct LP_priceinfo @@ -539,12 +539,12 @@ cJSON *LP_orderbookjson(struct LP_orderbookentry *op) //jaddbits256(item,"txid",op->txid); //jaddnum(item,"vout",op->vout); jaddbits256(item,"pubkey",op->pubkey); - jaddnum(item,"age",op->age); + jaddnum(item,"age",time(NULL)-op->timestamp); } return(item); } -struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,int32_t age) +struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp) { struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) @@ -559,7 +559,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d op->basesatoshis = basesatoshis; op->maxsatoshis = maxsatoshis; op->pubkey = pubkey; - op->age = age; + op->timestamp = timestamp; } return(op); } @@ -609,7 +609,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * maxsatoshis *= price; } } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,basesatoshis,maxsatoshis,pubp->pubkey,now - pubp->timestamp)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,basesatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; From 7274abcf5172615c2127a00b4263422a0f61865a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:29:32 +0200 Subject: [PATCH 0324/2732] Test --- iguana/exchanges/LP_prices.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5a32af338..543d6a019 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -216,7 +216,8 @@ char *LP_prices() void LP_prices_parse(cJSON *obj) { static uint8_t zeroes[20]; - struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid; char *base,*rel,*hexstr; double askprice; + struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid; char *base,*rel,*hexstr; double askprice; uint32_t now; + now = (uint32_t)time(NULL); pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { @@ -232,7 +233,10 @@ void LP_prices_parse(cJSON *obj) //LP_address_monitor(pubp); } } - if ( (timestamp= juint(obj,"timestamp")) > pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) + timestamp = juint(obj,"timestamp"); + if ( timestamp > now ) + timestamp = now; + if ( timestamp > pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) { pubp->timestamp = timestamp; for (i=0; i Date: Mon, 18 Sep 2017 10:45:13 +0200 Subject: [PATCH 0325/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_peers.c | 24 ++++++++++++++++++++++++ iguana/exchanges/LP_prices.c | 17 ++++++++++++++--- iguana/exchanges/LP_rpc.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7bb843f13..0be95d830 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -306,6 +306,7 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); void LP_postutxos(char *symbol); +uint16_t LP_randpeer(char *destip); #endif diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index e4551f0ac..f6c2bc4f5 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -254,3 +254,27 @@ int32_t LP_numpeers() } return(numpeers); } + +uint16_t LP_randpeer(char *destip) +{ + struct LP_peerinfo *peer,*tmp; uint16_t port = 0; int32_t n,r,numpeers = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + numpeers++; + } + if ( numpeers > 0 ) + { + r = rand() % numpeers; + n = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( n++ == r ) + { + strcpy(destip,peer->ipaddr); + port = peer->port; + break; + } + } + } + return(port); +} diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 543d6a019..b604f29e8 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -530,11 +530,12 @@ static int _cmp_orderbook(const void *a,const void *b) #undef ptr_b } -cJSON *LP_orderbookjson(struct LP_orderbookentry *op) +cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) { cJSON *item = cJSON_CreateObject(); if ( LP_pricevalid(op->price) > 0 ) { + jaddstr(item,"coin",symbol); jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); @@ -548,6 +549,12 @@ cJSON *LP_orderbookjson(struct LP_orderbookentry *op) return(item); } +void LP_check_unspents(char *symbol,struct LP_orderbookentry *op) +{ + if ( op->numutxos == 0 ) + LP_listunspent_issue(symbol,op->coinaddr); +} + struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp) { struct LP_orderbookentry *op; @@ -670,7 +677,9 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) } for (i=0; ielectrum,&retjson,coinaddr)); } +void LP_listunspent_issue(char *symbol,char *coinaddr) +{ + struct iguana_info *coin; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; + if ( (coin= LP_coinfind(symbol)) != 0 ) + { + if ( coin->electrum != 0 ) + retjson = electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr); + else + { + if ( (destport= LP_randpeer(destip)) > 0 ) + { + retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); + printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); + } + } + if ( retjson != 0 ) + free_json(retjson); + if ( retstr != 0 ) + free(retstr); + } +} + cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { static void *ctx; From 3c7d8fe6e7a556f2d59ccb2cc585b0e76c588423 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:54:14 +0200 Subject: [PATCH 0326/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_prices.c | 10 +++++++--- iguana/exchanges/LP_utxo.c | 25 ++++++++++++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4c7d61328..259fa5729 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -437,6 +437,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( coin->electrum == 0 ) { + // issue listunspent DL_FOREACH_SAFE(ap->utxos,up,utmp) { if ( up->spendheight <= 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b604f29e8..a73f1118b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -649,7 +649,11 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; int32_t numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid; + uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid; + basecoin = LP_coinfind(base); + relcoin = LP_coinfind(rel); + if ( basecoin == 0 || relcoin == 0 ) + return(clonestr("{\"error\":\"base or rel not added\"}")); if ( (basepp= LP_priceinfofind(base)) == 0 || (relpp= LP_priceinfofind(rel)) == 0 ) return(clonestr("{\"error\":\"base or rel not added\"}")); if ( duration <= 0 ) @@ -679,7 +683,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { jaddi(array,LP_orderbookjson(rel,bids[i])); if ( i < 3 ) - LP_check_unspents(rel,bids[i]); + LP_address(relcoin,bids[i]->coinaddr); free(bids[i]); bids[i] = 0; } @@ -690,7 +694,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { jaddi(array,LP_orderbookjson(base,asks[i])); if ( i < 3 ) - LP_check_unspents(base,asks[i]); + LP_address(basecoin,asks[i]->coinaddr); free(asks[i]); asks[i] = 0; } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7cbfdd91b..76fdbed82 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -81,7 +81,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) { - struct LP_address *ap; + struct LP_address *ap = 0; if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) ap = _LP_addressadd(coin,coinaddr); return(ap); @@ -89,10 +89,25 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr) { - struct LP_address *ap; - portable_mutex_lock(&coin->addrmutex); - ap = _LP_addressfind(coin,coinaddr); - portable_mutex_unlock(&coin->addrmutex); + struct LP_address *ap = 0; + if ( coin != 0 ) + { + portable_mutex_lock(&coin->addrmutex); + ap = _LP_addressfind(coin,coinaddr); + portable_mutex_unlock(&coin->addrmutex); + } + return(ap); +} + +struct LP_address *LP_address(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap = 0; + if ( coin != 0 ) + { + portable_mutex_lock(&coin->addrmutex); + ap = _LP_address(coin,coinaddr); + portable_mutex_unlock(&coin->addrmutex); + } return(ap); } From 9b96ae4df7034d7e537096ec5109957b2add83c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:05:08 +0200 Subject: [PATCH 0327/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 259fa5729..f8d7b7a90 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -447,7 +447,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } } - else + else if ( 0 ) { if ( (retjson= electrum_address_listunspent(coin->symbol,coin->electrum,&retjson,ap->coinaddr)) != 0 ) free_json(retjson); From d72d3184734018ed7bbd7bf131423f50641ac70d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:06:10 +0200 Subject: [PATCH 0328/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f8d7b7a90..0af265262 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -432,7 +432,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; if ( time(NULL) > coin->lastmonitor+60 ) { - portable_mutex_lock(&coin->addrmutex); + //portable_mutex_lock(&coin->addrmutex); HASH_ITER(hh,coin->addresses,ap,atmp) { if ( coin->electrum == 0 ) @@ -447,13 +447,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } } - else if ( 0 ) + else { if ( (retjson= electrum_address_listunspent(coin->symbol,coin->electrum,&retjson,ap->coinaddr)) != 0 ) free_json(retjson); } } - portable_mutex_unlock(&coin->addrmutex); + //portable_mutex_unlock(&coin->addrmutex); coin->lastmonitor = (uint32_t)time(NULL); } if ( coin->electrum != 0 ) From de322cdfc18379cbbc983b031725b789b279a483 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:09:53 +0200 Subject: [PATCH 0329/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++++ iguana/exchanges/LP_utxo.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a73f1118b..1c273bb5a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -698,6 +698,10 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) free(asks[i]); asks[i] = 0; } + if ( basecoin->lastmonitor > 60 ) + basecoin->lastmonitor -= 60; + if ( relcoin->lastmonitor > 60 ) + relcoin->lastmonitor -= 60; jadd(retjson,"asks",array); jaddnum(retjson,"numasks",numasks); jaddstr(retjson,"base",base); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 76fdbed82..134a08be0 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -126,6 +126,8 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) n++; } } + if ( n > 0 ) + printf("n.%d %s min %.8f max %.8f\n",n,ap->coinaddr,dstr(*minp),dstr(*maxp)); return(n); } From 20b41c1c1b2cf467790647b50edd1260680a9031 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:14:08 +0200 Subject: [PATCH 0330/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 854d52ec3..c8e7840ca 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -466,7 +466,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) LP_postutxos(coin->symbol); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); @@ -616,7 +616,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("strjson.(%s)\n",jprint(strjson,0)); + //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 3d61c2761973d8d5c0080c93a09915448dc90494 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:19:27 +0200 Subject: [PATCH 0331/2732] Test --- iguana/exchanges/LP_socket.c | 14 ++++++++------ iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c8e7840ca..57334e037 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -324,19 +324,21 @@ int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *ar if (tx->height <= 0 ) { tx->height = jint(item,"height"); - printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); + printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } - if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts ) + value = j64bits(item,"value"); + v = jint(item,"tx_pos"); + if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && v >= 0 && v < tx->numvouts ) { - value = j64bits(item,"value"); if ( tx->outpoints[v].value == 0 && value != tx->outpoints[v].value ) { - printf(">>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); + printf("%s %s >>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); tx->outpoints[v].value = value; - flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); } } - printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); + if ( value != 0 && tx->height > 0 ) + flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); + //printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 134a08be0..b42d1eed5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -163,8 +163,8 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, portable_mutex_unlock(&coin->addrmutex); retval = 1; char str[65]; - if ( 0 && height > 0 ) - printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + if ( height > 0 ) + printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); From 02ffefac7f036afcddca81bdea3868914b080518 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:25:09 +0200 Subject: [PATCH 0332/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_prices.c | 14 ++++---------- iguana/exchanges/LP_socket.c | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0af265262..993e27e8f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -430,14 +430,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 ) continue; - if ( time(NULL) > coin->lastmonitor+60 ) + if ( time(NULL) > coin->lastmonitor+600 ) { //portable_mutex_lock(&coin->addrmutex); HASH_ITER(hh,coin->addresses,ap,atmp) { if ( coin->electrum == 0 ) { - // issue listunspent + LP_listunspent_issue(coin->symbol,ap->coinaddr); DL_FOREACH_SAFE(ap->utxos,up,utmp) { if ( up->spendheight <= 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1c273bb5a..40d71d55e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -549,12 +549,6 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) return(item); } -void LP_check_unspents(char *symbol,struct LP_orderbookentry *op) -{ - if ( op->numutxos == 0 ) - LP_listunspent_issue(symbol,op->coinaddr); -} - struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp) { struct LP_orderbookentry *op; @@ -698,10 +692,10 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) free(asks[i]); asks[i] = 0; } - if ( basecoin->lastmonitor > 60 ) - basecoin->lastmonitor -= 60; - if ( relcoin->lastmonitor > 60 ) - relcoin->lastmonitor -= 60; + if ( basecoin->lastmonitor > 3600 ) + basecoin->lastmonitor -= 3600; + if ( relcoin->lastmonitor > 3600 ) + relcoin->lastmonitor -= 3600; jadd(retjson,"asks",array); jaddnum(retjson,"numasks",numasks); jaddstr(retjson,"base",base); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 57334e037..9a16f7134 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -324,7 +324,7 @@ int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *ar if (tx->height <= 0 ) { tx->height = jint(item,"height"); - printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); + //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } value = j64bits(item,"value"); v = jint(item,"tx_pos"); @@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0)); + //printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) LP_postutxos(coin->symbol); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 835cd75dd18a570781c5bc3e8a28af97bf4b95cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:26:43 +0200 Subject: [PATCH 0333/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 85ad454c2..1cffef1ba 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -455,7 +455,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); - printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); + //printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); } } if ( retjson != 0 ) From 9fac1ebbb40d7b21c5e4f67f30d3c3050f53087b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:28:36 +0200 Subject: [PATCH 0334/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ccb18e6b1..76f302038 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); if ( coin->inactive == 0 && initonly == 0 ) { - if ( LP_privkey_init(pubsock,coin,privkey,pubkey) > 0 ) + if ( LP_privkey_init(pubsock,coin,privkey,pubkey) > 0 || (rand() % 10) == 0 ) LP_postutxos(coin->symbol); } } From 8056741b5e81fd1c8bea92d1ca66c790519bd50c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:33:26 +0200 Subject: [PATCH 0335/2732] Test --- iguana/exchanges/LP_rpc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1cffef1ba..be0680f4e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -455,6 +455,13 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( electrum_process_array(coin,coinaddr,retjson) != 0 ) + { + LP_postutxos(symbol); + } + } //printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); } } From f7af7a5b1d68620f5b998ecf75100dbb30adce91 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:42:31 +0200 Subject: [PATCH 0336/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 40d71d55e..7b6e78ddb 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -676,7 +676,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=0; ielectrum == 0 ) LP_address(relcoin,bids[i]->coinaddr); free(bids[i]); bids[i] = 0; @@ -687,7 +687,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=0; ielectrum == 0 ) LP_address(basecoin,asks[i]->coinaddr); free(asks[i]); asks[i] = 0; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index be0680f4e..e90da1254 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -459,7 +459,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) { if ( electrum_process_array(coin,coinaddr,retjson) != 0 ) { - LP_postutxos(symbol); + LP_postutxos(symbol); // might be good to not saturate } } //printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); From 9ccadc4f0c70f66bc4a54f24cfb35ce7bd3080d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:47:06 +0200 Subject: [PATCH 0337/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7b6e78ddb..0b3b6699b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -249,7 +249,7 @@ void LP_prices_parse(cJSON *obj) { if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { - char str[65]; printf("%s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); + //char str[65]; printf("%s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; if ( (relpp= LP_priceinfofind(rel)) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b42d1eed5..6047fb853 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -163,7 +163,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, portable_mutex_unlock(&coin->addrmutex); retval = 1; char str[65]; - if ( height > 0 ) + if ( 0 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } From 1f003c90f1e73654fc475c9f582802b377bcb2cb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 11:50:25 +0200 Subject: [PATCH 0338/2732] Test --- iguana/exchanges/LP_prices.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0b3b6699b..deef1f3a9 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -643,7 +643,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid; + uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 ) @@ -673,22 +673,22 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) // printf("%.8f ",asks[i]->price); //printf("sorted asks.%d\n",numasks); } - for (i=0; ielectrum == 0 ) - LP_address(relcoin,bids[i]->coinaddr); + if ( bids[i]->numutxos == 0 && (n == 0 || relcoin->electrum == 0) ) + LP_address(relcoin,bids[i]->coinaddr), n++; free(bids[i]); bids[i] = 0; } jadd(retjson,"bids",array); jaddnum(retjson,"numbids",numbids); array = cJSON_CreateArray(); - for (i=0; ielectrum == 0 ) - LP_address(basecoin,asks[i]->coinaddr); + if ( asks[i]->numutxos == 0 && (n == 0 || basecoin->electrum == 0) ) + LP_address(basecoin,asks[i]->coinaddr), n++; free(asks[i]); asks[i] = 0; } From f4ebbd3d1171288d1e85412a10625b98a36a632f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 12:05:01 +0200 Subject: [PATCH 0339/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 6 +++--- iguana/exchanges/LP_utxos.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0be95d830..2d0abd3c5 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -305,7 +305,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); -void LP_postutxos(char *symbol); +void LP_postutxos(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e90da1254..0f78716db 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -459,7 +459,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) { if ( electrum_process_array(coin,coinaddr,retjson) != 0 ) { - LP_postutxos(symbol); // might be good to not saturate + LP_postutxos(symbol,coinaddr); // might be good to not saturate } } //printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9a16f7134..a5204567c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -470,7 +470,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { //printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) - LP_postutxos(coin->symbol); + LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6047fb853..f0b80a966 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -217,10 +217,10 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum return(array); } -void LP_postutxos(char *symbol) +void LP_postutxos(char *symbol,char *coinaddr) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); - if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); if ( cJSON_GetArraySize(array) == 0 ) @@ -230,7 +230,7 @@ void LP_postutxos(char *symbol) memset(zero.bytes,0,sizeof(zero)); jaddstr(reqjson,"method","postutxos"); jaddstr(reqjson,"coin",symbol); - jaddstr(reqjson,"coinaddr",coin->smartaddr); + jaddstr(reqjson,"coinaddr",coinaddr); jadd(reqjson,"utxos",array); msg = jprint(reqjson,1); printf("post (%s) -> %d\n",msg,LP_mypubsock); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 76f302038..925354973 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -789,7 +789,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } free_json(array); if ( flag != 0 ) - LP_postutxos(coin->symbol); + LP_postutxos(coin->symbol,coin->smartaddr); } //printf("privkey.%s %.8f\n",symbol,dstr(total)); return(flag); @@ -909,8 +909,8 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); if ( coin->inactive == 0 && initonly == 0 ) { - if ( LP_privkey_init(pubsock,coin,privkey,pubkey) > 0 || (rand() % 10) == 0 ) - LP_postutxos(coin->symbol); + if ( LP_privkey_init(pubsock,coin,privkey,pubkey) == 0 && (rand() % 10) == 0 ) + LP_postutxos(coin->symbol,coin->smartaddr); } } } From ee81a6b6679894ca41efaa5f7d1e2ecca89e8658 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 12:12:59 +0200 Subject: [PATCH 0340/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f0b80a966..768a67286 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -242,7 +242,7 @@ void LP_postutxos(char *symbol,char *coinaddr) char *LP_postedutxos(cJSON *argjson) { int32_t i,n,v,ht,errs,height; uint64_t value,val; cJSON *array,*item,*txobj; bits256 txid; char str[65],*symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; - printf("posted.(%s)\n",jprint(argjson,0)); + //printf("posted.(%s)\n",jprint(argjson,0)); if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig { if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) From d1f3805b7668a26c8c066d667199a54f9532381b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 14:06:32 +0200 Subject: [PATCH 0341/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a5204567c..a67e2192a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -618,7 +618,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - //printf("strjson.(%s)\n",jprint(strjson,0)); + printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 26c815cf639106a7079c4dfcd4e90f229f9ed53c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 14:19:11 +0200 Subject: [PATCH 0342/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2d0abd3c5..8e8f97c6f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ //#define LP_STRICTPEERS -#define LP_ELECTRUM_MINPORT 8777 +#define LP_ELECTRUM_MINPORT 8776 #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a67e2192a..a5204567c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -618,7 +618,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("strjson.(%s)\n",jprint(strjson,0)); + //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 515dc4006dbc83e9b58946bf17d16d2c32cdac70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 14:21:19 +0200 Subject: [PATCH 0343/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 768a67286..42388f807 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -233,7 +233,7 @@ void LP_postutxos(char *symbol,char *coinaddr) jaddstr(reqjson,"coinaddr",coinaddr); jadd(reqjson,"utxos",array); msg = jprint(reqjson,1); - printf("post (%s) -> %d\n",msg,LP_mypubsock); + //printf("post (%s) -> %d\n",msg,LP_mypubsock); LP_broadcast_message(LP_mypubsock,symbol,symbol,zero,msg); } } From 013760d47e49918d616471528703b237b610c6da Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 14:35:05 +0200 Subject: [PATCH 0344/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 52d4f418d..d33f51efe 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -714,10 +714,13 @@ char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,ch desttxfee = LP_txfeecalc(LP_coinfind(rel),desttxfee); if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxopair\"}")); + printf("call LP_bestutxo\n"); if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + printf("call LP_quoteinfoinit\n"); if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + printf("call LP_quotedestinfo\n"); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); return(jprint(LP_quotejson(&Q),1)); From fa42297feed7571d992d5334b769df18e09a4db8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 16:26:43 +0200 Subject: [PATCH 0345/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d33f51efe..d5364249d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -602,7 +602,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, { if ( bestprice == 0. ) // assumes price ordered asks bestprice = price; - //printf("item.[%d] %s\n",i,jprint(item,0)); + printf("item.[%d] %s\n",i,jprint(item,0)); txid = jbits256(item,"txid"); vout = jint(item,"vout"); vol = jdouble(item,"volume"); @@ -689,6 +689,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, } free(obookstr); } + printf("bestutxo.%p %.8f %.8f\n",bestutxo,*ordermatchpricep,dstr(*bestdestsatoshisp)); if ( bestutxo == 0 || *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); bestutxo->T.bestflag = 1; From edc1568925cbe03586d3ba44147083cf1daf8e2d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 16:36:31 +0200 Subject: [PATCH 0346/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d5364249d..226e7a46d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -609,6 +609,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, metric = price / bestprice; if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { + printf("got butxo? %p\n",butxo); if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) { destsatoshis = ((butxo->S.satoshis - txfee) * price); From 054a87a548db3aaef6b81c7c5098de4c70bef88e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 17:55:50 +0200 Subject: [PATCH 0347/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++++ iguana/exchanges/LP_socket.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0f78716db..70321218b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -251,6 +251,8 @@ cJSON *LP_gettx(char *symbol,bits256 txid) coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); + if ( bits256_nonz(txid) == 0 ) + return(cJSON_Parse("{\"error\":\"null txid\"}")); if ( coin->electrum == 0 ) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); @@ -290,6 +292,8 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); + if ( bits256_nonz(txid) == 0 ) + return(cJSON_Parse("{\"error\":\"null txid\"}")); if ( coin->electrum == 0 ) { sprintf(buf,"[\"%s\", %d, true]",bits256_str(str,txid),vout); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a5204567c..dd79bb4e2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -502,6 +502,8 @@ cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp { char params[128],str[65]; sprintf(params,"[\"%s\", %d]",bits256_str(str,txid),height); + if ( bits256_nonz(txid) == 0 ) + return(cJSON_Parse("{\"error\":\"null txid\"}")); return(electrum_submit(symbol,ep,retjsonp,"blockchain.transaction.get_merkle",params,ELECTRUM_TIMEOUT)); } From d79d42663f16d3fde4024e96e7874674c83cb8f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 18:01:01 +0200 Subject: [PATCH 0348/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 226e7a46d..51ff01bbf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -607,6 +607,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vout = jint(item,"vout"); vol = jdouble(item,"volume"); metric = price / bestprice; + printf("metric %f vol %f\n",metric,vol); if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { printf("got butxo? %p\n",butxo); From b6efc38aab2870f6f396e5258423b526d4254f44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 18:07:27 +0200 Subject: [PATCH 0349/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 51ff01bbf..79551e8c1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -608,7 +608,8 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vol = jdouble(item,"volume"); metric = price / bestprice; printf("metric %f vol %f\n",metric,vol); - if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) + // check utxos > 1 for pubkey + /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { printf("got butxo? %p\n",butxo); if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) @@ -655,7 +656,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, if ( butxo != 0 ) printf("%llu %llu %d %d %d: ",(long long)(vol*SATOSHIDEN),(long long)butxo->S.satoshis,vol*SATOSHIDEN == butxo->S.satoshis,LP_isavailable(butxo) > 0,LP_ismine(butxo) == 0); printf("cant find butxo.%p or value mismatch %.8f != %.8f or bestflag.%d\n",butxo,vol,butxo!=0?dstr(butxo->S.satoshis):0,butxo->T.bestflag); - } + }*/ } else printf("self trading or blacklisted peer\n"); } else From d8037e7b5dd49f5ad0ee8885504de7abd61c39ac Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 21:39:36 +0200 Subject: [PATCH 0350/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 70321218b..43ff407a2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -139,6 +139,8 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); + if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) + return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 ) { if ( coin->electrum == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index dd79bb4e2..77b1c4004 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -644,7 +644,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { *(ep->heightp) = height; *(ep->heighttimep) = (uint32_t)time(NULL); - printf("ELECTRUM >>>>>>>>> set height.%d\n",height); + printf("%s ELECTRUM >>>>>>>>> set height.%d\n",ep->symbol,height); } } idnum = juint(strjson,"id"); From 19ee1f5e4180f2e7299fb65e00d5e861be800bcc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 22:35:46 +0200 Subject: [PATCH 0351/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 79551e8c1..566f5a8b6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -607,7 +607,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vout = jint(item,"vout"); vol = jdouble(item,"volume"); metric = price / bestprice; - printf("metric %f vol %f\n",metric,vol); + printf("metric %f vol %f add pings, electrum cache\n",metric,vol); // check utxos > 1 for pubkey /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 77b1c4004..480b78d22 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -726,7 +726,7 @@ void LP_dedicatedloop(void *arg) } DL_APPEND(ep->pendingQ.list,&sitem->DL); portable_mutex_unlock(&ep->pendingQ.mutex);*/ - //printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); + printf("%p SENT.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); queue_enqueue("pendingQ",&ep->pendingQ,&sitem->DL); flag++; } From dad559237bb9a23f3bb7c5def65dc81a62816a7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 22:48:03 +0200 Subject: [PATCH 0352/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 43ff407a2..69d4ad5ab 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -262,6 +262,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else { + printf("gettx\n"); sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { @@ -303,6 +304,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) } else { + printf("gettxout v%d\n",vout); sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { From f0315e45adbe66266b2c72a3b170ca11d25e502b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 22:50:45 +0200 Subject: [PATCH 0353/2732] Test --- iguana/exchanges/LP_transaction.c | 2 ++ iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 51b6b2ec7..bead94605 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -799,6 +799,7 @@ int32_t LP_swap_getcoinaddr(char *symbol,char *coinaddr,bits256 txid,int32_t vou { cJSON *retjson; coinaddr[0] = 0; + printf("LP_swap_getcoinaddr\n"); if ( (retjson= LP_gettx(symbol,txid)) != 0 ) { LP_txdestaddr(coinaddr,txid,vout,retjson); @@ -810,6 +811,7 @@ int32_t LP_swap_getcoinaddr(char *symbol,char *coinaddr,bits256 txid,int32_t vou int32_t basilisk_swap_getsigscript(char *symbol,uint8_t *script,int32_t maxlen,bits256 txid,int32_t vini) { cJSON *retjson,*vins,*item,*skey; int32_t n,scriptlen = 0; char *hexstr; + printf("basilisk_swap_getsigscript\n"); if ( (retjson= LP_gettx(symbol,txid)) != 0 ) { if ( (vins= jarray(&n,retjson,"vin")) != 0 && vini < n ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 42388f807..83c149ad5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -412,7 +412,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *txobj,*vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { - //printf("TX.(%s)\n",jprint(txobj,0)); + printf("LP_transactioninit.(%s)\n",jprint(txobj,0)); if ( coin->electrum == 0 ) height = LP_txheight(coin,txid); else height = -1; From 3ceaa2820ced763b76ff1eeb070e0ed90bbbcfbe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 23:40:32 +0200 Subject: [PATCH 0354/2732] Fix duplicate gets --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_scan.c | 8 ++++---- iguana/exchanges/LP_socket.c | 6 +++--- iguana/exchanges/LP_transaction.c | 2 -- iguana/exchanges/LP_utxo.c | 22 ++++++++++++---------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8e8f97c6f..5c27b039f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -300,7 +300,7 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); -int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter); +int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5f0b4175b..6d81a26c0 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -42,7 +42,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) if ( iter == 1 ) for (j=0; j<10; j++) { - if (LP_transactioninit(coin,txid,iter) == 0 ) + if (LP_transactioninit(coin,txid,iter,0) == 0 ) break; printf("transaction ht.%d init error.%d, pause\n",height,j); sleep(1); @@ -52,7 +52,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { for (j=0; j<10; j++) { - if (LP_transactioninit(coin,txid,iter) == 0 ) + if (LP_transactioninit(coin,txid,iter,0) == 0 ) break; printf("transaction ht.%d init error.%d, pause\n",height,j); sleep(1); @@ -435,8 +435,8 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) txid = jbits256i(array,i); if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { - LP_transactioninit(coin,txid,0); - LP_transactioninit(coin,txid,1); + LP_transactioninit(coin,txid,0,0); + LP_transactioninit(coin,txid,1,0); } if ( bits256_cmp(txid,searchtxid) == 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 480b78d22..750ab4fe1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -306,7 +306,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *array) { - int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item; struct LP_transaction *tx; + int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; isymbol,txid)) != 0 ) + struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; + if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { - printf("LP_transactioninit.(%s)\n",jprint(txobj,0)); if ( coin->electrum == 0 ) height = LP_txheight(coin,txid); else height = -1; @@ -456,10 +455,13 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } } - free_json(txobj); - return(0); + if ( iter == 1 ) + { + free_json(txobj); + return(0); + } else return(txobj); } //else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); - return(-1); + return(0); } int32_t LP_txheight(struct iguana_info *coin,bits256 txid) @@ -532,7 +534,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; cJSON *txobj; uint64_t value; struct iguana_info *coin; char str[65],str2[65],_coinaddr[65]; + struct LP_transaction *tx; cJSON *txobj=0; uint64_t value; struct iguana_info *coin; char str[65],str2[65],_coinaddr[65]; if ( bits256_nonz(txid) == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) @@ -541,8 +543,8 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) coinaddr[0] = 0; if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { - LP_transactioninit(coin,txid,0); - LP_transactioninit(coin,txid,1); + txobj = LP_transactioninit(coin,txid,0,0); + LP_transactioninit(coin,txid,1,txobj); tx = LP_transactionfind(coin,txid); } if ( tx != 0 ) From 16dd1657e1157a57f3b073124bf2de65da970029 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 23:41:27 +0200 Subject: [PATCH 0355/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5c27b039f..075669b2a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -300,7 +300,7 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); -int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); +cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 5948ca276..f56c28fb2 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -407,7 +407,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf return(value); } -int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) +cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 ) From 8b2be4076d5a91fd681b3a79640654ae3a1a13ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 09:37:46 +0200 Subject: [PATCH 0356/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 566f5a8b6..7984b3c13 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -608,7 +608,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vol = jdouble(item,"volume"); metric = price / bestprice; printf("metric %f vol %f add pings, electrum cache\n",metric,vol); - // check utxos > 1 for pubkey + // check utxos > 1 for pubkey, SPV validate recv'ed /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { printf("got butxo? %p\n",butxo); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f56c28fb2..5212eac5b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -262,13 +262,13 @@ char *LP_postedutxos(cJSON *argjson) value = LP_value_extract(txobj,0); if ( value != val ) { - printf("REJECT %s %s/v%d value.%llu vs %llu\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val); + printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(item,0)); errs++; } ht = coin->height - jint(txobj,"confirmations"); if ( ht < height-2 ) { - printf("REJECT %s %s/v%d ht.%d vs %d\n",symbol,bits256_str(str,txid),v,ht,height); + printf("REJECT %s %s/v%d ht.%d vs %d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jprint(item,0)); errs++; } free_json(txobj); From 9a6e80c0732ba2489abe3ee2b09e942344e90815 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 09:39:40 +0200 Subject: [PATCH 0357/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 750ab4fe1..8ae2565c2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -620,7 +620,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - //printf("strjson.(%s)\n",jprint(strjson,0)); + printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 68069b33a90316c449e70eeb7840216e297da5c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 09:43:18 +0200 Subject: [PATCH 0358/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8ae2565c2..60571a6e6 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 3 +#define ELECTRUM_TIMEOUT 5 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { From 72158b0098d1563af406aeed0be8e026b3c105d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 09:47:23 +0200 Subject: [PATCH 0359/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 5212eac5b..c7bac33cf 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -260,13 +260,13 @@ char *LP_postedutxos(cJSON *argjson) if ( coin->electrum == 0 && (txobj= LP_gettxout(symbol,txid,v)) != 0 ) { value = LP_value_extract(txobj,0); - if ( value != val ) + if ( value != 0 && value != val ) { printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(item,0)); errs++; } ht = coin->height - jint(txobj,"confirmations"); - if ( ht < height-2 ) + if ( ht != 0 && ht < height-2 ) { printf("REJECT %s %s/v%d ht.%d vs %d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jprint(item,0)); errs++; From 9439c26ee097e385d81f5669030409db16d1088a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 09:54:19 +0200 Subject: [PATCH 0360/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 60571a6e6..685ca92f7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -620,7 +620,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("strjson.(%s)\n",jprint(strjson,0)); + //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 569a3a0861661f7a322b9c77d11a83b76d903352 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 09:59:39 +0200 Subject: [PATCH 0361/2732] Test --- iguana/exchanges/LP_utxo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c7bac33cf..6ae0c00b6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -265,7 +265,9 @@ char *LP_postedutxos(cJSON *argjson) printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(item,0)); errs++; } - ht = coin->height - jint(txobj,"confirmations"); + if ( coin->height != 0 ) + ht = coin->height - jint(txobj,"confirmations"); + else ht = 0; if ( ht != 0 && ht < height-2 ) { printf("REJECT %s %s/v%d ht.%d vs %d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jprint(item,0)); From a7582f93246d3a67d97798d40eab5c9a890b2423 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 10:00:20 +0200 Subject: [PATCH 0362/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 685ca92f7..08765352f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -726,7 +726,7 @@ void LP_dedicatedloop(void *arg) } DL_APPEND(ep->pendingQ.list,&sitem->DL); portable_mutex_unlock(&ep->pendingQ.mutex);*/ - printf("%p SENT.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); + //printf("%p SENT.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); queue_enqueue("pendingQ",&ep->pendingQ,&sitem->DL); flag++; } From f03ffc970e3abe9fc931e824203990ff29a37c72 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 10:02:23 +0200 Subject: [PATCH 0363/2732] Test --- iguana/exchanges/LP_rpc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 69d4ad5ab..a4b22b12f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -262,7 +262,6 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else { - printf("gettx\n"); sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { From ddf24ad58478a2bc94e7cd69dcc0f36e4c072176 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 10:10:07 +0200 Subject: [PATCH 0364/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7984b3c13..c5ec092f1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -607,7 +607,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vout = jint(item,"vout"); vol = jdouble(item,"volume"); metric = price / bestprice; - printf("metric %f vol %f add pings, electrum cache\n",metric,vol); + printf("metric %f vol %f add pings numutxos.%d min %.8f max %.8f\n",metric,vol,jint(item,"numutxos"),jdouble(item,"minvolume"),jdouble(item,"maxvolume")); // check utxos > 1 for pubkey, SPV validate recv'ed /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { From 83978a01626cd3a7636df9f635528da4a050454c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 10:54:10 +0200 Subject: [PATCH 0365/2732] Test --- iguana/exchanges/LP_rpc.c | 17 ++++++++++++++++- iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a4b22b12f..71330a93a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -266,6 +266,12 @@ cJSON *LP_gettx(char *symbol,bits256 txid) if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); + if ( strlen(hexstr) > 50000 ) + { + printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); + free(hexstr); + return(cJSON_Parse("{\"error\":\"transaction too big\"}")); + } if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) hexstr[strlen(hexstr)-1] = 0; if ( (len= is_hexstr(hexstr+1,0)) > 2 ) @@ -274,6 +280,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); decode_hex(serialized,len,hexstr+1); + free(hexstr); //printf("DATA.(%s)\n",hexstr+1); extraspace = calloc(1,1000000); retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); @@ -282,6 +289,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); return(retjson); } else printf("non-hex tx.(%s)\n",hexstr); + free(hexstr); return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); } else printf("failed blockcjhain.transaction.get\n"); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); @@ -308,6 +316,12 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(hexobj,1); + if ( strlen(hexstr) > 50000 ) + { + printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); + free(hexstr); + return(cJSON_Parse("{\"error\":\"transaction too big\"}")); + } if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) hexstr[strlen(hexstr)-1] = 0; if ( (len= is_hexstr(hexstr+1,0)) > 2 ) @@ -317,6 +331,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) decode_hex(serialized,len,hexstr+1); LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); + free(hexstr); if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) { //printf("array.(%s)\n",jprint(array,0)); @@ -365,7 +380,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) } free_json(array); } - } + } else free(hexstr); return(retjson); } return(cJSON_Parse("{\"error\":\"couldnt get tx\"}")); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 51b6b2ec7..02c005b29 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -396,7 +396,7 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) { - uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 65536; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; + uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; maxsize = 1000000; memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) @@ -417,7 +417,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ { //printf("numinputs.%d msgtx.%d\n",numinputs,msgtx->tx_in); memset(msgtx,0,sizeof(*msgtx)); - if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,65536,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) + if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) { memset(pubkeys,0,sizeof(pubkeys)); memset(privkeys,0,sizeof(privkeys)); From e23d904fe7d132ac10909bde02c4e375e6fc947f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 10:57:38 +0200 Subject: [PATCH 0366/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 075669b2a..99381bfe9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -267,7 +267,7 @@ struct basilisk_swap struct basilisk_swapmessage *messages; int32_t nummessages,sentflag; char Bdeposit[64],Bpayment[64]; uint64_t otherdeck[INSTANTDEX_DECKSIZE][2],deck[INSTANTDEX_DECKSIZE][2]; - uint8_t persistent_pubkey33[33],changermd160[20],pad[15],verifybuf[65536]; + uint8_t persistent_pubkey33[33],changermd160[20],pad[15],verifybuf[100000]; }; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 08765352f..c1cf15f3c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 5 +#define ELECTRUM_TIMEOUT 10 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { From 26c1ea9b8d9a306ae9c82bbe04a5d927c0068608 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:12:15 +0200 Subject: [PATCH 0367/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c5ec092f1..786b05f0c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -607,7 +607,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vout = jint(item,"vout"); vol = jdouble(item,"volume"); metric = price / bestprice; - printf("metric %f vol %f add pings numutxos.%d min %.8f max %.8f\n",metric,vol,jint(item,"numutxos"),jdouble(item,"minvolume"),jdouble(item,"maxvolume")); + printf("maxdest %.8f metric %f vol %f add pings numutxos.%d min %.8f max %.8f\n",dstr(maxdestsatoshis),metric,vol,jint(item,"numutxos"),jdouble(item,"minvolume"),jdouble(item,"maxvolume")); // check utxos > 1 for pubkey, SPV validate recv'ed /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index deef1f3a9..1d6971004 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -636,7 +636,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * } }*/ } - printf("pubp.(%s) %.8f %p\n",coinaddr,price,ap); + //printf("pubp.(%s) %.8f %p\n",coinaddr,price,ap); } return(num); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c1cf15f3c..a778d0c9d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 10 +#define ELECTRUM_TIMEOUT 3 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { From 49dd22bd017374fe402c9a962d639ae9f9ef4c73 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:21:07 +0200 Subject: [PATCH 0368/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 --- iguana/exchanges/LP_prices.c | 26 ++++++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 786b05f0c..255ac95ca 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -718,13 +718,10 @@ char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,ch desttxfee = LP_txfeecalc(LP_coinfind(rel),desttxfee); if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxopair\"}")); - printf("call LP_bestutxo\n"); if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - printf("call LP_quoteinfoinit\n"); if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - printf("call LP_quotedestinfo\n"); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); return(jprint(LP_quotejson(&Q),1)); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1d6971004..84f91ce0e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -18,7 +18,7 @@ // marketmaker // -struct LP_orderbookentry { bits256 pubkey; double price; uint64_t basesatoshis,maxsatoshis; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; +struct LP_orderbookentry { bits256 pubkey; double price; uint64_t minsatoshis,maxsatoshis; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; #define LP_MAXPRICEINFOS 256 struct LP_priceinfo @@ -539,8 +539,10 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); - jaddnum(item,"minvolume",dstr(op->basesatoshis)); - jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); + if ( op->minsatoshis != 0 ) + jaddnum(item,"minvolume",1./dstr(op->minsatoshis)); + if ( op->maxsatoshis != 0 ) + jaddnum(item,"maxvolume",1./dstr(op->maxsatoshis)); //jaddbits256(item,"txid",op->txid); //jaddnum(item,"vout",op->vout); jaddbits256(item,"pubkey",op->pubkey); @@ -549,7 +551,7 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) return(item); } -struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp) +struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t minsatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp) { struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) @@ -561,7 +563,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d safecopy(op->coinaddr,address,sizeof(op->coinaddr)); op->price = price; op->numutxos = numutxos; - op->basesatoshis = basesatoshis; + op->minsatoshis = minsatoshis; op->maxsatoshis = maxsatoshis; op->pubkey = pubkey; op->timestamp = timestamp; @@ -580,7 +582,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t basesatoshis,maxsatoshis; + char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); @@ -596,25 +598,25 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - basesatoshis = maxsatoshis = n = 0; + minsatoshis = maxsatoshis = n = 0; ap = 0; //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); //if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL ) //if ( polarity > 0 ) - // basesatoshis = utxo->S.satoshis; - //else basesatoshis = utxo->S.satoshis * price; + // minsatoshis = utxo->S.satoshis; + //else minsatoshis = utxo->S.satoshis * price; if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL ) { if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { - n = LP_address_minmax(&basesatoshis,&maxsatoshis,ap); + n = LP_address_minmax(&minsatoshis,&maxsatoshis,ap); if ( polarity < 0 ) { - basesatoshis *= price; + minsatoshis *= price; maxsatoshis *= price; } } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,basesatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; From 9759b211e843d9219f29995b02937f07b04025c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:23:42 +0200 Subject: [PATCH 0369/2732] Test --- iguana/exchanges/LP_prices.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 84f91ce0e..0e3397bdd 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -539,10 +539,10 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); - if ( op->minsatoshis != 0 ) - jaddnum(item,"minvolume",1./dstr(op->minsatoshis)); - if ( op->maxsatoshis != 0 ) - jaddnum(item,"maxvolume",1./dstr(op->maxsatoshis)); + //if ( op->minsatoshis != 0 ) + jaddnum(item,"minvolume",dstr(op->minsatoshis)); + //if ( op->maxsatoshis != 0 ) + jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); //jaddbits256(item,"txid",op->txid); //jaddnum(item,"vout",op->vout); jaddbits256(item,"pubkey",op->pubkey); @@ -610,11 +610,11 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { n = LP_address_minmax(&minsatoshis,&maxsatoshis,ap); - if ( polarity < 0 ) + /*if ( polarity < 0 ) { minsatoshis *= price; maxsatoshis *= price; - } + }*/ } if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) { From 0cec1db87e83fc032e810443974224ed7da2c578 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:26:08 +0200 Subject: [PATCH 0370/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0e3397bdd..862a6e4c4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -610,11 +610,11 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { n = LP_address_minmax(&minsatoshis,&maxsatoshis,ap); - /*if ( polarity < 0 ) + if ( polarity < 0 ) { minsatoshis *= price; maxsatoshis *= price; - }*/ + } } if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) { From c6696a99d0429928f04be793fc4f7d37929fa2f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:28:02 +0200 Subject: [PATCH 0371/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 862a6e4c4..e1b5b1da7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -610,7 +610,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { n = LP_address_minmax(&minsatoshis,&maxsatoshis,ap); - if ( polarity < 0 ) + if ( polarity > 0 ) { minsatoshis *= price; maxsatoshis *= price; From 5b2b57cdc83613b71df5e76bd2a2bf51bcd9be4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:31:43 +0200 Subject: [PATCH 0372/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index e1b5b1da7..3ce4164a1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -678,7 +678,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 && (n == 0 || relcoin->electrum == 0) ) + if ( bids[i]->numutxos == 0 && relcoin->electrum == 0 ) LP_address(relcoin,bids[i]->coinaddr), n++; free(bids[i]); bids[i] = 0; @@ -689,7 +689,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 && (n == 0 || basecoin->electrum == 0) ) + if ( asks[i]->numutxos == 0 && basecoin->electrum == 0 ) LP_address(basecoin,asks[i]->coinaddr), n++; free(asks[i]); asks[i] = 0; From 71c3f448ebbc0abb27939fddf1097eccb9c5f779 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:38:48 +0200 Subject: [PATCH 0373/2732] Test --- iguana/exchanges/LP_prices.c | 30 ++++++++++++++++++++++++++++-- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 3ce4164a1..54151f67a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -524,7 +524,33 @@ static int _cmp_orderbook(const void *a,const void *b) else if ( ptr_b < ptr_a ) return(1); } - // printf("%.8f vs %.8f -> %d\n",ptr_a,ptr_b,retval); + // printf("%.8f vs %.8f -> %d\n",ptr_a,ptr_b,retval); + return(retval); +#undef ptr_a +#undef ptr_b +} + +static int _revcmp_orderbook(const void *a,const void *b) +{ + int32_t retval = 0; +#define ptr_a (*(struct LP_orderbookentry **)a)->price +#define ptr_b (*(struct LP_orderbookentry **)b)->price + if ( ptr_b > ptr_a ) + retval = 1; + else if ( ptr_b < ptr_a ) + retval = -1; + else + { +#undef ptr_a +#undef ptr_b +#define ptr_a ((struct LP_orderbookentry *)a)->maxsatoshis +#define ptr_b ((struct LP_orderbookentry *)b)->maxsatoshis + if ( ptr_b > ptr_a ) + return(-1); + else if ( ptr_b < ptr_a ) + return(1); + } + // printf("%.8f vs %.8f -> %d\n",ptr_a,ptr_b,retval); return(retval); #undef ptr_a #undef ptr_b @@ -664,7 +690,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); if ( numbids > 1 ) - qsort(bids,numbids,sizeof(*bids),_cmp_orderbook); + qsort(bids,numbids,sizeof(*bids),_revcmp_orderbook); if ( numasks > 1 ) { //for (i=0; ioutpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); if ( strcmp(coin->symbol,"BTC") != 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); - } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); + } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d spendheight.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts,tx->outpoints[spentvout].spendheight); } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); From 9280314f649f7e493f302aefd5d4ed9ef3368952 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:39:39 +0200 Subject: [PATCH 0374/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 54151f67a..afce2549e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -704,7 +704,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 && relcoin->electrum == 0 ) + if ( bids[i]->numutxos == 0 || relcoin->electrum == 0 ) LP_address(relcoin,bids[i]->coinaddr), n++; free(bids[i]); bids[i] = 0; @@ -715,7 +715,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 && basecoin->electrum == 0 ) + if ( asks[i]->numutxos == 0 || basecoin->electrum == 0 ) LP_address(basecoin,asks[i]->coinaddr), n++; free(asks[i]); asks[i] = 0; From 2d27f58802c5246f13b051c69e6f4d15c6b0e335 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:39:56 +0200 Subject: [PATCH 0375/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index afce2549e..fbcd54749 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -704,7 +704,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 || relcoin->electrum == 0 ) + if ( bids[i]->numutxos == 0 )//|| relcoin->electrum == 0 ) LP_address(relcoin,bids[i]->coinaddr), n++; free(bids[i]); bids[i] = 0; @@ -715,7 +715,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 || basecoin->electrum == 0 ) + if ( asks[i]->numutxos == 0 )//|| basecoin->electrum == 0 ) LP_address(basecoin,asks[i]->coinaddr), n++; free(asks[i]); asks[i] = 0; From d5b31da179834c2d3f7fd0dee7ad7de42ccb0ccf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:53:52 +0200 Subject: [PATCH 0376/2732] Test --- iguana/exchanges/LP_coins.c | 7 ++++++- iguana/exchanges/LP_prices.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 6f0b1d76d..6ab37355c 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -172,7 +172,7 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) { - char wifstr[128]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); + struct electrum_info *ep; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); if ( showwif != 0 ) { @@ -187,6 +187,11 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) else jaddstr(item,"status","active"); if ( coin->isPoS != 0 ) jaddstr(item,"type","PoS"); + if ( (ep= coin->electrum) != 0 ) + { + sprintf(ipaddr,"%s:%u",ep->ipaddr,ep->port); + jaddstr(item,"electrum",ipaddr); + } jaddstr(item,"smartaddress",coin->smartaddr); jaddstr(item,"rpc",coin->serverport); jaddnum(item,"pubtype",coin->pubtype); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index fbcd54749..430448a29 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -709,6 +709,8 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) free(bids[i]); bids[i] = 0; } + if ( n > 0 && relcoin->lastmonitor > 3600 ) + relcoin->lastmonitor -= 3600; jadd(retjson,"bids",array); jaddnum(retjson,"numbids",numbids); array = cJSON_CreateArray(); @@ -720,10 +722,8 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) free(asks[i]); asks[i] = 0; } - if ( basecoin->lastmonitor > 3600 ) + if ( n > 0 && basecoin->lastmonitor > 3600 ) basecoin->lastmonitor -= 3600; - if ( relcoin->lastmonitor > 3600 ) - relcoin->lastmonitor -= 3600; jadd(retjson,"asks",array); jaddnum(retjson,"numasks",numasks); jaddstr(retjson,"base",base); From c6cd9723e0faa5f4ac2511939d378db4b86079f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 14:02:16 +0200 Subject: [PATCH 0377/2732] Test --- iguana/exchanges/LP_commands.c | 21 ++- iguana/exchanges/LP_ordermatch.c | 213 +++++++++++++++++++++++++++++-- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_utxo.c | 15 +++ iguana/exchanges/buy | 2 + iguana/exchanges/install | 2 +- iguana/exchanges/sell | 2 + 7 files changed, 238 insertions(+), 19 deletions(-) create mode 100755 iguana/exchanges/buy create mode 100755 iguana/exchanges/sell diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8dd2fc418..57718f917 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -103,9 +103,8 @@ enable(coin)\n\ disable(coin)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ -ordermatch(base, txfee=0, rel, desttxfee=0, price, relvolume=0, txid, vout, feetxid, feevout, duration=3600)\n\ -trade(price, timeout=10, duration=3600, )\n\ -autotrade(base, rel, price, relvolume, timeout=10, duration=3600)\n\ +buy(base, rel, price, relvolume, timeout=10, duration=3600)\n\ +sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ @@ -212,7 +211,7 @@ dividends(coin, height, )\n\ return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"no price set\"}")); } - else if ( strcmp(method,"ordermatch") == 0 ) + /*else if ( strcmp(method,"ordermatch") == 0 ) { if ( price > SMALLVAL ) return(LP_ordermatch(base,j64bits(argjson,"txfee"),price,jdouble(argjson,"relvolume"),rel,jbits256(argjson,"txid"),jint(argjson,"vout"),jbits256(argjson,"feetxid"),jint(argjson,"feevout"),j64bits(argjson,"desttxfee"),jint(argjson,"duration"))); @@ -233,6 +232,20 @@ dividends(coin, height, )\n\ { return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set\"}")); + }*/ + else if ( strcmp(method,"buy") == 0 ) + { + if ( price > SMALLVAL ) + { + return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + } else return(clonestr("{\"error\":\"no price set\"}")); + } + else if ( strcmp(method,"sell") == 0 ) + { + if ( price > SMALLVAL ) + { + return(LP_autosell(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); + } else return(clonestr("{\"error\":\"no price set\"}")); } } else if ( rel != 0 && strcmp(method,"bestfit") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 255ac95ca..30d656dc5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -572,6 +572,17 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } +char *LP_bestfit(char *rel,double relvolume) +{ + struct LP_utxoinfo *autxo; + if ( relvolume <= 0. || LP_priceinfofind(rel) == 0 ) + return(clonestr("{\"error\":\"invalid parameter\"}")); + if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) + return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + return(jprint(LP_utxojson(autxo),1)); +} + +#ifdef oldway struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) { int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,n,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; @@ -701,16 +712,6 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, return(bestutxo); } -char *LP_bestfit(char *rel,double relvolume) -{ - struct LP_utxoinfo *autxo; - if ( relvolume <= 0. || LP_priceinfofind(rel) == 0 ) - return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) - return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - return(jprint(LP_utxojson(autxo),1)); -} - char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) { struct LP_quoteinfo Q; int64_t bestsatoshis=0,bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; @@ -727,6 +728,37 @@ char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,ch return(jprint(LP_quotejson(&Q),1)); } +char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) +{ + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + if ( duration <= 0 ) + duration = LP_ORDERBOOK_DURATION; + if ( timeout <= 0 ) + timeout = LP_AUTOTRADE_TIMEOUT; + if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) + return(clonestr("{\"error\":\"invalid parameter\"}")); + if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) + return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + LP_txfees(&txfee,&desttxfee,base,rel); + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + { + printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); + return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + } + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(clonestr("{\"error\":\"quote validation error\"}")); + } + printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); +} +#endif + char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { struct LP_utxoinfo *bobutxo,*aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; @@ -784,9 +816,132 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) +int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { - uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60); + for (i=0; iU.value - targetval); + //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + if ( dist >= 0 && dist < mindist ) + { + mini = i; + mindist = dist; + } + } + } + return(mini); +} + +struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price) +{ + struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; + if ( (ap= LP_addressfind(coin,coinaddr)) != 0 ) + { + if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) + { + targetval = SATOSHIDEN * (relvolume / price) + 2*txfee; + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) + { + up = utxos[mini]; + utxos[mini] = 0; + targetval = (targetval / 8) * 9 + 2*txfee; + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) + { + if ( up != 0 && (up2= utxos[mini]) != 0 ) + { + safecopy(utxo->coin,coin->symbol,sizeof(utxo->coin)); + safecopy(utxo->coinaddr,coinaddr,sizeof(utxo->coinaddr)); + utxo->payment.txid = up->U.txid; + utxo->payment.vout = up->U.vout; + utxo->payment.value = up->U.value; + utxo->iambob = 1; + utxo->deposit.txid = up2->U.txid; + utxo->deposit.vout = up2->U.vout; + utxo->deposit.value = up2->U.value; + utxo->S.satoshis = SATOSHIDEN * (relvolume / price); + return(utxo); + } + } + } + } + } + return(0); +} + +struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) +{ + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + *ordermatchpricep = 0.; + *bestsatoshisp = *bestdestsatoshisp = 0; + basecoin = LP_coinfind(base); + if ( duration <= 0 ) + duration = LP_ORDERBOOK_DURATION; + if ( maxprice <= 0. || LP_priceinfofind(base) == 0 || basecoin == 0 ) + return(0); + utxos = calloc(max,sizeof(*utxos)); + LP_txfees(&txfee,&desttxfee,base,autxo->coin); + if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) + { + if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) + { + if ( (asks= jarray(&numasks,orderbook,"asks")) != 0 ) + { + for (i=0; i 0 && price <= maxprice ) + { + pubkey = jbits256(item,"pubkey"); + if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) + { + if ( (n= jint(item,"numutxos")) > 1 ) + { + minvol = jdouble(item,"minvolume"); + maxvol = jdouble(item,"maxvolume"); + if ( relvolume >= minvol && relvolume <= maxvol ) + { + bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price)) != 0 ) + { + bestutxo->pubkey = pubp->pubkey; + safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); + *bestsatoshisp = bestutxo->S.satoshis; + *ordermatchpricep = price; + *bestdestsatoshisp = autxo->S.satoshis; + printf("ordermatch %.8f %.8f %.8f\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp)); + break; + } + } + } + } else printf("self trading or blacklisted peer\n"); + } + else + { + if ( i == 0 ) + printf("too expensive maxprice %.8f vs %.8f\n",maxprice,price); + break; + } + } + } + free_json(orderbook); + } + free(obookstr); + } + free(utxos); + if ( *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) + return(0); + int32_t changed; + LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); + return(bestutxo); +} + +char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) +{ + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) @@ -796,7 +951,39 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *r if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); LP_txfees(&txfee,&desttxfee,base,rel); - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + memset(&_best,0,sizeof(_best)); + if ( (bestutxo= LP_buyutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,relvolume,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + { + printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); + return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + } + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(clonestr("{\"error\":\"quote validation error\"}")); + } + printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); + return(clonestr("{\"result\":\"success\"}")); + //return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); +} + +char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double basevolume,int32_t timeout,int32_t duration) +{ + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + if ( duration <= 0 ) + duration = LP_ORDERBOOK_DURATION; + if ( timeout <= 0 ) + timeout = LP_AUTOTRADE_TIMEOUT; + if ( maxprice <= 0. || basevolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) + return(clonestr("{\"error\":\"invalid parameter\"}")); + if ( (autxo= LP_utxo_bestfit(base,SATOSHIDEN * basevolume)) == 0 ) + return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + LP_txfees(&txfee,&desttxfee,base,rel); + //if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*basevolume*maxprice)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 15263a593..c7fcd1a04 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -437,7 +437,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str break; if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) { - if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600)) != 0 ) + if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 718c46673..cff304b07 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -131,6 +131,21 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } +int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) +{ + struct LP_address_utxo *up,*tmp; int32_t n = 0; + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->spendheight <= 0 ) + { + utxos[n++] = up; + if ( n >= max ) + break; + } + } + return(n); +} + int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; diff --git a/iguana/exchanges/buy b/iguana/exchanges/buy new file mode 100755 index 000000000..4bed65f19 --- /dev/null +++ b/iguana/exchanges/buy @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"buy\",\"base\":\"KMD\",\"rel\":\"BTC\",\"relvolume\":0.005,\"price\":0.0005}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 1b7a629d9..bda13d6ef 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir diff --git a/iguana/exchanges/sell b/iguana/exchanges/sell new file mode 100755 index 000000000..5f48ff299 --- /dev/null +++ b/iguana/exchanges/sell @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"BTC\",\"basevolume\":10.0\"price\":0.0005}" From 6126770bbbeda431c85e15cb7055ae45e80de8eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 14:05:14 +0200 Subject: [PATCH 0378/2732] Test --- iguana/exchanges/LP_portfolio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index c7fcd1a04..018f293da 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -415,7 +415,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) } } -int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,struct iguana_info *buy,struct iguana_info *sell,double relvolume,int32_t setbaserel) +int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,struct iguana_info *buy,struct iguana_info *sell,double relvolume,int32_t setbaserel,char *gui) { char *retstr2; double bid,ask,maxprice; uint32_t requestid,quoteid,iter,i; cJSON *retjson2; requestid = quoteid = 0; @@ -437,7 +437,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str break; if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) { - if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600)) != 0 ) + if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { @@ -546,7 +546,7 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 && buy->inactive == 0 && sell->inactive == 0 ) { - if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1) < 0 ) + if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1,"portfolio") < 0 ) { array = jarray(&m,retjson,"portfolio"); if ( array != 0 && (n= LP_portfolio_order(trades,(int32_t)(sizeof(trades)/sizeof(*trades)),array)) > 0 ) @@ -557,7 +557,7 @@ void prices_loop(void *ignore) { buy = LP_coinfind(trades[i].buycoin); sell = LP_coinfind(trades[i].sellcoin); - if ( buy != 0 && sell != 0 && LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,0) == 0 ) + if ( buy != 0 && sell != 0 && LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,0,"portfolio") == 0 ) break; } } From deb7f0d4167a71494d34898edd37c59daeebde05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 14:10:51 +0200 Subject: [PATCH 0379/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 30d656dc5..e48bbe8ac 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -942,6 +942,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + printf("LP_autobuy\n"); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) From db7de81410cd15cb422e7bd3d9d183826c2a747f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 14:12:12 +0200 Subject: [PATCH 0380/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index cff304b07..064db834e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -126,7 +126,7 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) n++; } } - if ( n > 0 ) + if ( 0 && n > 0 ) printf("n.%d %s min %.8f max %.8f\n",n,ap->coinaddr,dstr(*minp),dstr(*maxp)); return(n); } From c5c4bcb30612c0761b2220bdeac912fa48512c94 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 14:21:14 +0200 Subject: [PATCH 0381/2732] Test --- iguana/exchanges/LP_ordermatch.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e48bbe8ac..ad76899eb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -257,10 +257,9 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp) return(0); } -double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop,struct LP_quoteinfo *qp,int32_t iambob) +double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp,int32_t iambob) { double qprice; uint64_t txfee,desttxfee,srcvalue,srcvalue2,destvalue,destvalue2; - *autxop = *butxop = 0; if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { printf("bob not eligible\n"); @@ -273,19 +272,19 @@ double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop } if ( LP_quote_checkmempool(qp) < 0 ) return(-4); - if ( (*butxop= LP_utxofind(1,qp->txid,qp->vout)) == 0 ) - return(-5); - if ( bits256_cmp((*butxop)->deposit.txid,qp->txid2) != 0 || (*butxop)->deposit.vout != qp->vout2 ) + //if ( iambob != 0 && (*butxop= LP_utxofind(1,qp->txid,qp->vout)) == 0 ) + // return(-5); + if ( bits256_cmp(butxo->deposit.txid,qp->txid2) != 0 || butxo->deposit.vout != qp->vout2 ) return(-6); - if ( strcmp((*butxop)->coinaddr,qp->coinaddr) != 0 ) + if ( strcmp(butxo->coinaddr,qp->coinaddr) != 0 ) return(-7); if ( iambob == 0 ) { - if ( (*autxop= LP_utxofind(0,qp->desttxid,qp->destvout)) == 0 ) - return(-8); - if ( bits256_cmp((*autxop)->fee.txid,qp->feetxid) != 0 || (*autxop)->fee.vout != qp->feevout ) + //if ( (*autxop= LP_utxofind(0,qp->desttxid,qp->destvout)) == 0 ) + // return(-8); + if ( bits256_cmp(autxo->fee.txid,qp->feetxid) != 0 || autxo->fee.vout != qp->feevout ) return(-9); - if ( strcmp((*autxop)->coinaddr,qp->destaddr) != 0 ) + if ( strcmp(autxo->coinaddr,qp->destaddr) != 0 ) return(-10); } if ( destvalue < qp->desttxfee+qp->destsatoshis || srcvalue < qp->txfee+qp->satoshis ) @@ -446,7 +445,7 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_cmp(Q.desthash,LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s)\n",jprint(argjson,0)); - if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + //if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); LP_pendingswaps--; @@ -529,7 +528,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,1)) <= SMALLVAL ) + //if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); return(-4); @@ -941,7 +940,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { - uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; printf("LP_autobuy\n"); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; @@ -962,7 +961,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + if ( (qprice= LP_quote_validate(autxo,bestutxo,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); @@ -993,7 +992,7 @@ char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *re return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); From 39a4b60283571781ee81819b089ed89c147eb57e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 14:28:38 +0200 Subject: [PATCH 0382/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ad76899eb..155b490e5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -908,6 +908,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); + autxo->S.satoshis = bestutxo->S.satoshis * price; *bestsatoshisp = bestutxo->S.satoshis; *ordermatchpricep = price; *bestdestsatoshisp = autxo->S.satoshis; From a36e48c3cb30e8d7f5a16b3d5f2c3ce25b872240 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:03:38 +0200 Subject: [PATCH 0383/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_ordermatch.c | 99 +++++++++++++++++++++++++++----- 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 57718f917..c97693008 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -244,7 +244,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autosell(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); + return(LP_autosell(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 155b490e5..ea5a703ad 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -760,15 +760,15 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *r char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { - struct LP_utxoinfo *bobutxo,*aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; + struct LP_utxoinfo *aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) { char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(clonestr("{\"error\":\"cant find alice utxopair\"}")); } - if ( (bobutxo= LP_utxopairfind(1,qp->txid,qp->vout,qp->txid2,qp->vout2)) == 0 ) + /*if ( (bobutxo= LP_utxopairfind(1,qp->txid,qp->vout,qp->txid2,qp->vout2)) == 0 ) return(clonestr("{\"error\":\"cant find bob utxopair\"}")); - bobutxo->T.bestflag = (uint32_t)time(NULL); + bobutxo->T.bestflag = (uint32_t)time(NULL);*/ //if ( (retstr= LP_registerall(0)) != 0 ) // free(retstr); price = LP_query(ctx,myipaddr,mypubsock,"request",qp); @@ -778,7 +778,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q if ( price <= maxprice ) { price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); - LP_requestinit(&qp->R,qp->srchash,qp->desthash,bobutxo->coin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); expiration = (uint32_t)time(NULL) + timeout; while ( time(NULL) < expiration ) { @@ -788,7 +788,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } if ( aliceutxo->S.swap == 0 ) { - if ( (pubp= LP_pubkeyadd(bobutxo->pubkey)) != 0 ) + if ( (pubp= LP_pubkeyadd(qp->srchash)) != 0 ) pubp->numerrors++; jaddstr(bestitem,"status","couldnt establish connection"); } else jaddstr(bestitem,"status","connected"); @@ -939,6 +939,75 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr return(bestutxo); } +struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *rel,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) +{ + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *relcoin; + *ordermatchpricep = 0.; + *bestsatoshisp = *bestdestsatoshisp = 0; + relcoin = LP_coinfind(rel); + if ( duration <= 0 ) + duration = LP_ORDERBOOK_DURATION; + if ( maxprice <= 0. || LP_priceinfofind(rel) == 0 || relcoin == 0 ) + return(0); + utxos = calloc(max,sizeof(*utxos)); + LP_txfees(&txfee,&desttxfee,autxo->coin,rel); + if ( (obookstr= LP_orderbook(autxo->coin,rel,duration)) != 0 ) + { + if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) + { + if ( (asks= jarray(&numasks,orderbook,"bids")) != 0 ) + { + for (i=0; i 0 && price <= maxprice ) + { + pubkey = jbits256(item,"pubkey"); + if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) + { + if ( (n= jint(item,"numutxos")) > 1 ) + { + minvol = jdouble(item,"minvolume"); + maxvol = jdouble(item,"maxvolume"); + if ( relvolume >= minvol && relvolume <= maxvol ) + { + bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,txfee,relvolume,price)) != 0 ) + { + bestutxo->pubkey = pubp->pubkey; + safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); + autxo->S.satoshis = bestutxo->S.satoshis; + *bestsatoshisp = bestutxo->S.satoshis / price; + *ordermatchpricep = price; + *bestdestsatoshisp = autxo->S.satoshis; + printf("ordermatch %.8f %.8f %.8f\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp)); + break; + } + } + } + } else printf("self trading or blacklisted peer\n"); + } + else + { + if ( i == 0 ) + printf("too expensive maxprice %.8f vs %.8f\n",maxprice,price); + break; + } + } + } + free_json(orderbook); + } + free(obookstr); + } + free(utxos); + if ( *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) + return(0); + int32_t changed; + LP_mypriceset(&changed,autxo->coin,rel,*ordermatchpricep); + return(bestutxo); +} + char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; @@ -968,38 +1037,38 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"quote validation error\"}")); } printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); - return(clonestr("{\"result\":\"success\"}")); - //return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } -char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double basevolume,int32_t timeout,int32_t duration) +char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double basevolume,int32_t timeout,int32_t duration,char *gui) { - uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *butxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) timeout = LP_AUTOTRADE_TIMEOUT; if ( maxprice <= 0. || basevolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( (autxo= LP_utxo_bestfit(base,SATOSHIDEN * basevolume)) == 0 ) + if ( (butxo= LP_utxo_bestfit(base,SATOSHIDEN * basevolume)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); LP_txfees(&txfee,&desttxfee,base,rel); - //if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*basevolume*maxprice)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_sellutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,butxo,rel,maxprice,duration,txfee,desttxfee,SATOSHIDEN*basevolume*maxprice,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); } - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + if ( LP_quoteinfoinit(&Q,bestutxo,base,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) + if ( LP_quotedestinfo(&Q,bestutxo->payment.txid,bestutxo->payment.vout,bestutxo->deposit.txid,bestutxo->deposit.vout,LP_mypub25519,bestutxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) + if ( (qprice= LP_quote_validate(bestutxo,butxo,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); + return(clonestr("{\"result\":\"success\"}")); + //return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } From e2d416f57fe4b70c14d59f55b12b416d27065017 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:17:35 +0200 Subject: [PATCH 0384/2732] Test --- iguana/exchanges/LP_ordermatch.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ea5a703ad..cbf453f43 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -939,9 +939,9 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr return(bestutxo); } -struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *rel,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) +struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *rel,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double basevolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *relcoin; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*bids,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *relcoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; relcoin = LP_coinfind(rel); @@ -955,11 +955,11 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) { - if ( (asks= jarray(&numasks,orderbook,"bids")) != 0 ) + if ( (bids= jarray(&numasks,orderbook,"bids")) != 0 ) { for (i=0; i 0 && price <= maxprice ) { @@ -970,10 +970,11 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { minvol = jdouble(item,"minvolume"); maxvol = jdouble(item,"maxvolume"); - if ( relvolume >= minvol && relvolume <= maxvol ) + printf("%s %.8f %.8f\n",jprint(item,0),minvol/price,maxvol/price); + if ( basevolume >= minvol/price && basevolume <= maxvol/price ) { bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,txfee,relvolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,txfee,basevolume,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From 96375467142c3f84544d40bae713a17f2ddf9d38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:25:16 +0200 Subject: [PATCH 0385/2732] Test --- iguana/exchanges/LP_ordermatch.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cbf453f43..082059ba9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -939,7 +939,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr return(bestutxo); } -struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *rel,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double basevolume,char *gui) +struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *rel,double minprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double basevolume,char *gui) { bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*bids,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *relcoin; *ordermatchpricep = 0.; @@ -947,7 +947,7 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp relcoin = LP_coinfind(rel); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; - if ( maxprice <= 0. || LP_priceinfofind(rel) == 0 || relcoin == 0 ) + if ( minprice <= 0. || LP_priceinfofind(rel) == 0 || relcoin == 0 ) return(0); utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,autxo->coin,rel); @@ -961,7 +961,7 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { item = jitem(bids,i); price = jdouble(item,"price"); - if ( LP_pricevalid(price) > 0 && price <= maxprice ) + if ( LP_pricevalid(price) > 0 && price >= minprice ) { pubkey = jbits256(item,"pubkey"); if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) @@ -970,11 +970,11 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { minvol = jdouble(item,"minvolume"); maxvol = jdouble(item,"maxvolume"); - printf("%s %.8f %.8f\n",jprint(item,0),minvol/price,maxvol/price); + printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol/price,basevolume,maxvol/price); if ( basevolume >= minvol/price && basevolume <= maxvol/price ) { bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,txfee,basevolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -1041,19 +1041,19 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } -char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double basevolume,int32_t timeout,int32_t duration,char *gui) +char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double minprice,double basevolume,int32_t timeout,int32_t duration,char *gui) { uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *butxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) timeout = LP_AUTOTRADE_TIMEOUT; - if ( maxprice <= 0. || basevolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) + if ( minprice <= 0. || basevolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); if ( (butxo= LP_utxo_bestfit(base,SATOSHIDEN * basevolume)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); LP_txfees(&txfee,&desttxfee,base,rel); - if ( (bestutxo= LP_sellutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,butxo,rel,maxprice,duration,txfee,desttxfee,SATOSHIDEN*basevolume*maxprice,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_sellutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,butxo,rel,minprice,duration,txfee,desttxfee,basevolume,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); From fd35bced19c3c496c1bbc17fe762106173355abc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:30:55 +0200 Subject: [PATCH 0386/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 082059ba9..b5d830bf1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -992,7 +992,7 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp else { if ( i == 0 ) - printf("too expensive maxprice %.8f vs %.8f\n",maxprice,price); + printf("too expensive maxprice %.8f vs %.8f\n",minprice,price); break; } } From 090207445cbd2561b5f6685d7f8a1884d8c90cd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:34:45 +0200 Subject: [PATCH 0387/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b5d830bf1..4c1d0ea48 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -970,11 +970,11 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { minvol = jdouble(item,"minvolume"); maxvol = jdouble(item,"maxvolume"); - printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol/price,basevolume,maxvol/price); if ( basevolume >= minvol/price && basevolume <= maxvol/price ) { + printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol/price,basevolume,maxvol/price); bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume*price,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -992,7 +992,7 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp else { if ( i == 0 ) - printf("too expensive maxprice %.8f vs %.8f\n",minprice,price); + printf("too little minprice %.8f vs %.8f\n",minprice,price); break; } } From 0138625a809cbfacd81b713ad846ae0801a5722f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:39:03 +0200 Subject: [PATCH 0388/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4c1d0ea48..0bdc83eb5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -834,14 +834,16 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t return(mini); } -struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price) +struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price) { struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; if ( (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) { - targetval = SATOSHIDEN * (relvolume / price) + 2*txfee; + if ( relflag != 0 ) + targetval = SATOSHIDEN * (volume / price) + 2*txfee; + else targetval = SATOSHIDEN * (volume*price) + 2*txfee; if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) { up = utxos[mini]; @@ -904,7 +906,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr if ( relvolume >= minvol && relvolume <= maxvol ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(1,bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -972,9 +974,9 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp maxvol = jdouble(item,"maxvolume"); if ( basevolume >= minvol/price && basevolume <= maxvol/price ) { - printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol/price,basevolume,maxvol/price); + printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol,basevolume*price,maxvol); bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume*price,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(0,bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From 9ace32f8df8556cf06cf7ec55a6eeb5b2ebf5606 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:42:22 +0200 Subject: [PATCH 0389/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0bdc83eb5..313400107 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -844,6 +844,12 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo if ( relflag != 0 ) targetval = SATOSHIDEN * (volume / price) + 2*txfee; else targetval = SATOSHIDEN * (volume*price) + 2*txfee; + { + int32_t i; + for (i=0; iU.value)); + printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); + } if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) { up = utxos[mini]; From c68de697ff3153ebba64ee13f1298ef8e73496d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:43:47 +0200 Subject: [PATCH 0390/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 313400107..4a0ac29a4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -868,7 +868,9 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo utxo->deposit.txid = up2->U.txid; utxo->deposit.vout = up2->U.vout; utxo->deposit.value = up2->U.value; - utxo->S.satoshis = SATOSHIDEN * (relvolume / price); + if ( relflag != 0 ) + utxo->S.satoshis = SATOSHIDEN * (volume / price); + else utxo->S.satoshis = SATOSHIDEN * (volume * price); return(utxo); } } From 00238f0d6cf13ab7efc4cf8109e0e599e2792ec7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:46:42 +0200 Subject: [PATCH 0391/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4a0ac29a4..c32c17395 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -984,7 +984,7 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol,basevolume*price,maxvol); bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(0,bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(0,bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume*price,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From 06cbfc9d30af7f412f2b527e40248304ee7f3b6d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:51:37 +0200 Subject: [PATCH 0392/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c32c17395..abc0896c8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -989,9 +989,9 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); autxo->S.satoshis = bestutxo->S.satoshis; - *bestsatoshisp = bestutxo->S.satoshis / price; + *bestsatoshisp = autxo->S.satoshis; *ordermatchpricep = price; - *bestdestsatoshisp = autxo->S.satoshis; + *bestdestsatoshisp = bestutxo->S.satoshis; printf("ordermatch %.8f %.8f %.8f\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp)); break; } From a684a3df03971dfb76e627690a0d500507691d23 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 15:55:04 +0200 Subject: [PATCH 0393/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index abc0896c8..f17a2bd59 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -988,7 +988,6 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - autxo->S.satoshis = bestutxo->S.satoshis; *bestsatoshisp = autxo->S.satoshis; *ordermatchpricep = price; *bestdestsatoshisp = bestutxo->S.satoshis; From ede10528eb117725fc7867df76217c4d82187a34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 16:03:46 +0200 Subject: [PATCH 0394/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f17a2bd59..191d4abd7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -843,7 +843,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo { if ( relflag != 0 ) targetval = SATOSHIDEN * (volume / price) + 2*txfee; - else targetval = SATOSHIDEN * (volume*price) + 2*txfee; + else targetval = SATOSHIDEN * (volume * price) + 2*txfee; { int32_t i; for (i=0; ipubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); + // ordermatch 0.00050029 12.99990000 0.00000250 + // 0.00156398 0.01062943 0.00164483 0.00163831 0.00200000 0.00091512 0.03616972 0.00149051 0.00011714 0.03721034 0.02667164 0.00126502 0.03982604 0.00158423 0.00129022 0.04057810 0.00137594 0.00100000 0.00055601 0.00067499 0.00022800 0.12000000 0.03679745 0.00191550 0.00068144 0.00060983 0.00155659 0.03500084 0.00186860 0.00065110 0.00062265 0.00017046 0.00001468 0.00051851 0.00571714 0.00205292 0.00309702 0.03363277 targetval 0.00070640 vol 0.00500290 price 0.00050029 txfee 0.00035195 *bestsatoshisp = autxo->S.satoshis; *ordermatchpricep = price; *bestdestsatoshisp = bestutxo->S.satoshis; From 7a13cf930cffc3d93893329b385f159447d49bb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 16:06:20 +0200 Subject: [PATCH 0395/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 191d4abd7..cf1a73f95 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -849,6 +849,9 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo for (i=0; iU.value)); printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); + //{"coin":"BTC","address":"1L7Kzud7jC3LnLyZmtg85XxxvADLuLwfwr","price":0.00050196,"numutxos":22,"minvolume":0.00011714,"maxvolume":0.10820861,"pubkey":"1bfcfc1d48dbe3e1332b09cb48e50e7789bdde2308b74f905299db12d093fa2d","age":13} 0.00011714 [0.00501960] 0.10820861 + //0.00100000 0.00100000 0.00200000 0.08947953 0.10820861 0.03616972 0.00126502 0.04057810 0.00091512 0.00011714 0.00164483 0.00149051 0.00158423 0.00129022 0.03982604 0.03721034 0.00163831 0.00137594 0.00156398 0.02667164 0.00099693 0.01062943 targetval 0.00070641 vol 0.00501960 price 0.00050196 txfee 0.00035195 + //ordermatch 0.00050196 12.99990000 0.00000251 } if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) { @@ -984,7 +987,7 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol,basevolume*price,maxvol); bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(0,bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume*price,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(0,bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From 0f6c01a75d7df4ae161d6ad3a556f94dc40610ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 16:12:33 +0200 Subject: [PATCH 0396/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cf1a73f95..12773c12d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -167,7 +167,7 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * LP_txfees(&qp->txfee,&qp->desttxfee,utxo->coin,qp->destcoin); qp->satoshis = satoshis;//(destsatoshis / price) + 0.49; qp->destsatoshis = destsatoshis; - if ( utxo->iambob == 0 || qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) + if ( qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) //utxo->iambob == 0 || { printf("quoteinit error.(%d %d %d %d) %.8f vs %.8f\n",utxo->iambob == 0,qp->txfee >= qp->satoshis,qp->txfee >= utxo->deposit.value,utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis),dstr(utxo->deposit.value),dstr(LP_DEPOSITSATOSHIS(qp->satoshis))); return(-1); @@ -849,9 +849,6 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo for (i=0; iU.value)); printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); - //{"coin":"BTC","address":"1L7Kzud7jC3LnLyZmtg85XxxvADLuLwfwr","price":0.00050196,"numutxos":22,"minvolume":0.00011714,"maxvolume":0.10820861,"pubkey":"1bfcfc1d48dbe3e1332b09cb48e50e7789bdde2308b74f905299db12d093fa2d","age":13} 0.00011714 [0.00501960] 0.10820861 - //0.00100000 0.00100000 0.00200000 0.08947953 0.10820861 0.03616972 0.00126502 0.04057810 0.00091512 0.00011714 0.00164483 0.00149051 0.00158423 0.00129022 0.03982604 0.03721034 0.00163831 0.00137594 0.00156398 0.02667164 0.00099693 0.01062943 targetval 0.00070641 vol 0.00501960 price 0.00050196 txfee 0.00035195 - //ordermatch 0.00050196 12.99990000 0.00000251 } if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) { @@ -991,8 +988,6 @@ struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchp { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - // ordermatch 0.00050029 12.99990000 0.00000250 - // 0.00156398 0.01062943 0.00164483 0.00163831 0.00200000 0.00091512 0.03616972 0.00149051 0.00011714 0.03721034 0.02667164 0.00126502 0.03982604 0.00158423 0.00129022 0.04057810 0.00137594 0.00100000 0.00055601 0.00067499 0.00022800 0.12000000 0.03679745 0.00191550 0.00068144 0.00060983 0.00155659 0.03500084 0.00186860 0.00065110 0.00062265 0.00017046 0.00001468 0.00051851 0.00571714 0.00205292 0.00309702 0.03363277 targetval 0.00070640 vol 0.00500290 price 0.00050029 txfee 0.00035195 *bestsatoshisp = autxo->S.satoshis; *ordermatchpricep = price; *bestdestsatoshisp = bestutxo->S.satoshis; From 07f867358b00094632a5a4776ee3aa492c4228e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 16:14:25 +0200 Subject: [PATCH 0397/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 12773c12d..227eef83a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -167,11 +167,11 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * LP_txfees(&qp->txfee,&qp->desttxfee,utxo->coin,qp->destcoin); qp->satoshis = satoshis;//(destsatoshis / price) + 0.49; qp->destsatoshis = destsatoshis; - if ( qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) //utxo->iambob == 0 || + /*if ( qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) //utxo->iambob == 0 || { printf("quoteinit error.(%d %d %d %d) %.8f vs %.8f\n",utxo->iambob == 0,qp->txfee >= qp->satoshis,qp->txfee >= utxo->deposit.value,utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis),dstr(utxo->deposit.value),dstr(LP_DEPOSITSATOSHIS(qp->satoshis))); return(-1); - } + }*/ qp->txid = utxo->payment.txid; qp->vout = utxo->payment.vout; qp->txid2 = utxo->deposit.txid; From 2cd3632f9410e0d2accbf1c7395afecc07d9689d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 18:15:06 +0200 Subject: [PATCH 0398/2732] Test --- iguana/exchanges/LP_commands.c | 6 +- iguana/exchanges/LP_ordermatch.c | 140 ++++--------------------------- 2 files changed, 20 insertions(+), 126 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c97693008..e42f9de70 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -104,7 +104,6 @@ disable(coin)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600)\n\ -sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ @@ -124,7 +123,8 @@ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ \"}")); - + //sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ + base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); if ( USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) @@ -244,7 +244,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autosell(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 227eef83a..d2ea61f18 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -439,13 +439,17 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s)\n",jprint(argjson,0)); - //if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + memset(&A,0,sizeof(A)); + memset(&B,0,sizeof(B)); + autxo = &A; + butxo = &B; + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); LP_pendingswaps--; @@ -460,15 +464,7 @@ char *LP_connectedalice(cJSON *argjson) // alice return(clonestr("{\"error\":\"no price set\"}")); } printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); - //if ( (price= ask) == 0. ) - price = bid; - /*if ( SATOSHIDEN*qprice > (SATOSHIDEN * price) * 1.001 + 10 ) - { - printf("qprice %.8f too big vs %.8f\n",qprice,price); - LP_availableset(autxo); - LP_pendingswaps--; - return(clonestr("{\"error\":\"quote price too expensive\"}")); - }*/ + price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { LP_pendingswaps--; @@ -515,7 +511,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; int32_t retval = -1; struct LP_quoteinfo Q; + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; int32_t retval = -1; struct LP_quoteinfo Q; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); @@ -528,7 +524,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - //if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,1)) <= SMALLVAL ) + memset(&A,0,sizeof(A)); + memset(&B,0,sizeof(B)); + autxo = &A; + butxo = &B; + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); return(-4); @@ -834,16 +834,14 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t return(mini); } -struct LP_utxoinfo *LP_address_utxopair(int32_t relflag,struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price) +struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price) { struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; if ( (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) { - if ( relflag != 0 ) - targetval = SATOSHIDEN * (volume / price) + 2*txfee; - else targetval = SATOSHIDEN * (volume * price) + 2*txfee; + targetval = SATOSHIDEN * (volume / price) + 2*txfee; { int32_t i; for (i=0; ideposit.txid = up2->U.txid; utxo->deposit.vout = up2->U.vout; utxo->deposit.value = up2->U.value; - if ( relflag != 0 ) - utxo->S.satoshis = SATOSHIDEN * (volume / price); - else utxo->S.satoshis = SATOSHIDEN * (volume * price); + utxo->S.satoshis = SATOSHIDEN * (volume / price); return(utxo); } } @@ -914,7 +910,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr if ( relvolume >= minvol && relvolume <= maxvol ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(1,bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -949,75 +945,6 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr return(bestutxo); } -struct LP_utxoinfo *LP_sellutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *rel,double minprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double basevolume,char *gui) -{ - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*bids,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *relcoin; - *ordermatchpricep = 0.; - *bestsatoshisp = *bestdestsatoshisp = 0; - relcoin = LP_coinfind(rel); - if ( duration <= 0 ) - duration = LP_ORDERBOOK_DURATION; - if ( minprice <= 0. || LP_priceinfofind(rel) == 0 || relcoin == 0 ) - return(0); - utxos = calloc(max,sizeof(*utxos)); - LP_txfees(&txfee,&desttxfee,autxo->coin,rel); - if ( (obookstr= LP_orderbook(autxo->coin,rel,duration)) != 0 ) - { - if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) - { - if ( (bids= jarray(&numasks,orderbook,"bids")) != 0 ) - { - for (i=0; i 0 && price >= minprice ) - { - pubkey = jbits256(item,"pubkey"); - if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) - { - if ( (n= jint(item,"numutxos")) > 1 ) - { - minvol = jdouble(item,"minvolume"); - maxvol = jdouble(item,"maxvolume"); - if ( basevolume >= minvol/price && basevolume <= maxvol/price ) - { - printf("%s %.8f [%.8f] %.8f\n",jprint(item,0),minvol,basevolume*price,maxvol); - bitcoin_address(coinaddr,relcoin->taddr,relcoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(0,bestutxo,utxos,max,relcoin,coinaddr,desttxfee,basevolume,price)) != 0 ) - { - bestutxo->pubkey = pubp->pubkey; - safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - *bestsatoshisp = autxo->S.satoshis; - *ordermatchpricep = price; - *bestdestsatoshisp = bestutxo->S.satoshis; - printf("ordermatch %.8f %.8f %.8f\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp)); - break; - } - } - } - } else printf("self trading or blacklisted peer\n"); - } - else - { - if ( i == 0 ) - printf("too little minprice %.8f vs %.8f\n",minprice,price); - break; - } - } - } - free_json(orderbook); - } - free(obookstr); - } - free(utxos); - if ( *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) - return(0); - int32_t changed; - LP_mypriceset(&changed,autxo->coin,rel,*ordermatchpricep); - return(bestutxo); -} - char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; @@ -1050,37 +977,4 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } -char *LP_autosell(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double minprice,double basevolume,int32_t timeout,int32_t duration,char *gui) -{ - uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *butxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; - if ( duration <= 0 ) - duration = LP_ORDERBOOK_DURATION; - if ( timeout <= 0 ) - timeout = LP_AUTOTRADE_TIMEOUT; - if ( minprice <= 0. || basevolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) - return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( (butxo= LP_utxo_bestfit(base,SATOSHIDEN * basevolume)) == 0 ) - return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - LP_txfees(&txfee,&desttxfee,base,rel); - if ( (bestutxo= LP_sellutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,butxo,rel,minprice,duration,txfee,desttxfee,basevolume,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) - { - printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); - return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - } - if ( LP_quoteinfoinit(&Q,bestutxo,base,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,bestutxo->payment.txid,bestutxo->payment.vout,bestutxo->deposit.txid,bestutxo->deposit.vout,LP_mypub25519,bestutxo->coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(bestutxo,butxo,&Q,0)) <= SMALLVAL ) - { - printf("quote validate error %.0f\n",qprice); - return(clonestr("{\"error\":\"quote validation error\"}")); - } - printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); - return(clonestr("{\"result\":\"success\"}")); - //return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); -} - - - From bf8b2e73391accd95e3f61382c8cd4c458923406 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 18:21:16 +0200 Subject: [PATCH 0399/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d2ea61f18..597ddaa7f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -948,7 +948,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; - printf("LP_autobuy\n"); + printf("LP_autobuy %s/%s price %.8f vol %.8f\n",base,rel,maxprice,relvolume); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) From ca1e4bb80167a00f474732b22aa144c51e239b6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 18:25:26 +0200 Subject: [PATCH 0400/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 597ddaa7f..d9646c7af 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -907,6 +907,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr { minvol = jdouble(item,"minvolume"); maxvol = jdouble(item,"maxvolume"); + printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); if ( relvolume >= minvol && relvolume <= maxvol ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); From 45aa9edfa8fff33cf051b3b449fc221cce03f06c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 18:30:22 +0200 Subject: [PATCH 0401/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e42f9de70..ba09dc42c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -244,7 +244,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } From 22f2276c35c49b528a1b945f14f4be75b4b09680 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 18:47:56 +0200 Subject: [PATCH 0402/2732] Test --- iguana/exchanges/LP_ordermatch.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d9646c7af..bed5cf84d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -514,6 +514,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; int32_t retval = -1; struct LP_quoteinfo Q; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { + //LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 ) @@ -524,10 +525,32 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - memset(&A,0,sizeof(A)); memset(&B,0,sizeof(B)); - autxo = &A; butxo = &B; + butxo->pubkey = Q.srchash; + safecopy(butxo->coin,Q.srccoin,sizeof(butxo->coin)); + safecopy(butxo->coinaddr,Q.coinaddr,sizeof(butxo->coinaddr)); + butxo->payment.txid = Q.txid; + butxo->payment.vout = Q.vout; + //butxo->payment.value = Q.value; + butxo->iambob = 1; + butxo->deposit.txid = Q.txid2; + butxo->deposit.vout = Q.vout2; + //butxo->deposit.value = up2->U.value; + butxo->S.satoshis = Q.satoshis; + memset(&A,0,sizeof(A)); + autxo = &A; + autxo->pubkey = Q.desthash; + safecopy(autxo->coin,Q.destcoin,sizeof(autxo->coin)); + safecopy(autxo->coinaddr,Q.destaddr,sizeof(autxo->coinaddr)); + autxo->payment.txid = Q.desttxid; + autxo->payment.vout = Q.destvout; + //autxo->payment.value = Q.value; + autxo->iambob = 0; + autxo->deposit.txid = Q.feetxid; + autxo->deposit.vout = Q.feevout; + //autxo->deposit.value = up2->U.value; + autxo->S.satoshis = Q.destsatoshis; if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); @@ -766,11 +789,6 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(clonestr("{\"error\":\"cant find alice utxopair\"}")); } - /*if ( (bobutxo= LP_utxopairfind(1,qp->txid,qp->vout,qp->txid2,qp->vout2)) == 0 ) - return(clonestr("{\"error\":\"cant find bob utxopair\"}")); - bobutxo->T.bestflag = (uint32_t)time(NULL);*/ - //if ( (retstr= LP_registerall(0)) != 0 ) - // free(retstr); price = LP_query(ctx,myipaddr,mypubsock,"request",qp); bestitem = LP_quotejson(qp); if ( LP_pricevalid(price) > 0 ) From 4910c95df39afa88005eb5638c944d9c1d7cbafc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 18:57:29 +0200 Subject: [PATCH 0403/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 177 ---------------------------- iguana/exchanges/LP_rpc.c | 6 +- iguana/exchanges/LP_statemachine.c | 178 +++++++++++++++++++++++++++++ 4 files changed, 182 insertions(+), 181 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 99381bfe9..af0f0fee3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -49,7 +49,7 @@ #define LP_MINVOL 10 #define LP_MINCLIENTVOL 20 #define LP_MINSIZE_TXFEEMULT 10 -#define LP_REQUIRED_TXFEE 0.95 +#define LP_REQUIRED_TXFEE 0.9 #define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV) #define LP_DEPOSITSATOSHIS(satoshis) ((satoshis) + (satoshis >> 3)) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bed5cf84d..3f1cbd636 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -604,183 +604,6 @@ char *LP_bestfit(char *rel,double relvolume) return(jprint(LP_utxojson(autxo),1)); } -#ifdef oldway -struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) -{ - int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,n,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; - *ordermatchpricep = 0.; - *bestsatoshisp = *bestdestsatoshisp = 0; - if ( duration <= 0 ) - duration = LP_ORDERBOOK_DURATION; - if ( maxprice <= 0. || LP_priceinfofind(base) == 0 ) - return(0); - LP_txfees(&txfee,&desttxfee,base,autxo->coin); - if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) - { - if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) - { - if ( (asks= jarray(&numasks,orderbook,"asks")) != 0 ) - { - for (i=0; i 0 && price <= maxprice ) - { - //price *= 1.0001; - //if ( price > maxprice ) - // price = maxprice; - pubkey = jbits256(item,"pubkey"); - if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 && pubp->numerrors < LP_MAXPUBKEY_ERRORS ) - { - if ( bestprice == 0. ) // assumes price ordered asks - bestprice = price; - printf("item.[%d] %s\n",i,jprint(item,0)); - txid = jbits256(item,"txid"); - vout = jint(item,"vout"); - vol = jdouble(item,"volume"); - metric = price / bestprice; - printf("maxdest %.8f metric %f vol %f add pings numutxos.%d min %.8f max %.8f\n",dstr(maxdestsatoshis),metric,vol,jint(item,"numutxos"),jdouble(item,"minvolume"),jdouble(item,"maxvolume")); - // check utxos > 1 for pubkey, SPV validate recv'ed - /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) - { - printf("got butxo? %p\n",butxo); - if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) - { - destsatoshis = ((butxo->S.satoshis - txfee) * price); - satoshis = (destsatoshis / price + 0.49) - txfee; - if ( satoshis <= 0 ) - continue; - qprice = (double)destsatoshis / satoshis; - n = (int32_t)((double)destsatoshis / desttxfee); - if ( n < 10 ) - n = 10; - else n = 3; - for (j=0; jS.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) - break; - } - //printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); - if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) - { - printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); - metric = dstr(destsatoshis) * metric * metric * metric; - if ( bestmetric == 0. || metric < bestmetric ) - { - bestutxo = butxo; - *ordermatchpricep = price; - *bestdestsatoshisp = destsatoshis; - *bestsatoshisp = satoshis; - bestmetric = metric; - printf("set best!\n"); - } - } // else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); - } - else - { - printf("ineligible.(%.8f %.8f)\n",price,dstr(butxo->S.satoshis)); - //if ( butxo->T.spentflag == 0 ) - // butxo->T.spentflag = (uint32_t)time(NULL); - } - } - else - { - if ( butxo != 0 ) - printf("%llu %llu %d %d %d: ",(long long)(vol*SATOSHIDEN),(long long)butxo->S.satoshis,vol*SATOSHIDEN == butxo->S.satoshis,LP_isavailable(butxo) > 0,LP_ismine(butxo) == 0); - printf("cant find butxo.%p or value mismatch %.8f != %.8f or bestflag.%d\n",butxo,vol,butxo!=0?dstr(butxo->S.satoshis):0,butxo->T.bestflag); - }*/ - } else printf("self trading or blacklisted peer\n"); - } - else - { - if ( i == 0 ) - printf("maxprice %.8f vs %.8f\n",maxprice,price); - break; - } - } - if ( bestutxo == 0 ) - { - int32_t numrestraints; - for (i=numrestraints=0; iT.bestflag = 0; - pubp->numerrors = 0; - } - } - } - printf("no bob utxo found -> cleared %d restraints\n",numrestraints); - } - } - free_json(orderbook); - } - free(obookstr); - } - printf("bestutxo.%p %.8f %.8f\n",bestutxo,*ordermatchpricep,dstr(*bestdestsatoshisp)); - if ( bestutxo == 0 || *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) - return(0); - bestutxo->T.bestflag = 1; - int32_t changed; - LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); - return(bestutxo); -} - -char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) -{ - struct LP_quoteinfo Q; int64_t bestsatoshis=0,bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; - txfee = LP_txfeecalc(LP_coinfind(base),txfee); - desttxfee = LP_txfeecalc(LP_coinfind(rel),desttxfee); - if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) - return(clonestr("{\"error\":\"cant find alice utxopair\"}")); - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) - return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - return(jprint(LP_quotejson(&Q),1)); -} - -char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) -{ - uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; - if ( duration <= 0 ) - duration = LP_ORDERBOOK_DURATION; - if ( timeout <= 0 ) - timeout = LP_AUTOTRADE_TIMEOUT; - if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) - return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) - return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - LP_txfees(&txfee,&desttxfee,base,rel); - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) - { - printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); - return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - } - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) - { - printf("quote validate error %.0f\n",qprice); - return(clonestr("{\"error\":\"quote validation error\"}")); - } - printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); -} -#endif - char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { struct LP_utxoinfo *aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 71330a93a..5f6e34af4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -571,9 +571,9 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime+600 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { - sprintf(buf,"[%d]",3); + sprintf(buf,"[%d]",6); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { if ( retstr[0] != '-' ) @@ -581,7 +581,7 @@ double LP_getestimatedrate(struct iguana_info *coin) rate = atof(retstr) / 1024.; if ( rate < 0.00000020 ) rate = 0.00000020; - coin->rate = rate; + coin->rate = rate * 1.25; coin->ratetime = (uint32_t)time(NULL); printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 860c796e1..e22ca255f 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1601,3 +1601,181 @@ if ( (array= LP_tradecandidates(base)) != 0 ) }*/ +#ifdef oldway +struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) +{ + int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,n,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; + *ordermatchpricep = 0.; + *bestsatoshisp = *bestdestsatoshisp = 0; + if ( duration <= 0 ) + duration = LP_ORDERBOOK_DURATION; + if ( maxprice <= 0. || LP_priceinfofind(base) == 0 ) + return(0); + LP_txfees(&txfee,&desttxfee,base,autxo->coin); + if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) + { + if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) + { + if ( (asks= jarray(&numasks,orderbook,"asks")) != 0 ) + { + for (i=0; i 0 && price <= maxprice ) + { + //price *= 1.0001; + //if ( price > maxprice ) + // price = maxprice; + pubkey = jbits256(item,"pubkey"); + if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 && pubp->numerrors < LP_MAXPUBKEY_ERRORS ) + { + if ( bestprice == 0. ) // assumes price ordered asks + bestprice = price; + printf("item.[%d] %s\n",i,jprint(item,0)); + txid = jbits256(item,"txid"); + vout = jint(item,"vout"); + vol = jdouble(item,"volume"); + metric = price / bestprice; + printf("maxdest %.8f metric %f vol %f add pings numutxos.%d min %.8f max %.8f\n",dstr(maxdestsatoshis),metric,vol,jint(item,"numutxos"),jdouble(item,"minvolume"),jdouble(item,"maxvolume")); + // check utxos > 1 for pubkey, SPV validate recv'ed + /*if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) + { + printf("got butxo? %p\n",butxo); + if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) + { + destsatoshis = ((butxo->S.satoshis - txfee) * price); + satoshis = (destsatoshis / price + 0.49) - txfee; + if ( satoshis <= 0 ) + continue; + qprice = (double)destsatoshis / satoshis; + n = (int32_t)((double)destsatoshis / desttxfee); + if ( n < 10 ) + n = 10; + else n = 3; + for (j=0; jS.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) + break; + } + //printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); + if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) + { + printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); + metric = dstr(destsatoshis) * metric * metric * metric; + if ( bestmetric == 0. || metric < bestmetric ) + { + bestutxo = butxo; + *ordermatchpricep = price; + *bestdestsatoshisp = destsatoshis; + *bestsatoshisp = satoshis; + bestmetric = metric; + printf("set best!\n"); + } + } // else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); + } + else + { + printf("ineligible.(%.8f %.8f)\n",price,dstr(butxo->S.satoshis)); + //if ( butxo->T.spentflag == 0 ) + // butxo->T.spentflag = (uint32_t)time(NULL); + } + } + else + { + if ( butxo != 0 ) + printf("%llu %llu %d %d %d: ",(long long)(vol*SATOSHIDEN),(long long)butxo->S.satoshis,vol*SATOSHIDEN == butxo->S.satoshis,LP_isavailable(butxo) > 0,LP_ismine(butxo) == 0); + printf("cant find butxo.%p or value mismatch %.8f != %.8f or bestflag.%d\n",butxo,vol,butxo!=0?dstr(butxo->S.satoshis):0,butxo->T.bestflag); + }*/ + } else printf("self trading or blacklisted peer\n"); + } + else + { + if ( i == 0 ) + printf("maxprice %.8f vs %.8f\n",maxprice,price); + break; + } + } + if ( bestutxo == 0 ) + { + int32_t numrestraints; + for (i=numrestraints=0; iT.bestflag = 0; + pubp->numerrors = 0; + } + } + } + printf("no bob utxo found -> cleared %d restraints\n",numrestraints); + } + } + free_json(orderbook); + } + free(obookstr); + } + printf("bestutxo.%p %.8f %.8f\n",bestutxo,*ordermatchpricep,dstr(*bestdestsatoshisp)); + if ( bestutxo == 0 || *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) + return(0); + bestutxo->T.bestflag = 1; + int32_t changed; + LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); + return(bestutxo); +} + +char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) +{ + struct LP_quoteinfo Q; int64_t bestsatoshis=0,bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; + txfee = LP_txfeecalc(LP_coinfind(base),txfee); + desttxfee = LP_txfeecalc(LP_coinfind(rel),desttxfee); + if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) + return(clonestr("{\"error\":\"cant find alice utxopair\"}")); + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + return(jprint(LP_quotejson(&Q),1)); +} + +char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) +{ + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + if ( duration <= 0 ) + duration = LP_ORDERBOOK_DURATION; + if ( timeout <= 0 ) + timeout = LP_AUTOTRADE_TIMEOUT; + if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) + return(clonestr("{\"error\":\"invalid parameter\"}")); + if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) + return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + LP_txfees(&txfee,&desttxfee,base,rel); + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + { + printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); + return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + } + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(clonestr("{\"error\":\"quote validation error\"}")); + } + printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); +} +#endif + + From 51dbfd15548ec480961091ec9a83adc8c30cc71d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 19:17:46 +0200 Subject: [PATCH 0404/2732] Test --- iguana/exchanges/LP_ordermatch.c | 58 +++++++++++++++++--------------- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_utxos.c | 4 +-- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3f1cbd636..838686adc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -437,6 +437,34 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(retval); } +void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) +{ + memset(butxo,0,sizeof(*butxo)); + butxo->pubkey = qp->srchash; + safecopy(butxo->coin,qp->srccoin,sizeof(butxo->coin)); + safecopy(butxo->coinaddr,qp->coinaddr,sizeof(butxo->coinaddr)); + butxo->payment.txid = qp->txid; + butxo->payment.vout = qp->vout; + //butxo->payment.value = qp->value; + butxo->iambob = 1; + butxo->deposit.txid = qp->txid2; + butxo->deposit.vout = qp->vout2; + //butxo->deposit.value = up2->U.value; + butxo->S.satoshis = qp->satoshis; + memset(autxo,0,sizeof(*autxo)); + autxo->pubkey = qp->desthash; + safecopy(autxo->coin,qp->destcoin,sizeof(autxo->coin)); + safecopy(autxo->coinaddr,qp->destaddr,sizeof(autxo->coinaddr)); + autxo->payment.txid = qp->desttxid; + autxo->payment.vout = qp->destvout; + //autxo->payment.value = qp->value; + autxo->iambob = 0; + autxo->deposit.txid = qp->feetxid; + autxo->deposit.vout = qp->feevout; + //autxo->deposit.value = up2->U.value; + autxo->S.satoshis = qp->destsatoshis; +} + char *LP_connectedalice(cJSON *argjson) // alice { cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; @@ -445,10 +473,9 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_cmp(Q.desthash,LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s)\n",jprint(argjson,0)); - memset(&A,0,sizeof(A)); - memset(&B,0,sizeof(B)); autxo = &A; butxo = &B; + LP_abutxo_set(autxo,butxo,&Q); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); @@ -525,32 +552,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - memset(&B,0,sizeof(B)); - butxo = &B; - butxo->pubkey = Q.srchash; - safecopy(butxo->coin,Q.srccoin,sizeof(butxo->coin)); - safecopy(butxo->coinaddr,Q.coinaddr,sizeof(butxo->coinaddr)); - butxo->payment.txid = Q.txid; - butxo->payment.vout = Q.vout; - //butxo->payment.value = Q.value; - butxo->iambob = 1; - butxo->deposit.txid = Q.txid2; - butxo->deposit.vout = Q.vout2; - //butxo->deposit.value = up2->U.value; - butxo->S.satoshis = Q.satoshis; - memset(&A,0,sizeof(A)); autxo = &A; - autxo->pubkey = Q.desthash; - safecopy(autxo->coin,Q.destcoin,sizeof(autxo->coin)); - safecopy(autxo->coinaddr,Q.destaddr,sizeof(autxo->coinaddr)); - autxo->payment.txid = Q.desttxid; - autxo->payment.vout = Q.destvout; - //autxo->payment.value = Q.value; - autxo->iambob = 0; - autxo->deposit.txid = Q.feetxid; - autxo->deposit.vout = Q.feevout; - //autxo->deposit.value = up2->U.value; - autxo->S.satoshis = Q.destsatoshis; + butxo = &B; + LP_abutxo_set(autxo,butxo,&Q); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 430448a29..b10faa211 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -929,7 +929,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { - if ( (rand() % 100) == 0 ) + if ( (rand() % 5000) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->matrix[basepp->ind][relpp->ind] = price; dxblend(&basepp->relvals[relpp->ind],price,0.9); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 925354973..bd27731cd 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -394,7 +394,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit tmpsatoshis = (((value2 - 2*txfee) / 9) << 3); else return(0); } else tmpsatoshis = (value - txfee); - char str[65],str2[65],dispflag = (iambob == 0); + char str[65],str2[65],dispflag = 0;//(iambob == 0); if ( iambob == 0 && bits256_cmp(pubkey,LP_mypub25519) != 0 ) { printf("trying to add Alice utxo when not mine? %s/v%d\n",bits256_str(str,txid),vout); @@ -681,7 +681,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txid = jbits256(item,"txid"); vout = juint(item,"vout"); value = LP_value_extract(item,0); - height = coin->height - jint(item,"confirmations"); + height = LP_getheight(coin) - jint(item,"confirmations"); } else { From 2c36befb0cbc4eb93af9bb5da74b5528f1dcfd69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 19:35:11 +0200 Subject: [PATCH 0405/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 838686adc..adb1043bb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -589,7 +589,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else if ( strcmp(method,"connect") == 0 ) // bob { retval = 4; - if ( butxo->T.swappending != 0 && butxo->S.swap == 0 ) + if ( butxo->S.swap == 0 ) //butxo->T.swappending != 0 && LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } From 94804f2a63791ffd61767d1c37a4a87672c9085f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 19:46:04 +0200 Subject: [PATCH 0406/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index adb1043bb..1b2a1ee76 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -401,7 +401,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(-1); } privkey = LP_privkey(utxo->coinaddr,coin->taddr); - if ( bits256_nonz(privkey) != 0 && qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && bits256_cmp(LP_mypub25519,qp->srchash) == 0 ) + if ( bits256_nonz(privkey) != 0 && bits256_cmp(LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && { if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 064db834e..f55b13f5a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -193,7 +193,7 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 { jaddbits256(item,"txid",up->U.txid); jaddnum(item,"vout",up->U.vout); - jaddnum(item,"confirmations",coin->height - up->U.height); + jaddnum(item,"confirmations",LP_getheight(coin) - up->U.height); jaddnum(item,"amount",dstr(up->U.value)); jaddstr(item,"scriptPubKey",""); } @@ -281,11 +281,11 @@ char *LP_postedutxos(cJSON *argjson) errs++; } if ( coin->height != 0 ) - ht = coin->height - jint(txobj,"confirmations"); + ht = LP_getheight(coin) - jint(txobj,"confirmations"); else ht = 0; if ( ht != 0 && ht < height-2 ) { - printf("REJECT %s %s/v%d ht.%d vs %d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jprint(item,0)); + printf("REJECT %s %s/v%d ht.%d vs %d confs.%d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jint(txobj,"confirmations"),jprint(item,0)); errs++; } free_json(txobj); From 3200ea2ba3715f0f3986dce362455e019c70a0b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 19:49:20 +0200 Subject: [PATCH 0407/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5f6e34af4..b2d89ce85 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -250,6 +250,8 @@ cJSON *LP_paxprice(char *fiat) cJSON *LP_gettx(char *symbol,bits256 txid) { char buf[128],str[65],*hexstr; int32_t len; bits256 checktxid; cJSON *retjson; struct iguana_info *coin; struct iguana_msgtx msgtx; uint8_t *extraspace,*serialized; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); From 87adf904271cc3109d63d9a232f96a0ef70f4f59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 19:55:05 +0200 Subject: [PATCH 0408/2732] Error checks --- iguana/exchanges/LP_rpc.c | 62 ++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b2d89ce85..8f3924833 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -120,6 +120,8 @@ char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coi char *LP_apicall(struct iguana_info *coin,char *method,char *params) { cJSON *retjson; char *retstr; + if ( coin == 0 ) + return(0); if ( coin->electrum != 0 ) { if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) @@ -211,9 +213,10 @@ cJSON *LP_assethbla(char *assetid) int32_t LP_getheight(struct iguana_info *coin) { - cJSON *retjson; char *method = "getinfo"; int32_t height = coin->height; + cJSON *retjson; char *method = "getinfo"; int32_t height; if ( coin == 0 ) return(-1); + height = coin->height; if ( coin->electrum == 0 && time(NULL) > coin->heighttime+60 ) { if ( strcmp(coin->symbol,"BTC") == 0 ) @@ -230,7 +233,10 @@ int32_t LP_getheight(struct iguana_info *coin) cJSON *LP_getmempool(char *symbol,char *coinaddr) { - cJSON *array; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *array; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); if ( coin == 0 || (coin->electrum != 0 && coinaddr == 0) ) return(cJSON_Parse("{\"error\":\"no native coin\"}")); if ( coin->electrum == 0 ) @@ -301,6 +307,8 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -402,7 +410,10 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) cJSON *LP_validateaddress(char *symbol,char *address) { - char buf[512],coinaddr[64],checkaddr[64],script[128]; int32_t i; uint8_t rmd160[20],addrtype; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + char buf[512],coinaddr[64],checkaddr[64],script[128]; int32_t i; uint8_t rmd160[20],addrtype; cJSON *retjson; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin != 0 && coin->electrum != 0 ) @@ -438,6 +449,8 @@ cJSON *LP_validateaddress(char *symbol,char *address) int32_t LP_address_ismine(char *symbol,char *address) { int32_t doneflag = 0; cJSON *retjson; + if ( symbol == 0 || symbol[0] == 0 ) + return(0); if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) { if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) @@ -453,7 +466,10 @@ int32_t LP_address_ismine(char *symbol,char *address) cJSON *LP_listunspent(char *symbol,char *coinaddr) { - char buf[128]; cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + char buf[128]; cJSON *retjson; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); //printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); if ( coin == 0 || coin->inactive != 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -470,6 +486,8 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) void LP_listunspent_issue(char *symbol,char *coinaddr) { struct iguana_info *coin; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; + if ( symbol == 0 || symbol[0] == 0 ) + return; if ( (coin= LP_coinfind(symbol)) != 0 ) { if ( coin->electrum != 0 ) @@ -500,6 +518,8 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { static void *ctx; char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t doneflag = 0; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -529,7 +549,10 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) int32_t LP_importaddress(char *symbol,char *address) { - char buf[1024],*retstr; cJSON *validatejson,*retjson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin = LP_coinfind(symbol); + char buf[1024],*retstr; cJSON *validatejson,*retjson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(-2); + coin = LP_coinfind(symbol); if ( coin == 0 ) return(-2); if ( coin->electrum != 0 ) @@ -597,6 +620,8 @@ double LP_getestimatedrate(struct iguana_info *coin) char *LP_sendrawtransaction(char *symbol,char *signedtx) { cJSON *array; char *paramstr,*tmpstr,*retstr=0; int32_t n; cJSON *retjson; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(0); coin = LP_coinfind(symbol); if ( coin == 0 ) return(0); @@ -630,7 +655,10 @@ char *LP_sendrawtransaction(char *symbol,char *signedtx) char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON *vins,char *rawtx,cJSON *privkeys,struct vin_info *V) { - cJSON *array,*json,*retjson; int32_t len; uint8_t *data; char str[65],*paramstr,*retstr,*hexstr,*signedtx=0; struct iguana_msgtx msgtx; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *array,*json,*retjson; int32_t len; uint8_t *data; char str[65],*paramstr,*retstr,*hexstr,*signedtx=0; struct iguana_msgtx msgtx; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(0); + coin = LP_coinfind(symbol); memset(signedtxidp,0,sizeof(*signedtxidp)); *completedp = 0; if ( coin == 0 ) @@ -697,7 +725,10 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * cJSON *LP_getblock(char *symbol,bits256 txid) { - char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); + char buf[128],str[65]; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); if ( coin == 0 || coin->electrum != 0 ) return(cJSON_Parse("{\"error\":\"no native coin\"}")); sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); @@ -708,6 +739,8 @@ cJSON *LP_getblock(char *symbol,bits256 txid) uint64_t LP_txfee(char *symbol) { uint64_t txfee = 0; + if ( symbol == 0 || symbol[0] == 0 ) + return(LP_MIN_TXFEE); if ( strcmp(symbol,"BTC") != 0 ) txfee = LP_MIN_TXFEE; return(txfee); @@ -715,7 +748,10 @@ uint64_t LP_txfee(char *symbol) char *LP_blockhashstr(char *symbol,int32_t height) { - cJSON *array; char *paramstr,*retstr; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *array; char *paramstr,*retstr; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(0); + coin = LP_coinfind(symbol); if ( coin == 0 || coin->electrum != 0 ) return(0); array = cJSON_CreateArray(); @@ -728,7 +764,10 @@ char *LP_blockhashstr(char *symbol,int32_t height) cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) { - char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); + char buf[128]; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); if ( coin == 0 || coin->electrum != 0 ) return(cJSON_Parse("{\"error\":\"no native coin daemon\"}")); sprintf(buf,"[\"%s\"]",blockhashstr); @@ -737,7 +776,10 @@ cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t height) { - cJSON *json = 0; int32_t flag = 0; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *json = 0; int32_t flag = 0; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); if ( coin == 0 || coin->electrum != 0 ) { printf("unexpected electrum path for %s\n",symbol); From 61904047ee6728c41952b71cab845c02fca78339 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 19:59:09 +0200 Subject: [PATCH 0409/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1b2a1ee76..5d332a8d3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -459,8 +459,8 @@ void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP autxo->payment.vout = qp->destvout; //autxo->payment.value = qp->value; autxo->iambob = 0; - autxo->deposit.txid = qp->feetxid; - autxo->deposit.vout = qp->feevout; + autxo->fee.txid = qp->feetxid; + autxo->fee.vout = qp->feevout; //autxo->deposit.value = up2->U.value; autxo->S.satoshis = qp->destsatoshis; } From 6ca9d6518336ea54356aec33199080c00d95a694 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:15:58 +0200 Subject: [PATCH 0410/2732] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- iguana/exchanges/LP_utxo.c | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8f3924833..bb5c6d347 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -549,7 +549,7 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) int32_t LP_importaddress(char *symbol,char *address) { - char buf[1024],*retstr; cJSON *validatejson,*retjson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin; + char buf[1024],*retstr; cJSON *validatejson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) return(-2); coin = LP_coinfind(symbol); @@ -557,11 +557,11 @@ int32_t LP_importaddress(char *symbol,char *address) return(-2); if ( coin->electrum != 0 ) { - if ( (retjson= electrum_address_subscribe(symbol,coin->electrum,&retjson,address)) != 0 ) + /*if ( (retjson= electrum_address_subscribe(symbol,coin->electrum,&retjson,address)) != 0 ) { printf("importaddress.(%s) -> %s\n",address,jprint(retjson,0)); free_json(retjson); - } + }*/ return(0); } else diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f55b13f5a..52ba64e71 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -531,9 +531,12 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int else { if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) - numconfirms = (coin->height - ht); - else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) - numconfirms = 0; + numconfirms = (LP_getheight(coin) - ht); + else if ( mempool != 0 ) + { + if (LP_waitmempool(symbol,coinaddr,txid,30) >= 0 ) + numconfirms = 0; + } } //#endif return(numconfirms); From 045619d15068f54077903d4750fa467e56b8e9f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:18:58 +0200 Subject: [PATCH 0411/2732] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 6d81a26c0..5f74346a0 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -45,7 +45,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) if (LP_transactioninit(coin,txid,iter,0) == 0 ) break; printf("transaction ht.%d init error.%d, pause\n",height,j); - sleep(1); + sleep(10); } } else @@ -55,7 +55,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) if (LP_transactioninit(coin,txid,iter,0) == 0 ) break; printf("transaction ht.%d init error.%d, pause\n",height,j); - sleep(1); + sleep(10); } } } From 12e499b2549dd1046edbee10a0d3a04a56fc9ea5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:30:53 +0200 Subject: [PATCH 0412/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 3 ++- iguana/exchanges/LP_transaction.c | 6 +++--- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5d332a8d3..78b9a4a27 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -819,7 +819,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } - printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); + //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index bb5c6d347..11b310a66 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -608,7 +608,8 @@ double LP_getestimatedrate(struct iguana_info *coin) rate = 0.00000020; coin->rate = rate * 1.25; coin->ratetime = (uint32_t)time(NULL); - printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); + if ( (rand() % 10) == 0 ) + printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); } free(retstr); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 02c005b29..a5dfcde32 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1313,7 +1313,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->aliceclaim.txbytes[i]); printf(" <- aliceclaim\n");*/ //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,10)); + return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); } printf("error with bobdeposit\n"); @@ -1331,7 +1331,7 @@ int32_t LP_verify_alicepayment(struct basilisk_swap *swap,uint8_t *data,int32_t if ( bits256_nonz(swap->alicepayment.I.signedtxid) != 0 ) swap->aliceunconf = 1; basilisk_dontforget_update(swap,&swap->alicepayment); - return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,10)); + return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,60)); //printf("import alicepayment address.(%s)\n",swap->alicepayment.p2shaddr); //LP_importaddress(swap->alicecoin.symbol,swap->alicepayment.p2shaddr); return(0); @@ -1378,7 +1378,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->alicespend.txbytes[i]); printf(" <- alicespend\n\n");*/ swap->I.alicespent = 1; - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,10)); + return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->alicespend.I.suppress_pubkeys,swap->bobpayment.I.destaddr); } printf("error validating bobpayment\n"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 52ba64e71..0350b78ec 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -573,7 +573,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) { - printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); + //printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); return(0); } else @@ -688,7 +688,7 @@ int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vo } if ( utxo->T.spentflag != 0 ) { - char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); + //char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); return(1); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index bd27731cd..be104cc6b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -691,7 +691,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri height = jint(item,"height"); } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); - if ( satoshis != value ) + if ( satoshis != 0 && satoshis != value ) printf("unexpected privkey_init value mismatch %.8f vs %.8f (%s) %.8f %.8f\n",dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) { From 0db4286d1435b2f4edb81ea03d6b4c837b8175d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:37:53 +0200 Subject: [PATCH 0413/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a778d0c9d..87324d4cd 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 3 +#define ELECTRUM_TIMEOUT 13 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0350b78ec..bf918e379 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -554,7 +554,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; cJSON *txobj=0; uint64_t value; struct iguana_info *coin; char str[65],str2[65],_coinaddr[65]; + struct LP_transaction *tx; cJSON *txobj=0; uint64_t value; struct iguana_info *coin; char str[65],_coinaddr[65]; if ( bits256_nonz(txid) == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) From aa86b50a5fa095cc76b54c48383dc793bd15b7f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:43:44 +0200 Subject: [PATCH 0414/2732] Test --- iguana/exchanges/LP_utxo.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bf918e379..ae9017281 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -30,12 +30,15 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { - double val = 0.; uint64_t value; + double val = 0.; uint64_t value = 0; if ( (val= jdouble(obj,"amount")) < SMALLVAL ) val = jdouble(obj,"value"); - if ( val > SMALLVAL ) - value = ((val + jdouble(obj,"interest")*addinterest) * SATOSHIDEN + 0.0000000049); - else value = 0; + value = val * SATOSHIDEN + 0.0000000049; + if ( value != 0 ) + { + if ( addinterest != 0 && jobj(obj,"interest") != 0 ) + value += (jdouble(obj,"interest") * SATOSHIDEN); + } return(value); } @@ -464,7 +467,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); - if ( strcmp(coin->symbol,"BTC") != 0 ) + if ( 0 && strcmp(coin->symbol,"BTC") != 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d spendheight.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts,tx->outpoints[spentvout].spendheight); } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); From 47aefb5a5cbae1dc6ee6e13d5225a02bff928b93 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:47:27 +0200 Subject: [PATCH 0415/2732] Test --- iguana/exchanges/LP_scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5f74346a0..089cf9625 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -21,7 +21,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { - int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; + char str[65]; int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && checkht == height ) { if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) @@ -44,7 +44,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { if (LP_transactioninit(coin,txid,iter,0) == 0 ) break; - printf("transaction ht.%d init error.%d, pause\n",height,j); + printf("%s transaction ht.%d init error.%d, pause\n",bits256_str(str,txid),height,j); sleep(10); } } @@ -54,7 +54,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { if (LP_transactioninit(coin,txid,iter,0) == 0 ) break; - printf("transaction ht.%d init error.%d, pause\n",height,j); + printf("%s transaction ht.%d init error.%d, pause\n",bits256_str(str,txid),height,j); sleep(10); } } From 0734cda9a0a51a5704bc8f9652b9d235ff343dc7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:54:32 +0200 Subject: [PATCH 0416/2732] Test --- iguana/exchanges/LP_scan.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 089cf9625..7c49ed039 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -27,36 +27,22 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) { for (iter=0; iter<2; iter++) - for (i=0; iheight == 0 ) - tx->height = height; - else if ( tx->height != height ) + txid = jbits256i(txs,i); + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) { - printf("LP_blockinit: tx->height %d != %d\n",tx->height,height); - tx->height = height; - } - if ( iter == 1 ) - for (j=0; j<10; j++) + if ( tx->height == 0 ) + tx->height = height; + else if ( tx->height != height ) { - if (LP_transactioninit(coin,txid,iter,0) == 0 ) - break; - printf("%s transaction ht.%d init error.%d, pause\n",bits256_str(str,txid),height,j); - sleep(10); + printf("LP_blockinit: tx->height %d != %d\n",tx->height,height); + tx->height = height; } - } - else - { - for (j=0; j<10; j++) - { - if (LP_transactioninit(coin,txid,iter,0) == 0 ) - break; - printf("%s transaction ht.%d init error.%d, pause\n",bits256_str(str,txid),height,j); - sleep(10); - } + if ( iter == 1 ) + LP_transactioninit(coin,txid,iter,0); + } else LP_transactioninit(coin,txid,iter,0); } } } From 5d1d15b07bc5c99010d8e4775e0b23d0cc2db549 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:57:09 +0200 Subject: [PATCH 0417/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 87324d4cd..47014d145 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -371,7 +371,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch usleep(10000); if ( *retjsonp == 0 ) { - printf("unexpected timeout with null retjson: %s %s\n",method,params); + printf("unexpected %s timeout with null retjson: %s %s\n",ep->symbol,method,params); *retjsonp = cJSON_Parse("{\"error\":\"timeout\"}"); } return(*retjsonp); From 8f159179ec329a3169f2f9c485f5267acf026223 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 21:03:29 +0200 Subject: [PATCH 0418/2732] Test --- iguana/exchanges/LP_utxo.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ae9017281..80ffb7e4c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -286,11 +286,11 @@ char *LP_postedutxos(cJSON *argjson) if ( coin->height != 0 ) ht = LP_getheight(coin) - jint(txobj,"confirmations"); else ht = 0; - if ( ht != 0 && ht < height-2 ) + /*if ( ht != 0 && ht < height-2 ) { printf("REJECT %s %s/v%d ht.%d vs %d confs.%d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jint(txobj,"confirmations"),jprint(item,0)); errs++; - } + }*/ free_json(txobj); } if ( errs == 0 ) @@ -461,14 +461,17 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS continue; if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) { - if ( spentvout < tx->numvouts && tx->outpoints[spentvout].spendheight <= 0 ) + if ( spentvout < tx->numvouts ) { - tx->outpoints[spentvout].spendtxid = txid; - tx->outpoints[spentvout].spendvini = i; - tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; - LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); - if ( 0 && strcmp(coin->symbol,"BTC") != 0 ) - printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); + if ( tx->outpoints[spentvout].spendheight <= 0 ) + { + tx->outpoints[spentvout].spendtxid = txid; + tx->outpoints[spentvout].spendvini = i; + tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; + LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + if ( 0 && strcmp(coin->symbol,"BTC") != 0 ) + printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); + } } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d spendheight.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts,tx->outpoints[spentvout].spendheight); } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) From aa06cb1c689192d80ae1987b0ee45c9124cf68a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 21:07:29 +0200 Subject: [PATCH 0419/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 78b9a4a27..e31f663b0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -629,7 +629,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q { if ( aliceutxo->S.swap != 0 ) break; - sleep(1); + sleep(3); } if ( aliceutxo->S.swap == 0 ) { From 4583c8f73e127b6b9e9b9c00be230bb60737ca45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 21:11:52 +0200 Subject: [PATCH 0420/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 80ffb7e4c..af767fc98 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -33,7 +33,7 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) double val = 0.; uint64_t value = 0; if ( (val= jdouble(obj,"amount")) < SMALLVAL ) val = jdouble(obj,"value"); - value = val * SATOSHIDEN + 0.0000000049; + value = val * SATOSHIDEN + 0.0000000059; if ( value != 0 ) { if ( addinterest != 0 && jobj(obj,"interest") != 0 ) @@ -280,7 +280,7 @@ char *LP_postedutxos(cJSON *argjson) value = LP_value_extract(txobj,0); if ( value != 0 && value != val ) { - printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(item,0)); + printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(txobj,0)); errs++; } if ( coin->height != 0 ) From 167dbf79240c065b0f2c89768a98f4e3c00982d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 21:32:51 +0200 Subject: [PATCH 0421/2732] Test --- iguana/exchanges/electrum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/electrum b/iguana/exchanges/electrum index 8bf0eb38a..e7f562b41 100755 --- a/iguana/exchanges/electrum +++ b/iguana/exchanges/electrum @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"46.4.125.2\",\"port\":50001}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"173.212.225.176\",\"port\":50001}" From 479bacbd8fd689a51b4f88a5bbbdf730f991a377 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 21:51:22 +0200 Subject: [PATCH 0422/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 11b310a66..fad136744 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -274,7 +274,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); - if ( strlen(hexstr) > 50000 ) + if ( strlen(hexstr) > 100000 ) { printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); free(hexstr); From 5af45e2d6d6385eb29153e7f93a00907432dad77 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:04:48 +0200 Subject: [PATCH 0423/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index fad136744..2e2a1fd0b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -274,7 +274,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); - if ( strlen(hexstr) > 100000 ) + if ( strlen(hexstr) > 10000 ) { printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); free(hexstr); From e2d492c4ffe21c6d6efbbf9f80a87dae6409535a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:09:38 +0200 Subject: [PATCH 0424/2732] Test --- iguana/exchanges/LP_utxo.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index af767fc98..592f35b11 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -27,6 +27,10 @@ // electrum only, network for gettxout // locally track spends, height +/*spent.0 BTC txid or value 0.00980000 < 0.00937462 or val2 0.00000000 < 0.00043744, e85478826d74936168197a655bc81bb918a31c278295a5f68d0eaff32b1a3900/v1 83a8baea6a5741c2c96ac346aef905c0f694acf6beeb764508969271b8fe6db0/v0 or < 10x txfee 0.00042538 +BTC 83a8baea6a5741c2c96ac346aef905c0f694acf6beeb764508969271b8fe6db0 ineligible 0.00980000 0.00000000 +couldnt find.245433003 peerind.2 Q.13 err.0 match.5 +*/ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { @@ -649,6 +653,10 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } // else printf("no val2\n"); } char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); + if ( val == 0 ) + LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,-1,1); + if ( val2 == 0 ) + LP_address_utxoadd(coin,destaddr,txid2,vout2,threshold,-1,1); /*for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) From d3e455ecad7e1ea561c0059bf870810a2d3a455d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:10:14 +0200 Subject: [PATCH 0425/2732] Test --- iguana/exchanges/LP_rpc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2e2a1fd0b..39ddac1a0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -276,7 +276,9 @@ cJSON *LP_gettx(char *symbol,bits256 txid) hexstr = jprint(retjson,1); if ( strlen(hexstr) > 10000 ) { - printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); + static uint32_t counter; + if ( counter++ < 3 ) + printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); free(hexstr); return(cJSON_Parse("{\"error\":\"transaction too big\"}")); } @@ -326,9 +328,11 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(hexobj,1); - if ( strlen(hexstr) > 50000 ) + if ( strlen(hexstr) > 10000 ) { - printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); + static uint32_t counter; + if ( counter++ < 3 ) + printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); free(hexstr); return(cJSON_Parse("{\"error\":\"transaction too big\"}")); } From e6482c377d5ff419c0783986acb3665291bf3e6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:19:06 +0200 Subject: [PATCH 0426/2732] Test --- iguana/exchanges/LP_utxo.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 592f35b11..da720368e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -153,6 +153,21 @@ int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct L return(n); } +struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout) +{ + struct LP_address *ap; struct LP_address_utxo *up,*tmp; + //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) + return(up); + } + } + return(0); +} + int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; @@ -619,7 +634,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { //struct LP_utxoinfo *utxo; - uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); + struct LP_address_utxo *up; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) { printf("null txid not eligible\n"); @@ -631,6 +646,10 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( bypass != 0 ) val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); + if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) + return(-2); + if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) + return(-3); txfee = LP_txfeecalc(LP_coinfind(symbol),0); if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { From 5d9cc63da82964d1dfb00571e36335f4dae7ffa9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:21:23 +0200 Subject: [PATCH 0427/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 47014d145..f4befdba9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 13 +#define ELECTRUM_TIMEOUT 3 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index da720368e..21ae3d676 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -26,11 +26,6 @@ // pruned node, network for external listunspent, gettxout to validate // electrum only, network for gettxout -// locally track spends, height -/*spent.0 BTC txid or value 0.00980000 < 0.00937462 or val2 0.00000000 < 0.00043744, e85478826d74936168197a655bc81bb918a31c278295a5f68d0eaff32b1a3900/v1 83a8baea6a5741c2c96ac346aef905c0f694acf6beeb764508969271b8fe6db0/v0 or < 10x txfee 0.00042538 -BTC 83a8baea6a5741c2c96ac346aef905c0f694acf6beeb764508969271b8fe6db0 ineligible 0.00980000 0.00000000 -couldnt find.245433003 peerind.2 Q.13 err.0 match.5 -*/ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { From f0b652864da8cb0b3ac8d6ac16e08718db0f9e1b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:31:26 +0200 Subject: [PATCH 0428/2732] Test --- iguana/exchanges/LP_rpc.c | 7 +++++++ iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 39ddac1a0..2a6a0e89a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -159,6 +159,13 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) { + if ( jobj(retjson,"error") != 0 ) + { + free_json(retjson); + retjson = 0; + retjson = electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT); + printf("RETRY.(%s)\n",jprint(retjson,0)); + } //printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); /*if ( (resultjson= jobj(retjson,"result")) != 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f4befdba9..70af8f427 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -666,7 +666,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( stritem->expiration < ep->lasttime ) { DL_DELETE(ep->pendingQ.list,item); - printf("expired (%s)\n",stritem->str); + printf("expired %s (%s)\n",ep->symbol,stritem->str); errjson = cJSON_CreateObject(); jaddnum(errjson,"id",item->type); jaddstr(errjson,"error","timeout"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 21ae3d676..4aa50918d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -26,6 +26,9 @@ // pruned node, network for external listunspent, gettxout to validate // electrum only, network for gettxout +// handle spurious errors +// handle invalid data + uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { From 6d2bff50cf5fe1e5aea60d63270d740a168e9aea Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:41:23 +0200 Subject: [PATCH 0429/2732] Test --- iguana/exchanges/LP_rpc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2a6a0e89a..51f9bddba 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -163,8 +163,6 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { free_json(retjson); retjson = 0; - retjson = electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT); - printf("RETRY.(%s)\n",jprint(retjson,0)); } //printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0)); /*if ( (resultjson= jobj(retjson,"result")) != 0 ) @@ -278,7 +276,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 || (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); if ( strlen(hexstr) > 10000 ) From 3e5a040f828bfddf190dae040c8b736bd768fb5f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:44:06 +0200 Subject: [PATCH 0430/2732] Test --- iguana/exchanges/LP_commands.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ba09dc42c..e9099f018 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,7 +36,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; //printf("stats_JSON(%s)\n",jprint(argjson,0)); - if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) + method = jstr(argjson,"method"); + if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) { @@ -60,7 +61,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jint(argjson,"numpeers"),jint(argjson,"numutxos"),juint(argjson,"session")); } } - if ( (method= jstr(argjson,"method")) == 0 ) + if ( method == 0 ) { if ( flag == 0 || jobj(argjson,"result") != 0 ) printf("stats_JSON no method: (%s) (%s:%u)\n",jprint(argjson,0),ipaddr,argport); From c905af95f081052310149c001f6ac50f41e8480a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:46:09 +0200 Subject: [PATCH 0431/2732] Test --- iguana/exchanges/LP_include.h | 1 - iguana/exchanges/LP_peers.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index af0f0fee3..292b997d6 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,6 @@ //#define LP_STRICTPEERS -#define LP_ELECTRUM_MINPORT 8776 #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index f6c2bc4f5..e249f099a 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -58,8 +58,6 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; printf("addpeer (%s:%u)\n",ipaddr,port); - if ( port >= LP_ELECTRUM_MINPORT ) - return(0); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) return(0); From af899f856ff60839f7d03648b7a6c9923b171553 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:52:33 +0200 Subject: [PATCH 0432/2732] Test --- iguana/exchanges/LP_utxo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4aa50918d..1a055033b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -622,9 +622,10 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) LP_destaddr(coinaddr,txobj); free_json(txobj); //printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); - return(value); + if ( value != 0 ) + return(value); } - printf("pruned node? LP_txvalue couldnt find %s tx %s\n",coin->symbol,bits256_str(str,txid)); + printf("pruned node? LP_txvalue couldnt find %s tx %s/v%d\n",coin->symbol,bits256_str(str,txid),vout); } return(0); } From 90b8417b1e72cc8b2d8d68254f6cdabb472f65b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:56:35 +0200 Subject: [PATCH 0433/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1a055033b..300dfb47b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -35,7 +35,7 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) double val = 0.; uint64_t value = 0; if ( (val= jdouble(obj,"amount")) < SMALLVAL ) val = jdouble(obj,"value"); - value = val * SATOSHIDEN + 0.0000000059; + value = val * SATOSHIDEN + 0.000000009; if ( value != 0 ) { if ( addinterest != 0 && jobj(obj,"interest") != 0 ) From 95f0719156db5c060d107b34dfa97e9120004656 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 22:58:44 +0200 Subject: [PATCH 0434/2732] Test --- iguana/exchanges/LP_rpc.c | 4 +++- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 51f9bddba..aadc15035 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -276,7 +276,9 @@ cJSON *LP_gettx(char *symbol,bits256 txid) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 || (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 || + (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 || + (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); if ( strlen(hexstr) > 10000 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 70af8f427..9274ecbbb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ #include #endif -#define ELECTRUM_TIMEOUT 3 +#define ELECTRUM_TIMEOUT 5 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { From 24e35d53858710039ef802343742bc41595810d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 23:03:36 +0200 Subject: [PATCH 0435/2732] Test --- iguana/exchanges/LP_socket.c | 15 +++++++++------ iguana/exchanges/LP_utxo.c | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9274ecbbb..493aa1ead 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -371,7 +371,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch usleep(10000); if ( *retjsonp == 0 ) { - printf("unexpected %s timeout with null retjson: %s %s\n",ep->symbol,method,params); + //printf("unexpected %s timeout with null retjson: %s %s\n",ep->symbol,method,params); *retjsonp = cJSON_Parse("{\"error\":\"timeout\"}"); } return(*retjsonp); @@ -666,11 +666,14 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( stritem->expiration < ep->lasttime ) { DL_DELETE(ep->pendingQ.list,item); - printf("expired %s (%s)\n",ep->symbol,stritem->str); - errjson = cJSON_CreateObject(); - jaddnum(errjson,"id",item->type); - jaddstr(errjson,"error","timeout"); - *((cJSON **)stritem->retptrp) = errjson; + if ( 0 ) + { + printf("expired %s (%s)\n",ep->symbol,stritem->str); + errjson = cJSON_CreateObject(); + jaddnum(errjson,"id",item->type); + jaddstr(errjson,"error","timeout"); + *((cJSON **)stritem->retptrp) = errjson; + } free(item); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 300dfb47b..2522ea529 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -29,6 +29,7 @@ // handle spurious errors // handle invalid data +//REJECT KMD ccee27b53b52ca61bbc9fdc7de5feb0a12c14d4d92639414d372f002cc3d092f/v0 value.468169379 vs 468169380 ({"bestblock":"080400d4216c02d100004fd2f4f3505ddb507b643785e02703d3412feba39fb1","confirmations":2356,"value":4.68169380,"scriptPubKey":{"asm":"0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842 OP_CHECKSIG","hex":"210224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842ac","reqSigs":1,"type":"pubkey","addresses":["RFssbc211PJdVy1bvcvAG5X2N4ovPAoy5o"]},"version":1,"coinbase":true}) uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { From 26fb43d5e38736b11f05cc8baebe040fc3fb5136 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 23:09:53 +0200 Subject: [PATCH 0436/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2522ea529..29ab3fc4a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -36,7 +36,7 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) double val = 0.; uint64_t value = 0; if ( (val= jdouble(obj,"amount")) < SMALLVAL ) val = jdouble(obj,"value"); - value = val * SATOSHIDEN + 0.000000009; + value = (val + 0.0000000049) * SATOSHIDEN; if ( value != 0 ) { if ( addinterest != 0 && jobj(obj,"interest") != 0 ) From 0f265b65a72dfcbb203f0fccd03e94c8674a9443 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Sep 2017 07:23:32 +0200 Subject: [PATCH 0437/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_socket.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 7c49ed039..ce4a2b0ee 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -21,7 +21,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { - char str[65]; int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; + int32_t i,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && checkht == height ) { if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 493aa1ead..fa41ecb01 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -198,7 +198,7 @@ int32_t LP_socketsend(int32_t sock,uint8_t *serialized,int32_t len) flags = MSG_NOSIGNAL; #endif remains = len; - while ( remains > 0 ) + while ( sock >= 0 && remains > 0 ) { if ( (numsent= (int32_t)send(sock,serialized,remains,flags)) < 0 ) { @@ -225,7 +225,7 @@ int32_t LP_socketsend(int32_t sock,uint8_t *serialized,int32_t len) int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) { int32_t recvlen = -1; - while ( 1 ) + while ( sock >= 0 ) { if ( (recvlen= (int32_t)recv(sock,recvbuf,maxlen,0)) < 0 ) { @@ -574,7 +574,7 @@ void electrum_test() struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { - struct electrum_info *ep=0; int32_t i; struct stritem *sitem; char name[512],*str = "init string"; + struct electrum_info *ep=0; int32_t i,sock; struct stritem *sitem; char name[512],*str = "init string"; *alreadyp = 0; portable_mutex_lock(&LP_electrummutex); for (i=0; isock = LP_socket(0,ipaddr,port); + ep->sock = sock; safecopy(ep->symbol,symbol,sizeof(ep->symbol)); safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); ep->port = port; @@ -771,7 +776,11 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) struct electrum_info *ep; int32_t already; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"ipaddr",ipaddr); jaddnum(retjson,"port",port); - ep = LP_electrum_info(&already,coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10); + if ( (ep= LP_electrum_info(&already,coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10)) == 0 ) + { + jaddstr(retjson,"error","couldnt connect to electrum server"); + return(retjson); + } if ( already == 0 ) { if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) From cd0dddfdfc48aefc76a9fd087845640632e05156 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Sep 2017 07:24:33 +0200 Subject: [PATCH 0438/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index aadc15035..9e900a3c6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -276,9 +276,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 || - (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 || - (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); if ( strlen(hexstr) > 10000 ) @@ -308,7 +306,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else printf("non-hex tx.(%s)\n",hexstr); free(hexstr); return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); - } else printf("failed blockcjhain.transaction.get\n"); + } else printf("failed blockchain.transaction.get\n"); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); } } From 3e6aa58744d2f68c3419f5d3bde654a7231afc4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Sep 2017 07:29:38 +0200 Subject: [PATCH 0439/2732] Test --- iguana/exchanges/LP_bitcoin.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index ba6a5b63f..67325c8dc 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2619,7 +2619,8 @@ cJSON *bitcoin_txscript(char *asmstr,char **vardata,int32_t numvars) { int32_t i; cJSON *scriptjson,*array; scriptjson = cJSON_CreateObject(); - jaddstr(scriptjson,"asm",asmstr); + if ( asmstr != 0 ) + jaddstr(scriptjson,"asm",asmstr); jaddnum(scriptjson,"numvars",numvars); if ( numvars > 0 ) { @@ -3186,7 +3187,7 @@ int32_t iguana_parsevoutobj(uint8_t *serialized,int32_t maxsize,struct iguana_ms cJSON *iguana_voutjson(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,struct iguana_msgvout *vout,int32_t txi,bits256 txid) { // 035f1321ed17d387e4433b2fa229c53616057964af065f98bfcae2233c5108055e OP_CHECKSIG - char scriptstr[IGUANA_MAXSCRIPTSIZE+1],asmstr[2*IGUANA_MAXSCRIPTSIZE+1]; int32_t i,m,n,scriptlen,asmtype; struct vin_info *vp; + char scriptstr[IGUANA_MAXSCRIPTSIZE+1]; int32_t i,m,n,scriptlen,asmtype; struct vin_info *vp; uint8_t space[8192]; cJSON *addrs,*skey,*json = cJSON_CreateObject(); vp = calloc(1,sizeof(*vp)); jadd64bits(json,"satoshis",vout->value); @@ -3196,12 +3197,12 @@ cJSON *iguana_voutjson(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,struct igu if ( vout->pk_script != 0 && vout->pk_scriptlen*2+1 < sizeof(scriptstr) ) { memset(vp,0,sizeof(*vp)); - if ( (asmtype= iguana_calcrmd160(taddr,pubtype,p2shtype,asmstr,vp,vout->pk_script,vout->pk_scriptlen,txid,txi,0xffffffff)) >= 0 ) + if ( (asmtype= iguana_calcrmd160(taddr,pubtype,p2shtype,0,vp,vout->pk_script,vout->pk_scriptlen,txid,txi,0xffffffff)) >= 0 ) { skey = cJSON_CreateObject(); - scriptlen = iguana_scriptgen(taddr,pubtype,p2shtype,&m,&n,vp->coinaddr,space,asmstr,vp->rmd160,asmtype,vp,txi); - if ( asmstr[0] != 0 ) - jaddstr(skey,"asm",asmstr); + scriptlen = iguana_scriptgen(taddr,pubtype,p2shtype,&m,&n,vp->coinaddr,space,0,vp->rmd160,asmtype,vp,txi); + //if ( asmstr[0] != 0 ) + // jaddstr(skey,"asm",asmstr); addrs = cJSON_CreateArray(); if ( vp->N == 1 ) { From e2cfe9f20eb7412a8e33c3252d2f23ff2c41bdea Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Sep 2017 07:30:38 +0200 Subject: [PATCH 0440/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9e900a3c6..ab670a326 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -306,7 +306,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else printf("non-hex tx.(%s)\n",hexstr); free(hexstr); return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); - } else printf("failed blockchain.transaction.get\n"); + } else printf("failed blockchain.transaction.get %s\n",buf); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); } } From a55abad6c44c96f12a7c6bb185ba3af460f20011 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:06:19 +0200 Subject: [PATCH 0441/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_ordermatch.c | 344 ++++++++++++++++++++---------- iguana/exchanges/LP_scan.c | 6 +- iguana/exchanges/LP_socket.c | 60 +++--- iguana/exchanges/LP_transaction.c | 4 +- iguana/exchanges/LP_utxo.c | 11 +- iguana/exchanges/electrum.kmd3 | 2 + 8 files changed, 282 insertions(+), 149 deletions(-) create mode 100755 iguana/exchanges/electrum.kmd3 diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 292b997d6..6453ce80c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -306,6 +306,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); void LP_postutxos(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); +int32_t LP_butxo_findeither(bits256 txid,int32_t vout); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 993e27e8f..def85d884 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -30,7 +30,7 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex; int32_t LP_canbind; struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; @@ -633,6 +633,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_electrummutex); portable_mutex_init(&LP_messagemutex); portable_mutex_init(&LP_portfoliomutex); + portable_mutex_init(&LP_butxomutex); LP_sessionid = (uint32_t)time(NULL); printf("getting myipaddr sessionid.%u\n",LP_sessionid); if ( system("curl -s4 checkip.amazonaws.com > /tmp/myipaddr") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e31f663b0..ef81f9b54 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -241,15 +241,15 @@ char *LP_postedprice(cJSON *argjson) return(clonestr("{\"error\":\"missing fields in posted price\"}")); } -int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp) +int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo) { int32_t selector,spendvini; bits256 spendtxid; - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->srccoin,qp->coinaddr,qp->txid,qp->vout,qp->txid2,qp->vout2)) >= 0 ) + if ( butxo != 0 && (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->srccoin,qp->coinaddr,qp->txid,qp->vout,qp->txid2,qp->vout2)) >= 0 ) { char str[65]; printf("LP_tradecommand selector.%d in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); return(-1); } - if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) >= 0 ) + if ( autxo != 0 && (selector= LP_mempool_vinscan(&spendtxid,&spendvini,qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) >= 0 ) { char str[65]; printf("LP_tradecommand dest selector.%d in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); return(-1); @@ -259,26 +259,29 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp) double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp,int32_t iambob) { - double qprice; uint64_t txfee,desttxfee,srcvalue,srcvalue2,destvalue,destvalue2; - if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) + double qprice=0.; uint64_t txfee,desttxfee,srcvalue=0,srcvalue2=0,destvalue=0,destvalue2=0; + if ( butxo != 0 ) { - printf("bob not eligible\n"); - return(-2); + if (LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) + { + printf("bob not eligible\n"); + return(-2); + } + if ( bits256_cmp(butxo->deposit.txid,qp->txid2) != 0 || butxo->deposit.vout != qp->vout2 ) + return(-6); + if ( strcmp(butxo->coinaddr,qp->coinaddr) != 0 ) + return(-7); } - if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) + if ( autxo != 0 && LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { char str[65]; printf("alice not eligible (%.8f %.8f) %s/v%d\n",dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); return(-3); } - if ( LP_quote_checkmempool(qp) < 0 ) + if ( LP_quote_checkmempool(qp,autxo,butxo) < 0 ) return(-4); //if ( iambob != 0 && (*butxop= LP_utxofind(1,qp->txid,qp->vout)) == 0 ) // return(-5); - if ( bits256_cmp(butxo->deposit.txid,qp->txid2) != 0 || butxo->deposit.vout != qp->vout2 ) - return(-6); - if ( strcmp(butxo->coinaddr,qp->coinaddr) != 0 ) - return(-7); - if ( iambob == 0 ) + if ( iambob == 0 && autxo != 0 ) { //if ( (*autxop= LP_utxofind(0,qp->desttxid,qp->destvout)) == 0 ) // return(-8); @@ -292,16 +295,22 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str printf("destvalue %.8f srcvalue %.8f, destsatoshis %.8f or satoshis %.8f is too small txfees %.8f %.8f?\n",dstr(destvalue),dstr(srcvalue),dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->desttxfee),dstr(qp->txfee)); return(-11); } - qprice = ((double)qp->destsatoshis / qp->satoshis); - if ( qp->satoshis < (srcvalue / LP_MINVOL) || srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT ) + if ( qp->satoshis != 0 ) { - printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee)); - return(-12); + qprice = ((double)qp->destsatoshis / qp->satoshis); + if ( qp->satoshis < (srcvalue / LP_MINVOL) || srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT ) + { + printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee)); + return(-12); + } } - if ( qp->destsatoshis < (destvalue / LP_MINCLIENTVOL) || destvalue < qp->desttxfee*LP_MINSIZE_TXFEEMULT ) + if ( qp->destsatoshis != 0 ) { - printf("destsatoshis %.8f is less than %f of value %.8f or < 10x txfee %.8f\n",dstr(qp->destsatoshis),1./LP_MINCLIENTVOL,dstr(destvalue),dstr(qp->desttxfee)); - return(-13); + if ( qp->destsatoshis < (destvalue / LP_MINCLIENTVOL) || destvalue < qp->desttxfee*LP_MINSIZE_TXFEEMULT ) + { + printf("destsatoshis %.8f is less than %f of value %.8f or < 10x txfee %.8f\n",dstr(qp->destsatoshis),1./LP_MINCLIENTVOL,dstr(destvalue),dstr(qp->desttxfee)); + return(-13); + } } LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); @@ -390,6 +399,174 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } +struct LP_utxoinfo BUTXOS[100]; + +int32_t LP_butxo_findeither(bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo; int32_t i,retval = 0; + portable_mutex_lock(&LP_butxomutex); + for (i=0; ipayment.vout && bits256_cmp(txid,utxo->payment.txid)) == 0 || (vout == utxo->deposit.vout && bits256_cmp(txid,utxo->deposit.txid) == 0) ) + { + retval = 1; + break; + } + } + portable_mutex_unlock(&LP_butxomutex); + return(retval); +} + +struct LP_utxoinfo *LP_butxo_find(struct LP_utxoinfo *butxo) +{ + int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); + portable_mutex_lock(&LP_butxomutex); + for (i=0; ipayment.vout == utxo->payment.vout && butxo->deposit.vout == utxo->deposit.vout && bits256_nonz(butxo->payment.txid) != 0 && bits256_nonz(butxo->deposit.txid) != 0 && bits256_cmp(butxo->payment.txid,utxo->payment.txid) == 0 && bits256_cmp(butxo->deposit.txid,utxo->deposit.txid) == 0 ) + break; + if ( utxo->S.swap == 0 && now > utxo->T.swappending ) + memset(utxo,0,sizeof(*utxo)); + } + portable_mutex_unlock(&LP_butxomutex); + return(utxo); +} + +struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) +{ + static struct LP_utxoinfo zeroes; + int32_t i; struct LP_utxoinfo *utxo=0; + portable_mutex_lock(&LP_butxomutex); + if ( (utxo= LP_butxo_find(butxo)) == 0 ) + { + for (i=0; iU.value - targetval); + //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + if ( dist >= 0 && dist < mindist ) + { + mini = i; + mindist = dist; + } + } + } + return(mini); +} + +struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,int32_t avoidflag) +{ + struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; + if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) + { + if ( (m= LP_address_utxo_ptrs(utxos,max,ap,avoidflag)) > 1 ) + { + targetval = SATOSHIDEN * (volume / price) + 2*txfee; + { + int32_t i; + for (i=0; iU.value)); + printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); + } + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) + { + up = utxos[mini]; + utxos[mini] = 0; + targetval = (targetval / 8) * 9 + 2*txfee; + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) + { + if ( up != 0 && (up2= utxos[mini]) != 0 ) + { + safecopy(utxo->coin,coin->symbol,sizeof(utxo->coin)); + safecopy(utxo->coinaddr,coinaddr,sizeof(utxo->coinaddr)); + utxo->payment.txid = up->U.txid; + utxo->payment.vout = up->U.vout; + utxo->payment.value = up->U.value; + utxo->iambob = 1; + utxo->deposit.txid = up2->U.txid; + utxo->deposit.vout = up2->U.vout; + utxo->deposit.value = up2->U.value; + utxo->S.satoshis = SATOSHIDEN * (volume / price); + return(utxo); + } + } + } + } + } + return(0); +} + +void LP_butxo_swapfields_copy(struct LP_utxoinfo *destutxo,struct LP_utxoinfo *srcutxo) +{ + destutxo->S = srcutxo->S; + destutxo->T.swappending = srcutxo->T.swappending; +} + +void LP_butxo_swapfields(struct LP_utxoinfo *butxo) +{ + struct LP_utxoinfo *getutxo=0; + if ( (getutxo= LP_butxo_find(butxo)) != 0 ) + LP_butxo_swapfields_copy(butxo,getutxo); +} + +void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) +{ + struct LP_utxoinfo *setutxo; + if ( (setutxo= LP_butxo_add(butxo)) != 0 ) + LP_butxo_swapfields_copy(setutxo,butxo); +} + +void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) +{ + if ( butxo != 0 ) + { + memset(butxo,0,sizeof(*butxo)); + butxo->pubkey = qp->srchash; + safecopy(butxo->coin,qp->srccoin,sizeof(butxo->coin)); + safecopy(butxo->coinaddr,qp->coinaddr,sizeof(butxo->coinaddr)); + butxo->payment.txid = qp->txid; + butxo->payment.vout = qp->vout; + //butxo->payment.value = qp->value; + butxo->iambob = 1; + butxo->deposit.txid = qp->txid2; + butxo->deposit.vout = qp->vout2; + //butxo->deposit.value = up2->U.value; + butxo->S.satoshis = qp->satoshis; + } + if ( autxo != 0 ) + { + memset(autxo,0,sizeof(*autxo)); + autxo->pubkey = qp->desthash; + safecopy(autxo->coin,qp->destcoin,sizeof(autxo->coin)); + safecopy(autxo->coinaddr,qp->destaddr,sizeof(autxo->coinaddr)); + autxo->payment.txid = qp->desttxid; + autxo->payment.vout = qp->destvout; + //autxo->payment.value = qp->value; + autxo->iambob = 0; + autxo->fee.txid = qp->feetxid; + autxo->fee.vout = qp->feevout; + //autxo->deposit.value = up2->U.value; + autxo->S.satoshis = qp->destsatoshis; + } +} + int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *base,char *rel,double price,struct LP_quoteinfo *qp) { char pairstr[512],*msg; cJSON *retjson; bits256 privkey; int32_t pair=-1,retval = -1,DEXselector = 0; struct basilisk_swap *swap; struct iguana_info *coin; @@ -401,7 +578,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(-1); } privkey = LP_privkey(utxo->coinaddr,coin->taddr); - if ( bits256_nonz(privkey) != 0 && bits256_cmp(LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && + if ( bits256_nonz(privkey) != 0 && bits256_cmp(LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && { if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { @@ -434,37 +611,10 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ nn_close(pair); LP_availableset(utxo); } else LP_unavailableset(utxo,utxo->S.otherpubkey); + LP_butxo_swapfields(utxo); return(retval); } -void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) -{ - memset(butxo,0,sizeof(*butxo)); - butxo->pubkey = qp->srchash; - safecopy(butxo->coin,qp->srccoin,sizeof(butxo->coin)); - safecopy(butxo->coinaddr,qp->coinaddr,sizeof(butxo->coinaddr)); - butxo->payment.txid = qp->txid; - butxo->payment.vout = qp->vout; - //butxo->payment.value = qp->value; - butxo->iambob = 1; - butxo->deposit.txid = qp->txid2; - butxo->deposit.vout = qp->vout2; - //butxo->deposit.value = up2->U.value; - butxo->S.satoshis = qp->satoshis; - memset(autxo,0,sizeof(*autxo)); - autxo->pubkey = qp->desthash; - safecopy(autxo->coin,qp->destcoin,sizeof(autxo->coin)); - safecopy(autxo->coinaddr,qp->destaddr,sizeof(autxo->coinaddr)); - autxo->payment.txid = qp->desttxid; - autxo->payment.vout = qp->destvout; - //autxo->payment.value = qp->value; - autxo->iambob = 0; - autxo->fee.txid = qp->feetxid; - autxo->fee.vout = qp->feevout; - //autxo->deposit.value = up2->U.value; - autxo->S.satoshis = qp->destsatoshis; -} - char *LP_connectedalice(cJSON *argjson) // alice { cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; @@ -490,6 +640,7 @@ char *LP_connectedalice(cJSON *argjson) // alice LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } + // SPV validate bobs printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) @@ -538,7 +689,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; int32_t retval = -1; struct LP_quoteinfo Q; + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo **utxos; struct LP_quoteinfo Q; int32_t retval = -1,max=10000; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { //LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); @@ -554,7 +705,23 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price = ask; autxo = &A; butxo = &B; + if ( strcmp(method,"request") == 0 ) + { + utxos = calloc(max,sizeof(*utxos)); + butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.satoshis),price,1); + free(utxos); + } + if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) + { + char str[65]; printf("couldnt find bob utxos for autxo %s/v%d %.8f\n",bits256_str(str,autxo->payment.txid),autxo->payment.vout,dstr(autxo->S.satoshis)); + return(-44); + } + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; LP_abutxo_set(autxo,butxo,&Q); + LP_butxo_swapfields(butxo); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); @@ -589,10 +756,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else if ( strcmp(method,"connect") == 0 ) // bob { retval = 4; - if ( butxo->S.swap == 0 ) //butxo->T.swappending != 0 && + if ( butxo->S.swap == 0 && butxo->T.swappending != 0 ) + { + // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); + } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } + LP_butxo_swapfields_set(butxo); } } return(retval); @@ -660,70 +831,9 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) -{ - int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60); - for (i=0; iU.value - targetval); - //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); - if ( dist >= 0 && dist < mindist ) - { - mini = i; - mindist = dist; - } - } - } - return(mini); -} - -struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price) -{ - struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; - if ( (ap= LP_addressfind(coin,coinaddr)) != 0 ) - { - if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) - { - targetval = SATOSHIDEN * (volume / price) + 2*txfee; - { - int32_t i; - for (i=0; iU.value)); - printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); - } - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) - { - up = utxos[mini]; - utxos[mini] = 0; - targetval = (targetval / 8) * 9 + 2*txfee; - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) - { - if ( up != 0 && (up2= utxos[mini]) != 0 ) - { - safecopy(utxo->coin,coin->symbol,sizeof(utxo->coin)); - safecopy(utxo->coinaddr,coinaddr,sizeof(utxo->coinaddr)); - utxo->payment.txid = up->U.txid; - utxo->payment.vout = up->U.vout; - utxo->payment.value = up->U.value; - utxo->iambob = 1; - utxo->deposit.txid = up2->U.txid; - utxo->deposit.vout = up2->U.vout; - utxo->deposit.value = up2->U.value; - utxo->S.satoshis = SATOSHIDEN * (volume / price); - return(utxo); - } - } - } - } - } - return(0); -} - struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 1000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -733,6 +843,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr return(0); utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); + printf("LP_buyutxo %s/%s %.8f %.8f\n",base,autxo->coin,dstr(txfee),dstr(desttxfee)); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) @@ -745,6 +856,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr price = jdouble(item,"price"); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { + printf("%s\n",jprint(item,0)); pubkey = jbits256(item,"pubkey"); if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { @@ -756,7 +868,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr if ( relvolume >= minvol && relvolume <= maxvol ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price,0)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -814,7 +926,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(autxo,bestutxo,&Q,0)) <= SMALLVAL ) + if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index ce4a2b0ee..019767670 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -440,7 +440,10 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration { struct iguana_info *coin; struct LP_transaction *tx; cJSON *array,*item; uint32_t expiration,i,n; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + { + printf("LP_waitmempool missing coin.%p or inactive\n",coin); return(-1); + } expiration = (uint32_t)time(NULL) + duration; while ( 1 ) { @@ -453,11 +456,12 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height >= 0 ) { - char str[65]; printf("LP_waitmempool found %s %s\n",symbol,bits256_str(str,txid)); + char str[65]; printf("LP_waitmempool found confirmed %s %s\n",symbol,bits256_str(str,txid)); return(tx->height); } if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) { + char str[65]; printf("check %s mempool.(%s)\n",bits256_str(str,txid),jprint(array,0)); if ( (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; isock >= 0 && retjsonp != 0 ) { - *retjsonp = cJSON_Parse("{\"error\":\"unsupported method\"}"); - return(*retjsonp); - } - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); - ep->buf[0] = 0; - sitem = (struct stritem *)queueitem(stratumreq); - sitem->expiration = timeout; - sitem->DL.type = ep->stratumid++; - sitem->retptrp = (void **)retjsonp; - queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); - expiration = (uint32_t)time(NULL) + timeout + 1; - while ( *retjsonp == 0 && time(NULL) <= expiration ) - usleep(10000); - if ( *retjsonp == 0 ) - { - //printf("unexpected %s timeout with null retjson: %s %s\n",ep->symbol,method,params); - *retjsonp = cJSON_Parse("{\"error\":\"timeout\"}"); - } - return(*retjsonp); - } else printf("couldnt find electrum server for (%s %s) or no retjsonp.%p\n",method,params,retjsonp); + *retjsonp = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); + memset(ep->buf,0,ep->bufsize); + sitem = (struct stritem *)queueitem(stratumreq); + sitem->expiration = timeout; + sitem->DL.type = ep->stratumid++; + sitem->retptrp = (void **)retjsonp; + queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); + expiration = (uint32_t)time(NULL) + timeout + 1; + while ( *retjsonp == 0 && time(NULL) <= expiration ) + usleep(10000); + if ( ep->prev == 0 ) + { + if ( *retjsonp == 0 ) + { + //printf("unexpected %s timeout with null retjson: %s %s\n",ep->symbol,method,params); + *retjsonp = cJSON_Parse("{\"error\":\"timeout\"}"); + } + return(*retjsonp); + } + } else printf("couldnt find electrum server for (%s %s) or no retjsonp.%p\n",method,params,retjsonp); + ep = ep->prev; + } return(0); } @@ -753,7 +756,12 @@ void LP_dedicatedloop(void *arg) usleep(100000); } } - printf("close %s:%u\n",ep->ipaddr,ep->port); + if ( coin->electrum == ep ) + { + coin->electrum = ep->prev; + printf("set %s electrum to %s\n",coin->symbol,coin->electrum); + } else printf("backup electrum server closing\n"); + printf(">>>>>>>>>> electrum close %s:%u\n",ep->ipaddr,ep->port); if ( Num_electrums > 0 ) { portable_mutex_lock(&LP_electrummutex); @@ -768,7 +776,8 @@ void LP_dedicatedloop(void *arg) } portable_mutex_unlock(&LP_electrummutex); } - free(ep); + ep->sock = -1; + //free(ep); } cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) @@ -792,6 +801,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); + ep->prev = coin->electrum; coin->electrum = ep; } } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a5dfcde32..5153646c9 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1306,12 +1306,12 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da retval = 0; if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) { - /*for (i=0; ibobdeposit.I.datalen; i++) + int32_t i; for (i=0; ibobdeposit.I.datalen; i++) printf("%02x",swap->bobdeposit.txbytes[i]); printf(" <- bobdeposit\n"); for (i=0; ialiceclaim.I.datalen; i++) printf("%02x",swap->aliceclaim.txbytes[i]); - printf(" <- aliceclaim\n");*/ + printf(" <- aliceclaim\n"); //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 29ab3fc4a..1617a3cd3 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -137,16 +137,19 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } -int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) +int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,int32_t avoidflag) { struct LP_address_utxo *up,*tmp; int32_t n = 0; DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->spendheight <= 0 ) { - utxos[n++] = up; - if ( n >= max ) - break; + if ( avoidflag == 0 || LP_butxo_findeither(up->U.txid,up->U.vout) == 0 ) + { + utxos[n++] = up; + if ( n >= max ) + break; + } } } return(n); diff --git a/iguana/exchanges/electrum.kmd3 b/iguana/exchanges/electrum.kmd3 new file mode 100755 index 000000000..449658cac --- /dev/null +++ b/iguana/exchanges/electrum.kmd3 @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140 \",\"port\":8777}" From 330365aaffd64385a2243688cebe9defed55e398 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:08:25 +0200 Subject: [PATCH 0442/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2739f17a6..80691bfc6 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -759,7 +759,7 @@ void LP_dedicatedloop(void *arg) if ( coin->electrum == ep ) { coin->electrum = ep->prev; - printf("set %s electrum to %s\n",coin->symbol,coin->electrum); + printf("set %s electrum to %p\n",coin->symbol,coin->electrum); } else printf("backup electrum server closing\n"); printf(">>>>>>>>>> electrum close %s:%u\n",ep->ipaddr,ep->port); if ( Num_electrums > 0 ) From 0205423fb6c168e58636de3ddc38829780f760ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:16:25 +0200 Subject: [PATCH 0443/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_socket.c | 6 +++--- iguana/exchanges/LP_utxo.c | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index def85d884..b8a4c8f6c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -430,7 +430,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 ) continue; - if ( time(NULL) > coin->lastmonitor+600 ) + if ( time(NULL) > coin->lastmonitor+60 ) { //portable_mutex_lock(&coin->addrmutex); HASH_ITER(hh,coin->addresses,ap,atmp) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 80691bfc6..335c403e4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -467,17 +467,17 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) + //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0)); + printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); } - } else retjson = LP_address_utxos(coin,addr,1); + } //else retjson = LP_address_utxos(coin,addr,1); return(retjson); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1617a3cd3..83cd9da0b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -81,6 +81,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) struct LP_address *ap; ap = calloc(1,sizeof(*ap)); safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); + printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); return(ap); } From 34385c7085fae220c59b1d0c6e816bbca0c742ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:22:37 +0200 Subject: [PATCH 0444/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 335c403e4..6046ef31f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -310,6 +310,7 @@ int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *ar int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { + printf("PROCESS %s %s num.%d\n",coin->symbol,coinaddr,n); for (i=0; isymbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From b8542cce6f1517a7bb1e390b89fdd04d9c8885c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:30:49 +0200 Subject: [PATCH 0445/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 19 ++++++++++++------- iguana/exchanges/LP_socket.c | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b8a4c8f6c..4681b589a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -447,7 +447,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } } - else + else if ( 0 ) { if ( (retjson= electrum_address_listunspent(coin->symbol,coin->electrum,&retjson,ap->coinaddr)) != 0 ) free_json(retjson); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ef81f9b54..9c98c7c59 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -833,7 +833,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double minvol,maxvol,price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*array,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -860,14 +860,19 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr pubkey = jbits256(item,"pubkey"); if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - if ( (n= jint(item,"numutxos")) > 1 ) + bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + if ( (array= electrum_address_listunspent(basecoin->symbol,basecoin->electrum,&array,coinaddr)) != 0 ) { - minvol = jdouble(item,"minvolume"); - maxvol = jdouble(item,"maxvolume"); - printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); - if ( relvolume >= minvol && relvolume <= maxvol ) + n = cJSON_GetArraySize(array); + free_json(array); + } else n = 0; + if ( n > 1 ) + { + //minvol = jdouble(item,"minvolume"); + //maxvol = jdouble(item,"maxvolume"); + //printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); + //if ( relvolume >= minvol && relvolume <= maxvol ) { - bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price,0)) != 0 ) { bestutxo->pubkey = pubp->pubkey; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6046ef31f..1dda5a683 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - //if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) + if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { From 7a6158b226356dea139db07dee19b2e8847ff174 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:41:16 +0200 Subject: [PATCH 0446/2732] Test --- iguana/exchanges/LP_utxo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 83cd9da0b..9036b3e6b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -175,7 +175,10 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); - if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about + ap = LP_addressfind(coin,coinaddr); + else ap = LP_address(coin,coinaddr); + if ( ap != 0 ) { flag = 0; DL_FOREACH_SAFE(ap->utxos,up,tmp) From 85120d993d675c402a416140c2bfbe303133039f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:46:24 +0200 Subject: [PATCH 0447/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1dda5a683..de2268507 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -467,7 +467,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); - //printf("electrum listunspent last.(%s lag %d)\n",coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); + printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) From 550e1327bdeb1b47442e89e6408857f955bc3019 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:54:51 +0200 Subject: [PATCH 0448/2732] Test --- iguana/exchanges/LP_ordermatch.c | 15 ++++++++------- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 10 +++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9c98c7c59..a6fa028ea 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -290,21 +290,26 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str if ( strcmp(autxo->coinaddr,qp->destaddr) != 0 ) return(-10); } - if ( destvalue < qp->desttxfee+qp->destsatoshis || srcvalue < qp->txfee+qp->satoshis ) + if ( (autxo != 0 && destvalue < qp->desttxfee+qp->destsatoshis) || (butxo != 0 && srcvalue < qp->txfee+qp->satoshis) ) { printf("destvalue %.8f srcvalue %.8f, destsatoshis %.8f or satoshis %.8f is too small txfees %.8f %.8f?\n",dstr(destvalue),dstr(srcvalue),dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->desttxfee),dstr(qp->txfee)); return(-11); } if ( qp->satoshis != 0 ) - { qprice = ((double)qp->destsatoshis / qp->satoshis); + LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); + printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); + if ( qp->txfee < LP_REQUIRED_TXFEE*txfee || qp->desttxfee < LP_REQUIRED_TXFEE*desttxfee ) + return(-14); + if ( butxo != 0 ) + { if ( qp->satoshis < (srcvalue / LP_MINVOL) || srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT ) { printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee)); return(-12); } } - if ( qp->destsatoshis != 0 ) + if ( autxo != 0 ) { if ( qp->destsatoshis < (destvalue / LP_MINCLIENTVOL) || destvalue < qp->desttxfee*LP_MINSIZE_TXFEEMULT ) { @@ -312,10 +317,6 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-13); } } - LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); - printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); - if ( qp->txfee < LP_REQUIRED_TXFEE*txfee || qp->desttxfee < LP_REQUIRED_TXFEE*desttxfee ) - return(-14); return(qprice); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index ab670a326..644838101 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -508,7 +508,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( electrum_process_array(coin,coinaddr,retjson) != 0 ) + if ( electrum_process_array(coin,coin->electrum,coinaddr,retjson) != 0 ) { LP_postutxos(symbol,coinaddr); // might be good to not saturate } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index de2268507..28e7a582d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -305,12 +305,12 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } -int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *array) +int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep,char *coinaddr,cJSON *array) { int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - printf("PROCESS %s %s num.%d\n",coin->symbol,coinaddr,n); + printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); for (i=0; isymbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); From c356f45b27ac9978a97ff393e93a46fab4e43ec8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 12:57:44 +0200 Subject: [PATCH 0449/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a6fa028ea..b5b4bc9ae 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -706,6 +706,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price = ask; autxo = &A; butxo = &B; + LP_abutxo_set(autxo,0,&Q); if ( strcmp(method,"request") == 0 ) { utxos = calloc(max,sizeof(*utxos)); @@ -721,7 +722,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - LP_abutxo_set(autxo,butxo,&Q); + LP_abutxo_set(0,butxo,&Q); LP_butxo_swapfields(butxo); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 28e7a582d..32747b63a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -467,7 +467,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); - printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); + //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) From 8e86a244b75a53d8d93edc23e04f7b4370cd5dcf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:05:26 +0200 Subject: [PATCH 0450/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b5b4bc9ae..501fccd5d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -710,7 +710,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { utxos = calloc(max,sizeof(*utxos)); - butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.satoshis),price,1); + butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1); free(utxos); } if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 32747b63a..84be2f097 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 ) + if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { From 31458d94c35f40721edb46bbbb735e5209f4e4fa Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:17:37 +0200 Subject: [PATCH 0451/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 - iguana/exchanges/LP_rpc.c | 3 ++- iguana/exchanges/LP_utxos.c | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 501fccd5d..26c9dff54 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -693,7 +693,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo **utxos; struct LP_quoteinfo Q; int32_t retval = -1,max=10000; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { - //LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 644838101..d781decd7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -508,8 +508,9 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( electrum_process_array(coin,coin->electrum,coinaddr,retjson) != 0 ) + if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 ) { + printf("PROCESS INTERNAL.(%s)\n",coin->symbol); LP_postutxos(symbol,coinaddr); // might be good to not saturate } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index be104cc6b..b20f871ed 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -882,13 +882,17 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan userpub = curve25519(userpass,curve25519_basepoint9()); printf("userpass.(%s)\n",bits256_str(USERPASS,userpub)); } - if ( coin->electrum == 0 && (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) + if ( coin->electrum == 0 ) { - if ( jobj(retjson,"error") != 0 ) + LP_listunspent_issue(coin->symbol,coin->smartaddr); + if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) { - printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1)); - exit(-1); - } + if ( jobj(retjson,"error") != 0 ) + { + printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1)); + exit(-1); + } + } else free_json(retjson); } } LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); From 87fa15308326ea82b39226f68fb2d921b9d70c5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:32:53 +0200 Subject: [PATCH 0452/2732] Test --- iguana/exchanges/LP_rpc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d781decd7..4c25b26a4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -503,18 +503,20 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) retjson = electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr); else { - if ( (destport= LP_randpeer(destip)) > 0 ) + if ( strcmp(coin->smartaddr,coinaddr) == 0 ) + { + retjson = LP_listunspent(symbol,coinaddr); + printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); + } + else if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 ) - { - printf("PROCESS INTERNAL.(%s)\n",coin->symbol); - LP_postutxos(symbol,coinaddr); // might be good to not saturate - } - } - //printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr); + retjson = cJSON_Parse(retstr); + } + if ( retjson != 0 ) + { + if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 ) + LP_postutxos(symbol,coinaddr); // might be good to not saturate } } if ( retjson != 0 ) From 949699aa86a8cad358e6275aab077afe04744ff5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:34:27 +0200 Subject: [PATCH 0453/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 26c9dff54..7318f5545 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -353,6 +353,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L msg = jprint(reqjson,1); printf("QUERY.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); + LP_broadcast_message(-1,qp->srccoin,qp->destcoin,qp->srchash,msg); for (i=0; i<30; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) From 5c382bef3074535b985f4d2e1e7ef7dcfd7f3b4f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:37:54 +0200 Subject: [PATCH 0454/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7318f5545..eb9446ed6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -334,7 +334,7 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; char *msg; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; + cJSON *reqjson; char *msg,*msg2; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -351,9 +351,10 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); + msg2 = clonestr(msg); printf("QUERY.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - LP_broadcast_message(-1,qp->srccoin,qp->destcoin,qp->srchash,msg); + LP_broadcast_message(-1,qp->srccoin,qp->destcoin,qp->srchash,msg2); for (i=0; i<30; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) From 280924f3a1d58c4f092f730e81e0ce5459b030df Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:45:59 +0200 Subject: [PATCH 0455/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index eb9446ed6..2f910abea 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -334,7 +334,7 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; char *msg,*msg2; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -354,7 +354,8 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L msg2 = clonestr(msg); printf("QUERY.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - LP_broadcast_message(-1,qp->srccoin,qp->destcoin,qp->srchash,msg2); + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg2); for (i=0; i<30; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 84be2f097..091233f4c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -310,7 +310,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); + //printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); for (i=0; icoinaddr,coinaddr,sizeof(ap->coinaddr)); - printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); + //printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); return(ap); } From b20d39f8632cb156651f8bf91ee7d589d2c46e7e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 13:53:35 +0200 Subject: [PATCH 0456/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2f910abea..a77b983a7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -696,10 +696,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo **utxos; struct LP_quoteinfo Q; int32_t retval = -1,max=10000; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { - printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); retval = 1; - if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 ) + printf("LP_tradecommand: check received %s\n",method); + if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) { + printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); if ( (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4c25b26a4..013e25114 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -506,7 +506,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) if ( strcmp(coin->smartaddr,coinaddr) == 0 ) { retjson = LP_listunspent(symbol,coinaddr); - printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); + //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } else if ( (destport= LP_randpeer(destip)) > 0 ) { From bd1324bf10101239a5206c6c09ac069600c159f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:08:02 +0200 Subject: [PATCH 0457/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_nativeDEX.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e9099f018..11732e063 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -440,6 +440,7 @@ dividends(coin, height, )\n\ memset(zero.bytes,0,sizeof(zero)); //printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + Broadcaststr = jprint(reqjson,0); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4681b589a..11e20ba8e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -32,7 +32,7 @@ #include "LP_include.h" portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex; int32_t LP_canbind; - +char *Broadcaststr; struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; @@ -266,7 +266,7 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) { - int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < 1000 && recvlen > 0 ) @@ -281,6 +281,15 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); + if ( Broadcaststr != 0 ) + { + printf("self broadcast.(%s)\n",Broadcaststr); + str = Broadcaststr; + Broadcaststr = 0; + if ( (retstr= LP_process_message(ctx,"selfbroadcast",myipaddr,-1,(void *)str,(int32_t)strlen(str)+1,-1)) != 0 ) + free(retstr); + free(str); + } } } } From 853b3a608f787156e2cc7921ba4583b9d8899379 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:12:00 +0200 Subject: [PATCH 0458/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 11e20ba8e..2815f3ae0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -286,7 +286,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int printf("self broadcast.(%s)\n",Broadcaststr); str = Broadcaststr; Broadcaststr = 0; - if ( (retstr= LP_process_message(ctx,"selfbroadcast",myipaddr,-1,(void *)str,(int32_t)strlen(str)+1,-1)) != 0 ) + if ( (retstr= LP_process_message(ctx,"selfbroadcast",myipaddr,pubsock,(void *)str,(int32_t)strlen(str)+1,sock)) != 0 ) free(retstr); free(str); } From eba155dc06159e3edd834cb6d0214957a417fbac Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:15:35 +0200 Subject: [PATCH 0459/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2815f3ae0..80da2a32d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -266,7 +266,7 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) { - int32_t recvlen=1,nonz = 0; void *ptr; char *retstr,*str; struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < 1000 && recvlen > 0 ) @@ -286,8 +286,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int printf("self broadcast.(%s)\n",Broadcaststr); str = Broadcaststr; Broadcaststr = 0; - if ( (retstr= LP_process_message(ctx,"selfbroadcast",myipaddr,pubsock,(void *)str,(int32_t)strlen(str)+1,sock)) != 0 ) - free(retstr); + if ( (argjson= cJSON_Parse(str)) != 0 ) + { + LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0); + free_json(argjson); + } free(str); } } From 68a2efe25d1b4376153f176be3d7f7cf0cc3ce96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:20:29 +0200 Subject: [PATCH 0460/2732] test --- iguana/exchanges/LP_nativeDEX.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 80da2a32d..153ba5522 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -264,7 +264,7 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu return(n); } -int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) +int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr) { int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) @@ -288,7 +288,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int Broadcaststr = 0; if ( (argjson= cJSON_Parse(str)) != 0 ) { - LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0); + if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) + free(retstr); + //LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0); free_json(argjson); } free(str); @@ -317,7 +319,7 @@ void command_rpcloop(void *myipaddr) else continue; } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); - nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock); + nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -327,7 +329,7 @@ void command_rpcloop(void *myipaddr) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); }*/ if ( LP_mypullsock >= 0 ) - nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock); + nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) From ad148cc9bf9cecb6876832d03fbfdd5906a37829 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:26:45 +0200 Subject: [PATCH 0461/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 11732e063..e47cc1a0e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -438,7 +438,7 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); - //printf("broadcast.(%s)\n",jprint(reqjson,0)); + printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); Broadcaststr = jprint(reqjson,0); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 153ba5522..3ff8cde32 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -283,7 +283,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free(retstr); if ( Broadcaststr != 0 ) { - printf("self broadcast.(%s)\n",Broadcaststr); + //printf("self broadcast.(%s)\n",Broadcaststr); str = Broadcaststr; Broadcaststr = 0; if ( (argjson= cJSON_Parse(str)) != 0 ) From f9d5d8ad6a79bbb95fe9a9e279bd28a3c102ede3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:34:07 +0200 Subject: [PATCH 0462/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e47cc1a0e..c06b28d25 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -426,6 +426,7 @@ dividends(coin, height, )\n\ bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) { + Broadcaststr = jprint(reqjson,0); if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) { cipherlen = (int32_t)strlen(cipherstr) >> 1; @@ -440,7 +441,6 @@ dividends(coin, height, )\n\ memset(zero.bytes,0,sizeof(zero)); printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); - Broadcaststr = jprint(reqjson,0); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); From 316e4f8395d529a6c2a6134c3f932a5675087049 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:45:13 +0200 Subject: [PATCH 0463/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c06b28d25..bb13e0f6d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -439,7 +439,7 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); - printf("broadcast.(%s)\n",jprint(reqjson,0)); + //printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3ff8cde32..05de2d87c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -288,8 +288,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int Broadcaststr = 0; if ( (argjson= cJSON_Parse(str)) != 0 ) { - if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) + if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) + { + if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) free(retstr); + } //LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0); free_json(argjson); } From b04d15e08f6d08f5cbe86b13c37a6510d02765e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:54:17 +0200 Subject: [PATCH 0464/2732] Test --- iguana/exchanges/LP_commands.c | 3 ++- iguana/exchanges/LP_nativeDEX.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index bb13e0f6d..43c41e08d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -439,7 +439,8 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); - //printf("broadcast.(%s)\n",jprint(reqjson,0)); + if ( strcmp("connect",method) == 0 ) + printf("broadcast.(%s)\n",jprint(reqjson,0)); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 05de2d87c..48fdfd9fa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -288,12 +288,13 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int Broadcaststr = 0; if ( (argjson= cJSON_Parse(str)) != 0 ) { + if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) + printf("self.(%s)\n",str); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) free(retstr); } - //LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0); free_json(argjson); } free(str); From 9cf32d3d7e041c3ebc344b27190fb436e090d54a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 14:59:07 +0200 Subject: [PATCH 0465/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a77b983a7..da5931e5a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -366,7 +366,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L break; } } - usleep(100000); + usleep(1000000); } return(price); } From 00b5f918e92909653d7820c028b8d1f37892a2ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 15:21:08 +0200 Subject: [PATCH 0466/2732] Test --- iguana/exchanges/LP_ordermatch.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index da5931e5a..cf8620ab7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -334,7 +334,7 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -351,22 +351,29 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); - msg2 = clonestr(msg); printf("QUERY.(%s)\n",msg); - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - memset(&zero,0,sizeof(zero)); - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg2); - for (i=0; i<30; i++) + if ( strcmp(method,"connect") == 0 ) { - if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) + sleep(3); + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); + } + else + { + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); + for (i=0; i<30; i++) { - if ( flag == 0 || bits256_nonz(qp->desthash) != 0 ) + if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) { - printf("break out of loop.%d price %.8f %s/%s\n",i,price,qp->srccoin,qp->destcoin); - break; + if ( flag == 0 || bits256_nonz(qp->desthash) != 0 ) + { + printf("break out of loop.%d price %.8f %s/%s\n",i,price,qp->srccoin,qp->destcoin); + break; + } } + usleep(1000000); } - usleep(1000000); } return(price); } From dfb41e5c9d4888850589031852e6337fa8d7184b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 16:49:56 +0200 Subject: [PATCH 0467/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_network.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 48fdfd9fa..fd2893593 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -274,10 +274,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; - if ( nn_poll(&pfd,1,1) != 1 ) + if ( nn_poll(&pfd,1,10) != 1 ) break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { + printf("received %d\n",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 4f84b0dab..58bc2d728 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -57,7 +57,7 @@ int32_t LP_sockcheck(int32_t sock) struct nn_pollfd pfd; pfd.fd = sock; pfd.events = NN_POLLOUT; - if ( nn_poll(&pfd,1,1) > 0 ) + if ( nn_poll(&pfd,1,10) > 0 ) return(1); else return(-1); } @@ -162,7 +162,7 @@ void queue_loop(void *ignore) if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); else flag = 1; - } + } else printf("sock not ready to send.%d\n",ptr->msglen); } else if ( time(NULL) > ptr->starttime+13 ) { @@ -562,7 +562,7 @@ char *LP_psock(char *myipaddr,int32_t ispaired) { if ( nn_bind(pullsock,pushaddr) >= 0 && nn_bind(pubsock,subaddr) >= 0 ) { - timeout = 1; + timeout = 10; nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); if ( ispaired != 0 ) @@ -700,7 +700,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char exit(-1); } } - timeout = 1; + timeout = 10; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; From 61a47af1189aece543b30a8ad38bbb2bf994614a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 17:01:05 +0200 Subject: [PATCH 0468/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fd2893593..6eb22fc7f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -278,7 +278,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - printf("received %d\n",recvlen); + fprintf(stderr,"%d ",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -333,8 +333,8 @@ void command_rpcloop(void *myipaddr) if ( coin->bussock >= 0 ) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); }*/ - if ( LP_mypullsock >= 0 ) - nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); + //if ( LP_mypullsock >= 0 ) + // nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) @@ -725,10 +725,16 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) // free(retstr); + int32_t nonz; while ( 1 ) { + nonz = 0; //fprintf(stderr,"."); - if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) == 0 ) + if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) != 0 ) + nonz++; + if ( LP_mypullsock >= 0 ) + nonz += LP_sock_check("SUB",ctx,myipaddr,-1,LP_mypullsock,"127.0.0.1"); + if ( nonz == 0 ) usleep(1000000 / MAINLOOP_PERSEC); } } From 7901b725f3123631088a6597f9e04981d5c97b6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 17:08:59 +0200 Subject: [PATCH 0469/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_ordermatch.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6eb22fc7f..9827eecbd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -278,7 +278,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - fprintf(stderr,"%d ",recvlen); + if ( recvlen > 1500 ) + fprintf(stderr,"%d ",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cf8620ab7..458a264f8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -761,7 +761,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddstr(retjson,"method","reserved"); msg = jprint(retjson,1); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)",butxo->T.swappending,qprice,price,msg); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + { + bits256 zero; + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey + } butxo->T.lasttime = (uint32_t)time(NULL); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } From 3314cf4cd26295799e44aafe89a5d63b6ffd3f2a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 17:18:45 +0200 Subject: [PATCH 0470/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9827eecbd..78b3ad787 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,6 +202,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; + printf("%s\n",jstr(argjson,"method")); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } @@ -334,8 +335,8 @@ void command_rpcloop(void *myipaddr) if ( coin->bussock >= 0 ) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); }*/ - //if ( LP_mypullsock >= 0 ) - // nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); + if ( LP_mypullsock >= 0 ) + nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 58bc2d728..4519c855d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[8192]; static unsigned long dup,total; + static uint32_t crcs[16]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) From fb98099b49c92438945ae302365b7db24119884a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 17:35:25 +0200 Subject: [PATCH 0471/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 78b3ad787..44f5714c9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,7 +202,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - printf("%s\n",jstr(argjson,"method")); + fprintf(stderr,"%s ",jstr(argjson,"method")); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 4519c855d..f3c6c1355 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -157,7 +157,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - // else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); + else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -214,7 +214,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - //printf("Q sent %u\n",crc32); + printf("Q sent %u\n",crc32); sock0 = -1; } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b20f871ed..479500d3c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -193,7 +193,7 @@ int32_t LP_utxopurge(int32_t allutxos) cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; - jaddstr(item,"method","utxo"); + jaddstr(item,"method","oldutxo"); if ( utxo == 0 ) return(item); if ( utxo->gui[0] != 0 ) From 59f36f01b52d70a47808ffd535b85fb77a9502b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 17:53:20 +0200 Subject: [PATCH 0472/2732] Test --- iguana/exchanges/LP_commands.c | 9 ++++++++- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 43c41e08d..cf47309d6 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -441,7 +441,14 @@ dividends(coin, height, )\n\ memset(zero.bytes,0,sizeof(zero)); if ( strcmp("connect",method) == 0 ) printf("broadcast.(%s)\n",jprint(reqjson,0)); - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + if ( LP_mypubsock >= 0 ) + { + char *msg; + msg = jprint(reqjson,0); + nn_send(pubsock,(void *)msg,(int32_t)strlen(msg)+1,0); + free(msg); + } + //LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 44f5714c9..1c82749c5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,7 +202,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - fprintf(stderr,"%s ",jstr(argjson,"method")); + if ( strcmp(method,"postprice") != 0 ) + fprintf(stderr,"%s ",jstr(argjson,"method")); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f3c6c1355..2262efcd8 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -214,7 +214,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - printf("Q sent %u\n",crc32); + printf("Q sent %u msglen.%d\n",crc32,msglen); sock0 = -1; } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 458a264f8..2a3776542 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -594,7 +594,9 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + printf("call swapinit\n"); swap = LP_swapinit(1,0,privkey,&qp->R,qp); + printf("swapinit.%p\n",swap); swap->N.pair = pair; utxo->S.swap = swap; swap->utxo = utxo; @@ -764,6 +766,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); + if ( pubsock >= 0 ) + nn_send(pubsock,msg,(int32_t)strlen(msg)+1,0); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey } butxo->T.lasttime = (uint32_t)time(NULL); From d16961b53102a34d8c189c918c81aeb6a69433ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 17:58:09 +0200 Subject: [PATCH 0473/2732] test --- iguana/exchanges/LP_commands.c | 9 +-------- iguana/exchanges/LP_ordermatch.c | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index cf47309d6..43c41e08d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -441,14 +441,7 @@ dividends(coin, height, )\n\ memset(zero.bytes,0,sizeof(zero)); if ( strcmp("connect",method) == 0 ) printf("broadcast.(%s)\n",jprint(reqjson,0)); - if ( LP_mypubsock >= 0 ) - { - char *msg; - msg = jprint(reqjson,0); - nn_send(pubsock,(void *)msg,(int32_t)strlen(msg)+1,0); - free(msg); - } - //LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2a3776542..afaab7ab6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -766,8 +766,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); - if ( pubsock >= 0 ) - nn_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + //if ( pubsock >= 0 ) + // nn_send(pubsock,msg,(int32_t)strlen(msg)+1,0); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey } butxo->T.lasttime = (uint32_t)time(NULL); From 2132bf2ef27a4b2f7e89b2d409339c7adc5b5b8a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:03:14 +0200 Subject: [PATCH 0474/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index afaab7ab6..9931fa6d7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -766,8 +766,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); - //if ( pubsock >= 0 ) - // nn_send(pubsock,msg,(int32_t)strlen(msg)+1,0); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey } butxo->T.lasttime = (uint32_t)time(NULL); From a4ce26cba6b3f55faec8b75b8136ff0fcfbb08aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:06:46 +0200 Subject: [PATCH 0475/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1c82749c5..f6843d7dc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,7 +202,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - if ( strcmp(method,"postprice") != 0 ) + if ( jobj(argjson,"method") && strcmp(method,"postprice") != 0 ) fprintf(stderr,"%s ",jstr(argjson,"method")); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2262efcd8..bef1b9972 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -46,7 +46,7 @@ int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) } if ( (sentbytes= nn_send(sock,msg,sendlen,0)) != sendlen ) printf("LP_send sent %d instead of %d\n",sentbytes,sendlen); - //else printf("SENT.(%s)\n",msg); + else printf("SENT.(%s)\n",msg); if ( freeflag != 0 ) free(msg); return(sentbytes); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9931fa6d7..9010c4217 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -767,6 +767,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, bits256 zero; memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey + _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); } butxo->T.lasttime = (uint32_t)time(NULL); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); From a39af0a2acff1ce30b680f940700a6f85edbf81c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:10:33 +0200 Subject: [PATCH 0476/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f6843d7dc..ce362c933 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,7 +202,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - if ( jobj(argjson,"method") && strcmp(method,"postprice") != 0 ) + if ( jobj(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"postprice") != 0 ) fprintf(stderr,"%s ",jstr(argjson,"method")); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index bef1b9972..37bbaebc1 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -46,7 +46,7 @@ int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) } if ( (sentbytes= nn_send(sock,msg,sendlen,0)) != sendlen ) printf("LP_send sent %d instead of %d\n",sentbytes,sendlen); - else printf("SENT.(%s)\n",msg); + else printf("SENT.(%s)\n",(char *)msg); if ( freeflag != 0 ) free(msg); return(sentbytes); From 9f56ccf2870b5a3994b73603b842c0f610d3a5f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:17:00 +0200 Subject: [PATCH 0477/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9010c4217..83775a4a3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -766,8 +766,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey } butxo->T.lasttime = (uint32_t)time(NULL); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); From 939eca54b59e2555e41d514b08d846ba018ffbe0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:27:20 +0200 Subject: [PATCH 0478/2732] Test --- iguana/exchanges/LP_commands.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 43c41e08d..7908202c8 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -438,10 +438,13 @@ dividends(coin, height, )\n\ } else { + char *msg; memset(zero.bytes,0,sizeof(zero)); if ( strcmp("connect",method) == 0 ) printf("broadcast.(%s)\n",jprint(reqjson,0)); - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + msg = jprint(reqjson,0); + _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,msg); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); From e3f1d1193793b3c9d304bde5ab4a9faeb5212bd3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:38:58 +0200 Subject: [PATCH 0479/2732] test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ce362c933..2d2b41679 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,7 +202,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - if ( jobj(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"postprice") != 0 ) + if ( jobj(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"connect") == 0 ) fprintf(stderr,"%s ",jstr(argjson,"method")); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { @@ -280,8 +280,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - if ( recvlen > 1500 ) - fprintf(stderr,"%d ",recvlen); + //if ( recvlen > 1500 ) + // fprintf(stderr,"%d ",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -732,7 +732,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu while ( 1 ) { nonz = 0; - //fprintf(stderr,"."); + fprintf(stderr,"."); if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) != 0 ) nonz++; if ( LP_mypullsock >= 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 37bbaebc1..48d3ef687 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -199,7 +199,7 @@ void queue_loop(void *ignore) //if ( n != 0 ) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) - usleep(500000); + usleep(50000); } } From 65d2e5c9b29ba91bb822528cce1cd172c5b9398a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 18:52:16 +0200 Subject: [PATCH 0480/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7908202c8..7b6ae9411 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -443,7 +443,7 @@ dividends(coin, height, )\n\ if ( strcmp("connect",method) == 0 ) printf("broadcast.(%s)\n",jprint(reqjson,0)); msg = jprint(reqjson,0); - _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + //_LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,msg); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2d2b41679..9d4db2c22 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,8 +202,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - if ( jobj(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"connect") == 0 ) - fprintf(stderr,"%s ",jstr(argjson,"method")); + if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) + fprintf(stderr,"%s\n",jsonstr); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 83775a4a3..ec77e2dc8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -766,7 +766,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); - _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + //_LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey } butxo->T.lasttime = (uint32_t)time(NULL); From ccd629415d7de33d3da8c0229eaa3ad147153ddc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 19:01:41 +0200 Subject: [PATCH 0481/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9d4db2c22..0a409cbb1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -732,7 +732,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu while ( 1 ) { nonz = 0; - fprintf(stderr,"."); + //fprintf(stderr,"."); if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) != 0 ) nonz++; if ( LP_mypullsock >= 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ec77e2dc8..0b8a24b31 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -820,6 +820,8 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q if ( aliceutxo->S.swap != 0 ) break; sleep(3); + price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); } if ( aliceutxo->S.swap == 0 ) { From b47d43aab27b60956471b677dca9c96c3c71b80f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 19:15:21 +0200 Subject: [PATCH 0482/2732] Test --- iguana/exchanges/LP_network.c | 5 +++-- iguana/exchanges/LP_ordermatch.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 48d3ef687..525a13d5c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -214,7 +214,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - printf("Q sent %u msglen.%d\n",crc32,msglen); + //printf("Q sent %u msglen.%d\n",crc32,msglen); sock0 = -1; } } @@ -311,7 +311,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + if ( strncmp(method,"connect",7) == 0 ) + printf("CRC32.%u (%s)\n",crc32,msgstr); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0b8a24b31..24e99a821 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -762,7 +762,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); jaddstr(retjson,"method","reserved"); msg = jprint(retjson,1); - printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)",butxo->T.swappending,qprice,price,msg); + printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { bits256 zero; memset(&zero,0,sizeof(zero)); @@ -820,8 +820,8 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q if ( aliceutxo->S.swap != 0 ) break; sleep(3); - price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); - LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + //price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); + //LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); } if ( aliceutxo->S.swap == 0 ) { From dc0ff5f3896e7499ae8e4bd549a1b240fc681427 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 19:40:33 +0200 Subject: [PATCH 0483/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0a409cbb1..45b19f561 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -735,8 +735,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //fprintf(stderr,"."); if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) != 0 ) nonz++; - if ( LP_mypullsock >= 0 ) - nonz += LP_sock_check("SUB",ctx,myipaddr,-1,LP_mypullsock,"127.0.0.1"); + //if ( LP_mypullsock >= 0 ) + // nonz += LP_sock_check("SUB",ctx,myipaddr,-1,LP_mypullsock,"127.0.0.1"); if ( nonz == 0 ) usleep(1000000 / MAINLOOP_PERSEC); } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 525a13d5c..de2861cd1 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -311,7 +311,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - if ( strncmp(method,"connect",7) == 0 ) + if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) printf("CRC32.%u (%s)\n",crc32,msgstr); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); } // else printf("no valid method in (%s)\n",msgstr); From 9a5965ab3d1c9f30d00e14476ae3d92fb0d5c996 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 19:53:52 +0200 Subject: [PATCH 0484/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 24e99a821..d4b2e342f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -541,7 +541,10 @@ void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) { struct LP_utxoinfo *setutxo; if ( (setutxo= LP_butxo_add(butxo)) != 0 ) + { LP_butxo_swapfields_copy(setutxo,butxo); + printf("LP_butxo_swapfields_copy set\n"); + } } void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) @@ -766,8 +769,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); - //_LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey + _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + //LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey } butxo->T.lasttime = (uint32_t)time(NULL); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); From a497f744b944852fa8ad56592ddacedad67beccf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:05:12 +0200 Subject: [PATCH 0485/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d4b2e342f..3db672af0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -709,7 +709,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { retval = 1; - printf("LP_tradecommand: check received %s\n",method); if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) { printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); @@ -765,14 +764,16 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); jaddstr(retjson,"method","reserved"); msg = jprint(retjson,1); + butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { bits256 zero; memset(&zero,0,sizeof(zero)); - _LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + //_LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); //LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey + LP_butxo_swapfields_set(butxo); + return(1); } - butxo->T.lasttime = (uint32_t)time(NULL); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } else if ( strcmp(method,"connect") == 0 ) // bob @@ -782,12 +783,15 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); + LP_butxo_swapfields_set(butxo); + return(2); } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } - LP_butxo_swapfields_set(butxo); } } + if ( method != 0 ) + printf("LP_tradecommand: check received %s\n",method); return(retval); } From f7b9a735e388a407dd192bdce8a5f3e12d128e9c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:15:22 +0200 Subject: [PATCH 0486/2732] Test --- iguana/exchanges/LP_ordermatch.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3db672af0..43be9afb7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -705,10 +705,11 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo **utxos; struct LP_quoteinfo Q; int32_t retval = -1,max=10000; + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { - retval = 1; + printf("LP_tradecommand: check received %s\n",method); + //retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) { printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); @@ -723,9 +724,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_abutxo_set(autxo,0,&Q); if ( strcmp(method,"request") == 0 ) { - utxos = calloc(max,sizeof(*utxos)); + //utxos = calloc(max,sizeof(*utxos)); butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1); - free(utxos); + //free(utxos), utxos = 0; } if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { @@ -767,10 +768,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { - bits256 zero; - memset(&zero,0,sizeof(zero)); - //_LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); - //LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); //butxo->S.otherpubkey + //bits256 zero; + //memset(&zero,0,sizeof(zero)); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); return(1); } @@ -788,10 +788,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } + LP_butxo_swapfields_set(butxo); } } - if ( method != 0 ) - printf("LP_tradecommand: check received %s\n",method); return(retval); } From c6f25ab279bee143c79e4d5d9d31fbfc32504878 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:18:46 +0200 Subject: [PATCH 0487/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 45b19f561..ffa8eec48 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -271,7 +271,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { - while ( nonz < 1000 && recvlen > 0 ) + while ( nonz < 1 && recvlen > 0 ) { memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; @@ -280,8 +280,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - //if ( recvlen > 1500 ) - // fprintf(stderr,"%d ",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); From d3c0cbec0d1fd7d9a0cdbfba025f86c6ea366d1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:23:58 +0200 Subject: [PATCH 0488/2732] Test --- iguana/exchanges/LP_commands.c | 6 ++++++ iguana/exchanges/LP_ordermatch.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7b6ae9411..a28c0217f 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -367,9 +367,15 @@ dividends(coin, height, )\n\ else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"reserved") == 0 ) + { + printf("RESERVED.(%s)\n",jprint(argjson,0)); retstr = LP_quotereceived(argjson); + } else if ( strcmp(method,"connected") == 0 ) + { + printf("CONNECTED.(%s)\n",jprint(argjson,0)); retstr = LP_connectedalice(argjson); + } else if ( strcmp(method,"checktxid") == 0 ) retstr = LP_spentcheck(argjson); else if ( strcmp(method,"getcoins") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 43be9afb7..e627e4102 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -709,7 +709,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); - //retval = 1; + retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) { printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); @@ -772,7 +772,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); - return(1); + return(2); } } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } @@ -784,7 +784,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); LP_butxo_swapfields_set(butxo); - return(2); + return(3); } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } From 80537395ade272489b5c4618dd278522047deb9a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:39:56 +0200 Subject: [PATCH 0489/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 ++++++++-- iguana/exchanges/LP_ordermatch.c | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ffa8eec48..4878d0fc4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -207,6 +207,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } + if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) + fprintf(stderr,"finished %s\n",jsonstr); free_json(argjson); } } @@ -320,9 +322,13 @@ void command_rpcloop(void *myipaddr) { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 10000) == 0 ) + if ( (rand() % 100) == 0 ) peer->errors--; - else continue; + else + { + printf("skip %s\n",peer->ipaddr); + continue; + } } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e627e4102..d86298e92 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -712,7 +712,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) { - printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); if ( (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); @@ -733,6 +732,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char str[65]; printf("couldnt find bob utxos for autxo %s/v%d %.8f\n",bits256_str(str,autxo->payment.txid),autxo->payment.vout,dstr(autxo->S.satoshis)); return(-44); } + printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); Q.txid = butxo->payment.txid; Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; @@ -772,7 +772,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); - return(2); + return(0); } } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } @@ -784,7 +784,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); LP_butxo_swapfields_set(butxo); - return(3); + return(0); } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } From c2d6d15c9785d55e351e5594540f8031674606b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:47:46 +0200 Subject: [PATCH 0490/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_ordermatch.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4878d0fc4..1984ebfea 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -111,7 +111,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } - } + } else printf("finished tradecommand (%s)\n",jprint(argjson,0)); return(retstr); } @@ -207,7 +207,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) + //if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) fprintf(stderr,"finished %s\n",jsonstr); free_json(argjson); } @@ -322,7 +322,7 @@ void command_rpcloop(void *myipaddr) { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 100) == 0 ) + if ( (rand() % 1000) == 0 ) peer->errors--; else { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d86298e92..104a98872 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -772,6 +772,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); + printf("return after RESERVED\n"); return(0); } } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); From 905ca8f620dcd679fad9d725da0affceefa19a88 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:59:08 +0200 Subject: [PATCH 0491/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 ++ iguana/exchanges/LP_ordermatch.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1984ebfea..86f1eca78 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -207,7 +207,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - //if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) + if ( jobj(argjson,"method") != 0 && (strncmp(jstr(argjson,"method"),"connect",7) == 0 || strncmp(jstr(argjson,"method"),"reserve",7) == 0) ) fprintf(stderr,"finished %s\n",jsonstr); free_json(argjson); } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index de2861cd1..30b83e127 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -314,6 +314,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) printf("CRC32.%u (%s)\n",crc32,msgstr); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); + if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) + printf("finished %u\n",crc32); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); } else printf("couldnt parse (%s)\n",msgstr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 104a98872..c50265c66 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -768,9 +768,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { - //bits256 zero; - //memset(&zero,0,sizeof(zero)); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + bits256 zero; + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg);//butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(0); From 2570123d2ffd07a244ed2dd6a58ee25d18b8f350 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 21:08:12 +0200 Subject: [PATCH 0492/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c50265c66..9f0b15e0f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -456,7 +456,10 @@ struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) { utxo = &BUTXOS[i]; if ( memcmp(&zeroes,utxo,sizeof(*utxo)) == 0 ) + { *utxo = *butxo; + break; + } } } portable_mutex_unlock(&LP_butxomutex); @@ -771,6 +774,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, bits256 zero; memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg);//butxo->S.otherpubkey,msg); + printf("return after RESERVED\n"); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(0); From 57cd0d812c43dd753c9aa3cfc69adb0bb4fdee24 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 21:12:58 +0200 Subject: [PATCH 0493/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 -- iguana/exchanges/LP_ordermatch.c | 76 ++++++++++++++++---------------- 2 files changed, 39 insertions(+), 41 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 86f1eca78..c6274457e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,13 +202,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) - fprintf(stderr,"%s\n",jsonstr); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - if ( jobj(argjson,"method") != 0 && (strncmp(jstr(argjson,"method"),"connect",7) == 0 || strncmp(jstr(argjson,"method"),"reserve",7) == 0) ) - fprintf(stderr,"finished %s\n",jsonstr); free_json(argjson); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9f0b15e0f..0e5fe431b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -429,43 +429,6 @@ int32_t LP_butxo_findeither(bits256 txid,int32_t vout) return(retval); } -struct LP_utxoinfo *LP_butxo_find(struct LP_utxoinfo *butxo) -{ - int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); - portable_mutex_lock(&LP_butxomutex); - for (i=0; ipayment.vout == utxo->payment.vout && butxo->deposit.vout == utxo->deposit.vout && bits256_nonz(butxo->payment.txid) != 0 && bits256_nonz(butxo->deposit.txid) != 0 && bits256_cmp(butxo->payment.txid,utxo->payment.txid) == 0 && bits256_cmp(butxo->deposit.txid,utxo->deposit.txid) == 0 ) - break; - if ( utxo->S.swap == 0 && now > utxo->T.swappending ) - memset(utxo,0,sizeof(*utxo)); - } - portable_mutex_unlock(&LP_butxomutex); - return(utxo); -} - -struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) -{ - static struct LP_utxoinfo zeroes; - int32_t i; struct LP_utxoinfo *utxo=0; - portable_mutex_lock(&LP_butxomutex); - if ( (utxo= LP_butxo_find(butxo)) == 0 ) - { - for (i=0; ipayment.vout == utxo->payment.vout && butxo->deposit.vout == utxo->deposit.vout && bits256_nonz(butxo->payment.txid) != 0 && bits256_nonz(butxo->deposit.txid) != 0 && bits256_cmp(butxo->payment.txid,utxo->payment.txid) == 0 && bits256_cmp(butxo->deposit.txid,utxo->deposit.txid) == 0 ) + break; + if ( utxo->S.swap == 0 && now > utxo->T.swappending ) + memset(utxo,0,sizeof(*utxo)); + utxo = 0; + } + portable_mutex_unlock(&LP_butxomutex); + return(utxo); +} + +struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) +{ + static struct LP_utxoinfo zeroes; + int32_t i; struct LP_utxoinfo *utxo=0; + portable_mutex_lock(&LP_butxomutex); + if ( (utxo= LP_butxo_find(butxo)) == 0 ) + { + for (i=0; iS = srcutxo->S; From 52e4929a4b452a974cf853b6619fdf107ce22972 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 21:19:41 +0200 Subject: [PATCH 0494/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 10 +++++----- iguana/exchanges/LP_ordermatch.c | 12 +++++++----- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a28c0217f..ae78f9a98 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -368,7 +368,7 @@ dividends(coin, height, )\n\ retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"reserved") == 0 ) { - printf("RESERVED.(%s)\n",jprint(argjson,0)); + //printf("RESERVED.(%s)\n",jprint(argjson,0)); retstr = LP_quotereceived(argjson); } else if ( strcmp(method,"connected") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c6274457e..0b5113618 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -111,7 +111,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } - } else printf("finished tradecommand (%s)\n",jprint(argjson,0)); + } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); return(retstr); } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 30b83e127..1a6a758b9 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -157,7 +157,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); + //else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -311,11 +311,11 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) - printf("CRC32.%u (%s)\n",crc32,msgstr); + //if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) + // printf("CRC32.%u (%s)\n",crc32,msgstr); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); - if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) - printf("finished %u\n",crc32); + //if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) + // printf("finished %u\n",crc32); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); } else printf("couldnt parse (%s)\n",msgstr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0e5fe431b..f8ae7c857 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -490,10 +490,10 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre return(0); } -struct LP_utxoinfo *LP_butxo_find(struct LP_utxoinfo *butxo) +struct LP_utxoinfo *_LP_butxo_find(struct LP_utxoinfo *butxo) { int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); - portable_mutex_lock(&LP_butxomutex); + //portable_mutex_lock(&LP_butxomutex); for (i=0; i Date: Thu, 21 Sep 2017 21:26:09 +0200 Subject: [PATCH 0495/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f8ae7c857..4be94c444 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -494,6 +494,7 @@ struct LP_utxoinfo *_LP_butxo_find(struct LP_utxoinfo *butxo) { int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); //portable_mutex_lock(&LP_butxomutex); + printf("_LP_butxo_find\n"); for (i=0; iS = srcutxo->S; destutxo->T.swappending = srcutxo->T.swappending; } @@ -538,6 +543,7 @@ void LP_butxo_swapfields_copy(struct LP_utxoinfo *destutxo,struct LP_utxoinfo *s void LP_butxo_swapfields(struct LP_utxoinfo *butxo) { struct LP_utxoinfo *getutxo=0; + printf("swapfields\n"); portable_mutex_lock(&LP_butxomutex); if ( (getutxo= _LP_butxo_find(butxo)) != 0 ) LP_butxo_swapfields_copy(butxo,getutxo); @@ -547,6 +553,7 @@ void LP_butxo_swapfields(struct LP_utxoinfo *butxo) void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) { struct LP_utxoinfo *setutxo; + printf("swapfields set\n"); if ( (setutxo= LP_butxo_add(butxo)) != 0 ) { LP_butxo_swapfields_copy(setutxo,butxo); From 80bf841fadc4a4b439059cae1823987842978609 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 21:28:52 +0200 Subject: [PATCH 0496/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0b5113618..ec4748f02 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -318,11 +318,11 @@ void command_rpcloop(void *myipaddr) { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 1000) == 0 ) + if ( (rand() % 10000) == 0 ) peer->errors--; else { - printf("skip %s\n",peer->ipaddr); + //printf("skip %s\n",peer->ipaddr); continue; } } From 61a14b3b946fa65a9f10ab28453ad650f64d6bd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 21:51:38 +0200 Subject: [PATCH 0497/2732] Test --- iguana/exchanges/LP_ordermatch.c | 13 ++++++------- iguana/exchanges/LP_scan.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4be94c444..3d3a9bdcf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -352,16 +352,16 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); printf("QUERY.(%s)\n",msg); - if ( strcmp(method,"connect") == 0 ) + memset(&zero,0,sizeof(zero)); + if ( 0 && strcmp(method,"connect") == 0 ) { sleep(3); - memset(&zero,0,sizeof(zero)); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); } else { memset(&zero,0,sizeof(zero)); - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); for (i=0; i<30; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) @@ -744,7 +744,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65]; printf("couldnt find bob utxos for autxo %s/v%d %.8f\n",bits256_str(str,autxo->payment.txid),autxo->payment.vout,dstr(autxo->S.satoshis)); - return(-44); + return(1); } printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); Q.txid = butxo->payment.txid; @@ -785,10 +785,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, bits256 zero; memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg);//butxo->S.otherpubkey,msg); - printf("return after RESERVED\n"); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); - return(0); + return(2); } } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } @@ -800,7 +799,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); LP_butxo_swapfields_set(butxo); - return(0); + return(3); } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 019767670..7d2bf6dda 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -478,7 +478,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration free(array); } } - if ( time(NULL) < expiration ) + if ( time(NULL) > expiration ) break; usleep(500000); } From e58d85a2675e3e9caf3724cb4cea9957006dd7eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 22:06:34 +0200 Subject: [PATCH 0498/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3d3a9bdcf..038ef08a4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -738,7 +738,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { //utxos = calloc(max,sizeof(*utxos)); - butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1); + butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis+Q.desttxfee),price,1); //free(utxos), utxos = 0; } if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) From f944b19624ceaf787ab9fa07e7308bff573a78a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 22:15:40 +0200 Subject: [PATCH 0499/2732] Test --- iguana/exchanges/LP_ordermatch.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 038ef08a4..dadcbb6d8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -290,11 +290,16 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str if ( strcmp(autxo->coinaddr,qp->destaddr) != 0 ) return(-10); } - if ( (autxo != 0 && destvalue < qp->desttxfee+qp->destsatoshis) || (butxo != 0 && srcvalue < qp->txfee+qp->satoshis) ) + if ( autxo != 0 && destvalue < qp->desttxfee+qp->destsatoshis ) { - printf("destvalue %.8f srcvalue %.8f, destsatoshis %.8f or satoshis %.8f is too small txfees %.8f %.8f?\n",dstr(destvalue),dstr(srcvalue),dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->desttxfee),dstr(qp->txfee)); + printf("destvalue %.8f destsatoshis %.8f is too small txfee %.8f?\n",dstr(destvalue),dstr(qp->destsatoshis),dstr(qp->desttxfee)); return(-11); } + if ( butxo != 0 && srcvalue < qp->txfee+qp->satoshis ) + { + printf("srcvalue %.8f satoshis %.8f is too small txfee %.8f?\n",dstr(srcvalue),dstr(qp->satoshis),dstr(qp->txfee)); + return(-33); + } if ( qp->satoshis != 0 ) qprice = ((double)qp->destsatoshis / qp->satoshis); LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); @@ -448,14 +453,14 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t return(mini); } -struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,int32_t avoidflag) +struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,int32_t avoidflag,uint64_t desttxfee) { struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(utxos,max,ap,avoidflag)) > 1 ) { - targetval = SATOSHIDEN * (volume / price) + 2*txfee; + targetval = SATOSHIDEN * ((volume+desttxfee) / price) + 2*txfee; { int32_t i; for (i=0; ipayment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) @@ -915,7 +920,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr //printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); //if ( relvolume >= minvol && relvolume <= maxvol ) { - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price,0)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From 7d12954ab7a4ecdf80d4b5aca792714e8cdac6c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 22:23:02 +0200 Subject: [PATCH 0500/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index dadcbb6d8..36723b31d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -460,7 +460,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre { if ( (m= LP_address_utxo_ptrs(utxos,max,ap,avoidflag)) > 1 ) { - targetval = SATOSHIDEN * ((volume+desttxfee) / price) + 2*txfee; + targetval = SATOSHIDEN * ((volume + dstr(desttxfee)) / price) + 2*txfee; { int32_t i; for (i=0; i Date: Thu, 21 Sep 2017 22:26:16 +0200 Subject: [PATCH 0501/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 36723b31d..9a5359155 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -442,9 +442,9 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t if ( utxos[i] != 0 ) { dist = (utxos[i]->U.value - targetval); - //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { + printf("(%.8f %.8f %.8f).%d ",dstr(utxos[i]->U.value),dstr(dist),dstr(mindist),mini); mini = i; mindist = dist; } From bedfcabde3c20152abf837cf321804c9fdf05ab1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 22:36:16 +0200 Subject: [PATCH 0502/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9a5359155..ba0a495fc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -471,7 +471,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre { up = utxos[mini]; utxos[mini] = 0; - targetval = (targetval / 8) * 9 + 2*txfee; + targetval = (up->U.value / 8) * 9 + 2*txfee; if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) @@ -485,7 +485,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre utxo->deposit.txid = up2->U.txid; utxo->deposit.vout = up2->U.vout; utxo->deposit.value = up2->U.value; - utxo->S.satoshis = SATOSHIDEN * (volume / price); + utxo->S.satoshis = SATOSHIDEN * ((volume + dstr(desttxfee)) / price); return(utxo); } } @@ -924,8 +924,8 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - autxo->S.satoshis = bestutxo->S.satoshis * price; - *bestsatoshisp = bestutxo->S.satoshis; + autxo->S.satoshis = bestutxo->S.satoshis * price - desttxfee; + *bestsatoshisp = bestutxo->S.satoshis - txfee; *ordermatchpricep = price; *bestdestsatoshisp = autxo->S.satoshis; printf("ordermatch %.8f %.8f %.8f\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp)); From 8774869824e4aef5ada203b62189ef1e51325c26 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 22:43:30 +0200 Subject: [PATCH 0503/2732] Test --- iguana/exchanges/LP_include.h | 2 ++ iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 22 ++++++++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6453ce80c..9ca3cdb5f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -284,6 +284,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,bits256 pubkey,char int32_t LP_ismine(struct LP_utxoinfo *utxo); int32_t LP_isavailable(struct LP_utxoinfo *utxo); struct LP_peerinfo *LP_peerfind(uint32_t ipbits,uint16_t port); +uint64_t LP_value_extract(cJSON *obj,int32_t addinterest); char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); @@ -307,6 +308,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum void LP_postutxos(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); int32_t LP_butxo_findeither(bits256 txid,int32_t vout); +cJSON *LP_listunspent(char *symbol,char *coinaddr); #endif diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ba0a495fc..2b222070d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -903,7 +903,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr price = jdouble(item,"price"); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { - printf("%s\n",jprint(item,0)); + //printf("%s\n",jprint(item,0)); pubkey = jbits256(item,"pubkey"); if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 013e25114..8fdaf0c68 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -313,7 +313,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value,val; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); @@ -351,7 +351,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); free(hexstr); - if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) + if ( (array= LP_listunspent(coin->symbol,coinaddr)) != 0 ) { //printf("array.(%s)\n",jprint(array,0)); if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) @@ -359,8 +359,20 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) for (i=0; ielectrum == 0 ) + { + t = jbits256(item,"txid"); + v = jint(item,"vout"); + val = LP_value_extract(item,0); + } + else + { + t = jbits256(item,"tx_hash"); + v = jint(item,"tx_pos"); + val = j64bits(item,"value"); + } + if ( value != val ) + printf("LP_gettxout: value %llu != %llu\n",(long long)value,(long long)val); if ( v == vout && bits256_cmp(t,txid) == 0 ) { retjson = cJSON_CreateObject(); @@ -380,8 +392,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) "version": 1, "coinbase": false }*/ - if ( value != j64bits(item,"value") ) - printf("LP_gettxout: value %llu != %llu\n",(long long)value,(long long)j64bits(item,"value")); jaddnum(retjson,"value",dstr(value)); jaddbits256(retjson,"txid",t); jaddnum(retjson,"vout",v); From b8a69ad98e3c93ac15b4174875fcb6a9dbdd192a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 22:52:56 +0200 Subject: [PATCH 0504/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 ++++--- iguana/exchanges/LP_rpc.c | 30 +++++++++++------------------- iguana/exchanges/LP_socket.c | 25 +++++++++++++++++++------ 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2b222070d..ee012976e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -880,7 +880,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*array,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -908,11 +908,12 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( (array= electrum_address_listunspent(basecoin->symbol,basecoin->electrum,&array,coinaddr)) != 0 ) + /*if ( (array= LP_listunspent(basecoin->symbol,coinaddr)) != 0 ) { n = cJSON_GetArraySize(array); free_json(array); - } else n = 0; + } else n = 0;*/ + n = LP_listunspent_issue(basecoin->symbol,coinaddr); if ( n > 1 ) { //minvol = jdouble(item,"minvolume"); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8fdaf0c68..b5725f181 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -313,7 +313,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value,val; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); @@ -351,7 +351,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); free(hexstr); - if ( (array= LP_listunspent(coin->symbol,coinaddr)) != 0 ) + if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) { //printf("array.(%s)\n",jprint(array,0)); if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) @@ -359,20 +359,8 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) for (i=0; ielectrum == 0 ) - { - t = jbits256(item,"txid"); - v = jint(item,"vout"); - val = LP_value_extract(item,0); - } - else - { - t = jbits256(item,"tx_hash"); - v = jint(item,"tx_pos"); - val = j64bits(item,"value"); - } - if ( value != val ) - printf("LP_gettxout: value %llu != %llu\n",(long long)value,(long long)val); + t = jbits256(item,"tx_hash"); + v = jint(item,"tx_pos"); if ( v == vout && bits256_cmp(t,txid) == 0 ) { retjson = cJSON_CreateObject(); @@ -392,6 +380,8 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) "version": 1, "coinbase": false }*/ + if ( value != j64bits(item,"value") ) + printf("LP_gettxout: value %llu != %llu\n",(long long)value,(long long)j64bits(item,"value")); jaddnum(retjson,"value",dstr(value)); jaddbits256(retjson,"txid",t); jaddnum(retjson,"vout",v); @@ -502,11 +492,11 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)); } -void LP_listunspent_issue(char *symbol,char *coinaddr) +int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { - struct iguana_info *coin; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; + struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; if ( symbol == 0 || symbol[0] == 0 ) - return; + return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) { if ( coin->electrum != 0 ) @@ -525,6 +515,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) } if ( retjson != 0 ) { + n = cJSON_GetArraySize(retjson); if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 ) LP_postutxos(symbol,coinaddr); // might be good to not saturate } @@ -534,6 +525,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr) if ( retstr != 0 ) free(retstr); } + return(n); } cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 091233f4c..02f9387fc 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -307,14 +307,29 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep,char *coinaddr,cJSON *array) { - int32_t i,v,n,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; + int32_t i,v,n,ht,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { //printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); for (i=0; ielectrum == 0 ) + { + txid = jbits256(item,"txid"); + v = jint(item,"vout"); + value = LP_value_extract(item,0); + ht = LP_txheight(coin,txid); + } + else + { + txid = jbits256(item,"tx_hash"); + v = jint(item,"tx_pos"); + value = j64bits(item,"value"); + ht = jint(item,"height"); + } + if ( bits256_nonz(txid) == 0 ) + continue; if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { txobj = LP_transactioninit(coin,txid,0,0); @@ -325,12 +340,10 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep { if (tx->height <= 0 ) { - tx->height = jint(item,"height"); + tx->height = ht; //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } - value = j64bits(item,"value"); - v = jint(item,"tx_pos"); - if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && v >= 0 && v < tx->numvouts ) + if ( v >= 0 && v < tx->numvouts ) { if ( tx->outpoints[v].value == 0 && value != tx->outpoints[v].value ) { From dced1b5f90b19a9dcb616d8ef60cdfb743561642 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:01:21 +0200 Subject: [PATCH 0505/2732] Test --- iguana/exchanges/LP_ordermatch.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ee012976e..405d2960c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -880,7 +880,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*array,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -903,17 +903,19 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr price = jdouble(item,"price"); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { - //printf("%s\n",jprint(item,0)); + printf("%s\n",jprint(item,0)); pubkey = jbits256(item,"pubkey"); if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - /*if ( (array= LP_listunspent(basecoin->symbol,coinaddr)) != 0 ) + if ( basecoin->electrum != 0 ) { - n = cJSON_GetArraySize(array); - free_json(array); - } else n = 0;*/ - n = LP_listunspent_issue(basecoin->symbol,coinaddr); + if ( (array= LP_listunspent(basecoin->symbol,coinaddr)) != 0 ) + { + n = cJSON_GetArraySize(array); + free_json(array); + } else n = 0; + } else n = LP_listunspent_issue(basecoin->symbol,coinaddr); if ( n > 1 ) { //minvol = jdouble(item,"minvolume"); From c4056761f2ac8740f6e38998e7425c802cd0e311 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:10:56 +0200 Subject: [PATCH 0506/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 405d2960c..00cc9b639 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -923,7 +923,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr //printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); //if ( relvolume >= minvol && relvolume <= maxvol ) { - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,relvolume,price,0,desttxfee)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,dstr(bestutxo->S.satoshis * price - desttxfee),price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -931,7 +931,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr *bestsatoshisp = bestutxo->S.satoshis - txfee; *ordermatchpricep = price; *bestdestsatoshisp = autxo->S.satoshis; - printf("ordermatch %.8f %.8f %.8f\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp)); + printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } } From 98b38fa81e1a36626970d1ddb3c03fc45c38412e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:13:17 +0200 Subject: [PATCH 0507/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 00cc9b639..d1f2e3f93 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -968,9 +968,9 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel timeout = LP_AUTOTRADE_TIMEOUT; if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) - return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); LP_txfees(&txfee,&desttxfee,base,rel); + if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume + desttxfee)) == 0 ) + return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); memset(&_best,0,sizeof(_best)); if ( (bestutxo= LP_buyutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,relvolume,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { From 43a445509aed3ec617f626d33be2394f59bfc668 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:18:24 +0200 Subject: [PATCH 0508/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d1f2e3f93..c24a163ac 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -485,7 +485,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre utxo->deposit.txid = up2->U.txid; utxo->deposit.vout = up2->U.vout; utxo->deposit.value = up2->U.value; - utxo->S.satoshis = SATOSHIDEN * ((volume + dstr(desttxfee)) / price); + utxo->S.satoshis = SATOSHIDEN * (volume / price); return(utxo); } } @@ -923,12 +923,12 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr //printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); //if ( relvolume >= minvol && relvolume <= maxvol ) { - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,dstr(bestutxo->S.satoshis * price - desttxfee),price,0,desttxfee)) != 0 ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,dstr(autxo->S.satoshis),price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - autxo->S.satoshis = bestutxo->S.satoshis * price - desttxfee; - *bestsatoshisp = bestutxo->S.satoshis - txfee; + //autxo->S.satoshis = bestutxo->S.satoshis * price - desttxfee; + *bestsatoshisp = bestutxo->S.satoshis; *ordermatchpricep = price; *bestdestsatoshisp = autxo->S.satoshis; printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 479500d3c..0889cef7c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -290,7 +290,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { - if ( utxo->S.satoshis >= destsatoshis/2 && (bestutxo == 0 || (bestutxo->S.satoshis < destsatoshis && utxo->S.satoshis >= destsatoshis) || (bestutxo->S.satoshis >= destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis)) ) + if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || (bestutxo->S.satoshis < destsatoshis && utxo->S.satoshis >= destsatoshis) || (bestutxo->S.satoshis >= destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis)) ) { if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { From bb4681b6baa6ca7923107dda6b28a6bb56cc12e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:37:26 +0200 Subject: [PATCH 0509/2732] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1a6a758b9..55fffe825 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -162,7 +162,7 @@ void queue_loop(void *ignore) if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); else flag = 1; - } else printf("sock not ready to send.%d\n",ptr->msglen); + } //else printf("sock not ready to send.%d\n",ptr->msglen); } else if ( time(NULL) > ptr->starttime+13 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c24a163ac..9ba930ee3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -724,14 +724,14 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg; cJSON *retjson,*array; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t n,retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) { - if ( (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) + if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(-3); @@ -743,6 +743,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { //utxos = calloc(max,sizeof(*utxos)); + if ( coin->electrum != 0 ) + { + if ( (array= LP_listunspent(coin->symbol,Q.coinaddr)) != 0 ) + { + n = cJSON_GetArraySize(array); + free_json(array); + } else n = 0; + } else n = LP_listunspent_issue(coin->symbol,Q.coinaddr); butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1,Q.desttxfee); //free(utxos), utxos = 0; } From a7435eef4e11a2165bead8982b2ca839456c34e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:47:43 +0200 Subject: [PATCH 0510/2732] Test --- iguana/exchanges/LP_ordermatch.c | 38 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9ba930ee3..ac76c941d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -739,20 +739,32 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price = ask; autxo = &A; butxo = &B; - LP_abutxo_set(autxo,0,&Q); + LP_abutxo_set(autxo,butxo,&Q); if ( strcmp(method,"request") == 0 ) { - //utxos = calloc(max,sizeof(*utxos)); - if ( coin->electrum != 0 ) + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { - if ( (array= LP_listunspent(coin->symbol,Q.coinaddr)) != 0 ) + if ( coin->electrum != 0 ) { - n = cJSON_GetArraySize(array); - free_json(array); - } else n = 0; - } else n = LP_listunspent_issue(coin->symbol,Q.coinaddr); - butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1,Q.desttxfee); - //free(utxos), utxos = 0; + if ( (array= LP_listunspent(coin->symbol,Q.coinaddr)) != 0 ) + { + n = cJSON_GetArraySize(array); + free_json(array); + } else n = 0; + } + else + { + n = LP_listunspent_issue(coin->symbol,Q.coinaddr); + printf("need to verify\n"); + } + butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1,Q.desttxfee); + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; + LP_abutxo_set(0,butxo,&Q); + LP_butxo_swapfields(butxo); + } } if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { @@ -760,12 +772,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(1); } printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); - Q.txid = butxo->payment.txid; - Q.vout = butxo->payment.vout; - Q.txid2 = butxo->deposit.txid; - Q.vout2 = butxo->deposit.vout; - LP_abutxo_set(0,butxo,&Q); - LP_butxo_swapfields(butxo); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); From 2af509d711cd7845007a446f23a8d930284d2aa2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 23:53:17 +0200 Subject: [PATCH 0511/2732] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 55fffe825..02905f29a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[16]; static unsigned long dup,total; + static uint32_t crcs[256]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ac76c941d..aee95fbe9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -540,9 +540,9 @@ struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) void LP_butxo_swapfields_copy(struct LP_utxoinfo *destutxo,struct LP_utxoinfo *srcutxo) { - printf("LP_butxo_swapfields_copy\n"); + printf("LP_butxo_swapfields_copy %u <- %u\n",destutxo->T.swappending,srcutxo->T.swappending); destutxo->S = srcutxo->S; - destutxo->T.swappending = srcutxo->T.swappending; + destutxo->T = srcutxo->T; } void LP_butxo_swapfields(struct LP_utxoinfo *butxo) @@ -740,6 +740,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, autxo = &A; butxo = &B; LP_abutxo_set(autxo,butxo,&Q); + LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) @@ -755,7 +756,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else { n = LP_listunspent_issue(coin->symbol,Q.coinaddr); - printf("need to verify\n"); + //printf("need to verify\n"); } butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1,Q.desttxfee); Q.txid = butxo->payment.txid; From ba4e114b8fb9730a4f46d7e307ecb491c5844089 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 00:06:35 +0200 Subject: [PATCH 0512/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_scan.c | 13 ++++++++----- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/LP_transaction.c | 6 +++--- iguana/exchanges/LP_utxo.c | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 9ca3cdb5f..3e5eaff8e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -298,7 +298,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); -int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration); +int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 7d2bf6dda..2cf8bd599 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -436,9 +436,9 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) return(-1); } -int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration) +int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration) { - struct iguana_info *coin; struct LP_transaction *tx; cJSON *array,*item; uint32_t expiration,i,n; + struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) { printf("LP_waitmempool missing coin.%p or inactive\n",coin); @@ -454,10 +454,13 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t duration } else { - if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height >= 0 ) + LP_listunspent_issue(coin->symbol,coinaddr); + struct LP_address_utxo *up; + if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) + //if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 ) { - char str[65]; printf("LP_waitmempool found confirmed %s %s\n",symbol,bits256_str(str,txid)); - return(tx->height); + char str[65]; printf("address_utxofind found confirmed %s %s ht.%d vs %d\n",symbol,bits256_str(str,txid),up->U.height,coin->height); + return(coin->height - up->U.height); } if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) { diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index bcfe946cd..dab03cc91 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -635,7 +635,7 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 if ( suppress_swapsend == 0 ) { retval = LP_swapsend(pairsock,swap,msgbits,sendbuf,sendlen,nextbits,rawtx->I.crcs); - if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,LP_SWAPSTEP_TIMEOUT*10) < 0 ) + if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,0,LP_SWAPSTEP_TIMEOUT*10) < 0 ) { char str[65]; printf("failed to find %s %s %s in the mempool?\n",rawtx->name,rawtx->I.destaddr,bits256_str(str,rawtx->I.actualtxid)); retval = -1; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 5153646c9..073c947a0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1313,7 +1313,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->aliceclaim.txbytes[i]); printf(" <- aliceclaim\n"); //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,60)); + return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,0,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); } printf("error with bobdeposit\n"); @@ -1331,7 +1331,7 @@ int32_t LP_verify_alicepayment(struct basilisk_swap *swap,uint8_t *data,int32_t if ( bits256_nonz(swap->alicepayment.I.signedtxid) != 0 ) swap->aliceunconf = 1; basilisk_dontforget_update(swap,&swap->alicepayment); - return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,60)); + return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,60)); //printf("import alicepayment address.(%s)\n",swap->alicepayment.p2shaddr); //LP_importaddress(swap->alicecoin.symbol,swap->alicepayment.p2shaddr); return(0); @@ -1378,7 +1378,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->alicespend.txbytes[i]); printf(" <- alicespend\n\n");*/ swap->I.alicespent = 1; - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,60)); + return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->alicespend.I.suppress_pubkeys,swap->bobpayment.I.destaddr); } printf("error validating bobpayment\n"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6a91957a7..af5db5094 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -565,7 +565,7 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int numconfirms = (LP_getheight(coin) - ht); else if ( mempool != 0 ) { - if (LP_waitmempool(symbol,coinaddr,txid,30) >= 0 ) + if (LP_waitmempool(symbol,coinaddr,txid,vout,30) >= 0 ) numconfirms = 0; } } From a7ee6eb61e9141ee564d132b1b5df8cba526fc53 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 00:14:47 +0200 Subject: [PATCH 0513/2732] Test --- iguana/exchanges/LP_scan.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 2cf8bd599..14825a425 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -438,7 +438,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration) { - struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n; + struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n,numconfirms = -1; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) { printf("LP_waitmempool missing coin.%p or inactive\n",coin); @@ -454,14 +454,6 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } else { - LP_listunspent_issue(coin->symbol,coinaddr); - struct LP_address_utxo *up; - if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) - //if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 ) - { - char str[65]; printf("address_utxofind found confirmed %s %s ht.%d vs %d\n",symbol,bits256_str(str,txid),up->U.height,coin->height); - return(coin->height - up->U.height); - } if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) { char str[65]; printf("check %s mempool.(%s)\n",bits256_str(str,txid),jprint(array,0)); @@ -472,20 +464,29 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int item = jitem(array,i); if ( bits256_cmp(txid,jbits256(item,"tx_hash")) == 0 ) { - free(array); char str[65]; printf("found %s %s in mempool\n",symbol,bits256_str(str,txid)); - return(0); + numconfirms = 0; + break; } } } free(array); } + LP_listunspent_issue(coin->symbol,coinaddr); + struct LP_address_utxo *up; + if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) + //if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 ) + { + char str[65]; printf("address_utxofind found confirmed %s %s ht.%d vs %d\n",symbol,bits256_str(str,txid),up->U.height,coin->height); + if ( coin->height >= up->U.height ) + numconfirms = (coin->height - up->U.height + 1); + } } - if ( time(NULL) > expiration ) + if ( time(NULL) > expiration || numconfirms >= 1 ) break; usleep(500000); } - return(-1); + return(numconfirms); } int32_t LP_mempool_vinscan(bits256 *spendtxidp,int32_t *spendvinp,char *symbol,char *coinaddr,bits256 searchtxid,int32_t searchvout,bits256 searchtxid2,int32_t searchvout2) From dbadf8ae1cfbcd1c0b1a484435c7f5da2a360b66 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 08:27:57 +0200 Subject: [PATCH 0514/2732] Test --- iguana/exchanges/LP_commands.c | 4 +--- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_network.c | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ae78f9a98..14ee2325d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -446,10 +446,8 @@ dividends(coin, height, )\n\ { char *msg; memset(zero.bytes,0,sizeof(zero)); - if ( strcmp("connect",method) == 0 ) - printf("broadcast.(%s)\n",jprint(reqjson,0)); msg = jprint(reqjson,0); - //_LP_send(pubsock,msg,(int32_t)strlen(msg)+1,0); + printf("broadcast.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,msg); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ec4748f02..d75b4d901 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -269,12 +269,12 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { - while ( nonz < 1 && recvlen > 0 ) + while ( nonz < 100 && recvlen > 0 ) { memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; - if ( nn_poll(&pfd,1,10) != 1 ) + if ( nn_poll(&pfd,1,1) != 1 ) break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { @@ -677,7 +677,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu { if ( nn_bind(pubsock,bindaddr) >= 0 ) { - timeout = 10; + timeout = 1; nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); } else diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 02905f29a..6f453c9bc 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -57,7 +57,7 @@ int32_t LP_sockcheck(int32_t sock) struct nn_pollfd pfd; pfd.fd = sock; pfd.events = NN_POLLOUT; - if ( nn_poll(&pfd,1,10) > 0 ) + if ( nn_poll(&pfd,1,1) > 0 ) return(1); else return(-1); } @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[256]; static unsigned long dup,total; + static uint32_t crcs[8192]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) @@ -565,7 +565,7 @@ char *LP_psock(char *myipaddr,int32_t ispaired) { if ( nn_bind(pullsock,pushaddr) >= 0 && nn_bind(pubsock,subaddr) >= 0 ) { - timeout = 10; + timeout = 1; nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); if ( ispaired != 0 ) @@ -703,7 +703,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char exit(-1); } } - timeout = 10; + timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; From 8e3172d1a8427738020057f092757c3a5d4bcf20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 08:33:11 +0200 Subject: [PATCH 0515/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 14ee2325d..ce593eb77 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -447,7 +447,7 @@ dividends(coin, height, )\n\ char *msg; memset(zero.bytes,0,sizeof(zero)); msg = jprint(reqjson,0); - printf("broadcast.(%s)\n",msg); + //printf("broadcast.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,msg); } retstr = clonestr("{\"result\":\"success\"}"); From 9a9e7ce40dcbdd7746e64ad1040146b853c6cc12 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:05:20 +0200 Subject: [PATCH 0516/2732] Test --- iguana/exchanges/LP_bitcoin.c | 16 +- iguana/exchanges/LP_coins.c | 4 +- iguana/exchanges/LP_commands.c | 71 ++++---- iguana/exchanges/LP_include.h | 8 +- iguana/exchanges/LP_nativeDEX.c | 198 +++++---------------- iguana/exchanges/LP_ordermatch.c | 22 +-- iguana/exchanges/LP_peers.c | 15 +- iguana/exchanges/LP_portfolio.c | 6 +- iguana/exchanges/LP_prices.c | 30 ++-- iguana/exchanges/LP_rpc.c | 52 ++---- iguana/exchanges/LP_statemachine.c | 276 +++++++++++++++++++++++++++++ iguana/exchanges/LP_utxo.c | 24 ++- iguana/exchanges/LP_utxos.c | 274 +++++++++------------------- 13 files changed, 520 insertions(+), 476 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 67325c8dc..20cc5858f 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -325,14 +325,12 @@ enum opcodetype OP_INVALIDOPCODE = 0xff, }; -struct { bits256 privkey; uint8_t rmd160[20]; } LP_privkeys[100]; int32_t LP_numprivkeys; - bits256 LP_privkeyfind(uint8_t rmd160[20]) { int32_t i; static bits256 zero; - for (i=0; i no privkey\n"); @@ -345,13 +343,13 @@ int32_t LP_privkeyadd(bits256 privkey,uint8_t rmd160[20]) tmpkey = LP_privkeyfind(rmd160); if ( bits256_nonz(tmpkey) != 0 ) return(-bits256_cmp(privkey,tmpkey)); - LP_privkeys[LP_numprivkeys].privkey = privkey; - memcpy(LP_privkeys[LP_numprivkeys].rmd160,rmd160,20); + G.LP_privkeys[G.LP_numprivkeys].privkey = privkey; + memcpy(G.LP_privkeys[G.LP_numprivkeys].rmd160,rmd160,20); //int32_t i; for (i=0; i<20; i++) // printf("%02x",rmd160[i]); //char str[65]; printf(" -> add privkey.(%s)\n",bits256_str(str,privkey)); - LP_numprivkeys++; - return(LP_numprivkeys); + G.LP_numprivkeys++; + return(G.LP_numprivkeys); } int32_t iguana_rwnum(int32_t rwflag,uint8_t *serialized,int32_t len,void *endianedp) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 6ab37355c..6898e1ad3 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -176,9 +176,9 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) jaddstr(item,"coin",coin->symbol); if ( showwif != 0 ) { - bitcoin_priv2wif(coin->wiftaddr,wifstr,LP_mypriv25519,coin->wiftype); + bitcoin_priv2wif(coin->wiftaddr,wifstr,G.LP_mypriv25519,coin->wiftype); bitcoin_wif2priv(coin->wiftaddr,&tmptype,&checkkey,wifstr); - if ( bits256_cmp(LP_mypriv25519,checkkey) == 0 ) + if ( bits256_cmp(G.LP_mypriv25519,checkkey) == 0 ) jaddstr(item,"wif",wifstr); else jaddstr(item,"wif","error creating wif"); } diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ce593eb77..5eec41e3c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -25,16 +25,16 @@ char *LP_numutxos() { jaddstr(retjson,"ipaddr",LP_mypeer->ipaddr); jaddnum(retjson,"port",LP_mypeer->port); - jaddnum(retjson,"numutxos",LP_mypeer->numutxos); + //jaddnum(retjson,"numutxos",LP_mypeer->numutxos); jaddnum(retjson,"numpeers",LP_mypeer->numpeers); - jaddnum(retjson,"session",LP_sessionid); + jaddnum(retjson,"session",G.LP_sessionid); } else jaddstr(retjson,"error","client node"); return(jprint(retjson,1)); } char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { - char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; + char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; //printf("stats_JSON(%s)\n",jprint(argjson,0)); method = jstr(argjson,"method"); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) @@ -50,11 +50,11 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { if ( 0 && (otherpeers= jint(argjson,"numpeers")) > peer->numpeers ) peer->numpeers = otherpeers; - if ( 0 && (othernumutxos= jint(argjson,"numutxos")) > peer->numutxos ) + /*if ( 0 && (othernumutxos= jint(argjson,"numutxos")) > peer->numutxos ) { printf("change.(%s) numutxos.%d -> %d mynumutxos.%d\n",peer->ipaddr,peer->numutxos,othernumutxos,LP_mypeer != 0 ? LP_mypeer->numutxos:0); peer->numutxos = othernumutxos; - } + }*/ if ( peer->sessionid == 0 ) peer->sessionid = juint(argjson,"session"); //printf("peer.(%s) found (%d %d) (%d %d) (%s)\n",peer->ipaddr,peer->numpeers,peer->numutxos,otherpeers,othernumutxos,jprint(argjson,0)); @@ -76,7 +76,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); - if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,LP_mypub25519) == 0 ) + if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,G.LP_mypub25519) == 0 ) { newstr = jprint(argjson,0); if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) @@ -112,6 +112,7 @@ getcoins()\n\ getcoin(coin)\n\ portfolio()\n\ getpeers()\n\ +passphrase(passphrase)\n\ listunspent(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ @@ -128,18 +129,18 @@ dividends(coin, height, )\n\ base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); - if ( USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) + if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) { - if ( USERPASS_COUNTER == 0 ) + if ( G.USERPASS_COUNTER == 0 ) { - USERPASS_COUNTER = 1; + G.USERPASS_COUNTER = 1; retjson = cJSON_CreateObject(); - jaddstr(retjson,"userpass",USERPASS); - jaddbits256(retjson,"mypubkey",LP_mypub25519); + jaddstr(retjson,"userpass",G.USERPASS); + jaddbits256(retjson,"mypubkey",G.LP_mypub25519); jadd(retjson,"coins",LP_coinsjson(LP_showwif)); return(jprint(retjson,1)); } - if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,USERPASS) != 0 ) + if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,G.USERPASS) != 0 ) return(clonestr("{\"error\":\"authentication error\"}")); jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) @@ -162,6 +163,12 @@ dividends(coin, height, )\n\ LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"passphrase") == 0 ) + { + if ( LP_passphrase_init(jstr(argjson,"passphrase")) < 0 ) + return(clonestr("{\"error\":\"couldnt change passphrase\"}")); + else return(clonestr("{\"result\":\"success\"}")); + } else if ( strcmp(method,"portfolio") == 0 ) { return(LP_portfolio()); @@ -212,28 +219,6 @@ dividends(coin, height, )\n\ return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"no price set\"}")); } - /*else if ( strcmp(method,"ordermatch") == 0 ) - { - if ( price > SMALLVAL ) - return(LP_ordermatch(base,j64bits(argjson,"txfee"),price,jdouble(argjson,"relvolume"),rel,jbits256(argjson,"txid"),jint(argjson,"vout"),jbits256(argjson,"feetxid"),jint(argjson,"feevout"),j64bits(argjson,"desttxfee"),jint(argjson,"duration"))); - else return(clonestr("{\"error\":\"no price set\"}")); - } - else if ( strcmp(method,"trade") == 0 ) - { - struct LP_quoteinfo Q; - if ( price > SMALLVAL || jobj(argjson,"quote") != 0 ) - { - LP_quoteparse(&Q,jobj(argjson,"quote")); - return(LP_trade(ctx,myipaddr,pubsock,&Q,price,jint(argjson,"timeout"),jint(argjson,"duration"))); - } else return(clonestr("{\"error\":\"no price set or no quote object\"}")); - } - else if ( strcmp(method,"autotrade") == 0 ) - { - if ( price > SMALLVAL ) - { - return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); - } else return(clonestr("{\"error\":\"no price set\"}")); - }*/ else if ( strcmp(method,"buy") == 0 ) { if ( price > SMALLVAL ) @@ -305,14 +290,14 @@ dividends(coin, height, )\n\ { //privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR); //LP_utxopurge(0); - if ( bits256_nonz(LP_mypriv25519) != 0 ) - LP_privkey_init(-1,ptr,LP_mypriv25519,LP_mypub25519); + if ( bits256_nonz(G.LP_mypriv25519) != 0 ) + LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"coin",coin); jaddnum(retjson,"timestamp",time(NULL)); - jadd(retjson,"alice",LP_inventory(coin,0)); - jadd(retjson,"bob",LP_inventory(coin,1)); + jadd(retjson,"alice",LP_inventory(coin)); + //jadd(retjson,"bob",LP_inventory(coin,1)); return(jprint(retjson,1)); } } @@ -466,7 +451,17 @@ dividends(coin, height, )\n\ else return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); } else if ( strcmp(method,"notify") == 0 ) + { + char *rmd160str,str[65]; bits256 pub; struct LP_pubkeyinfo *pubp; + pub = jbits256(argjson,"pub"); + if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) + { + if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + decode_hex(pubp->rmd160,20,rmd160str); + printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); + } retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); + } } else { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3e5eaff8e..f89011c73 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -75,8 +75,8 @@ #define DEX_SLEEP 3 #define BASILISK_KEYSIZE ((int32_t)(2*sizeof(bits256)+sizeof(uint32_t)*2)) -extern char GLOBAL_DBDIR[],USERPASS[],USERPASS_WIFSTR[]; -extern int32_t IAMLP,USERPASS_COUNTER; +extern char GLOBAL_DBDIR[]; +extern int32_t IAMLP; struct iguana_msgvin { bits256 prev_hash; uint8_t *vinscript,*userdata,*spendscript,*redeemscript; uint32_t prev_vout,sequence; uint16_t scriptlen,p2shlen,userdatalen,spendlen; }; @@ -235,7 +235,7 @@ struct LP_peerinfo { UT_hash_handle hh; uint64_t ip_port; - uint32_t ipbits,errortime,errors,numpeers,numutxos,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; + uint32_t ipbits,errortime,errors,numpeers,needping,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; int32_t pushsock,subsock; uint16_t port; char ipaddr[64]; @@ -290,7 +290,7 @@ void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); -void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); +//void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d75b4d901..22229e365 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -33,7 +33,6 @@ portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex; int32_t LP_canbind; char *Broadcaststr; -struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; @@ -41,7 +40,7 @@ struct iguana_info *LP_coins; char *activecoins[] = { "BTC", "KMD" }; char GLOBAL_DBDIR[] = { "DB" }; -char USERPASS[65],USERPASS_WIFSTR[64],LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; +char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", };//"5.9.253.204" }; // @@ -51,11 +50,22 @@ uint16_t LP_fixed_pairport,LP_publicport; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; -int32_t LP_pendingswaps,LP_showwif,USERPASS_COUNTER,IAMLP = 0; -uint32_t LP_sessionid; +int32_t LP_showwif,IAMLP = 0; double LP_profitratio = 1.; -bits256 LP_mypub25519,LP_mypriv25519; -uint8_t LP_myrmd160[20]; + + +struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; + +struct LP_globals +{ + struct LP_utxoinfo *LP_utxoinfos,*LP_utxoinfos2; + bits256 LP_mypub25519,LP_mypriv25519; + uint8_t LP_myrmd160[20]; + uint32_t LP_sessionid,counter; + int32_t LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting; + char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41]; + struct LP_privkey LP_privkeys[100]; +} G; // stubs @@ -124,7 +134,7 @@ char *LP_decrypt(uint8_t *ptr,int32_t *recvlenp) cipherlen = recvlen - (2 + crypto_box_NONCEBYTES); if ( cipherlen > 0 && cipherlen <= sizeof(decoded) ) { - if ( (jsonstr= (char *)_SuperNET_decipher(nonce,cipher,decoded,cipherlen,GENESIS_PUBKEY,LP_mypriv25519)) != 0 ) + if ( (jsonstr= (char *)_SuperNET_decipher(nonce,cipher,decoded,cipherlen,GENESIS_PUBKEY,G.LP_mypriv25519)) != 0 ) { recvlen = (cipherlen - crypto_box_ZEROBYTES); if ( strlen(jsonstr)+1 != recvlen ) @@ -151,7 +161,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, dup++; else uniq++; if ( (rand() % 1000) == 0 ) - printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1); + printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); if ( duplicate == 0 ) { if ( i >= 0 ) @@ -217,53 +227,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, return(retstr); } -void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) -{ - struct _LP_utxoinfo u; struct iguana_info *coin; char str[65]; uint32_t now = (uint32_t)time(NULL); - if ( IAMLP != 0 && (coin= LP_coinfind(utxo->coin)) != 0 && coin->inactive != 0 ) - return; - //printf("%s lag.%d\n",bits256_str(str,utxo->txid),now-utxo->lastspentcheck); - if ( utxo->T.spentflag == 0 && now > utxo->T.lastspentcheck+60 ) - { - u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - utxo->T.lastspentcheck = now; - if ( LP_txvalue(0,utxo->coin,utxo->payment.txid,utxo->payment.vout) == 0 ) - { - printf("txid.%s %s/v%d %.8f has been spent\n",utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,dstr(utxo->payment.value)); - LP_spentnotify(utxo,0); - } - else if ( LP_txvalue(0,utxo->coin,u.txid,u.vout) == 0 ) - { - printf("txid2.%s %s/v%d %.8f has been spent\n",utxo->coin,bits256_str(str,u.txid),u.vout,dstr(u.value)); - LP_spentnotify(utxo,1); - } - } -} - -void LP_myutxo_updates(void *ctx,int32_t pubsock,char *passphrase) -{ - //LP_utxopurge(0); not good to disrupt existing pointers - LP_privkey_updates(ctx,pubsock,passphrase,0); -} - -int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,int32_t interval,int32_t maxentries) -{ - int32_t lastn,n = -1; - if ( peer->lastutxos < now-interval ) - { - //lastn = peer->numutxos - mypeer->numutxos + LP_PROPAGATION_SLACK; - //if ( lastn < LP_PROPAGATION_SLACK * 2 ) - lastn = LP_PROPAGATION_SLACK * 2; - if ( mypeer == 0 || strcmp(peer->ipaddr,mypeer->ipaddr) != 0 ) - { - peer->lastutxos = now; - //printf("query utxos from %s\n",peer->ipaddr); - n = LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,maxentries); - } - } //else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos); - return(n); -} - int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr) { int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; @@ -307,7 +270,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int void command_rpcloop(void *myipaddr) { - int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; void *ctx; //struct iguana_info *coin,*ctmp; + int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; void *ctx; ctx = bitcoin_ctx(); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -345,19 +308,16 @@ void command_rpcloop(void *myipaddr) } } -int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase) +int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { - int32_t enable_utxos = 0; - static uint32_t counter,numpeers,lastresync; //lastforward - struct LP_utxoinfo *utxo,*utmp; cJSON *retjson; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp,*mostpeer; uint32_t id,now; int32_t mostutxos,nonz = 0,n=0,num,lastn=-1; + static uint32_t counter,numpeers; + struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; if ( mypeer == 0 ) myipaddr = "127.0.0.1"; numpeers = LP_numpeers(); - mostutxos = 0; - mostpeer = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors >= LP_MAXPEER_ERRORS ) @@ -372,112 +332,35 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) { - //if ( IAMLP != 0 ) - // printf("numpeers.%d updatepeer.%s lag.%d\n",numpeers,peer->ipaddr,now-peer->lastpeers); peer->lastpeers = now; - //if ( IAMLP != 0 && peer->numpeers != numpeers ) - // printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - LP_peer_pricesquery(peer->ipaddr,peer->port); - } - if ( enable_utxos && IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) - { - if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) + LP_peer_pricesquery(peer); + if ( peer->needping != 0 ) { - //printf("%d <- (%s)\n",peer->numutxos,retstr); - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( (num= jint(retjson,"numutxos")) > peer->numutxos ) - peer->numutxos = num; - if ( (num= jint(retjson,"numpeers")) > peer->numpeers ) - peer->numpeers = num; - if ( (id= juint(retjson,"session")) != 0 ) - peer->sessionid = id; - free_json(retjson); - } - free(retstr); - retstr = 0; + if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) + free(retstr); + peer->needping = 0; } } } if ( peer->diduquery == 0 ) { - if ( enable_utxos && (lastn != n || n < 20) ) - { - lastn = n; - n = LP_peer_utxosquery(mypeer,myport,pubsock,peer,now,60,100); - } - LP_peer_pricesquery(peer->ipaddr,peer->port); + LP_peer_pricesquery(peer); peer->diduquery = now; } - if ( peer->numutxos > mostutxos ) - { - mostutxos = peer->numutxos; - mostpeer = peer; - } - } - //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( enable_utxos && LP_mypeer != 0 && mostpeer != 0 && ((LP_mypeer->numutxos < mostutxos && time(NULL) > lastresync+10) || time(NULL) > lastresync+60) ) - { - //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); - LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); - lastresync = (uint32_t)time(NULL); - //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } if ( (counter % 6000) == 10 ) { - LP_myutxo_updates(ctx,pubsock,passphrase); - if ( enable_utxos ) - { - HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) - { - LP_utxo_spentcheck(pubsock,utxo); - } - HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) - { - LP_utxo_spentcheck(pubsock,utxo); - if ( LP_isunspent(utxo) > 0 && utxo->T.lasttime == 0 && LP_ismine(utxo) > 0 ) - { - char str[65]; printf("publish mybob %s\n",bits256_str(str,utxo->payment.txid)); - LP_utxo_clientpublish(utxo); - } - } - } + LP_privkey_updates(ctx,pubsock,0); } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; struct LP_address *ap,*atmp; struct LP_address_utxo *up,*utmp; + int32_t height; bits256 zero; //struct LP_address *ap,*atmp; struct LP_address_utxo *up,*utmp; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( coin->inactive != 0 ) continue; - if ( time(NULL) > coin->lastmonitor+60 ) - { - //portable_mutex_lock(&coin->addrmutex); - HASH_ITER(hh,coin->addresses,ap,atmp) - { - if ( coin->electrum == 0 ) - { - LP_listunspent_issue(coin->symbol,ap->coinaddr); - DL_FOREACH_SAFE(ap->utxos,up,utmp) - { - if ( up->spendheight <= 0 ) - { - if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) - up->spendheight = 1; - } - } - } - else if ( 0 ) - { - if ( (retjson= electrum_address_listunspent(coin->symbol,coin->electrum,&retjson,ap->coinaddr)) != 0 ) - free_json(retjson); - } - } - //portable_mutex_unlock(&coin->addrmutex); - coin->lastmonitor = (uint32_t)time(NULL); - } if ( coin->electrum != 0 ) continue; memset(zero.bytes,0,sizeof(zero)); @@ -533,7 +416,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int return(nonz); } -void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins,char *passphrase) +void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) { int32_t i,n; cJSON *item; for (i=0; i /tmp/myipaddr") == 0 ) { if ( (myipaddr= OS_filestr(&filesize,"/tmp/myipaddr")) != 0 && myipaddr[0] != 0 ) @@ -700,7 +580,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //LP_deadman_switch = (uint32_t)time(NULL); printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); printf("initcoins\n"); - LP_initcoins(ctx,pubsock,jobj(argjson,"coins"),passphrase); + LP_initcoins(ctx,pubsock,jobj(argjson,"coins")); + LP_passphrase_init(passphrase); if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) { printf("error launching LP_psockloop for (%s)\n",myipaddr); @@ -732,11 +613,14 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu while ( 1 ) { nonz = 0; - //fprintf(stderr,"."); - if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) != 0 ) + G.waiting = 1; + while ( G.initializing != 0 ) + { + fprintf(stderr,"."); + sleep(3); + } + if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; - //if ( LP_mypullsock >= 0 ) - // nonz += LP_sock_check("SUB",ctx,myipaddr,-1,LP_mypullsock,"127.0.0.1"); if ( nonz == 0 ) usleep(1000000 / MAINLOOP_PERSEC); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index aee95fbe9..e1ce01255 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -215,7 +215,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re { bits256 zero; char *msg; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); - jaddbits256(reqjson,"pubkey",LP_mypub25519); + jaddbits256(reqjson,"pubkey",G.LP_mypub25519); jaddstr(reqjson,"base",base); jaddstr(reqjson,"rel",rel); jaddnum(reqjson,"price",price); @@ -611,7 +611,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(-1); } privkey = LP_privkey(utxo->coinaddr,coin->taddr); - if ( bits256_nonz(privkey) != 0 && bits256_cmp(LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && + if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && { if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { @@ -638,7 +638,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ } else { - printf("dest %.8f vs required %.8f (%d %d %d %d %d)\n",dstr(qp->destsatoshis),dstr(price*(utxo->S.satoshis-qp->txfee)),bits256_nonz(privkey) != 0 ,qp->timestamp == utxo->T.swappending-LP_RESERVETIME,qp->quotetime >= qp->timestamp-3,qp->quotetime < utxo->T.swappending,bits256_cmp(LP_mypub25519,qp->srchash) == 0); + printf("dest %.8f vs required %.8f (%d %d %d %d %d)\n",dstr(qp->destsatoshis),dstr(price*(utxo->S.satoshis-qp->txfee)),bits256_nonz(privkey) != 0 ,qp->timestamp == utxo->T.swappending-LP_RESERVETIME,qp->quotetime >= qp->timestamp-3,qp->quotetime < utxo->T.swappending,bits256_cmp(G.LP_mypub25519,qp->srchash) == 0); } if ( retval < 0 ) { @@ -655,7 +655,7 @@ char *LP_connectedalice(cJSON *argjson) // alice cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); - if ( bits256_cmp(Q.desthash,LP_mypub25519) != 0 ) + if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s)\n",jprint(argjson,0)); autxo = &A; @@ -664,7 +664,7 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); - LP_pendingswaps--; + G.LP_pendingswaps--; printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } @@ -672,7 +672,7 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); - LP_pendingswaps--; + G.LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } // SPV validate bobs @@ -680,7 +680,7 @@ char *LP_connectedalice(cJSON *argjson) // alice price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { - LP_pendingswaps--; + G.LP_pendingswaps--; return(clonestr("{\"error\":\"cant get alicecoin\"}")); } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); @@ -711,7 +711,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("connected result.(%s)\n",jprint(retjson,0)); if ( jobj(retjson,"error") != 0 ) LP_availableset(autxo); - else LP_pendingswaps++; + else G.LP_pendingswaps++; return(jprint(retjson,1)); } else @@ -729,7 +729,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { printf("LP_tradecommand: check received %s\n",method); retval = 1; - if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) + if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) { if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { @@ -920,7 +920,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr { printf("%s\n",jprint(item,0)); pubkey = jbits256(item,"pubkey"); - if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) + if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); if ( basecoin->electrum != 0 ) @@ -994,7 +994,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel } if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) { diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index e249f099a..5c7efb7e7 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -35,9 +35,9 @@ cJSON *LP_peerjson(struct LP_peerinfo *peer) jaddnum(item,"port",peer->port); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) { - jaddnum(item,"session",LP_sessionid); - if ( LP_mypeer != 0 ) - jaddnum(item,"numutxos",LP_mypeer->numutxos); + jaddnum(item,"session",G.LP_sessionid); + //if ( LP_mypeer != 0 ) + // jaddnum(item,"numutxos",LP_mypeer->numutxos); } else jaddnum(item,"session",peer->sessionid); //jaddnum(item,"profit",peer->profitmargin); return(item); @@ -79,7 +79,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { peer = calloc(1,sizeof(*peer)); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) - peer->sessionid = LP_sessionid; + peer->sessionid = G.LP_sessionid; else peer->sessionid = sessionid; peer->pushsock = peer->subsock = pushsock = subsock = -1; strcpy(peer->ipaddr,ipaddr); @@ -217,9 +217,9 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport) { - char *retstr; struct LP_peerinfo *peer,*tmp; uint32_t now,flag = 0; + char *retstr; struct LP_peerinfo *peer,*tmp; bits256 zero; uint32_t now,flag = 0; peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); - if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,mypeer!=0?mypeer->numpeers:0,mypeer!=0?mypeer->numutxos:0)) != 0 ) + if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,mypeer!=0?mypeer->numpeers:0)) != 0 ) { //printf("got.(%s)\n",retstr); now = (uint32_t)time(NULL); @@ -233,7 +233,8 @@ void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr { printf("{%s:%u}.%d ",peer->ipaddr,peer->port,peer->lasttime - now); flag++; - if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,0,peer->sessionid)) != 0 ) + memset(&zero,0,sizeof(zero)); + if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,peer->sessionid,0,zero)) != 0 ) free(retstr); } } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 018f293da..585f236f1 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -63,7 +63,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) } free_json(array); } - if ( (array= LP_inventory(symbol,iambob)) != 0 ) + if ( (array= LP_inventory(symbol)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 && is_cJSON_Array(array) != 0 ) { @@ -93,7 +93,7 @@ char *LP_portfolio() continue; if ( iter == 0 ) { - LP_privkey_init(-1,coin,LP_mypriv25519,LP_mypub25519); + LP_privkey_init(-1,coin,G.LP_mypriv25519,G.LP_mypub25519); coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); if ( strcmp(coin->symbol,"KMD") != 0 ) @@ -427,7 +427,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str strcpy(LP_portfolio_rel,""); LP_portfolio_relvolume = 0.; } - printf("pending.%d base buy.%s, rel sell.%s relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buy->symbol,sell->symbol,sell->relvolume,maxprice,bid,ask); + printf("pending.%d base buy.%s, rel sell.%s relvolume %f maxprice %.8f (%.8f %.8f)\n",G.LP_pendingswaps,buy->symbol,sell->symbol,sell->relvolume,maxprice,bid,ask); if ( LP_pricevalid(maxprice) > 0 ) { relvolume = sell->relvolume; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b10faa211..2889e2a76 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -143,8 +143,8 @@ struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) portable_mutex_lock(&LP_pubkeymutex); pubp = calloc(1,sizeof(*pubp)); pubp->pubkey = pubkey; - if ( bits256_cmp(LP_mypub25519,pubkey) == 0 ) - memcpy(pubp->rmd160,LP_myrmd160,sizeof(pubp->rmd160)); + if ( bits256_cmp(G.LP_mypub25519,pubkey) == 0 ) + memcpy(pubp->rmd160,G.LP_myrmd160,sizeof(pubp->rmd160)); HASH_ADD_KEYPTR(hh,LP_pubkeyinfos,&pubp->pubkey,sizeof(pubp->pubkey),pubp); portable_mutex_unlock(&LP_pubkeymutex); if ( (pubp= LP_pubkeyfind(pubkey)) == 0 ) @@ -213,10 +213,10 @@ char *LP_prices() return(jprint(array,1)); } -void LP_prices_parse(cJSON *obj) +void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { static uint8_t zeroes[20]; - struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid; char *base,*rel,*hexstr; double askprice; uint32_t now; + struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid,mismatch; char *base,*rel,*hexstr; double askprice; uint32_t now; now = (uint32_t)time(NULL); pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) @@ -224,7 +224,12 @@ void LP_prices_parse(cJSON *obj) if ( (hexstr= jstr(obj,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) { decode_hex(rmd160,sizeof(rmd160),hexstr); - if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 && memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) + if ( memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) + mismatch = 1; + else mismatch = 0; + if ( bits256_cmp(pubkey,G.LP_mypub25519) == 0 && mismatch == 0 ) + peer->needping = 0; + if ( mismatch != 0 && memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) { for (i=0; i<20; i++) printf("%02x",pubp->rmd160[i]); @@ -263,22 +268,27 @@ void LP_prices_parse(cJSON *obj) } } -void LP_peer_pricesquery(char *destipaddr,uint16_t destport) +void LP_peer_pricesquery(struct LP_peerinfo *peer) { char *retstr; cJSON *array; int32_t i,n; - if ( (retstr= issue_LP_getprices(destipaddr,destport)) != 0 ) + peer->needping = (uint32_t)time(NULL); + if ( (retstr= issue_LP_getprices(peer->ipaddr,peer->port)) != 0 ) { if ( (array= cJSON_Parse(retstr)) != 0 ) { if ( is_cJSON_Array(array) && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; ineedping != 0 ) + { + printf("%s needs ping\n",peer->ipaddr); + } } double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,int32_t vout) @@ -387,7 +397,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) basepp->myprices[relpp->ind] = price; // ask //printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); //relpp->myprices[basepp->ind] = (1. / price); // bid - if ( (pubp= LP_pubkeyadd(LP_mypub25519)) != 0 ) + if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) { pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); @@ -750,7 +760,7 @@ char *LP_pricestr(char *base,char *rel,double origprice) retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"method","postprice"); - jaddbits256(retjson,"pubkey",LP_mypub25519); + jaddbits256(retjson,"pubkey",G.LP_mypub25519); jaddstr(retjson,"base",base); jaddstr(retjson,"rel",rel); jaddnum(retjson,"price",price); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b5725f181..5555f9767 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -48,54 +48,26 @@ char *LP_isitme(char *destip,uint16_t destport) } else return(0); } -char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) +char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers) { char url[512],*retstr; - sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); + sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d",destip,destport,ipaddr,port,numpeers); retstr = LP_issue_curl("getpeers",destip,port,url); //printf("%s -> getpeers.(%s)\n",destip,retstr); return(retstr); } -char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) +char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,uint32_t sessionid,char *rmd160str,bits256 pub) { - char url[512],*retstr; - printf("deprecated issue_LP_numutxos\n"); - return(0); - sprintf(url,"http://%s:%u/api/stats/numutxos?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); - retstr = LP_issue_curl("numutxos",destip,port,url); - //printf("%s -> getpeers.(%s)\n",destip,retstr); - return(retstr); -} - -char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) -{ - char url[512]; - printf("deprecated issue_LP_getutxos\n"); - return(0); - sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,numpeers,numutxos); - return(LP_issue_curl("getutxos",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -} - -char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t lastn) -{ - char url[512];//,*retstr; - printf("deprecated issue_LP_clientgetutxos\n"); - return(0); - sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=127.0.0.1&port=0",destip,destport,coin,lastn); - return(LP_issue_curl("clientgetutxos",destip,destport,url)); - //retstr = issue_curlt(url,LP_HTTP_TIMEOUT); - //printf("%s clientgetutxos.(%s)\n",url,retstr); - //return(retstr); -} - -char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos,uint32_t sessionid) -{ - char url[512],*retstr; + char url[512],*retstr,str[65]; if ( (retstr= LP_isitme(destip,destport)) != 0 ) return(retstr); - sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d&session=%u",destip,destport,ipaddr,port,numpeers,numutxos,sessionid); + sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&session=%u",destip,destport,ipaddr,port,numpeers,sessionid); + if ( rmd160str != 0 && bits256_nonz(pub) != 0 ) + { + sprintf(url+strlen(url),"&rmd160=%s&pub=%s",rmd160str,bits256_str(str,pub)); + printf("SEND (%s)\n",url); + } return(LP_issue_curl("notify",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } @@ -306,7 +278,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else printf("non-hex tx.(%s)\n",hexstr); free(hexstr); return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); - } else printf("failed blockchain.transaction.get %s\n",buf); + } else printf("failed blockchain.transaction.get %s %s\n",coin->symbol,buf); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); } } @@ -441,7 +413,7 @@ cJSON *LP_validateaddress(char *symbol,char *address) strcat(script,"88ac"); jaddstr(retjson,"scriptPubKey",script); } - bitcoin_address(coinaddr,coin->taddr,coin->pubtype,LP_myrmd160,20); + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,G.LP_myrmd160,20); if ( strcmp(address,coinaddr) == 0 ) jadd(retjson,"ismine",cJSON_CreateTrue()); jadd(retjson,"iswatchonly",cJSON_CreateFalse()); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index e22ca255f..5294b71f2 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1473,6 +1473,282 @@ if ( (array= LP_tradecandidates(base)) != 0 ) printf("metrics, best %f\n",bestmetric); */ +int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport,int32_t maxentries) +{ + char *retstr; struct LP_peerinfo *peer; uint32_t now; int32_t retval = -1; + printf("deprecated LP_utxosquery\n"); + return(-1); + peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); + if ( coin == 0 ) + coin = ""; + //printf("utxo query.(%s)\n",destipaddr); + if ( IAMLP != 0 ) + retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,mypeer != 0 ? mypeer->numpeers : 0,maxentries); + else retstr = issue_LP_clientgetutxos(destipaddr,destport,coin,maxentries); + if ( retstr != 0 ) + { + now = (uint32_t)time(NULL); + retval = LP_utxosparse(destipaddr,destport,retstr,now); + //printf("got.(%s)\n",retstr); + free(retstr); + } + return(retval); +} + +char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) +{ + char url[512],*retstr; + printf("deprecated issue_LP_numutxos\n"); + return(0); + sprintf(url,"http://%s:%u/api/stats/numutxos?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); + retstr = LP_issue_curl("numutxos",destip,port,url); + //printf("%s -> getpeers.(%s)\n",destip,retstr); + return(retstr); +} + +char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) +{ + char url[512]; + printf("deprecated issue_LP_getutxos\n"); + return(0); + sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,numpeers,numutxos); + return(LP_issue_curl("getutxos",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT)); +} + +char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t lastn) +{ + char url[512];//,*retstr; + printf("deprecated issue_LP_clientgetutxos\n"); + return(0); + sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=127.0.0.1&port=0",destip,destport,coin,lastn); + return(LP_issue_curl("clientgetutxos",destip,destport,url)); + //retstr = issue_curlt(url,LP_HTTP_TIMEOUT); + //printf("%s clientgetutxos.(%s)\n",url,retstr); + //return(retstr); +} +/*else if ( strcmp(method,"ordermatch") == 0 ) + { + if ( price > SMALLVAL ) + return(LP_ordermatch(base,j64bits(argjson,"txfee"),price,jdouble(argjson,"relvolume"),rel,jbits256(argjson,"txid"),jint(argjson,"vout"),jbits256(argjson,"feetxid"),jint(argjson,"feevout"),j64bits(argjson,"desttxfee"),jint(argjson,"duration"))); + else return(clonestr("{\"error\":\"no price set\"}")); + } + else if ( strcmp(method,"trade") == 0 ) + { + struct LP_quoteinfo Q; + if ( price > SMALLVAL || jobj(argjson,"quote") != 0 ) + { + LP_quoteparse(&Q,jobj(argjson,"quote")); + return(LP_trade(ctx,myipaddr,pubsock,&Q,price,jint(argjson,"timeout"),jint(argjson,"duration"))); + } else return(clonestr("{\"error\":\"no price set or no quote object\"}")); + } + else if ( strcmp(method,"autotrade") == 0 ) + { + if ( price > SMALLVAL ) + { + return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); + } else return(clonestr("{\"error\":\"no price set\"}")); + }*/ +int32_t LP_utxopurge(int32_t allutxos) +{ + char str[65]; struct LP_utxoinfo *utxo,*tmp; int32_t iambob,n = 0; + printf("LP_utxopurge mypub.(%s)\n",bits256_str(str,LP_mypub25519)); + portable_mutex_lock(&LP_utxomutex); + for (iambob=0; iambob<=1; iambob++) + { + HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) + { + if ( LP_isavailable(utxo) > 0 ) + { + if ( allutxos != 0 || LP_ismine(utxo) > 0 ) + { + printf("iambob.%d delete.(%s)\n",iambob,bits256_str(str,utxo->payment.txid)); + HASH_DELETE(hh,LP_utxoinfos[iambob],utxo); + //free(utxo); let the LP_utxoinfos2 free the utxo, should be 1:1 + } else n++; + } else n++; + } + HASH_ITER(hh,LP_utxoinfos2[iambob],utxo,tmp) + { + if ( LP_isavailable(utxo) > 0 ) + { + if ( allutxos != 0 || LP_ismine(utxo) > 0 ) + { + printf("iambob.%d delete2.(%s)\n",iambob,bits256_str(str,utxo->payment.txid)); + HASH_DELETE(hh2,LP_utxoinfos2[iambob],utxo); + free(utxo); + } else n++; + } else n++; + } + } + portable_mutex_unlock(&LP_utxomutex); + return(n); +} +int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t now) +{ + struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; bits256 txid; struct LP_utxoinfo *utxo; + //printf("parse.(%s)\n",retstr); + if ( (array= cJSON_Parse(retstr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; iT.lasttime = now; + } + } + if ( (destpeer= LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport)) != 0 ) + { + destpeer->numutxos = n; + } + } + free_json(array); + } + return(n); +} +void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) +{ + //cJSON *argjson; struct _LP_utxoinfo u; char *msg; + if ( utxo == 0 ) + return; + utxo->T.spentflag = (uint32_t)time(NULL); + /*if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) + LP_mypeer->numutxos--; + if ( LP_mypubsock >= 0 ) + { + argjson = cJSON_CreateObject(); + jaddstr(argjson,"method","checktxid"); + jaddbits256(argjson,"txid",utxo->payment.txid); + jaddnum(argjson,"vout",utxo->payment.vout); + if ( selector != 0 ) + { + if ( bits256_nonz(utxo->deposit.txid) != 0 ) + u = utxo->deposit; + else u = utxo->fee; + jaddbits256(argjson,"checktxid",u.txid); + jaddnum(argjson,"checkvout",u.vout); + } + msg = jprint(argjson,1); + /LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); + }*/ +} +char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn) +{ + int32_t i,n,m; uint64_t val,val2; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); + printf("deprecated! LP_utxos\n"); + //n = mypeer != 0 ? mypeer->numutxos : 0; + if ( lastn <= 0 ) + lastn = LP_PROPAGATION_SLACK * 2; + HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) + { + //char str[65]; printf("check %s.%s\n",utxo->coin,bits256_str(str,utxo->payment.txid)); + if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 ) + { + u = (iambob != 0) ? utxo->deposit : utxo->fee; + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) + { + char str[65]; printf("iambob.%d not eligible (%.8f %.8f) %s %s/v%d\n",iambob,dstr(val),dstr(val2),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout); + continue; + } else jaddi(utxosjson,LP_utxojson(utxo)); + } + } + if ( (n= cJSON_GetArraySize(utxosjson)) > lastn ) + { + m = n - lastn; + for (i=0; i 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + msg = jprint(LP_utxojson(utxo),1); + LP_broadcast_message(LP_mypubsock,utxo->coin,"",zero,msg); + } +} + +void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) +{ + struct _LP_utxoinfo u; struct iguana_info *coin; char str[65]; uint32_t now = (uint32_t)time(NULL); + if ( IAMLP != 0 && (coin= LP_coinfind(utxo->coin)) != 0 && coin->inactive != 0 ) + return; + //printf("%s lag.%d\n",bits256_str(str,utxo->txid),now-utxo->lastspentcheck); + if ( utxo->T.spentflag == 0 && now > utxo->T.lastspentcheck+60 ) + { + u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; + utxo->T.lastspentcheck = now; + if ( LP_txvalue(0,utxo->coin,utxo->payment.txid,utxo->payment.vout) == 0 ) + { + printf("txid.%s %s/v%d %.8f has been spent\n",utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,dstr(utxo->payment.value)); + LP_spentnotify(utxo,0); + } + else if ( LP_txvalue(0,utxo->coin,u.txid,u.vout) == 0 ) + { + printf("txid2.%s %s/v%d %.8f has been spent\n",utxo->coin,bits256_str(str,u.txid),u.vout,dstr(u.value)); + LP_spentnotify(utxo,1); + } + } +} + +int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,int32_t interval,int32_t maxentries) +{ + int32_t lastn,n = -1; + if ( peer->lastutxos < now-interval ) + { + //lastn = peer->numutxos - mypeer->numutxos + LP_PROPAGATION_SLACK; + //if ( lastn < LP_PROPAGATION_SLACK * 2 ) + lastn = LP_PROPAGATION_SLACK * 2; + if ( mypeer == 0 || strcmp(peer->ipaddr,mypeer->ipaddr) != 0 ) + { + peer->lastutxos = now; + //printf("query utxos from %s\n",peer->ipaddr); + n = LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,maxentries); + } + } //else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos); + return(n); +} +/*if ( time(NULL) > coin->lastmonitor+60 ) + { + //portable_mutex_lock(&coin->addrmutex); + HASH_ITER(hh,coin->addresses,ap,atmp) + { + if ( coin->electrum == 0 ) + { + LP_listunspent_issue(coin->symbol,ap->coinaddr); + DL_FOREACH_SAFE(ap->utxos,up,utmp) + { + if ( up->spendheight <= 0 ) + { + if ( LP_txvalue(0,coin->symbol,up->U.txid,up->U.vout) == 0 ) + up->spendheight = 1; + } + } + } + } + //portable_mutex_unlock(&coin->addrmutex); + coin->lastmonitor = (uint32_t)time(NULL); + }*/ + /*cJSON *LP_tradecandidates(char *base) { struct LP_peerinfo *peer,*tmp; struct LP_quoteinfo Q; char *utxostr,coinstr[16]; cJSON *array,*retarray=0,*item; int32_t i,n,totaladded,added; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index af5db5094..a4d637804 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -363,22 +363,37 @@ void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo=0; uint8_t key[sizeof(txid) + sizeof(vout)]; + if ( iambob != 0 ) + { + printf("_LP_utxofind deprecated iambob\n"); + return(0); + } LP_utxosetkey(key,txid,vout); - HASH_FIND(hh,LP_utxoinfos[iambob],key,sizeof(key),utxo); + HASH_FIND(hh,G.LP_utxoinfos,key,sizeof(key),utxo); return(utxo); } struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; uint8_t key2[sizeof(txid2) + sizeof(vout2)]; + if ( iambob != 0 ) + { + printf("_LP_utxo2find deprecated iambob\n"); + return(0); + } LP_utxosetkey(key2,txid2,vout2); - HASH_FIND(hh2,LP_utxoinfos2[iambob],key2,sizeof(key2),utxo); + HASH_FIND(hh2,G.LP_utxoinfos2,key2,sizeof(key2),utxo); return(utxo); } struct LP_utxoinfo *LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo=0; + if ( iambob != 0 ) + { + printf("LP_utxofind deprecated iambob\n"); + return(0); + } portable_mutex_lock(&LP_utxomutex); utxo = _LP_utxofind(iambob,txid,vout); portable_mutex_unlock(&LP_utxomutex); @@ -388,6 +403,11 @@ struct LP_utxoinfo *LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) struct LP_utxoinfo *LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; + if ( iambob != 0 ) + { + printf("LP_utxo2find deprecated iambob\n"); + return(0); + } portable_mutex_lock(&LP_utxomutex); utxo = _LP_utxo2find(iambob,txid2,vout2); portable_mutex_unlock(&LP_utxomutex); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0889cef7c..c69de1953 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -20,7 +20,7 @@ int32_t LP_ismine(struct LP_utxoinfo *utxo) { - if ( utxo != 0 && bits256_cmp(utxo->pubkey,LP_mypub25519) == 0 ) + if ( utxo != 0 && bits256_cmp(utxo->pubkey,G.LP_mypub25519) == 0 ) return(1); else return(0); } @@ -154,42 +154,6 @@ void LP_availableset(struct LP_utxoinfo *utxo) } } -int32_t LP_utxopurge(int32_t allutxos) -{ - char str[65]; struct LP_utxoinfo *utxo,*tmp; int32_t iambob,n = 0; - printf("LP_utxopurge mypub.(%s)\n",bits256_str(str,LP_mypub25519)); - portable_mutex_lock(&LP_utxomutex); - for (iambob=0; iambob<=1; iambob++) - { - HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) - { - if ( LP_isavailable(utxo) > 0 ) - { - if ( allutxos != 0 || LP_ismine(utxo) > 0 ) - { - printf("iambob.%d delete.(%s)\n",iambob,bits256_str(str,utxo->payment.txid)); - HASH_DELETE(hh,LP_utxoinfos[iambob],utxo); - //free(utxo); let the LP_utxoinfos2 free the utxo, should be 1:1 - } else n++; - } else n++; - } - HASH_ITER(hh,LP_utxoinfos2[iambob],utxo,tmp) - { - if ( LP_isavailable(utxo) > 0 ) - { - if ( allutxos != 0 || LP_ismine(utxo) > 0 ) - { - printf("iambob.%d delete2.(%s)\n",iambob,bits256_str(str,utxo->payment.txid)); - HASH_DELETE(hh2,LP_utxoinfos2[iambob],utxo); - free(utxo); - } else n++; - } else n++; - } - } - portable_mutex_unlock(&LP_utxomutex); - return(n); -} - cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; @@ -246,35 +210,6 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) return(item); } -char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn) -{ - int32_t i,n,m; uint64_t val,val2; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); - printf("deprecated! LP_utxos\n"); - //n = mypeer != 0 ? mypeer->numutxos : 0; - if ( lastn <= 0 ) - lastn = LP_PROPAGATION_SLACK * 2; - HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) - { - //char str[65]; printf("check %s.%s\n",utxo->coin,bits256_str(str,utxo->payment.txid)); - if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 ) - { - u = (iambob != 0) ? utxo->deposit : utxo->fee; - if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) - { - char str[65]; printf("iambob.%d not eligible (%.8f %.8f) %s %s/v%d\n",iambob,dstr(val),dstr(val2),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout); - continue; - } else jaddi(utxosjson,LP_utxojson(utxo)); - } - } - if ( (n= cJSON_GetArraySize(utxosjson)) > lastn ) - { - m = n - lastn; - for (i=0; i= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( strcmp(symbol,utxo->coin) != 0 ) @@ -307,29 +242,9 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) { - //cJSON *argjson; struct _LP_utxoinfo u; char *msg; if ( utxo == 0 ) return; utxo->T.spentflag = (uint32_t)time(NULL); - if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) - LP_mypeer->numutxos--; - /*if ( LP_mypubsock >= 0 ) - { - argjson = cJSON_CreateObject(); - jaddstr(argjson,"method","checktxid"); - jaddbits256(argjson,"txid",utxo->payment.txid); - jaddnum(argjson,"vout",utxo->payment.vout); - if ( selector != 0 ) - { - if ( bits256_nonz(utxo->deposit.txid) != 0 ) - u = utxo->deposit; - else u = utxo->fee; - jaddbits256(argjson,"checktxid",u.txid); - jaddnum(argjson,"checkvout",u.vout); - } - msg = jprint(argjson,1); - /LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); - }*/ } char *LP_spentcheck(cJSON *argjson) @@ -350,8 +265,8 @@ char *LP_spentcheck(cJSON *argjson) } if ( LP_txvalue(0,utxo->coin,checktxid,checkvout) == 0 ) { - if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) - LP_mypeer->numutxos--; + //if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) + // LP_mypeer->numutxos--; utxo->T.spentflag = (uint32_t)time(NULL); retval++; printf("indeed txid was spent\n"); @@ -363,17 +278,6 @@ char *LP_spentcheck(cJSON *argjson) return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); } -void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) -{ - bits256 zero; char *msg; - if ( 0 && LP_isunspent(utxo) > 0 ) - { - memset(zero.bytes,0,sizeof(zero)); - msg = jprint(LP_utxojson(utxo),1); - LP_broadcast_message(LP_mypubsock,utxo->coin,"",zero,msg); - } -} - struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; @@ -382,6 +286,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } + if ( iambob != 0 ) + { + printf("deprecated bob utxos\n"); + return(0); + } if ( (coin= LP_coinfind(symbol)) == 0 || (IAMLP == 0 && coin->inactive != 0) ) { printf("LP_utxoadd reject inactive %s\n",symbol); @@ -395,7 +304,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit else return(0); } else tmpsatoshis = (value - txfee); char str[65],str2[65],dispflag = 0;//(iambob == 0); - if ( iambob == 0 && bits256_cmp(pubkey,LP_mypub25519) != 0 ) + if ( iambob == 0 && bits256_cmp(pubkey,G.LP_mypub25519) != 0 ) { printf("trying to add Alice utxo when not mine? %s/v%d\n",bits256_str(str,txid),vout); return(0); @@ -484,26 +393,24 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit LP_utxosetkey(utxo->key,txid,vout); LP_utxosetkey(utxo->key2,txid2,vout2); if ( LP_ismine(utxo) > 0 ) - utxo->T.sessionid = LP_sessionid; + utxo->T.sessionid = G.LP_sessionid; else utxo->T.sessionid = sessionid; if ( coin->inactive == 0 && (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,coinaddr,txid,vout,txid2,vout2)) >= 0 ) { printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - printf("U.%d %s %.8f %.8f addutxo.%d pubkey.%s session.%u\n",LP_mypeer!=0?LP_mypeer->numutxos:-1,symbol,dstr(value),dstr(value2),LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); + printf(" %s %.8f %.8f addutxo.%d pubkey.%s session.%u\n",symbol,dstr(value),dstr(value2),LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); portable_mutex_lock(&LP_utxomutex); - HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); + HASH_ADD_KEYPTR(hh,G.LP_utxoinfos,utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) - HASH_ADD_KEYPTR(hh2,LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); + HASH_ADD_KEYPTR(hh2,G.LP_utxoinfos2,utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); if ( iambob != 0 ) { - if ( LP_mypeer != 0 ) - LP_mypeer->numutxos++; if ( LP_ismine(utxo) > 0 ) { - LP_utxo_clientpublish(utxo); + //LP_utxo_clientpublish(utxo); if ( LP_mypeer != 0 ) utxo->T.lasttime = (uint32_t)time(NULL); } @@ -530,75 +437,14 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson return(utxo); } -int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t now) +cJSON *LP_inventory(char *symbol) { - struct LP_peerinfo *destpeer,*peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; bits256 txid; struct LP_utxoinfo *utxo; - //printf("parse.(%s)\n",retstr); - if ( (array= cJSON_Parse(retstr)) != 0 ) - { - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; iT.lasttime = now; - } - } - if ( (destpeer= LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport)) != 0 ) - { - destpeer->numutxos = n; - } - } - free_json(array); - } - return(n); -} - -int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport,int32_t maxentries) -{ - char *retstr; struct LP_peerinfo *peer; uint32_t now; int32_t retval = -1; - printf("deprecated LP_utxosquery\n"); - return(-1); - peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); - if ( coin == 0 ) - coin = ""; - //printf("utxo query.(%s)\n",destipaddr); - if ( IAMLP != 0 ) - retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,mypeer != 0 ? mypeer->numpeers : 0,maxentries); - else retstr = issue_LP_clientgetutxos(destipaddr,destport,coin,maxentries); - if ( retstr != 0 ) - { - now = (uint32_t)time(NULL); - retval = LP_utxosparse(destipaddr,destport,retstr,now); - //printf("got.(%s)\n",retstr); - free(retstr); - } - return(retval); -} - -cJSON *LP_inventory(char *symbol,int32_t iambob) -{ - struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; + struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; int32_t iambob = 0; array = cJSON_CreateArray(); if ( LP_mypeer != 0 ) myipaddr = LP_mypeer->ipaddr; else myipaddr = "127.0.0.1"; - HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) + HASH_ITER(hh,G.LP_utxoinfos,utxo,tmp) { char str[65]; //printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); @@ -612,8 +458,8 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) printf("%s %s ineligible %.8f %.8f\n",utxo->coin,bits256_str(str,u.txid),dstr(val),dstr(val2)); continue; } - if ( iambob != 0 ) - LP_utxo_clientpublish(utxo); + //if ( iambob != 0 ) + // LP_utxo_clientpublish(utxo); jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } else if ( LP_ismine(utxo) > 0 && strcmp(symbol,utxo->coin) == 0 ) @@ -764,14 +610,14 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) { } } else { //printf("call utxoadd\n"); - if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) { } } @@ -839,7 +685,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { - static uint32_t counter; + //static uint32_t counter; bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype; if ( passphrase != 0 && passphrase[0] != 0 ) { @@ -864,23 +710,23 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan { coin->counter++; bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); - bitcoin_addr2rmd160(coin->taddr,&tmptype,LP_myrmd160,coin->smartaddr); - LP_privkeyadd(privkey,LP_myrmd160); + bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); + LP_privkeyadd(privkey,G.LP_myrmd160); if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); - if ( counter++ == 0 ) + if ( G.counter++ == 0 ) { - bitcoin_priv2wif(coin->wiftaddr,USERPASS_WIFSTR,privkey,188); - bitcoin_wif2priv(coin->wiftaddr,&tmptype,&checkkey,USERPASS_WIFSTR); + bitcoin_priv2wif(coin->wiftaddr,G.USERPASS_WIFSTR,privkey,188); + bitcoin_wif2priv(coin->wiftaddr,&tmptype,&checkkey,G.USERPASS_WIFSTR); if ( bits256_cmp(checkkey,privkey) != 0 ) { char str[65],str2[65]; - printf("FATAL ERROR converting USERPASS_WIFSTR %s -> %s != %s\n",USERPASS_WIFSTR,bits256_str(str,checkkey),bits256_str(str2,privkey)); + printf("FATAL ERROR converting USERPASS_WIFSTR %s -> %s != %s\n",G.USERPASS_WIFSTR,bits256_str(str,checkkey),bits256_str(str2,privkey)); exit(-1); } - conv_NXTpassword(userpass.bytes,pubkeyp->bytes,(uint8_t *)USERPASS_WIFSTR,(int32_t)strlen(USERPASS_WIFSTR)); + conv_NXTpassword(userpass.bytes,pubkeyp->bytes,(uint8_t *)G.USERPASS_WIFSTR,(int32_t)strlen(G.USERPASS_WIFSTR)); userpub = curve25519(userpass,curve25519_basepoint9()); - printf("userpass.(%s)\n",bits256_str(USERPASS,userpub)); + printf("userpass.(%s)\n",bits256_str(G.USERPASS,userpub)); } if ( coin->electrum == 0 ) { @@ -895,23 +741,29 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan } else free_json(retjson); } } - LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); - LP_mypriv25519 = privkey; + G.LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); + G.LP_mypriv25519 = privkey; //printf("privkey.(%s) -> LP_mypub25519.(%s)\n",bits256_str(str,privkey),bits256_str(str2,LP_mypub25519)); return(privkey); } -void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t initonly) +void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) { - struct iguana_info *coin,*tmp; bits256 pubkey,privkey; uint8_t pubkey33[33]; + struct iguana_info *coin,*tmp; bits256 pubkey,privkey; uint8_t pubkey33[33]; int32_t initonly; + initonly = (passphrase != 0); memset(privkey.bytes,0,sizeof(privkey)); - pubkey = privkey; + memset(pubkey.bytes,0,sizeof(pubkey)); HASH_ITER(hh,LP_coins,coin,tmp) { + if ( initonly != 0 ) + { + coin->counter = 0; + memset(coin->smartaddr,0,sizeof(coin->smartaddr)); + if ( bits256_nonz(privkey) == 0 || coin->smartaddr[0] == 0 ) + privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); + } //printf("i.%d of %d\n",i,LP_numcoins); - if ( bits256_nonz(privkey) == 0 || coin->smartaddr[0] == 0 ) - privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); - if ( coin->inactive == 0 && initonly == 0 ) + else if ( coin->inactive == 0 ) { if ( LP_privkey_init(pubsock,coin,privkey,pubkey) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); @@ -919,4 +771,40 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito } } +int32_t LP_passphrase_init(char *passphrase) +{ + static void *ctx; struct LP_utxoinfo *utxo,*tmp; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + if ( G.LP_pendingswaps != 0 ) + return(-1); + G.initializing = 1; + while ( G.waiting == 0 ) + { + printf("waiting for G.waiting\n"); + sleep(5); + } + if ( G.LP_utxoinfos != 0 ) + { + HASH_ITER(hh,G.LP_utxoinfos,utxo,tmp) + { + HASH_DELETE(hh,G.LP_utxoinfos,utxo); + free(utxo); + } + } + if ( G.LP_utxoinfos2 != 0 ) + { + HASH_ITER(hh,G.LP_utxoinfos2,utxo,tmp) + { + HASH_DELETE(hh,G.LP_utxoinfos2,utxo); + free(utxo); + } + } + memset(&G,0,sizeof(G)); + LP_privkey_updates(ctx,LP_mypubsock,passphrase); + init_hexbytes_noT(G.LP_myrmd160str,G.LP_myrmd160,20); + G.LP_sessionid = (uint32_t)time(NULL); + return(0); +} + From 4fe35e79fa186ba05c7905f068665dd1d2515e65 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:09:32 +0200 Subject: [PATCH 0517/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 22229e365..048b54368 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -581,6 +581,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); printf("initcoins\n"); LP_initcoins(ctx,pubsock,jobj(argjson,"coins")); + G.waiting = 1; LP_passphrase_init(passphrase); if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) { From 5ffb1a8d4eaae72ff7232a8b93fdddfc6749d535 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:13:17 +0200 Subject: [PATCH 0518/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c69de1953..6cbb86a44 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -157,7 +157,7 @@ void LP_availableset(struct LP_utxoinfo *utxo) cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; - jaddstr(item,"method","oldutxo"); + //jaddstr(item,"method","oldutxo"); if ( utxo == 0 ) return(item); if ( utxo->gui[0] != 0 ) From 5b447f82114cf438dec4b6392c13559c657eeaf8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:16:51 +0200 Subject: [PATCH 0519/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6cbb86a44..0c76c1976 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -765,7 +765,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) //printf("i.%d of %d\n",i,LP_numcoins); else if ( coin->inactive == 0 ) { - if ( LP_privkey_init(pubsock,coin,privkey,pubkey) == 0 && (rand() % 10) == 0 ) + if ( LP_privkey_init(pubsock,coin,G.LP_mypriv25519,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } } From ad0e5819e7156061640c74232f5aef213c9154b6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:23:40 +0200 Subject: [PATCH 0520/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2889e2a76..33348e387 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -287,7 +287,7 @@ void LP_peer_pricesquery(struct LP_peerinfo *peer) } if ( peer->needping != 0 ) { - printf("%s needs ping\n",peer->ipaddr); + //printf("%s needs ping\n",peer->ipaddr); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5555f9767..b128fbd39 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -66,7 +66,7 @@ char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port, if ( rmd160str != 0 && bits256_nonz(pub) != 0 ) { sprintf(url+strlen(url),"&rmd160=%s&pub=%s",rmd160str,bits256_str(str,pub)); - printf("SEND (%s)\n",url); + //printf("SEND (%s)\n",url); } return(LP_issue_curl("notify",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); From d2d4a1f0ba871e0cc0f580aed50b30fc4af706ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:31:05 +0200 Subject: [PATCH 0521/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5eec41e3c..5e0c28b39 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -167,7 +167,13 @@ dividends(coin, height, )\n\ { if ( LP_passphrase_init(jstr(argjson,"passphrase")) < 0 ) return(clonestr("{\"error\":\"couldnt change passphrase\"}")); - else return(clonestr("{\"result\":\"success\"}")); + { + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddstr(retjson,"userpass",G.USERPASS); + jaddbits256(retjson,"mypubkey",G.LP_mypub25519); + return(jprint(retjson,1)); + } } else if ( strcmp(method,"portfolio") == 0 ) { From 311b740b5b45f681ded2573b875555c4d75905ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:43:49 +0200 Subject: [PATCH 0522/2732] Test --- iguana/exchanges/LP_ordermatch.c | 65 +++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e1ce01255..1861f3bb9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -722,9 +722,47 @@ char *LP_connectedalice(cJSON *argjson) // alice } } +int32_t LP_listunspent_both(char *symbol,char *coinaddr) +{ + int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin != 0 ) + { + if ( coin->electrum != 0 ) + { + if ( (array= LP_listunspent(coin->symbol,coinaddr)) != 0 ) + { + n = cJSON_GetArraySize(array); + free_json(array); + } else n = 0; + } + else + { + sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); + if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; ielectrum != 0 ) - { - if ( (array= LP_listunspent(coin->symbol,Q.coinaddr)) != 0 ) - { - n = cJSON_GetArraySize(array); - free_json(array); - } else n = 0; - } - else - { - n = LP_listunspent_issue(coin->symbol,Q.coinaddr); - //printf("need to verify\n"); - } + LP_listunspent_both(Q.srccoin,Q.coinaddr); butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1,Q.desttxfee); Q.txid = butxo->payment.txid; Q.vout = butxo->payment.vout; @@ -895,7 +921,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*array,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -923,14 +949,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ( basecoin->electrum != 0 ) - { - if ( (array= LP_listunspent(basecoin->symbol,coinaddr)) != 0 ) - { - n = cJSON_GetArraySize(array); - free_json(array); - } else n = 0; - } else n = LP_listunspent_issue(basecoin->symbol,coinaddr); + n = LP_listunspent_both(base,coinaddr); if ( n > 1 ) { //minvol = jdouble(item,"minvolume"); From 8a26850f169932b047ec5d45ffa2c2658028503e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 11:48:18 +0200 Subject: [PATCH 0523/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 048b54368..c49df3c55 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -611,6 +611,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) // free(retstr); int32_t nonz; + printf("start mainloop\n"); while ( 1 ) { nonz = 0; From f5fb60c7227f58aade90f4025e336b02addf1737 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:17:04 +0200 Subject: [PATCH 0524/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 02f9387fc..cb37f36fe 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -490,7 +490,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); } - } //else retjson = LP_address_utxos(coin,addr,1); + } else retjson = LP_address_utxos(coin,addr,1); return(retjson); } From 71a4444ad3291b4a6c751be2a2a8eb3fcfc84e19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:22:46 +0200 Subject: [PATCH 0525/2732] Test --- iguana/exchanges/LP_ordermatch.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1861f3bb9..9a2675245 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -727,13 +727,9 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); if ( coin != 0 ) { - if ( coin->electrum != 0 ) + if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) < 0 ) { - if ( (array= LP_listunspent(coin->symbol,coinaddr)) != 0 ) - { - n = cJSON_GetArraySize(array); - free_json(array); - } else n = 0; + n = LP_listunspent_issue(symbol,coinaddr); } else { @@ -754,7 +750,6 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) } } } - //printf("need to verify\n"); } } return(n); From 38012c594226f17f911c22a03fb7340dc6f54bb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:24:22 +0200 Subject: [PATCH 0526/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b128fbd39..d941ed7ee 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -85,7 +85,7 @@ char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coi { char url[512]; sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); - //printf("listunspent.(%s)\n",url); + printf("listunspent.(%s)\n",url); return(LP_issue_curl("listunspent",destip,destport,url)); } From b13496766b69cba6da4248af71fae3c679e2b6bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:27:47 +0200 Subject: [PATCH 0527/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_rpc.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9a2675245..234ae5ff6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -733,6 +733,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) } else { + //printf("my coin\n"); sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d941ed7ee..b8fb1688e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -484,7 +484,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); retjson = cJSON_Parse(retstr); - } + } else printf("LP_listunspent_issue couldnt get a random peer?\n"); if ( retjson != 0 ) { n = cJSON_GetArraySize(retjson); @@ -492,6 +492,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) LP_postutxos(symbol,coinaddr); // might be good to not saturate } } + printf("issue listunspent %s (%s)\n",coinaddr,jprint(retjson,0)); if ( retjson != 0 ) free_json(retjson); if ( retstr != 0 ) From 528926a708c2db05a80c275da9dabbf7e4b9cf62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:30:58 +0200 Subject: [PATCH 0528/2732] Test --- iguana/exchanges/LP_ordermatch.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 234ae5ff6..4a37fbbc0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -725,7 +725,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_listunspent_both(char *symbol,char *coinaddr) { int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin != 0 ) + if ( coin != 0 && coin->inactive == 0 ) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) < 0 ) { @@ -917,7 +917,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -940,32 +940,26 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr price = jdouble(item,"price"); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { - printf("%s\n",jprint(item,0)); pubkey = jbits256(item,"pubkey"); + printf("%s -> %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); n = LP_listunspent_both(base,coinaddr); if ( n > 1 ) { - //minvol = jdouble(item,"minvolume"); - //maxvol = jdouble(item,"maxvolume"); - //printf("%s minvol %.8f %.8f maxvol %.8f\n",jprint(item,0),minvol,relvolume,maxvol); - //if ( relvolume >= minvol && relvolume <= maxvol ) + if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,dstr(autxo->S.satoshis),price,0,desttxfee)) != 0 ) { - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,dstr(autxo->S.satoshis),price,0,desttxfee)) != 0 ) - { - bestutxo->pubkey = pubp->pubkey; - safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - //autxo->S.satoshis = bestutxo->S.satoshis * price - desttxfee; - *bestsatoshisp = bestutxo->S.satoshis; - *ordermatchpricep = price; - *bestdestsatoshisp = autxo->S.satoshis; - printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); - break; - } + bestutxo->pubkey = pubp->pubkey; + safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); + //autxo->S.satoshis = bestutxo->S.satoshis * price - desttxfee; + *bestsatoshisp = bestutxo->S.satoshis; + *ordermatchpricep = price; + *bestdestsatoshisp = autxo->S.satoshis; + printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); + break; } - } + } else printf("no unspents %s\n",bits256_str(str,pubkey)); } else printf("self trading or blacklisted peer\n"); } else From d36b68a6a9b8082756d3974771d648c60993faef Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:33:02 +0200 Subject: [PATCH 0529/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4a37fbbc0..77a8215ce 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -752,7 +752,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) } } } - } + } else printf("%s coin.%p inactive.%d\n",symbol,coin,coin!=0?coin->inactive:-1); return(n); } From 4d48070b85c0141c15f8260f2c9bee19a67bdc1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:35:43 +0200 Subject: [PATCH 0530/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- iguana/exchanges/LP_rpc.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 77a8215ce..787fc7581 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -729,11 +729,12 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) < 0 ) { + printf("issue path\n"); n = LP_listunspent_issue(symbol,coinaddr); } else { - //printf("my coin\n"); + printf("my coin\n"); sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) { @@ -941,7 +942,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr if ( LP_pricevalid(price) > 0 && price <= maxprice ) { pubkey = jbits256(item,"pubkey"); - printf("%s -> %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); + printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b8fb1688e..eef057b00 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -469,6 +469,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; if ( symbol == 0 || symbol[0] == 0 ) return(0); + printf("LP_listunspent_issue\n"); if ( (coin= LP_coinfind(symbol)) != 0 ) { if ( coin->electrum != 0 ) From 51bb827d6184ab5ae5dc3d28797b081b4d9b5015 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:38:33 +0200 Subject: [PATCH 0531/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 787fc7581..e392e7d23 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -729,7 +729,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) < 0 ) { - printf("issue path\n"); + printf("issue path electrum.%p\n",coin->electrum); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index eef057b00..904c48d77 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -414,8 +414,7 @@ cJSON *LP_validateaddress(char *symbol,char *address) jaddstr(retjson,"scriptPubKey",script); } bitcoin_address(coinaddr,coin->taddr,coin->pubtype,G.LP_myrmd160,20); - if ( strcmp(address,coinaddr) == 0 ) - jadd(retjson,"ismine",cJSON_CreateTrue()); + jadd(retjson,"ismine",strcmp(address,coin->smartaddr) == 0 ? cJSON_CreateTrue() : cJSON_CreateFalse()); jadd(retjson,"iswatchonly",cJSON_CreateFalse()); jadd(retjson,"isscript",addrtype == coin->p2shtype ? cJSON_CreateTrue() : cJSON_CreateFalse()); return(retjson); @@ -437,7 +436,7 @@ int32_t LP_address_ismine(char *symbol,char *address) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - //printf("%s already ismine\n",address); + printf("%s ismine (%s)\n",address,jprint(retjson,0)); } //printf("%s\n",jprint(retjson,0)); free_json(retjson); From d82dec1aae48a7c7f555121f16b3b45d78010d4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:41:38 +0200 Subject: [PATCH 0532/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e392e7d23..8b5f10629 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -734,7 +734,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) } else { - printf("my coin\n"); + printf("my coin electrum.%p\n",coin->electrum); sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 904c48d77..b883d1a5c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -436,7 +436,7 @@ int32_t LP_address_ismine(char *symbol,char *address) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - printf("%s ismine (%s)\n",address,jprint(retjson,0)); + //printf("%s ismine (%s)\n",address,jprint(retjson,0)); } //printf("%s\n",jprint(retjson,0)); free_json(retjson); From a130e8f48e23405c4563ea7274a326d89e67664a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 12:43:12 +0200 Subject: [PATCH 0533/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8b5f10629..261fb1a82 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -727,7 +727,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); if ( coin != 0 && coin->inactive == 0 ) { - if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) < 0 ) + if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { printf("issue path electrum.%p\n",coin->electrum); n = LP_listunspent_issue(symbol,coinaddr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b883d1a5c..904c48d77 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -436,7 +436,7 @@ int32_t LP_address_ismine(char *symbol,char *address) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - //printf("%s ismine (%s)\n",address,jprint(retjson,0)); + printf("%s ismine (%s)\n",address,jprint(retjson,0)); } //printf("%s\n",jprint(retjson,0)); free_json(retjson); From 0e07e93ebab65e5b7e33a6c308ee8ee05923daca Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 14:09:53 +0200 Subject: [PATCH 0534/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_scan.c | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5e0c28b39..30424456a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -236,7 +236,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c49df3c55..2daa76cbf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -343,6 +343,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; } + //sync listunspent, parse arrays in ordermatch, electrum history to prune, spv } } if ( peer->diduquery == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 261fb1a82..379670a7c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -729,12 +729,12 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { - printf("issue path electrum.%p\n",coin->electrum); + //printf("issue path electrum.%p\n",coin->electrum); n = LP_listunspent_issue(symbol,coinaddr); } else { - printf("my coin electrum.%p\n",coin->electrum); + //printf("my coin electrum.%p\n",coin->electrum); sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 904c48d77..6b04e22e1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -436,7 +436,7 @@ int32_t LP_address_ismine(char *symbol,char *address) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - printf("%s ismine (%s)\n",address,jprint(retjson,0)); + //printf("%s ismine (%s)\n",address,jprint(retjson,0)); } //printf("%s\n",jprint(retjson,0)); free_json(retjson); @@ -492,7 +492,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) LP_postutxos(symbol,coinaddr); // might be good to not saturate } } - printf("issue listunspent %s (%s)\n",coinaddr,jprint(retjson,0)); + //printf("issue listunspent %s (%s)\n",coinaddr,jprint(retjson,0)); if ( retjson != 0 ) free_json(retjson); if ( retstr != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 14825a425..5cbbabf43 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -438,7 +438,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration) { - struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n,numconfirms = -1; + struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n; int32_t numconfirms = -1; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) { printf("LP_waitmempool missing coin.%p or inactive\n",coin); @@ -475,14 +475,13 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int LP_listunspent_issue(coin->symbol,coinaddr); struct LP_address_utxo *up; if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) - //if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 ) { char str[65]; printf("address_utxofind found confirmed %s %s ht.%d vs %d\n",symbol,bits256_str(str,txid),up->U.height,coin->height); if ( coin->height >= up->U.height ) numconfirms = (coin->height - up->U.height + 1); } } - if ( time(NULL) > expiration || numconfirms >= 1 ) + if ( time(NULL) > expiration || numconfirms >= 0 ) break; usleep(500000); } From 451e6c21e22ad4e10fe7523fab1312d864d703b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 14:53:06 +0200 Subject: [PATCH 0535/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 +++++++++++++++++- iguana/exchanges/LP_ordermatch.c | 2 ++ iguana/exchanges/LP_rpc.c | 1 - iguana/exchanges/LP_scan.c | 17 +++++++++++------ iguana/exchanges/LP_socket.c | 31 +++++++++++++++++++++++++++---- iguana/exchanges/LP_utxo.c | 22 +++++++++++----------- 6 files changed, 68 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2daa76cbf..5285f4da7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -343,7 +343,23 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; } - //sync listunspent, parse arrays in ordermatch, electrum history to prune, spv + HASH_ITER(hh,LP_coins,coin,ctmp) + { + char coinaddr[64]; cJSON *array; int32_t n; + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,G.LP_myrmd160,sizeof(G.LP_myrmd160)); + if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) + { + printf("compare (%s) vs (%s)\n",jprint(array,0),retstr); + free(retstr); + } + } + free_json(array); + } + //sync listunspent,, spv } } if ( peer->diduquery == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 379670a7c..25bb7a3e3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -730,6 +730,8 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { //printf("issue path electrum.%p\n",coin->electrum); + if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) + free_json(array); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 6b04e22e1..c42d5c3d7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -468,7 +468,6 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; if ( symbol == 0 || symbol[0] == 0 ) return(0); - printf("LP_listunspent_issue\n"); if ( (coin= LP_coinfind(symbol)) != 0 ) { if ( coin->electrum != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5cbbabf43..9f65fa7ef 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -21,13 +21,14 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { - int32_t i,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; + int32_t i,iter,numtx,checkht=-1; cJSON *blockobj,*txs,*txobj; bits256 txid; struct LP_transaction *tx; if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && checkht == height ) { if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) { for (iter=0; iter<2; iter++) { + txobj = 0; for (i=0; iheight = height; } if ( iter == 1 ) - LP_transactioninit(coin,txid,iter,0); - } else LP_transactioninit(coin,txid,iter,0); + txobj = LP_transactioninit(coin,txid,iter,0); + } else txobj = LP_transactioninit(coin,txid,iter,0); + if ( txobj != 0 ) + free_json(txobj), txobj = 0; } } } @@ -409,7 +412,7 @@ int32_t LP_spendsearch(bits256 *spendtxidp,int32_t *indp,char *symbol,bits256 se int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) { - int32_t i,n; cJSON *array; bits256 txid; struct iguana_info *coin; struct LP_transaction *tx; + int32_t i,n; cJSON *array,*txobj; bits256 txid; struct iguana_info *coin; struct LP_transaction *tx; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 || coin->electrum != 0 ) return(-1); if ( (array= LP_getmempool(symbol,0)) != 0 ) @@ -421,8 +424,10 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) txid = jbits256i(array,i); if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { - LP_transactioninit(coin,txid,0,0); - LP_transactioninit(coin,txid,1,0); + txobj = LP_transactioninit(coin,txid,0,0); + txobj = LP_transactioninit(coin,txid,1,txobj); + if ( txobj != 0 ) + free_json(txobj); } if ( bits256_cmp(txid,searchtxid) == 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cb37f36fe..80f1f230b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -334,6 +334,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep { txobj = LP_transactioninit(coin,txid,0,0); LP_transactioninit(coin,txid,1,txobj); + free_json(txobj); tx = LP_transactionfind(coin,txid); } if ( tx != 0 ) @@ -351,7 +352,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep tx->outpoints[v].value = value; } } - if ( value != 0 && tx->height > 0 ) + if ( value != 0 || tx->height > 0 ) flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); //printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } @@ -461,10 +462,32 @@ cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON ** cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { - cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); + struct LP_transaction *tx; cJSON *retjson,*txobj,*item; int32_t i,n,height; bits256 txid; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT); - printf("history.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,ep,addr,retjson); + //printf("history.(%s)\n",jprint(retjson,0)); + if ( retjson != 0 && (n= cJSON_GetArraySize(retjson)) > 0 ) + { + for (i=0; i 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + { + tx->height = height; + //for (j=0; jnumvouts; j++) + // LP_address_utxoadd(coin,coinaddr,txid,j,0,height,-1); + } + } + } + } return(retjson); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a4d637804..6f0dc3f84 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -185,11 +185,12 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) { - if ( up->U.height <= 0 && height > 0 ) - up->U.height = height; - if ( spendheight > 0 ) - up->spendheight = spendheight; - flag = 1; + if ( up->U.height <= 0 && height > 0 && up->U.height != height ) + up->U.height = height, flag = 1; + if ( spendheight > 0 && up->spendheight != spendheight ) + up->spendheight = spendheight, flag = 1; + if ( up->U.value == 0 && up->U.value != value ) + up->U.value = value, flag = 1; break; } } @@ -492,6 +493,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); + LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); } @@ -523,11 +525,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } } - if ( iter == 1 ) - { - free_json(txobj); - return(0); - } else return(txobj); + return(txobj); } //else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); return(0); } @@ -615,7 +613,9 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { txobj = LP_transactioninit(coin,txid,0,0); - LP_transactioninit(coin,txid,1,txobj); + txobj = LP_transactioninit(coin,txid,1,txobj); + if ( txobj != 0 ) + free_json(txobj); tx = LP_transactionfind(coin,txid); } if ( tx != 0 ) From 01d18eb8b59b8342fc915fa41ce4efe19c10170e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:02:52 +0200 Subject: [PATCH 0536/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 41 ++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f89011c73..d18c94000 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -306,6 +306,7 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); void LP_postutxos(char *symbol,char *coinaddr); +int32_t LP_listunspent_both(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5285f4da7..c6da0806f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -343,23 +343,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; } - HASH_ITER(hh,LP_coins,coin,ctmp) - { - char coinaddr[64]; cJSON *array; int32_t n; - bitcoin_address(coinaddr,coin->taddr,coin->pubtype,G.LP_myrmd160,sizeof(G.LP_myrmd160)); - if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) - { - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) - { - printf("compare (%s) vs (%s)\n",jprint(array,0),retstr); - free(retstr); - } - } - free_json(array); - } - //sync listunspent,, spv + //sync listunspent,, spv } } if ( peer->diduquery == 0 ) @@ -374,8 +358,27 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; //struct LP_address *ap,*atmp; struct LP_address_utxo *up,*utmp; - //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + int32_t height; bits256 zero; char coinaddr[64]; cJSON *array; int32_t n; + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,G.LP_myrmd160,sizeof(G.LP_myrmd160)); + LP_listunspent_both(coin->symbol,coinaddr); + if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( peer->errors < LP_MAXPEER_ERRORS ) + { + if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) + { + printf(">>>>>>>> compare (%s) vs (%s)\n",jprint(array,0),retstr); + free(retstr); + } + } + } + } + free_json(array); + } if ( coin->inactive != 0 ) continue; if ( coin->electrum != 0 ) From 66a4fe3e52f8b5cd5c95c2bde4833abb2ceff108 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:05:55 +0200 Subject: [PATCH 0537/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c6da0806f..6c6deb35b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -343,7 +343,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; } - //sync listunspent,, spv } } if ( peer->diduquery == 0 ) @@ -358,20 +357,20 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; char coinaddr[64]; cJSON *array; int32_t n; - bitcoin_address(coinaddr,coin->taddr,coin->pubtype,G.LP_myrmd160,sizeof(G.LP_myrmd160)); - LP_listunspent_both(coin->symbol,coinaddr); - if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + int32_t height; bits256 zero; cJSON *array; int32_t n; + LP_listunspent_both(coin->symbol,coin->smartaddr); + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) { + printf("[%s]\n\n",jprint(array,0)); HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors < LP_MAXPEER_ERRORS ) { - if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) + if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { - printf(">>>>>>>> compare (%s) vs (%s)\n",jprint(array,0),retstr); + printf(">>>>>>>> compare %s %s (%s)\n",coin->symbol,coin->smartaddr,retstr); free(retstr); } } From e7f1933a817a80064f47122f1d4128014a67192c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:15:15 +0200 Subject: [PATCH 0538/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 27 +++++++++++++++------------ iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 7 ++++--- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6c6deb35b..f9616e367 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -358,28 +358,31 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { int32_t height; bits256 zero; cJSON *array; int32_t n; - LP_listunspent_both(coin->symbol,coin->smartaddr); - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + if ( coin->inactive != 0 ) + continue; + if ( (rand() % 100) == 0 ) { - if ( (n= cJSON_GetArraySize(array)) > 0 ) + LP_listunspent_both(coin->symbol,coin->smartaddr); + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { - printf("[%s]\n\n",jprint(array,0)); - HASH_ITER(hh,LP_peerinfos,peer,tmp) + if ( (n= cJSON_GetArraySize(array)) > 0 ) { - if ( peer->errors < LP_MAXPEER_ERRORS ) + printf("[%s]\n\n",jprint(array,0)); + HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) + if ( strcmp(peer->ipaddr,LP_myipaddr) != 0 && peer->errors < LP_MAXPEER_ERRORS ) { - printf(">>>>>>>> compare %s %s (%s)\n",coin->symbol,coin->smartaddr,retstr); - free(retstr); + if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) + { + printf(">>>>>>>> compare %s %s (%s)\n",coin->symbol,coin->smartaddr,retstr); + free(retstr); + } } } } + free_json(array); } - free_json(array); } - if ( coin->inactive != 0 ) - continue; if ( coin->electrum != 0 ) continue; memset(zero.bytes,0,sizeof(zero)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 80f1f230b..de90fcb96 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -472,7 +472,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * item = jitem(retjson,i); txid = jbits256(item,"tx_hash"); height = jint(item,"height"); - char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); + //char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); txobj = LP_transactioninit(coin,txid,0,0); txobj = LP_transactioninit(coin,txid,1,txobj); if ( txobj != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6f0dc3f84..8ed5aa5e4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -185,12 +185,13 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) { + flag = 1; if ( up->U.height <= 0 && height > 0 && up->U.height != height ) - up->U.height = height, flag = 1; + up->U.height = height, flag |= 2; if ( spendheight > 0 && up->spendheight != spendheight ) - up->spendheight = spendheight, flag = 1; + up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) - up->U.value = value, flag = 1; + up->U.value = value, flag |= 8; break; } } From 891215ff1611e9e4c08d9142d8e1f06e3284b7c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:16:24 +0200 Subject: [PATCH 0539/2732] Test --- iguana/exchanges/LP_socket.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index de90fcb96..e6a40ce38 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -472,18 +472,21 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * item = jitem(retjson,i); txid = jbits256(item,"tx_hash"); height = jint(item,"height"); - //char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); - txobj = LP_transactioninit(coin,txid,0,0); - txobj = LP_transactioninit(coin,txid,1,txobj); - if ( txobj != 0 ) - free_json(txobj); - if ( height > 0 ) + if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { - if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); + txobj = LP_transactioninit(coin,txid,0,0); + txobj = LP_transactioninit(coin,txid,1,txobj); + if ( txobj != 0 ) + free_json(txobj); + if ( height > 0 ) { - tx->height = height; - //for (j=0; jnumvouts; j++) - // LP_address_utxoadd(coin,coinaddr,txid,j,0,height,-1); + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + { + tx->height = height; + //for (j=0; jnumvouts; j++) + // LP_address_utxoadd(coin,coinaddr,txid,j,0,height,-1); + } } } } From b77c53e825b0f9f93c806b225b79eeabcfd3b54f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:31:23 +0200 Subject: [PATCH 0540/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f9616e367..7684415da 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,7 +357,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height; bits256 zero; cJSON *array; int32_t n; + int32_t height,i,n,m; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; if ( coin->inactive != 0 ) continue; if ( (rand() % 100) == 0 ) @@ -367,14 +367,33 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( (n= cJSON_GetArraySize(array)) > 0 ) { - printf("[%s]\n\n",jprint(array,0)); + total = 0; + for (i=0; iipaddr,LP_myipaddr) != 0 && peer->errors < LP_MAXPEER_ERRORS ) { + total2 = m = 0; if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { - printf(">>>>>>>> compare %s %s (%s)\n",coin->symbol,coin->smartaddr,retstr); + if ( (array2= cJSON_Parse(retstr)) != 0 ) + { + if ( (m= cJSON_GetArraySize(array2)) > 0 ) + { + for (i=0; i>>>>>>> compare %s %s (%.8f n%d) (%.8f m%d)\n",coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); free(retstr); } } From 6cc6f2e8778f2d6a6a5cd82e395ff6b18d2ada32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:36:12 +0200 Subject: [PATCH 0541/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7684415da..9fd422cb7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -373,7 +373,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int item = jitem(array,i); total += j64bits(item,"value"); } - //printf("[%s]\n\n",jprint(array,0)); + printf("[%s]\n%s %s %.8f %d\n",jprint(array,0),coin->symbol,coin->smartaddr,dstr(total),n); HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( strcmp(peer->ipaddr,LP_myipaddr) != 0 && peer->errors < LP_MAXPEER_ERRORS ) From 15a92afd30c67035a4fa032007d4603be891e075 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:43:45 +0200 Subject: [PATCH 0542/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++++-- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9fd422cb7..504012b05 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -373,7 +373,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int item = jitem(array,i); total += j64bits(item,"value"); } - printf("[%s]\n%s %s %.8f %d\n",jprint(array,0),coin->symbol,coin->smartaddr,dstr(total),n); + //printf("[%s]\n%s %s %.8f %d\n",jprint(array,0),coin->symbol,coin->smartaddr,dstr(total),n); HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( strcmp(peer->ipaddr,LP_myipaddr) != 0 && peer->errors < LP_MAXPEER_ERRORS ) @@ -393,7 +393,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } free_json(array2); } - printf(">>>>>>>> compare %s %s (%.8f n%d) (%.8f m%d)\n",coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + if ( total != total || n != m ) + { + printf(">>>>>>>> compare %s %s (%.8f n%d) (%.8f m%d)\n",coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + LP_postutxos(coin->symbol,coin->smartaddr); + } free(retstr); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c42d5c3d7..a7da800ef 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -85,7 +85,7 @@ char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coi { char url[512]; sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); - printf("listunspent.(%s)\n",url); + //printf("listunspent.(%s)\n",url); return(LP_issue_curl("listunspent",destip,destport,url)); } From c5bfa7492c526d92f45f2b4f89b94834804bd8f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:51:21 +0200 Subject: [PATCH 0543/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++++---- iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 504012b05..bb13642da 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,11 +357,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height,i,n,m; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; + int32_t height,i,n,m,post; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; if ( coin->inactive != 0 ) continue; if ( (rand() % 100) == 0 ) { + post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { @@ -393,10 +394,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } free_json(array2); } - if ( total != total || n != m ) + if ( total != total2 || n != m ) { - printf(">>>>>>>> compare %s %s (%.8f n%d) (%.8f m%d)\n",coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - LP_postutxos(coin->symbol,coin->smartaddr); + printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + post++; } free(retstr); } @@ -405,6 +406,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } free_json(array); } + if ( post > 0 ) + LP_postutxos(coin->symbol,coin->smartaddr); } if ( coin->electrum != 0 ) continue; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 25bb7a3e3..6ebc79aa9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -749,7 +749,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) v = jint(item,"vout"); value = LP_value_extract(item,0); height = LP_txheight(coin,txid); - char str[65]; printf("LP_listunspent_both: %s/v%d ht.%d %.8f\n",bits256_str(str,txid),v,height,dstr(value)); + //char str[65]; printf("LP_listunspent_both: %s/v%d ht.%d %.8f\n",bits256_str(str,txid),v,height,dstr(value)); LP_address_utxoadd(coin,coinaddr,txid,v,value,height,-1); } } From e49443e9be581d7db6d550c1d8b1dce6ee414cbf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 16:15:01 +0200 Subject: [PATCH 0544/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 30 +++++++++++++++++++++++------- iguana/exchanges/LP_statemachine.c | 24 ++++++++++++++++++++++++ iguana/exchanges/LP_utxo.c | 25 ------------------------- 3 files changed, 47 insertions(+), 32 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bb13642da..e703bed80 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,7 +357,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height,i,n,m,post; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; + int32_t height,i,j,n,m,v,post; bits256 zero,txid,txid2; cJSON *array,*item,*item2,*array2; uint64_t total,total2; + memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; if ( (rand() % 100) == 0 ) @@ -387,18 +388,33 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (m= cJSON_GetArraySize(array2)) > 0 ) { for (i=0; i>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + for (i=0; iipaddr,jprint(item,0)); + } } + post++; } free_json(array2); } - if ( total != total2 || n != m ) - { - printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - post++; - } free(retstr); } } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 5294b71f2..4f2e21d35 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1527,6 +1527,30 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t //printf("%s clientgetutxos.(%s)\n",url,retstr); //return(retstr); } +void LP_address_monitor(struct LP_pubkeyinfo *pubp) +{ + struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; + return; + HASH_ITER(hh,LP_coins,coin,tmp) + { + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + portable_mutex_lock(&coin->addrmutex); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + ap->monitor = (uint32_t)time(NULL); + } + portable_mutex_unlock(&coin->addrmutex); + if ( coin->electrum != 0 ) + { + if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + { + printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); + free_json(retjson); + } + } + } +} + /*else if ( strcmp(method,"ordermatch") == 0 ) { if ( price > SMALLVAL ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8ed5aa5e4..8afc2a18f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -331,31 +331,6 @@ char *LP_postedutxos(cJSON *argjson) return(clonestr("{\"result\":\"success\"}")); } -/*void LP_address_monitor(struct LP_pubkeyinfo *pubp) -{ - struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; - return; - HASH_ITER(hh,LP_coins,coin,tmp) - { - bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - portable_mutex_lock(&coin->addrmutex); - if ( (ap= _LP_address(coin,coinaddr)) != 0 ) - { - ap->monitor = (uint32_t)time(NULL); - } - portable_mutex_unlock(&coin->addrmutex); - if ( coin->electrum != 0 ) - { - if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) - { - printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); - free_json(retjson); - } - } - } -} -*/ - void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) { memcpy(key,txid.bytes,sizeof(txid)); From e1ae0f661cbe3875859e08777674009a27adf1a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 16:27:17 +0200 Subject: [PATCH 0545/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_rpc.c | 4 ++++ iguana/exchanges/LP_utxo.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e703bed80..f20f0165f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,11 +357,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height,i,j,n,m,v,post; bits256 zero,txid,txid2; cJSON *array,*item,*item2,*array2; uint64_t total,total2; + int32_t height,i,j,n,m,v,post; bits256 zero,txid; cJSON *array,*item,*item2,*array2; uint64_t total,total2; memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; - if ( (rand() % 100) == 0 ) + if ( (rand() % 1000) == 0 ) { post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a7da800ef..9b19e18d9 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -372,6 +372,10 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) free_json(array); } } else free(hexstr); + if ( retjson == 0 ) + { + + } return(retjson); } return(cJSON_Parse("{\"error\":\"couldnt get tx\"}")); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8afc2a18f..ea9ecccb9 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -249,7 +249,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum DL_FOREACH_SAFE(ap->utxos,up,tmp) { //char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); - if ( up->spendheight <= 0 ) + if ( up->spendheight <= 0 && up->U.height > 0 ) { jaddi(array,LP_address_item(coin,up,electrumret)); //printf("new array %s\n",jprint(array,0)); From 748add6a0afdb28907412e31a93a57d1807ba3e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 16:37:46 +0200 Subject: [PATCH 0546/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_socket.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d18c94000..0b36a086f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -305,6 +305,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); +cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); int32_t LP_listunspent_both(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e6a40ce38..c41fe36f5 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -307,7 +307,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep,char *coinaddr,cJSON *array) { - int32_t i,v,n,ht,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*txobj; struct LP_transaction *tx; + int32_t i,v,n,ht,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*retjson,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { //printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); @@ -320,6 +320,13 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep v = jint(item,"vout"); value = LP_value_extract(item,0); ht = LP_txheight(coin,txid); + if ( (retjson= LP_gettxout(coin->symbol,txid,v)) != 0 ) + free_json(retjson); + else + { + printf("external unspent has no gettxout\n"); + flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,0,1); + } } else { From 37d0db4eb16d84c80b6aaba98351539f33048faf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 16:59:51 +0200 Subject: [PATCH 0547/2732] Test --- iguana/exchanges/LP_commands.c | 15 +++++++++++++++ iguana/exchanges/LP_nativeDEX.c | 11 +++++++---- iguana/exchanges/LP_rpc.c | 9 +++++++++ iguana/exchanges/LP_utxo.c | 2 ++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 30424456a..14e1f6cbc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -129,6 +129,7 @@ dividends(coin, height, )\n\ base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); + coin = jstr(argjson,"coin"); if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) { if ( G.USERPASS_COUNTER == 0 ) @@ -345,6 +346,20 @@ dividends(coin, height, )\n\ retstr = LP_postedutxos(argjson); else if ( strcmp(method,"getprices") == 0 ) return(LP_prices()); + else if ( strcmp(method,"uitem") == 0 ) + { + bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr; + txid = jbits256(argjson,"txid"); + vout = jint(argjson,"vout"); + height = jint(argjson,"ht"); + value = j64bits(argjson,"value"); + coinaddr = jstr(argjson,"coinaddr"); + if ( coin != 0 && coinaddr != 0 ) + { + char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); + } + } else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); else if ( strcmp(method,"listunspent") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f20f0165f..74fb5f1f1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -311,7 +311,7 @@ void command_rpcloop(void *myipaddr) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0; + struct iguana_info *coin,*ctmp; char *retstr,*retstr2,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -408,10 +408,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( j == m ) { + //5.9.253.202 missing {"tx_hash":"3ff8700d545186b1dcb29f50ccb2d1a48b9b5a36dfae59254a96a7057ca55a3f","tx_pos":1,"height":8242,"value":"1000000000"} printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); + if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) + free(retstr2); + post++; } } - post++; } free_json(array2); } @@ -422,8 +425,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } free_json(array); } - if ( post > 0 ) - LP_postutxos(coin->symbol,coin->smartaddr); + //if ( post > 0 ) + // LP_postutxos(coin->symbol,coin->smartaddr); } if ( coin->electrum != 0 ) continue; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9b19e18d9..2d11e0ef5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -57,6 +57,15 @@ char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t por return(retstr); } +char *issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t height,uint64_t value) +{ + char url[512],*retstr,str[65]; + if ( (retstr= LP_isitme(destip,destport)) != 0 ) + return(retstr); + sprintf(url,"http://%s:%u/api/stats/uitem?coin=%s&coinaddr=%s&txid=%s&vout=%d&ht=%d&value=%llu",destip,destport,symbol,coinaddr,bits256_str(str,txid),vout,height,(long long)value); + return(LP_issue_curl("uitem",destip,destport,url)); +} + char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,uint32_t sessionid,char *rmd160str,bits256 pub) { char url[512],*retstr,str[65]; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ea9ecccb9..473b62ae1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -175,6 +175,8 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + if ( coin == 0 ) + return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about ap = LP_addressfind(coin,coinaddr); else ap = LP_address(coin,coinaddr); From f0f7c1d78e9c9a2e3421f018bc6d86400eacbffd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:02:33 +0200 Subject: [PATCH 0548/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 14e1f6cbc..0f3acf555 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -359,6 +359,7 @@ dividends(coin, height, )\n\ char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } + return(clonestr("{\"result\":\"success\"}")); } else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); From cc859e9357507d1a6e1a6f27b00114be13acc45c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:03:05 +0200 Subject: [PATCH 0549/2732] Test --- iguana/exchanges/LP_rpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2d11e0ef5..3d87ebc8f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -63,7 +63,9 @@ char *issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr, if ( (retstr= LP_isitme(destip,destport)) != 0 ) return(retstr); sprintf(url,"http://%s:%u/api/stats/uitem?coin=%s&coinaddr=%s&txid=%s&vout=%d&ht=%d&value=%llu",destip,destport,symbol,coinaddr,bits256_str(str,txid),vout,height,(long long)value); - return(LP_issue_curl("uitem",destip,destport,url)); + retstr = LP_issue_curl("uitem",destip,destport,url); + printf("uitem.(%s)\n",retstr); + return(retstr); } char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,uint32_t sessionid,char *rmd160str,bits256 pub) From 122d685016c778ec17d086a357fcd00be2a9d208 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:04:48 +0200 Subject: [PATCH 0550/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0f3acf555..6f983a9cc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -356,7 +356,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3d87ebc8f..748da0614 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -64,7 +64,7 @@ char *issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr, return(retstr); sprintf(url,"http://%s:%u/api/stats/uitem?coin=%s&coinaddr=%s&txid=%s&vout=%d&ht=%d&value=%llu",destip,destport,symbol,coinaddr,bits256_str(str,txid),vout,height,(long long)value); retstr = LP_issue_curl("uitem",destip,destport,url); - printf("uitem.(%s)\n",retstr); + //printf("uitem.(%s)\n",retstr); return(retstr); } From 05e866bd31f77711464d1744208d2fa51f3e01b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:09:28 +0200 Subject: [PATCH 0551/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 74fb5f1f1..21157a645 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -415,7 +415,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int post++; } } - } + } else printf("%s matches\n",peer->ipaddr); free_json(array2); } free(retstr); From 46222bcb9da6efb71efaba25a09525440707b4a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:14:16 +0200 Subject: [PATCH 0552/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 21157a645..6091795e9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -409,13 +409,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( j == m ) { //5.9.253.202 missing {"tx_hash":"3ff8700d545186b1dcb29f50ccb2d1a48b9b5a36dfae59254a96a7057ca55a3f","tx_pos":1,"height":8242,"value":"1000000000"} - printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); + //printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) free(retstr2); post++; } } - } else printf("%s matches\n",peer->ipaddr); + } //else printf("%s matches\n",peer->ipaddr); free_json(array2); } free(retstr); From 7b91d763e705c8038e6e81fb69ffba7d9b6b0e16 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:22:46 +0200 Subject: [PATCH 0553/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_socket.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6ebc79aa9..d2b5d3673 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -730,8 +730,8 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { //printf("issue path electrum.%p\n",coin->electrum); - if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) - free_json(array); + //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) + // free_json(array); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c41fe36f5..4681fa7aa 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -518,6 +518,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From ce728c5109e4aa09065ccc7cb170ab19a3d8e1de Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:26:04 +0200 Subject: [PATCH 0554/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 4681fa7aa..af2370c41 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -361,8 +361,8 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep } if ( value != 0 || tx->height > 0 ) flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); - //printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); - } + printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); + } else printf("cant find tx\n"); } } return(flag); From f728ff72df5f36723064887f7fb24cef3db67fff Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:28:18 +0200 Subject: [PATCH 0555/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 473b62ae1..9b351ee1d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -464,7 +464,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS // maybe filter so only addresses we care about are using RAM if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { - //printf("create txid numvouts.%d numvins.%d\n",numvouts,numvins); + printf("create txid %s numvouts.%d numvins.%d\n",bits256_str(str,txid),numvouts,numvins); for (i=0; i Date: Fri, 22 Sep 2017 17:32:18 +0200 Subject: [PATCH 0556/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6091795e9..84615a2b0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -395,7 +395,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( total != total2 || n != m ) { - printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); for (i=0; i>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); } //else printf("%s matches\n",peer->ipaddr); free_json(array2); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9b351ee1d..f68f112ec 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -210,7 +210,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, portable_mutex_unlock(&coin->addrmutex); retval = 1; char str[65]; - if ( 0 && height > 0 ) + if ( height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } From 8c2b15532cf6cb0064e076b14d80abd37438ec9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:34:40 +0200 Subject: [PATCH 0557/2732] Test --- iguana/exchanges/LP_utxo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f68f112ec..fce5339bd 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -173,8 +173,8 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { - struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; - //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; + //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about @@ -194,6 +194,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; + printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } @@ -209,11 +210,10 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - char str[65]; if ( height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } - } + } else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); return(retval); } From e3372f328887e326d2c70820126a88642be1442d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:40:36 +0200 Subject: [PATCH 0558/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d2b5d3673..a0964d57b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -962,7 +962,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } - } else printf("no unspents %s\n",bits256_str(str,pubkey)); + } else printf("no unspents %s %s %s\n",base,coinaddr,bits256_str(str,pubkey)); } else printf("self trading or blacklisted peer\n"); } else diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 748da0614..3e683545c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -486,7 +486,10 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) if ( (coin= LP_coinfind(symbol)) != 0 ) { if ( coin->electrum != 0 ) - retjson = electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr); + { + if ( (retjson= electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + n = cJSON_GetArraySize(retjson); + } else { if ( strcmp(coin->smartaddr,coinaddr) == 0 ) @@ -503,7 +506,9 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { n = cJSON_GetArraySize(retjson); if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 ) - LP_postutxos(symbol,coinaddr); // might be good to not saturate + { + //LP_postutxos(symbol,coinaddr); // might be good to not saturate + } } } //printf("issue listunspent %s (%s)\n",coinaddr,jprint(retjson,0)); From 748986f3f9a0fe4baf8b0f593c51f7770fbb5919 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:43:06 +0200 Subject: [PATCH 0559/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxo.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a0964d57b..8a82fcca0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -755,7 +755,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) } } } - } else printf("%s coin.%p inactive.%d\n",symbol,coin,coin!=0?coin->inactive:-1); + } //else printf("%s coin.%p inactive.%d\n",symbol,coin,coin!=0?coin->inactive:-1); return(n); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index af2370c41..81d7a83bb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -361,8 +361,8 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep } if ( value != 0 || tx->height > 0 ) flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); - printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); - } else printf("cant find tx\n"); + //printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); + } //else printf("cant find tx\n"); } } return(flag); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fce5339bd..a9098c199 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -194,7 +194,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; - printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + //printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } @@ -210,10 +210,10 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( height > 0 ) + if ( 0 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } - } else printf("cant get ap %s %s\n",coin->symbol,coinaddr); + } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); return(retval); } @@ -464,7 +464,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS // maybe filter so only addresses we care about are using RAM if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins)) != 0 ) { - printf("create txid %s numvouts.%d numvins.%d\n",bits256_str(str,txid),numvouts,numvins); + //printf("create txid %s numvouts.%d numvins.%d\n",bits256_str(str,txid),numvouts,numvins); for (i=0; i Date: Fri, 22 Sep 2017 17:44:48 +0200 Subject: [PATCH 0560/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 81d7a83bb..6afb10ba1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -518,7 +518,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From a1f80c3b8d9671f0b3448257ed6637e3e9ab7011 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 17:53:21 +0200 Subject: [PATCH 0561/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8a82fcca0..927b9998e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -918,9 +918,9 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) +struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; + bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -951,7 +951,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *bestutxo,double *ordermatchpr n = LP_listunspent_both(base,coinaddr); if ( n > 1 ) { - if ( (bestutxo= LP_address_utxopair(bestutxo,utxos,max,basecoin,coinaddr,txfee,dstr(autxo->S.satoshis),price,0,desttxfee)) != 0 ) + if ( (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(autxo->S.satoshis),price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From 15b8cf0666ce89127737b3ebc93f9016bf76f5c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 18:14:22 +0200 Subject: [PATCH 0562/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_ordermatch.c | 13 +++---------- iguana/exchanges/LP_utxo.c | 4 +++- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0b36a086f..ab04eab46 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -45,8 +45,8 @@ #define LP_SWAPSTEP_TIMEOUT 30 #define LP_AUTOTRADE_TIMEOUT 60 #define LP_MIN_TXFEE 10000 -#define LP_MINVOL 10 -#define LP_MINCLIENTVOL 20 +#define LP_MINVOL 20 +#define LP_MINCLIENTVOL 50 #define LP_MINSIZE_TXFEEMULT 10 #define LP_REQUIRED_TXFEE 0.9 diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 927b9998e..0e0741a25 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -308,6 +308,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-14); if ( butxo != 0 ) { + //qprice 2259.01692494 <- 10.34279604/0.00457845 txfees.(0.00042631 0.00010000) vs (0.00042791 0.00010000) if ( qp->satoshis < (srcvalue / LP_MINVOL) || srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT ) { printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee)); @@ -467,7 +468,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre printf("%.8f ",dstr(utxos[i]->U.value)); printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); } - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL ) { up = utxos[mini]; utxos[mini] = 0; @@ -499,7 +500,6 @@ struct LP_utxoinfo *_LP_butxo_find(struct LP_utxoinfo *butxo) { int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); //portable_mutex_lock(&LP_butxomutex); - printf("_LP_butxo_find\n"); for (i=0; iT.swappending,srcutxo->T.swappending); destutxo->S = srcutxo->S; destutxo->T = srcutxo->T; } @@ -548,7 +544,6 @@ void LP_butxo_swapfields_copy(struct LP_utxoinfo *destutxo,struct LP_utxoinfo *s void LP_butxo_swapfields(struct LP_utxoinfo *butxo) { struct LP_utxoinfo *getutxo=0; - printf("swapfields\n"); portable_mutex_lock(&LP_butxomutex); if ( (getutxo= _LP_butxo_find(butxo)) != 0 ) LP_butxo_swapfields_copy(butxo,getutxo); @@ -558,11 +553,9 @@ void LP_butxo_swapfields(struct LP_utxoinfo *butxo) void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) { struct LP_utxoinfo *setutxo; - printf("swapfields set\n"); if ( (setutxo= LP_butxo_add(butxo)) != 0 ) { LP_butxo_swapfields_copy(setutxo,butxo); - printf("LP_butxo_swapfields_copy set\n"); } } @@ -944,7 +937,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice if ( LP_pricevalid(price) > 0 && price <= maxprice ) { pubkey = jbits256(item,"pubkey"); - printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); + //printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a9098c199..549d774e7 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -344,7 +344,9 @@ struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) struct LP_utxoinfo *utxo=0; uint8_t key[sizeof(txid) + sizeof(vout)]; if ( iambob != 0 ) { - printf("_LP_utxofind deprecated iambob\n"); + static uint32_t counter; + if ( counter++ < 3 ) + printf("_LP_utxofind deprecated iambob\n"); return(0); } LP_utxosetkey(key,txid,vout); From 47c99040d1f6ffd0f2beca6db37226b49078d758 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 19:00:13 +0200 Subject: [PATCH 0563/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_scan.c | 4 +++- iguana/exchanges/LP_socket.c | 3 +-- iguana/exchanges/LP_swap.c | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 84615a2b0..3b5c8a8d7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -414,7 +414,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int post++; } } - if ( post != 0 ) + if ( 0 && post != 0 ) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); } //else printf("%s matches\n",peer->ipaddr); free_json(array2); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 9f65fa7ef..f50df4b1f 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -481,7 +481,9 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int struct LP_address_utxo *up; if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) { - char str[65]; printf("address_utxofind found confirmed %s %s ht.%d vs %d\n",symbol,bits256_str(str,txid),up->U.height,coin->height); + char str[65]; printf("address_utxofind found confirmed %s %s %s ht.%d vs %d\n",symbol,coinaddr,bits256_str(str,txid),up->U.height,coin->height); + if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) + free_json(array); if ( coin->height >= up->U.height ) numconfirms = (coin->height - up->U.height + 1); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6afb10ba1..6682a782d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -491,8 +491,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * if ( (tx= LP_transactionfind(coin,txid)) != 0 ) { tx->height = height; - //for (j=0; jnumvouts; j++) - // LP_address_utxoadd(coin,coinaddr,txid,j,0,height,-1); + LP_address_utxoadd(coin,addr,txid,0,0,height,-1); } } } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index dab03cc91..9c27b1dce 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -733,7 +733,7 @@ void LP_bobloop(void *_swap) else m = 1; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { - char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",swap->alicepayment.I.destaddr,n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) @@ -786,7 +786,7 @@ void LP_aliceloop(void *_swap) else m = 1; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { - char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } swap->sentflag = 1; @@ -796,14 +796,14 @@ void LP_aliceloop(void *_swap) { while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { - char str[65];printf("%d waiting for bobpayment to be confirmed.%d %s %s\n",n,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); + char str[65];printf("%d waiting for bobpayment %s to be confirmed.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) { - char str[65];printf("%d waiting for alicespend to be confirmed.%d %s %s\n",n,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); + char str[65];printf("%d waiting for alicespend %s to be confirmed.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); } if ( swap->N.pair >= 0 ) From 46821e6124d49e2d81caa70560a7e2009bfdbbee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 19:01:18 +0200 Subject: [PATCH 0564/2732] Test --- iguana/exchanges/LP_swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 9c27b1dce..de83c61dd 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -733,7 +733,7 @@ void LP_bobloop(void *_swap) else m = 1; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { - char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",swap->alicepayment.I.destaddr,n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) From 437de9d6a0f679b2b5c816d6472e9b6611d0d1c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 19:18:10 +0200 Subject: [PATCH 0565/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0e0741a25..7af723c6e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -297,7 +297,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str } if ( butxo != 0 && srcvalue < qp->txfee+qp->satoshis ) { - printf("srcvalue %.8f satoshis %.8f is too small txfee %.8f?\n",dstr(srcvalue),dstr(qp->satoshis),dstr(qp->txfee)); + printf("srcvalue %.8f [%.8f] satoshis %.8f is too small txfee %.8f?\n",dstr(srcvalue),dstr(srcvalue) - dstr(qp->txfee+qp->satoshis),dstr(qp->satoshis),dstr(qp->txfee)); return(-33); } if ( qp->satoshis != 0 ) From 8d487e2cd32d9b9988aa569723e275c029f1a45e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 00:44:37 +0200 Subject: [PATCH 0566/2732] # --- iguana/exchanges/electrum.chips | 2 ++ iguana/exchanges/electrum.chips2 | 2 ++ iguana/exchanges/install | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/electrum.chips create mode 100755 iguana/exchanges/electrum.chips2 diff --git a/iguana/exchanges/electrum.chips b/iguana/exchanges/electrum.chips new file mode 100755 index 000000000..be36abd88 --- /dev/null +++ b/iguana/exchanges/electrum.chips @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CHIPS\",\"ipaddr\":\"173.212.225.176\",\"port\":50076}" diff --git a/iguana/exchanges/electrum.chips2 b/iguana/exchanges/electrum.chips2 new file mode 100755 index 000000000..72e3f2f70 --- /dev/null +++ b/iguana/exchanges/electrum.chips2 @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CHIPS\",\"ipaddr\":\"136.243.45.140\",\"port\":50076}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index bda13d6ef..3b1981f97 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . -echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir +#echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From ff2907f8a639bbd970af14508a2c3d947442b39a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 15:23:09 +0200 Subject: [PATCH 0567/2732] Fixes --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_ordermatch.c | 39 +++++++++++++-------- iguana/exchanges/LP_rpc.c | 29 +++++++++++----- iguana/exchanges/LP_scan.c | 57 +++++++++++++++++-------------- iguana/exchanges/LP_transaction.c | 23 +++++++++++-- iguana/exchanges/LP_utxo.c | 4 +-- 6 files changed, 101 insertions(+), 52 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ab04eab46..0cae842bf 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -311,6 +311,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); +int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid); #endif diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7af723c6e..192e95976 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -454,26 +454,31 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t return(mini); } +uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) +{ + return(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee); +} + struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,int32_t avoidflag,uint64_t desttxfee) { - struct LP_address *ap; uint64_t targetval; int32_t m,mini; struct LP_address_utxo *up,*up2; + struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(utxos,max,ap,avoidflag)) > 1 ) { - targetval = SATOSHIDEN * ((volume + dstr(desttxfee)) / price) + 2*txfee; + targetval = LP_basesatoshis(volume,price,txfee,desttxfee); { int32_t i; for (i=0; iU.value)); printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); } - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL ) + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { up = utxos[mini]; utxos[mini] = 0; - targetval = (up->U.value / 8) * 9 + 2*txfee; - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 ) + targetval2 = (up->U.value / 8) * 9 + 2*txfee; + if ( (mini= LP_nearest_utxovalue(utxos,m,targetval2)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { @@ -486,7 +491,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre utxo->deposit.txid = up2->U.txid; utxo->deposit.vout = up2->U.vout; utxo->deposit.value = up2->U.value; - utxo->S.satoshis = SATOSHIDEN * (volume / price); + utxo->S.satoshis = targetval; return(utxo); } } @@ -911,9 +916,9 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,double relvolume,char *gui) +struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui) { - bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; + bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -944,11 +949,11 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice n = LP_listunspent_both(base,coinaddr); if ( n > 1 ) { - if ( (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(autxo->S.satoshis),price,0,desttxfee)) != 0 ) + basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); + if ( (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis),price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - //autxo->S.satoshis = bestutxo->S.satoshis * price - desttxfee; *bestsatoshisp = bestutxo->S.satoshis; *ordermatchpricep = price; *bestdestsatoshisp = autxo->S.satoshis; @@ -980,7 +985,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { - uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_best,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_bestB,_bestA,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; printf("LP_autobuy %s/%s price %.8f vol %.8f\n",base,rel,maxprice,relvolume); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; @@ -989,10 +994,16 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); LP_txfees(&txfee,&desttxfee,base,rel); - if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume + desttxfee)) == 0 ) + memset(&_bestA,0,sizeof(_bestA)); + memset(&_bestB,0,sizeof(_bestB)); + destsatoshis = SATOSHIDEN * relvolume + desttxfee; + if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - memset(&_best,0,sizeof(_best)); - if ( (bestutxo= LP_buyutxo(&_best,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,relvolume,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + _bestA = *autxo; + autxo = &_bestA; + if ( destsatoshis < autxo->S.satoshis ) + autxo->S.satoshis = destsatoshis; + if ( (bestutxo= LP_buyutxo(&_bestB,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3e683545c..aaabcc46f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -626,7 +626,7 @@ double LP_getestimatedrate(struct iguana_info *coin) char *LP_sendrawtransaction(char *symbol,char *signedtx) { - cJSON *array; char *paramstr,*tmpstr,*retstr=0; int32_t n; cJSON *retjson; struct iguana_info *coin; + cJSON *array,*errobj; char *paramstr,*tmpstr,*retstr=0; int32_t n,alreadyflag = 0; cJSON *retjson; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) return(0); coin = LP_coinfind(symbol); @@ -646,14 +646,27 @@ char *LP_sendrawtransaction(char *symbol,char *signedtx) if ( (retjson= electrum_sendrawtransaction(symbol,coin->electrum,&retjson,signedtx)) != 0 ) { retstr = jprint(retjson,1); - printf("electrum sendrawtx.(%s) -> %s\n",signedtx,retstr); - n = (int32_t)strlen(retstr); - if ( retstr[0] == '"' && retstr[n-1] == '"' ) + //electrum sendrawtx (the transaction was rejected by network rules.\n\ntransaction already in block chain) + if ( strstr(retstr,"already in block") != 0 ) + alreadyflag = 1; + printf("electrum sendrawtx.(%s) -> %s already.%d\n",signedtx,retstr,alreadyflag); + if ( alreadyflag != 0 ) { - retstr[n-1] = 0; - tmpstr = clonestr(retstr+1); - free(retstr); - retstr = tmpstr; + errobj = cJSON_CreateObject(); + jaddstr(errobj,"error","rejected"); + jaddnum(errobj,"code",-27); + retstr = jprint(errobj,1); + } + else + { + n = (int32_t)strlen(retstr); + if ( retstr[0] == '"' && retstr[n-1] == '"' ) + { + retstr[n-1] = 0; + tmpstr = clonestr(retstr+1); + free(retstr); + retstr = tmpstr; + } } } } diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f50df4b1f..2af0d9f9f 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -452,46 +452,53 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int expiration = (uint32_t)time(NULL) + duration; while ( 1 ) { - if ( coin->electrum == 0 ) - { - if ( LP_mempoolscan(symbol,txid) >= 0 ) - return(0); - } + if ( LP_gettx_presence(symbol,txid) != 0 ) + numconfirms = 0; else { - if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) + if ( coin->electrum == 0 ) + { + if ( LP_mempoolscan(symbol,txid) >= 0 ) + numconfirms = 0; + } + else { - char str[65]; printf("check %s mempool.(%s)\n",bits256_str(str,txid),jprint(array,0)); - if ( (n= cJSON_GetArraySize(array)) > 0 ) + if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) { - for (i=0; i 0 ) { - item = jitem(array,i); - if ( bits256_cmp(txid,jbits256(item,"tx_hash")) == 0 ) + for (i=0; isymbol,coinaddr); + struct LP_address_utxo *up; + if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) + { + char str[65]; printf("address_utxofind found confirmed %s %s %s ht.%d vs %d\n",symbol,coinaddr,bits256_str(str,txid),up->U.height,coin->height); + if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) + free_json(array); + if ( coin->height >= up->U.height ) + numconfirms = (coin->height - up->U.height + 1); } - free(array); - } - LP_listunspent_issue(coin->symbol,coinaddr); - struct LP_address_utxo *up; - if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) - { - char str[65]; printf("address_utxofind found confirmed %s %s %s ht.%d vs %d\n",symbol,coinaddr,bits256_str(str,txid),up->U.height,coin->height); - if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) - free_json(array); - if ( coin->height >= up->U.height ) - numconfirms = (coin->height - up->U.height + 1); } } if ( time(NULL) > expiration || numconfirms >= 0 ) break; usleep(500000); } + if ( numconfirms <= 0 ) + numconfirms = LP_numconfirms(symbol,coinaddr,txid,vout,1); return(numconfirms); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 073c947a0..f93374066 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -19,13 +19,31 @@ // marketmaker // +int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid) +{ + cJSON *txobj; bits256 txid; int32_t flag = 0; + if ( (txobj= LP_gettx(symbol,expectedtxid)) != 0 ) + { + txid = jbits256(txobj,"txid"); + if ( jobj(txobj,"error") == 0 && bits256_cmp(txid,expectedtxid) == 0 ) + { + char str[65]; printf("%s already in gettx (%s)\n",bits256_str(str,txid),jprint(txobj,0)); + flag = 1; + } + free_json(txobj); + } + return(flag); +} + bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxid) { char *retstr; bits256 txid; cJSON *retjson,*errorobj; int32_t i,sentflag = 0; memset(&txid,0,sizeof(txid)); - for (i=0; i<1; i++) + for (i=0; i<2; i++) { - if ( (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 ) + if ( sentflag == 0 && LP_gettx_presence(symbol,expectedtxid) != 0 ) + sentflag = 1; + if ( sentflag == 0 && (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 ) { if ( is_hexstr(retstr,0) == 64 ) { @@ -50,6 +68,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } if ( sentflag != 0 ) break; + sleep(3); } return(txid); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 549d774e7..00b361531 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -542,7 +542,6 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t mempool) { struct iguana_info *coin; int32_t ht,numconfirms = 100; - //#ifndef BASILISK_DISABLEWAITTX cJSON *txobj; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) return(-1); @@ -560,14 +559,13 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int else { if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) - numconfirms = (LP_getheight(coin) - ht); + numconfirms = (LP_getheight(coin) - ht + 1); else if ( mempool != 0 ) { if (LP_waitmempool(symbol,coinaddr,txid,vout,30) >= 0 ) numconfirms = 0; } } - //#endif return(numconfirms); } From 5ba2d0e1aa700f250340a51f6a4aec6fa347d558 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 15:40:24 +0200 Subject: [PATCH 0568/2732] Test --- iguana/exchanges/LP_ordermatch.c | 42 ++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 192e95976..b5ff74124 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -916,9 +916,9 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui) +struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { - bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; + bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,j,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -942,6 +942,11 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice if ( LP_pricevalid(price) > 0 && price <= maxprice ) { pubkey = jbits256(item,"pubkey"); + for (j=0; jS.satoshis ) autxo->S.satoshis = destsatoshis; - if ( (bestutxo= LP_buyutxo(&_bestB,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + while ( 1 ) { - printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); - return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - } - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) - { - printf("quote validate error %.0f\n",qprice); - return(clonestr("{\"error\":\"quote validation error\"}")); + if ( (bestutxo= LP_buyutxo(&_bestB,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + { + printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); + return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + } + pubkeys[numpubs++] = bestutxo->pubkey; + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + continue; + //return(clonestr("{\"error\":\"quote validation error\"}")); + } + break; } //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); From 3568e90bbb3a50f2efc0990c97f194875ab58abb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 15:52:39 +0200 Subject: [PATCH 0569/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b5ff74124..8e6b58346 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -928,7 +928,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice return(0); utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); - printf("LP_buyutxo %s/%s %.8f %.8f\n",base,autxo->coin,dstr(txfee),dstr(desttxfee)); + printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) @@ -959,7 +959,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - *bestsatoshisp = bestutxo->S.satoshis; + *bestsatoshisp = basesatoshis; *ordermatchpricep = price; *bestdestsatoshisp = autxo->S.satoshis; printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); From 110460e6f0238db8e39bd57b3ff1a595f2b22580 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 15:59:20 +0200 Subject: [PATCH 0570/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8e6b58346..944bb51ac 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -260,6 +260,7 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo, double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp,int32_t iambob) { double qprice=0.; uint64_t txfee,desttxfee,srcvalue=0,srcvalue2=0,destvalue=0,destvalue2=0; + printf("quote %s %.8f -> %s %.8f\n",qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); if ( butxo != 0 ) { if (LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) @@ -456,6 +457,7 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { + printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee),relvolume,price); return(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee); } @@ -1024,6 +1026,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); +exit(-1); continue; //return(clonestr("{\"error\":\"quote validation error\"}")); } From 7eac682ea1fb6fc98939346ebaa863cb7595b655 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:09:07 +0200 Subject: [PATCH 0571/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6f983a9cc..d9915c479 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -237,7 +237,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")/price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } From b099fdba4cafbc2b94227a391d66035e399fb980 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:16:29 +0200 Subject: [PATCH 0572/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d9915c479..6f983a9cc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -237,7 +237,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")/price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } From 99fe7be3d38bfb86ac4dff40b21f070d25abbd10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:17:13 +0200 Subject: [PATCH 0573/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6f983a9cc..d65652d86 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -237,7 +237,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } From 7d4d25a855194c98597c6c3bd4b5ac4fd9f225e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:26:21 +0200 Subject: [PATCH 0574/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index aaabcc46f..8c626beea 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -604,7 +604,7 @@ double LP_getestimatedrate(struct iguana_info *coin) { if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { - sprintf(buf,"[%d]",6); + sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { if ( retstr[0] != '-' ) From ccd17f629f15879b30517d47b18d42cb8b7db386 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:28:25 +0200 Subject: [PATCH 0575/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8c626beea..4cf3fbe59 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -613,6 +613,8 @@ double LP_getestimatedrate(struct iguana_info *coin) if ( rate < 0.00000020 ) rate = 0.00000020; coin->rate = rate * 1.25; + if ( coin->electrum != 0 ) + coin->rate *= 2; coin->ratetime = (uint32_t)time(NULL); if ( (rand() % 10) == 0 ) printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); From b1f66fe018f0964996a3c87a01056ce6063971e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:36:25 +0200 Subject: [PATCH 0576/2732] Test --- iguana/exchanges/LP_rpc.c | 2 -- iguana/exchanges/LP_utxo.c | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4cf3fbe59..8c626beea 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -613,8 +613,6 @@ double LP_getestimatedrate(struct iguana_info *coin) if ( rate < 0.00000020 ) rate = 0.00000020; coin->rate = rate * 1.25; - if ( coin->electrum != 0 ) - coin->rate *= 2; coin->ratetime = (uint32_t)time(NULL); if ( (rand() % 10) == 0 ) printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 00b361531..ca6e6f352 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -626,12 +626,16 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( coinaddr == 0 ) coinaddr = _coinaddr; LP_destaddr(coinaddr,txobj); - free_json(txobj); //printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); if ( value != 0 ) + { + free_json(txobj); return(value); + } } - printf("pruned node? LP_txvalue couldnt find %s tx %s/v%d\n",coin->symbol,bits256_str(str,txid),vout); + printf("pruned node? LP_txvalue couldnt find %s tx %s/v%d (%s)\n",coin->symbol,bits256_str(str,txid),vout,txobj!=0?jprint(txobj,0):""); + if ( txobj != 0 ) + free_json(txobj); } return(0); } From 36e4d8b14dc08e07d3e35756347eb50aac1283d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:41:04 +0200 Subject: [PATCH 0577/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 944bb51ac..b1f3a221e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -469,6 +469,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre if ( (m= LP_address_utxo_ptrs(utxos,max,ap,avoidflag)) > 1 ) { targetval = LP_basesatoshis(volume,price,txfee,desttxfee); + if ( 0 ) { int32_t i; for (i=0; iU.value / 8) * 9 + 2*txfee; + printf("targetval %.8f, found val %.8f | targetval2 %.8f\n",dstr(targetval),dstr(up->U.value),dstr(targetval2)); if ( (mini= LP_nearest_utxovalue(utxos,m,targetval2)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) From ac76eebdc68a7e355cc2ac761b780a65a21acb9a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 16:48:15 +0200 Subject: [PATCH 0578/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b1f3a221e..ba5f5ec7d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -481,7 +481,6 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre up = utxos[mini]; utxos[mini] = 0; targetval2 = (up->U.value / 8) * 9 + 2*txfee; - printf("targetval %.8f, found val %.8f | targetval2 %.8f\n",dstr(targetval),dstr(up->U.value),dstr(targetval2)); if ( (mini= LP_nearest_utxovalue(utxos,m,targetval2)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) @@ -496,6 +495,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre utxo->deposit.vout = up2->U.vout; utxo->deposit.value = up2->U.value; utxo->S.satoshis = targetval; + printf("targetval %.8f, found val %.8f | targetval2 %.8f val2 %.8f\n",dstr(targetval),dstr(up->U.value),dstr(targetval2),dstr(up2->U.value)); return(utxo); } } @@ -959,7 +959,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); - if ( (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis),price,0,desttxfee)) != 0 ) + if ( (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); From aa8ddd7107a67f0f1f8ad36fc058e4f472df30ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:01:01 +0200 Subject: [PATCH 0579/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8c626beea..93d1f524c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime ) { sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) From b489e4d0fb01a64e6505a8acae456db39dec6344 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:04:36 +0200 Subject: [PATCH 0580/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 93d1f524c..9bf2a0894 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+3 ) { sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) @@ -614,7 +614,7 @@ double LP_getestimatedrate(struct iguana_info *coin) rate = 0.00000020; coin->rate = rate * 1.25; coin->ratetime = (uint32_t)time(NULL); - if ( (rand() % 10) == 0 ) + //if ( (rand() % 10) == 0 ) printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); } free(retstr); From eef5a1a73a93d3cb4ae6694b92f5c5ab41f9969f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:06:23 +0200 Subject: [PATCH 0581/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ba5f5ec7d..dea7a0c75 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -304,6 +304,10 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str if ( qp->satoshis != 0 ) qprice = ((double)qp->destsatoshis / qp->satoshis); LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); + if ( txfee < qp->txfee ) + qp->txfee = txfee; + if ( desttxfee < qp->desttxfee ) + qp->desttxfee = desttxfee; printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); if ( qp->txfee < LP_REQUIRED_TXFEE*txfee || qp->desttxfee < LP_REQUIRED_TXFEE*desttxfee ) return(-14); From 9eb88737f0c04785a329f40cc8560415261d4ce8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:12:00 +0200 Subject: [PATCH 0582/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index dea7a0c75..24ea79c7f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -305,9 +305,9 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str qprice = ((double)qp->destsatoshis / qp->satoshis); LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); if ( txfee < qp->txfee ) - qp->txfee = txfee; + txfee = qp->txfee; if ( desttxfee < qp->desttxfee ) - qp->desttxfee = desttxfee; + desttxfee = qp->desttxfee; printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); if ( qp->txfee < LP_REQUIRED_TXFEE*txfee || qp->desttxfee < LP_REQUIRED_TXFEE*desttxfee ) return(-14); From 697a807d83ba1df2394e5e8af4956ac6f2960a60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:14:18 +0200 Subject: [PATCH 0583/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 24ea79c7f..7f4ddeed1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -39,6 +39,7 @@ void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) { *txfeep = LP_txfeecalc(LP_coinfind(base),0); *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0); + printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); } double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) From e3734626931141b38ac63b317eb197f90d5c5869 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:18:50 +0200 Subject: [PATCH 0584/2732] Test --- iguana/exchanges/LP_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9bf2a0894..2f375cfd0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -612,10 +612,11 @@ double LP_getestimatedrate(struct iguana_info *coin) rate = atof(retstr) / 1024.; if ( rate < 0.00000020 ) rate = 0.00000020; - coin->rate = rate * 1.25; + rate *= 1.25; + coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); //if ( (rand() % 10) == 0 ) - printf("estimated rate.(%s) %s -> %.8f\n",coin->symbol,retstr,rate); + printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate); } free(retstr); } From a325746fa1e097d0b13035326318c8cd6eddd3fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:26:27 +0200 Subject: [PATCH 0585/2732] Test --- iguana/exchanges/LP_ordermatch.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7f4ddeed1..754617a84 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -365,27 +365,22 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L msg = jprint(reqjson,1); printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); - if ( 0 && strcmp(method,"connect") == 0 ) + if ( 1 && strcmp(method,"request") == 0 ) { sleep(3); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); - } - else + } else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); + for (i=0; i<30; i++) { - memset(&zero,0,sizeof(zero)); - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - for (i=0; i<30; i++) + if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) { - if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) + if ( flag == 0 || bits256_nonz(qp->desthash) != 0 ) { - if ( flag == 0 || bits256_nonz(qp->desthash) != 0 ) - { - printf("break out of loop.%d price %.8f %s/%s\n",i,price,qp->srccoin,qp->destcoin); - break; - } + printf("break out of loop.%d price %.8f %s/%s\n",i,price,qp->srccoin,qp->destcoin); + break; } - usleep(1000000); } + usleep(1000000); } return(price); } From 728bc913537b3dadf5cfce8d4aceb312d880e929 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:28:50 +0200 Subject: [PATCH 0586/2732] TRC and UIS tweaks --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/coins | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2f375cfd0..c5a20b532 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime+3 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+13 ) { sprintf(buf,"[%d]",3); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 0a7680a30..258a3be5e 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From ce9fd69b835dc783ad50b4f3e67c223d22232661 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:35:22 +0200 Subject: [PATCH 0587/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0cae842bf..6063e22f0 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -48,7 +48,7 @@ #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 #define LP_MINSIZE_TXFEEMULT 10 -#define LP_REQUIRED_TXFEE 0.9 +#define LP_REQUIRED_TXFEE 0.8 #define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV) #define LP_DEPOSITSATOSHIS(satoshis) ((satoshis) + (satoshis >> 3)) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c5a20b532..42e9f514c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -604,7 +604,7 @@ double LP_getestimatedrate(struct iguana_info *coin) { if ( coin->rate == 0. || time(NULL) > coin->ratetime+13 ) { - sprintf(buf,"[%d]",3); + sprintf(buf,"[%d]",6); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { if ( retstr[0] != '-' ) From cdb8d187763965998b8476f8f720d41bf4ecdcde Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:38:37 +0200 Subject: [PATCH 0588/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 42e9f514c..659d18644 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -613,6 +613,8 @@ double LP_getestimatedrate(struct iguana_info *coin) if ( rate < 0.00000020 ) rate = 0.00000020; rate *= 1.25; + if ( coin->electrum != 0 ) + rate *= 1.25; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); //if ( (rand() % 10) == 0 ) From 89357303686ff55192ca5ac73c5b274a3aafbc8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 17:50:48 +0200 Subject: [PATCH 0589/2732] Test --- iguana/exchanges/LP_ordermatch.c | 10 ++++++---- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 754617a84..98a921117 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -39,7 +39,7 @@ void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) { *txfeep = LP_txfeecalc(LP_coinfind(base),0); *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0); - printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); + //printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); } double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) @@ -458,7 +458,9 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee),relvolume,price); - return(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee); + if ( relvolume > dstr(desttxfee) ) + return(SATOSHIDEN * ((relvolume - dstr(desttxfee)) / price)); + else return(0); } struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,int32_t avoidflag,uint64_t desttxfee) @@ -476,7 +478,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre printf("%.8f ",dstr(utxos[i]->U.value)); printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); } - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) + if ( targetval != 0 && (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { up = utxos[mini]; utxos[mini] = 0; @@ -959,7 +961,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); - if ( (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,0,desttxfee)) != 0 ) + if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,0,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 659d18644..837294e64 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -617,7 +617,7 @@ double LP_getestimatedrate(struct iguana_info *coin) rate *= 1.25; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); - //if ( (rand() % 10) == 0 ) + if ( (rand() % 10) == 0 ) printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate); } free(retstr); From d1da4d74462bf294b52434e6e711ed2f3de0d89b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:04:47 +0200 Subject: [PATCH 0590/2732] Test --- iguana/exchanges/LP_transaction.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index f93374066..3d4e00068 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -27,7 +27,7 @@ int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid) txid = jbits256(txobj,"txid"); if ( jobj(txobj,"error") == 0 && bits256_cmp(txid,expectedtxid) == 0 ) { - char str[65]; printf("%s already in gettx (%s)\n",bits256_str(str,txid),jprint(txobj,0)); + //char str[65]; printf("%s already in gettx (%s)\n",bits256_str(str,txid),jprint(txobj,0)); flag = 1; } free_json(txobj); @@ -545,7 +545,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { - char *rawtxbytes=0,*signedtx=0,tmpaddr[64],hexstr[999],wifstr[128],txdestaddr[64],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*item,*privkeys; int32_t completed,spendlen,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value,change = 0; struct iguana_msgtx msgtx; + char *rawtxbytes=0,*signedtx=0,tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*vin,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; *destamountp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); if ( finalseqid == 0 ) @@ -554,12 +554,24 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch if ( redeemlen < 0 ) return(0); #ifndef BASILISK_DISABLESENDTX - if ( (value= LP_txvalue(txdestaddr,symbol,utxotxid,vout)) == 0 ) + if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) { - char str[65]; - printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); - return(0); + if ( (vins= jarray(&n,txobj,"vin")) != 0 && vout < n ) + { + vin = jitem(vins,vout); + value = LP_value_extract(vin,1); + } + free_json(txobj); } + /*if ( coin->electrum == 0 ) + { + if ( (value= LP_txvalue(txdestaddr,symbol,utxotxid,vout)) == 0 ) + { + char str[65]; + printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); + return(0); + } + }*/ #else value = satoshis; #endif From ebd43ac9121b9c53dec9527ad411eec63107db17 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:08:58 +0200 Subject: [PATCH 0591/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 4 +++- iguana/exchanges/LP_socket.c | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6063e22f0..20ee19193 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -312,6 +312,7 @@ uint16_t LP_randpeer(char *destip); int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid); +double LP_getestimatedrate(struct iguana_info *coin); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3b5c8a8d7..ef54689e0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -470,6 +470,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; } coin->lastscanht++; + LP_getestimatedrate(coin); break; } if ( (counter % 6000) == 60 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 98a921117..4ef246c55 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,7 +25,9 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { - if ( txfee == 0 && (txfee= LP_getestimatedrate(coin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( coin->rate == 0. ) + coin->rate = LP_getestimatedrate(coin); + if ( txfee == 0 && (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } else txfee = coin->txfee; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6682a782d..f7a7c5c5d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -685,6 +685,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) for (i=0; isymbol)); } /*else if ( strcmp(method,"blockchain.address.subscribe") == 0 ) never is called { From 52b6672cc4c77e0937192f01e35f4dab3eba801c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:20:17 +0200 Subject: [PATCH 0592/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ef54689e0..1d93e3540 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -361,6 +361,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; + if ( coin->rate == 0. ) + LP_getestimatedrate(coin); if ( (rand() % 1000) == 0 ) { post = 0; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4ef246c55..9dc4c0eaa 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -460,7 +460,7 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee),relvolume,price); - if ( relvolume > dstr(desttxfee) ) + if ( relvolume > dstr(desttxfee) && price > SMALLVAL ) return(SATOSHIDEN * ((relvolume - dstr(desttxfee)) / price)); else return(0); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 837294e64..90a40581f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -617,8 +617,7 @@ double LP_getestimatedrate(struct iguana_info *coin) rate *= 1.25; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); - if ( (rand() % 10) == 0 ) - printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate); + printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate); } free(retstr); } From a021fe94e1bde282d41c5f7828667d447520f81d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:21:23 +0200 Subject: [PATCH 0593/2732] Test --- iguana/exchanges/LP_coins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 6898e1ad3..dc682216b 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -296,6 +296,8 @@ int32_t LP_isdisabled(char *base,char *rel) struct iguana_info *LP_coinfind(char *symbol) { struct iguana_info *coin,cdata; int32_t isinactive,isPoS,longestchain = 1; uint16_t port,busport; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name,*assetname; + if ( symbol == 0 || symbol[0] == 0 ) + return(0); if ( (coin= LP_coinsearch(symbol)) != 0 ) return(coin); if ( (port= LP_rpcport(symbol)) == 0 ) From 7d6f51823147b01b98538c84919f53d5626e4763 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:34:03 +0200 Subject: [PATCH 0594/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 6 +++++- iguana/exchanges/LP_rpc.c | 10 ++++++++-- iguana/exchanges/LP_socket.c | 5 +++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 20ee19193..06d16ad6f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -182,7 +182,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; + uint32_t updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1d93e3540..b5b0008d4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -361,8 +361,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; - if ( coin->rate == 0. ) + if ( coin->updaterate != 0 || (coin->electrum == 0 && coin->rate == 0.) ) + { LP_getestimatedrate(coin); + if ( coin->rate != 0 ) + coin->updaterate = 0; + } if ( (rand() % 1000) == 0 ) { post = 0; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 90a40581f..cb660ef9d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -597,7 +597,7 @@ int32_t LP_importaddress(char *symbol,char *address) double LP_getestimatedrate(struct iguana_info *coin) { - char buf[512],*retstr; double rate = 0.00000020; + char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; if ( coin == 0 ) return(0.0001); if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) @@ -607,7 +607,13 @@ double LP_getestimatedrate(struct iguana_info *coin) sprintf(buf,"[%d]",6); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { - if ( retstr[0] != '-' ) + if ( (errjson= cJSON_Parse(retstr)) != 0 ) + { + if ( jobj(errjson,"error") != 0 ) + rate = 0.; + free_json(errjson); + } + else if ( retstr[0] != '-' ) { rate = atof(retstr) / 1024.; if ( rate < 0.00000020 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f7a7c5c5d..cd8def659 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -669,7 +669,7 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct queueitem *tmp,*item = 0; + cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { @@ -685,7 +685,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) for (i=0; isymbol)); + if ( (coin= LP_coinfind(ep->symbol)) != 0 ) + coin->updaterate = (uint32_t)time(NULL); } /*else if ( strcmp(method,"blockchain.address.subscribe") == 0 ) never is called { From 862800577406eaac5ba5d0971d0df7c58e98c474 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:39:17 +0200 Subject: [PATCH 0595/2732] Test --- iguana/exchanges/LP_coins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index dc682216b..f9ae0c9a8 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -261,6 +261,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset memset(coin,0,sizeof(*coin)); safecopy(coin->symbol,symbol,sizeof(coin->symbol)); sprintf(coin->serverport,"127.0.0.1:%u",port); + coin->updaterate = (uint32_t)time(NULL); coin->isPoS = isPoS; coin->taddr = taddr; coin->wiftaddr = wiftaddr; From dbfc5f0d58d6210cad05e41efa7ed91d2f2429b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:42:42 +0200 Subject: [PATCH 0596/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cd8def659..94f689a22 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -685,8 +685,6 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) for (i=0; isymbol)) != 0 ) - coin->updaterate = (uint32_t)time(NULL); } /*else if ( strcmp(method,"blockchain.address.subscribe") == 0 ) never is called { @@ -700,6 +698,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { *(ep->heightp) = height; *(ep->heighttimep) = (uint32_t)time(NULL); + if ( (coin= LP_coinfind(ep->symbol)) != 0 ) + coin->updaterate = (uint32_t)time(NULL); printf("%s ELECTRUM >>>>>>>>> set height.%d\n",ep->symbol,height); } } From 6e6c18bc41dc4b4e40d2e81208eb389254b9448d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:46:48 +0200 Subject: [PATCH 0597/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b5b0008d4..194f0f9b7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -363,6 +363,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; if ( coin->updaterate != 0 || (coin->electrum == 0 && coin->rate == 0.) ) { + printf("issue LP_getestimatedrate(%s)\n",coin->symbol); LP_getestimatedrate(coin); if ( coin->rate != 0 ) coin->updaterate = 0; From 0b14d95f8783fd3d878a9096f5119fd222b0877f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:49:45 +0200 Subject: [PATCH 0598/2732] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cb660ef9d..33b7ea020 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -600,9 +600,9 @@ double LP_getestimatedrate(struct iguana_info *coin) char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; if ( coin == 0 ) return(0.0001); - if ( (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) + if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime+13 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime ) { sprintf(buf,"[%d]",6); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) @@ -623,8 +623,8 @@ double LP_getestimatedrate(struct iguana_info *coin) rate *= 1.25; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); - printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate); } + printf("estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->symbol,retstr,rate,coin->rate); free(retstr); } } else rate = coin->rate; From 908c3918d9e371e87bffaf34c17edacf5b71d9e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 18:57:17 +0200 Subject: [PATCH 0599/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 194f0f9b7..b5b0008d4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -363,7 +363,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; if ( coin->updaterate != 0 || (coin->electrum == 0 && coin->rate == 0.) ) { - printf("issue LP_getestimatedrate(%s)\n",coin->symbol); LP_getestimatedrate(coin); if ( coin->rate != 0 ) coin->updaterate = 0; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 33b7ea020..b5f510c92 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -607,7 +607,7 @@ double LP_getestimatedrate(struct iguana_info *coin) sprintf(buf,"[%d]",6); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { - if ( (errjson= cJSON_Parse(retstr)) != 0 ) + if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) { if ( jobj(errjson,"error") != 0 ) rate = 0.; From 93f5168424af545c67a5bfcab7361310492f3eef Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 19:03:15 +0200 Subject: [PATCH 0600/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b5f510c92..d74288e4c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -604,7 +604,7 @@ double LP_getestimatedrate(struct iguana_info *coin) { if ( coin->rate == 0. || time(NULL) > coin->ratetime ) { - sprintf(buf,"[%d]",6); + sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) @@ -623,8 +623,8 @@ double LP_getestimatedrate(struct iguana_info *coin) rate *= 1.25; coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); + printf("estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->symbol,retstr,rate,coin->rate); } - printf("estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->symbol,retstr,rate,coin->rate); free(retstr); } } else rate = coin->rate; From 5114c52c2c41df024edbafc4ef95e2b426003566 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 19:07:47 +0200 Subject: [PATCH 0601/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9dc4c0eaa..a55526eb4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -835,7 +835,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { bits256 zero; memset(&zero,0,sizeof(zero)); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg);//butxo->S.otherpubkey,msg); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(2); From 8eba304588a91cf902d04b8363352f7b580d19a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 19:21:58 +0200 Subject: [PATCH 0602/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d74288e4c..9fded7317 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime ) + if ( strcmp(coin->symbol,"BTC") == 0 || coin->rate == 0. || time(NULL) > coin->ratetime ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) From a23e3b58b891afd539b9e65d082c0f7bf44cdb36 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 19:25:47 +0200 Subject: [PATCH 0603/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a55526eb4..cbcd0f851 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,7 +25,7 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { - if ( coin->rate == 0. ) + //if ( coin->rate == 0. ) coin->rate = LP_getestimatedrate(coin); if ( txfee == 0 && (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; @@ -41,7 +41,7 @@ void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) { *txfeep = LP_txfeecalc(LP_coinfind(base),0); *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0); - //printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); + printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); } double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) From a1bd02aacdfb6665ddcb057e4edf96c21719e24e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 19:33:30 +0200 Subject: [PATCH 0604/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cbcd0f851..36a1b9fac 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -129,7 +129,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) jadd64bits(retjson,"destsatoshis",qp->destsatoshis); if ( qp->satoshis != 0 ) { - price = (double)qp->destsatoshis / qp->satoshis; + price = (double)(qp->destsatoshis-qp->desttxfee) / (qp->satoshis - qp->txfee); jaddnum(retjson,"price",price); } } @@ -205,7 +205,7 @@ char *LP_quotereceived(cJSON *argjson) { struct LP_cacheinfo *ptr; double price; struct LP_quoteinfo Q; LP_quoteparse(&Q,argjson); - price = (double)Q.destsatoshis / Q.satoshis; + price = (double)(Q.destsatoshis-Q.desttxfee) / (Q.satoshis - Q.txfee); if ( (ptr= LP_cacheadd(Q.srccoin,Q.destcoin,Q.txid,Q.vout,price,&Q)) != 0 ) { ptr->Q = Q; @@ -305,7 +305,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-33); } if ( qp->satoshis != 0 ) - qprice = ((double)qp->destsatoshis / qp->satoshis); + qprice = ((double)(qp->destsatoshis-qp->desttxfee) / (qp->satoshis-qp->txfee)); LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); if ( txfee < qp->txfee ) txfee = qp->txfee; @@ -461,7 +461,7 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d { printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee),relvolume,price); if ( relvolume > dstr(desttxfee) && price > SMALLVAL ) - return(SATOSHIDEN * ((relvolume - dstr(desttxfee)) / price)); + return(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + txfee); else return(0); } From 8b6574434986e16fe4cdb42c5e0bf17884987f10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 19:58:59 +0200 Subject: [PATCH 0605/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_transaction.c | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9fded7317..a1f10e9d7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. ) { - if ( strcmp(coin->symbol,"BTC") == 0 || coin->rate == 0. || time(NULL) > coin->ratetime ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3d4e00068..1f2deff8a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -545,7 +545,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { - char *rawtxbytes=0,*signedtx=0,tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*vin,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; + char *rawtxbytes=0,*signedtx=0,tmpaddr[64],txdestaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*item,*privkeys; int32_t completed,spendlen,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; *destamountp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); if ( finalseqid == 0 ) @@ -554,24 +554,24 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch if ( redeemlen < 0 ) return(0); #ifndef BASILISK_DISABLESENDTX - if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) + if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { - if ( (vins= jarray(&n,txobj,"vin")) != 0 && vout < n ) + if ( (value= LP_txvalue(txdestaddr,symbol,utxotxid,vout)) == 0 ) { - vin = jitem(vins,vout); - value = LP_value_extract(vin,1); + char str[65]; + printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); + return(0); } - free_json(txobj); - } - /*if ( coin->electrum == 0 ) - { - if ( (value= LP_txvalue(txdestaddr,symbol,utxotxid,vout)) == 0 ) - { - char str[65]; - printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); - return(0); + /*if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) + { + if ( (vins= jarray(&n,txobj,"vin")) != 0 && vout < n ) + { + vin = jitem(vins,vout); + value = LP_value_extract(vin,1); + } + free_json(txobj); + }*/ } - }*/ #else value = satoshis; #endif From a7a17853b8b7f450c8580644797039ed74db8aae Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:08:07 +0200 Subject: [PATCH 0606/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a1f10e9d7..96a9b4747 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. ) { - if ( coin->rate == 0. || time(NULL) > coin->ratetime+60 ) + if ( coin->rate == 0. || (strcmp(coin->symbol,"BTC") == 0 && coin->txfee == 10000) || time(NULL) > coin->ratetime+60 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) From ceb2583e1cc179fcf19f083fb6c3a5c906b658ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:10:21 +0200 Subject: [PATCH 0607/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 36a1b9fac..70d3f4f97 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,12 +25,11 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { - //if ( coin->rate == 0. ) + if ( coin->rate == 0. || txfee < LP_MIN_TXFEE ) coin->rate = LP_getestimatedrate(coin); if ( txfee == 0 && (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; - } - else txfee = coin->txfee; + } else txfee = coin->txfee; if ( txfee < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } From fb983df693e0bb5fa80e58c71243f600429fea94 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:14:49 +0200 Subject: [PATCH 0608/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 96a9b4747..703e4b40d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,7 +602,7 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. ) { - if ( coin->rate == 0. || (strcmp(coin->symbol,"BTC") == 0 && coin->txfee == 10000) || time(NULL) > coin->ratetime+60 ) + if ( coin->rate == 0. || (strcmp(coin->symbol,"BTC") == 0 && coin->txfee == 10000) || time(NULL) > coin->ratetime+6 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) From a06f8a32aa4417201e7750ffd01e68d185ce53c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:20:59 +0200 Subject: [PATCH 0609/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +-- iguana/exchanges/LP_rpc.c | 64 ++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 70d3f4f97..6ecf8a7c6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,9 +25,8 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { - if ( coin->rate == 0. || txfee < LP_MIN_TXFEE ) - coin->rate = LP_getestimatedrate(coin); - if ( txfee == 0 && (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) + coin->rate = _LP_getestimatedrate(coin); + if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } else txfee = coin->txfee; if ( txfee < LP_MIN_TXFEE ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 703e4b40d..b0c4866c1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -595,39 +595,47 @@ int32_t LP_importaddress(char *symbol,char *address) } } -double LP_getestimatedrate(struct iguana_info *coin) +double _LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; + sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); + if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) + { + if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) + { + if ( jobj(errjson,"error") != 0 ) + rate = 0.; + free_json(errjson); + } + else if ( retstr[0] != '-' ) + { + rate = atof(retstr) / 1024.; + if ( rate < 0.00000020 ) + rate = 0.00000020; + rate *= 1.25; + if ( coin->electrum != 0 ) + rate *= 1.25; + coin->rate = rate; + coin->ratetime = (uint32_t)time(NULL); + printf("estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->symbol,retstr,rate,coin->rate); + } + free(retstr); + } + return(rate); +} + +double LP_getestimatedrate(struct iguana_info *coin) +{ + double rate = 0.00000020; if ( coin == 0 ) return(0.0001); - if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. ) + if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { - if ( coin->rate == 0. || (strcmp(coin->symbol,"BTC") == 0 && coin->txfee == 10000) || time(NULL) > coin->ratetime+6 ) - { - sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); - if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) - { - if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) - { - if ( jobj(errjson,"error") != 0 ) - rate = 0.; - free_json(errjson); - } - else if ( retstr[0] != '-' ) - { - rate = atof(retstr) / 1024.; - if ( rate < 0.00000020 ) - rate = 0.00000020; - rate *= 1.25; - if ( coin->electrum != 0 ) - rate *= 1.25; - coin->rate = rate; - coin->ratetime = (uint32_t)time(NULL); - printf("estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->symbol,retstr,rate,coin->rate); - } - free(retstr); - } - } else rate = coin->rate; + if ( coin->rate == 0. || (strcmp(coin->symbol,"BTC") == 0 && coin->txfee == 10000) ) + rate = _LP_getestimatedrate(coin); + else rate = coin->rate; + if ( rate != 0. ) + coin->txfee = (coin->rate * LP_AVETXSIZE); } else return((double)coin->txfee / LP_AVETXSIZE); return(SATOSHIDEN * rate); } From fde15b1521f4f66c4e58053d6ff68793d73d0d80 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:26:38 +0200 Subject: [PATCH 0610/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6ecf8a7c6..9458d1eff 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,9 +25,13 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { - coin->rate = _LP_getestimatedrate(coin); + coin->rate = LP_getestimatedrate(coin); if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) - txfee = LP_MIN_TXFEE; + { + coin->rate = _LP_getestimatedrate(coin); + if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) + txfee = LP_MIN_TXFEE; + } } else txfee = coin->txfee; if ( txfee < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; From c2f8bb5e6568d81d989d86c1be01ae1970eba26e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:37:42 +0200 Subject: [PATCH 0611/2732] Test --- iguana/exchanges/LP_rpc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b0c4866c1..7508dda6e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -631,12 +631,10 @@ double LP_getestimatedrate(struct iguana_info *coin) return(0.0001); if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { - if ( coin->rate == 0. || (strcmp(coin->symbol,"BTC") == 0 && coin->txfee == 10000) ) - rate = _LP_getestimatedrate(coin); - else rate = coin->rate; + rate = _LP_getestimatedrate(coin); if ( rate != 0. ) - coin->txfee = (coin->rate * LP_AVETXSIZE); - } else return((double)coin->txfee / LP_AVETXSIZE); + coin->txfee = SATOSHIDEN * (coin->rate * LP_AVETXSIZE); + } else return((double)coin->txfee / (LP_AVETXSIZE * SATOSHIDEN)); return(SATOSHIDEN * rate); } From c9916394e0ae34eba97c1d808ec3648f7f4afeb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:41:32 +0200 Subject: [PATCH 0612/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9458d1eff..a40924bd1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,6 +25,7 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { + coin->rate = 0.; coin->rate = LP_getestimatedrate(coin); if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7508dda6e..71629c0d6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -629,7 +629,7 @@ double LP_getestimatedrate(struct iguana_info *coin) double rate = 0.00000020; if ( coin == 0 ) return(0.0001); - if ( strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+60 ) + if ( coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+60 ) { rate = _LP_getestimatedrate(coin); if ( rate != 0. ) From 62329e286674876edf4c8b1e48d6c0a182e68bf5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:45:39 +0200 Subject: [PATCH 0613/2732] Test --- iguana/exchanges/LP_transaction.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 1f2deff8a..8b7644211 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -553,6 +553,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch //printf("bobtxspend.%s redeem.[%d]\n",symbol,redeemlen); if ( redeemlen < 0 ) return(0); + value = satoshis; #ifndef BASILISK_DISABLESENDTX if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { @@ -572,8 +573,6 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch free_json(txobj); }*/ } -#else - value = satoshis; #endif if ( satoshis != 0 ) { From 1fe35f02143cdec784099619a0a54aa8c162b269 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:46:43 +0200 Subject: [PATCH 0614/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 71629c0d6..ba7febf73 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -616,8 +616,8 @@ double _LP_getestimatedrate(struct iguana_info *coin) if ( coin->electrum != 0 ) rate *= 1.25; coin->rate = rate; + printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); coin->ratetime = (uint32_t)time(NULL); - printf("estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->symbol,retstr,rate,coin->rate); } free(retstr); } From f10cbf5eeab475b34a695a6288a63c893f8f7ca5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:49:10 +0200 Subject: [PATCH 0615/2732] Test --- iguana/exchanges/LP_rpc.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index ba7febf73..e5c1cad47 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -598,28 +598,31 @@ int32_t LP_importaddress(char *symbol,char *address) double _LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; - sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); - if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) + if ( coin->rate == 0. || time(NULL) > time(NULL) > coin->ratetime+6 ) { - if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) + sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); + if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { - if ( jobj(errjson,"error") != 0 ) - rate = 0.; - free_json(errjson); - } - else if ( retstr[0] != '-' ) - { - rate = atof(retstr) / 1024.; - if ( rate < 0.00000020 ) - rate = 0.00000020; - rate *= 1.25; - if ( coin->electrum != 0 ) + if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) + { + if ( jobj(errjson,"error") != 0 ) + rate = 0.; + free_json(errjson); + } + else if ( retstr[0] != '-' ) + { + rate = atof(retstr) / 1024.; + if ( rate < 0.00000020 ) + rate = 0.00000020; rate *= 1.25; - coin->rate = rate; - printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); - coin->ratetime = (uint32_t)time(NULL); + if ( coin->electrum != 0 ) + rate *= 1.25; + coin->rate = rate; + printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); + coin->ratetime = (uint32_t)time(NULL); + } + free(retstr); } - free(retstr); } return(rate); } From 03ac83100955c31025e2e6fdceeae20aea89dcee Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:50:05 +0200 Subject: [PATCH 0616/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e5c1cad47..e614cbc49 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -598,7 +598,7 @@ int32_t LP_importaddress(char *symbol,char *address) double _LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; - if ( coin->rate == 0. || time(NULL) > time(NULL) > coin->ratetime+6 ) + if ( coin->rate == 0. || time(NULL) > time(NULL) > coin->ratetime+30 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) @@ -632,7 +632,7 @@ double LP_getestimatedrate(struct iguana_info *coin) double rate = 0.00000020; if ( coin == 0 ) return(0.0001); - if ( coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+60 ) + if ( coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+600 ) { rate = _LP_getestimatedrate(coin); if ( rate != 0. ) From c2392cc4278cf073b032275a406ca6c04a56fe3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:55:13 +0200 Subject: [PATCH 0617/2732] Test --- iguana/exchanges/electrum.kmd3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/electrum.kmd3 b/iguana/exchanges/electrum.kmd3 index 449658cac..275990eef 100755 --- a/iguana/exchanges/electrum.kmd3 +++ b/iguana/exchanges/electrum.kmd3 @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140 \",\"port\":8777}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140 \",\"port\":50011}" From 2e997c5beda10a679e960530fe57ee00f5d3a6f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:58:24 +0200 Subject: [PATCH 0618/2732] Test --- iguana/exchanges/electrum.kmd3 | 2 +- iguana/exchanges/electrums | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/electrums diff --git a/iguana/exchanges/electrum.kmd3 b/iguana/exchanges/electrum.kmd3 index 275990eef..5fb7a6b9a 100755 --- a/iguana/exchanges/electrum.kmd3 +++ b/iguana/exchanges/electrum.kmd3 @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140 \",\"port\":50011}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140\",\"port\":50011}" diff --git a/iguana/exchanges/electrums b/iguana/exchanges/electrums new file mode 100755 index 000000000..5e4db6c70 --- /dev/null +++ b/iguana/exchanges/electrums @@ -0,0 +1,36 @@ +ource userpass + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"ARG\",\"ipaddr\":\"173.212.225.176\",\"port\":50081}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"136.243.45.140\",\"port\":50001}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"173.212.225.176\",\"port\":50001}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CRW\",\"ipaddr\":\"173.212.225.176\",\"port\":50041}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"DASH\",\"ipaddr\":\"173.212.225.176\",\"port\":50098}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"DGB\",\"ipaddr\":\"136.243.45.140\",\"port\":50022}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"DGB\",\"ipaddr\":\"173.212.225.176\",\"port\":50022}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"DOGE\",\"ipaddr\":\"173.212.225.176\",\"port\":50015}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"FAIR\",\"ipaddr\":\"173.212.225.176\",\"port\":50005}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"HUSH\",\"ipaddr\":\"173.212.225.176\",\"port\":50013}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140\",\"port\":50011}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"173.212.225.176\",\"port\":50011}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"LTC\",\"ipaddr\":\"173.212.225.176\",\"port\":50012}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"MONA\",\"ipaddr\":\"173.212.225.176\",\"port\":50002}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"NMC\",\"ipaddr\":\"173.212.225.176\",\"port\":50036}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"VTC\",\"ipaddr\":\"173.212.225.176\",\"port\":50088}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"ZEC\",\"ipaddr\":\"173.212.225.176\",\"port\":50032}" + From e01a090b6e13b5b4d2342639ab02a18a4ee83d10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 20:59:34 +0200 Subject: [PATCH 0619/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a40924bd1..cbbd17e38 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -25,10 +25,10 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) { if ( strcmp(coin->symbol,"BTC") == 0 ) { - coin->rate = 0.; coin->rate = LP_getestimatedrate(coin); if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) { + coin->rate = 0.; coin->rate = _LP_getestimatedrate(coin); if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e614cbc49..cd4fc2366 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -598,7 +598,7 @@ int32_t LP_importaddress(char *symbol,char *address) double _LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; - if ( coin->rate == 0. || time(NULL) > time(NULL) > coin->ratetime+30 ) + if ( coin->rate == 0. || time(NULL) > coin->ratetime+30 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) From b457d7737d865ecf71e3265cff0bbfb417138bf0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:01:37 +0200 Subject: [PATCH 0620/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b5b0008d4..7847460ff 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -361,12 +361,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; - if ( coin->updaterate != 0 || (coin->electrum == 0 && coin->rate == 0.) ) + /*if ( coin->updaterate != 0 || (coin->electrum == 0 && coin->rate == 0.) ) { LP_getestimatedrate(coin); if ( coin->rate != 0 ) coin->updaterate = 0; - } + }*/ if ( (rand() % 1000) == 0 ) { post = 0; From dae7e62c99ae4ee96a95767d5ed11c5e2cb4019b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:02:41 +0200 Subject: [PATCH 0621/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cd4fc2366..63b8a02b1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -617,8 +617,8 @@ double _LP_getestimatedrate(struct iguana_info *coin) rate *= 1.25; if ( coin->electrum != 0 ) rate *= 1.25; - coin->rate = rate; printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); + coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); } free(retstr); From 40a013fe43494b3dbc2ca06aa2f0a6ceb0a40b65 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:09:18 +0200 Subject: [PATCH 0622/2732] Test --- iguana/exchanges/LP_rpc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 63b8a02b1..d1b0d5b3c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -598,7 +598,7 @@ int32_t LP_importaddress(char *symbol,char *address) double _LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; - if ( coin->rate == 0. || time(NULL) > coin->ratetime+30 ) + if ( time(NULL) > coin->ratetime+30 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) @@ -623,7 +623,7 @@ double _LP_getestimatedrate(struct iguana_info *coin) } free(retstr); } - } + } else rate = coin->rate; return(rate); } @@ -632,12 +632,9 @@ double LP_getestimatedrate(struct iguana_info *coin) double rate = 0.00000020; if ( coin == 0 ) return(0.0001); - if ( coin->txfee == 0 || coin->rate == 0. || time(NULL) > coin->ratetime+600 ) - { - rate = _LP_getestimatedrate(coin); - if ( rate != 0. ) - coin->txfee = SATOSHIDEN * (coin->rate * LP_AVETXSIZE); - } else return((double)coin->txfee / (LP_AVETXSIZE * SATOSHIDEN)); + if ( (rate= _LP_getestimatedrate(coin)) != 0. ) + coin->txfee = LP_AVETXSIZE * (coin->rate * SATOSHIDEN); + else rate = dstr(coin->txfee) / LP_AVETXSIZE; return(SATOSHIDEN * rate); } From e9113f5897a07c23d74cda079ffe314e7e871288 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:11:48 +0200 Subject: [PATCH 0623/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cbbd17e38..70f49c12a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -26,11 +26,11 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) if ( strcmp(coin->symbol,"BTC") == 0 ) { coin->rate = LP_getestimatedrate(coin); - if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( (txfee= coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) { coin->rate = 0.; coin->rate = _LP_getestimatedrate(coin); - if ( (txfee= coin->rate * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( (txfee= coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } } else txfee = coin->txfee; From 52690233a3cab3a9ca5909dbe38a4d7a5f31a3cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:15:44 +0200 Subject: [PATCH 0624/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_rpc.c | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 70f49c12a..06ca2e6a0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -26,11 +26,11 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) if ( strcmp(coin->symbol,"BTC") == 0 ) { coin->rate = LP_getestimatedrate(coin); - if ( (txfee= coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) + if ( (txfee= SATOSHIDEN * coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) { - coin->rate = 0.; + coin->rate = -1.; coin->rate = _LP_getestimatedrate(coin); - if ( (txfee= coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) + if ( (txfee= SATOSHIDEN * coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } } else txfee = coin->txfee; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d1b0d5b3c..f7b065506 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -598,7 +598,7 @@ int32_t LP_importaddress(char *symbol,char *address) double _LP_getestimatedrate(struct iguana_info *coin) { char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; - if ( time(NULL) > coin->ratetime+30 ) + if ( coin->rate < 0. || time(NULL) > coin->ratetime+30 ) { sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) @@ -631,11 +631,10 @@ double LP_getestimatedrate(struct iguana_info *coin) { double rate = 0.00000020; if ( coin == 0 ) - return(0.0001); - if ( (rate= _LP_getestimatedrate(coin)) != 0. ) - coin->txfee = LP_AVETXSIZE * (coin->rate * SATOSHIDEN); - else rate = dstr(coin->txfee) / LP_AVETXSIZE; - return(SATOSHIDEN * rate); + return(rate); + if ( (rate= _LP_getestimatedrate(coin)) <= 0. ) + rate = dstr(coin->txfee) / LP_AVETXSIZE; + return(rate); } char *LP_sendrawtransaction(char *symbol,char *signedtx) From 4d5f6abce573d0b2833573c0064a5e5f29bf2087 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:17:58 +0200 Subject: [PATCH 0625/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 06ca2e6a0..bd3269ec2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -837,8 +837,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { bits256 zero; - memset(&zero,0,sizeof(zero)); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(2); From 484dbbd3f9daf601c2f88e56133283a4c0a5a19d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:23:49 +0200 Subject: [PATCH 0626/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bd3269ec2..9afd05a61 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -836,10 +836,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { - bits256 zero; - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + bits256 zero; char *msg2; memset(&zero,0,sizeof(zero)); + msg2 = clonestr(msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(2); From e166758bda077913b47a005fbc5adfa119e19ad5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:39:00 +0200 Subject: [PATCH 0627/2732] Test --- iguana/exchanges/LP_transaction.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 8b7644211..467608907 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -545,7 +545,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { - char *rawtxbytes=0,*signedtx=0,tmpaddr[64],txdestaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*item,*privkeys; int32_t completed,spendlen,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],txdestaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*vin,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; *destamountp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); if ( finalseqid == 0 ) @@ -555,24 +555,26 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch return(0); value = satoshis; #ifndef BASILISK_DISABLESENDTX - if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) + if ( (coin= LP_coinfind(symbol)) != 0 ) { - if ( (value= LP_txvalue(txdestaddr,symbol,utxotxid,vout)) == 0 ) - { - char str[65]; - printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); - return(0); - } - /*if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) + if ( coin->electrum == 0 ) + value = LP_txvalue(txdestaddr,symbol,utxotxid,vout); + else if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) { if ( (vins= jarray(&n,txobj,"vin")) != 0 && vout < n ) { vin = jitem(vins,vout); value = LP_value_extract(vin,1); - } + printf("value in vout.%d %.8f\n",vout,dstr(value)); + } else value = 0; free_json(txobj); - }*/ - } + } + if ( value == 0 ) + { + printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); + return(0); + } + } #endif if ( satoshis != 0 ) { From 5b98fe68cacbed8277c5082e6a16ec439c78dbc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:47:14 +0200 Subject: [PATCH 0628/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_transaction.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 6f453c9bc..fd33179f2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -157,7 +157,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - //else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); + else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -214,7 +214,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - //printf("Q sent %u msglen.%d\n",crc32,msglen); + printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); sock0 = -1; } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f7b065506..72a210cbb 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -262,7 +262,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(retjson,1); - if ( strlen(hexstr) > 10000 ) + if ( strlen(hexstr) > 20000 ) { static uint32_t counter; if ( counter++ < 3 ) @@ -316,7 +316,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { hexstr = jprint(hexobj,1); - if ( strlen(hexstr) > 10000 ) + if ( strlen(hexstr) > 20000 ) { static uint32_t counter; if ( counter++ < 3 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 467608907..75a9f7222 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -565,7 +565,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { vin = jitem(vins,vout); value = LP_value_extract(vin,1); - printf("value in vout.%d %.8f\n",vout,dstr(value)); + printf("value in vout.%d %.8f (%S)\n",vout,dstr(value),jprint(txobj,0)); } else value = 0; free_json(txobj); } From 3db83282ccdc3ecc311c997558df7d532780ac7f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:49:28 +0200 Subject: [PATCH 0629/2732] test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 75a9f7222..cc428bf40 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -565,7 +565,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { vin = jitem(vins,vout); value = LP_value_extract(vin,1); - printf("value in vout.%d %.8f (%S)\n",vout,dstr(value),jprint(txobj,0)); + printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0)); } else value = 0; free_json(txobj); } From 9619f0a129844528f79c650346cbd16980e74fe8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 21:52:28 +0200 Subject: [PATCH 0630/2732] Test --- iguana/exchanges/LP_transaction.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index cc428bf40..a08e73df7 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -545,7 +545,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { - char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],txdestaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*vin,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],txdestaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; *destamountp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); if ( finalseqid == 0 ) @@ -553,20 +553,18 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch //printf("bobtxspend.%s redeem.[%d]\n",symbol,redeemlen); if ( redeemlen < 0 ) return(0); - value = satoshis; + value = 0; #ifndef BASILISK_DISABLESENDTX if ( (coin= LP_coinfind(symbol)) != 0 ) { - if ( coin->electrum == 0 ) - value = LP_txvalue(txdestaddr,symbol,utxotxid,vout); - else if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) + if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) { - if ( (vins= jarray(&n,txobj,"vin")) != 0 && vout < n ) + if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n ) { - vin = jitem(vins,vout); - value = LP_value_extract(vin,1); - printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0)); - } else value = 0; + obj = jitem(vouts,vout); + value = LP_value_extract(obj,1); + //printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0)); + } free_json(txobj); } if ( value == 0 ) From 1a15fad37cd6379e13053fef7d76d8dbf568939d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 22:14:46 +0200 Subject: [PATCH 0631/2732] Test --- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/LP_transaction.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index de83c61dd..46c55141c 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -560,7 +560,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( recvlen != datalen+rawtx->I.redeemlen+75 ) printf("RECVLEN %d != %d + %d\n",recvlen,datalen,rawtx->I.redeemlen); txid = bits256_doublesha256(0,data,datalen); - //char str[65]; printf("rawtx.%s txid %s\n",rawtx->name,bits256_str(str,txid)); + char str[65]; printf("rawtx.%s txid %s\n",rawtx->name,bits256_str(str,txid)); if ( bits256_cmp(txid,rawtx->I.actualtxid) != 0 && bits256_nonz(rawtx->I.actualtxid) == 0 ) rawtx->I.actualtxid = txid; if ( (txobj= bitcoin_data2json(rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->coin->p2shtype,rawtx->coin->isPoS,height,&rawtx->I.signedtxid,&rawtx->msgtx,rawtx->extraspace,sizeof(rawtx->extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a08e73df7..ef8b778bc 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -545,7 +545,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { - char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],txdestaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; *destamountp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); if ( finalseqid == 0 ) @@ -1313,10 +1313,12 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->bobdeposit,0,data,datalen,0) == 0 ) { swap->aliceclaim.utxovout = 0; - swap->aliceclaim.utxotxid = swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,swap->bobcoin.symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); + swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,swap->bobcoin.symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); if ( bits256_nonz(swap->bobdeposit.I.signedtxid) != 0 ) swap->depositunconf = 1; + else swap->bobdeposit.I.signedtxid = swap->bobdeposit.I.actualtxid; len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + swap->aliceclaim.utxotxid = swap->bobdeposit.I.signedtxid; memcpy(swap->I.userdata_aliceclaim,userdata,len); swap->I.userdata_aliceclaimlen = len; bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); From 4284c3bb40ad3317580dd32bc4f2f9f38958fc0b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 22:30:07 +0200 Subject: [PATCH 0632/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7847460ff..5a2a4f37d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -241,6 +241,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { +printf("RECV.(%s)\n",(char *)ptr); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index fd33179f2..582c1f37a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -157,7 +157,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); + //else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -214,7 +214,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); + //printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); sock0 = -1; } } From ef616e37a2b1e43368ca7d90b7eff4f1644b9d8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 22:34:44 +0200 Subject: [PATCH 0633/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d65652d86..e8f41b51e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -//printf("stats_JSON(%s)\n",jprint(argjson,0)); +printf("stats_JSON(%s)\n",jprint(argjson,0)); method = jstr(argjson,"method"); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5a2a4f37d..b3c546f6c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -241,7 +241,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { -printf("RECV.(%s)\n",(char *)ptr); +//printf("RECV.(%s)\n",(char *)ptr); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); From d70d7f9104d05d0c4fe0dd832c2f8b38b298ebf6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 22:42:01 +0200 Subject: [PATCH 0634/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e8f41b51e..d65652d86 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -printf("stats_JSON(%s)\n",jprint(argjson,0)); +//printf("stats_JSON(%s)\n",jprint(argjson,0)); method = jstr(argjson,"method"); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b3c546f6c..051396535 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -368,7 +368,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->rate != 0 ) coin->updaterate = 0; }*/ - if ( (rand() % 1000) == 0 ) + if ( (rand() % 10000) == 0 ) { post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); @@ -700,7 +700,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) - usleep(1000000 / MAINLOOP_PERSEC); + usleep(100000); + else usleep(10000); } } From 5f628d87c55fc6cde3c156cb2daa36b0e94e3459 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 22:48:30 +0200 Subject: [PATCH 0635/2732] Test --- iguana/exchanges/LP_swap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 46c55141c..32d255a5b 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -720,7 +720,7 @@ void LP_bobloop(void *_swap) printf("error waiting for alicefee\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) == 0 ) printf("error sending bobdeposit\n"); - else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_alicepayment) < 0 ) + else if ( LP_waitfor(swap->N.pair,swap,1800,LP_verify_alicepayment) < 0 ) printf("error waiting for alicepayment\n"); else { @@ -775,7 +775,7 @@ void LP_aliceloop(void *_swap) LP_swapsfp_update(&swap->I.req); if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x80,data,maxlen,&swap->myfee,0x40,0) == 0 ) printf("error sending alicefee\n"); - else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_bobdeposit) < 0 ) + else if ( LP_waitfor(swap->N.pair,swap,1800,LP_verify_bobdeposit) < 0 ) printf("error waiting for bobdeposit\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x1000,data,maxlen,&swap->alicepayment,0x800,0) == 0 ) printf("error sending alicepayment\n"); @@ -790,7 +790,7 @@ void LP_aliceloop(void *_swap) sleep(10); } swap->sentflag = 1; - if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_bobpayment) < 0 ) + if ( LP_waitfor(swap->N.pair,swap,1800,LP_verify_bobpayment) < 0 ) printf("error waiting for bobpayment\n"); else { From 4c13862a4b300282cad5ca206a67ad38ab0d8535 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 22:57:52 +0200 Subject: [PATCH 0636/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_rpc.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 051396535..24f54eb05 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -700,8 +700,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) - usleep(100000); - else usleep(10000); + usleep(500000); + else usleep(50000); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 72a210cbb..633633af3 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -617,7 +617,8 @@ double _LP_getestimatedrate(struct iguana_info *coin) rate *= 1.25; if ( coin->electrum != 0 ) rate *= 1.25; - printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); + if ( fabs(rate - coin->rate) > SMALLVAL ) + printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); } From dd41578ec72f7331590729c18dc3889a23ae80fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 23:15:10 +0200 Subject: [PATCH 0637/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 24f54eb05..8f309c38d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -331,7 +331,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) + if ( now > peer->lastpeers+300 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 50000) == 0) ) { peer->lastpeers = now; if ( strcmp(peer->ipaddr,myipaddr) != 0 ) From b4cfb14154ceb80b66d953b9ae6e0b2f9e17a98f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 23:17:47 +0200 Subject: [PATCH 0638/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8f309c38d..6d8a97e03 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -331,7 +331,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+300 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 50000) == 0) ) + if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) { peer->lastpeers = now; if ( strcmp(peer->ipaddr,myipaddr) != 0 ) @@ -352,7 +352,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int peer->diduquery = now; } } - if ( (counter % 6000) == 10 ) + if ( (counter % 60000) == 10 ) { LP_privkey_updates(ctx,pubsock,0); } From bf903468b807fdef8ad99f602559985c3ecc7252 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 23:19:01 +0200 Subject: [PATCH 0639/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6d8a97e03..14210edbc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -352,7 +352,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int peer->diduquery = now; } } - if ( (counter % 60000) == 10 ) + if ( (counter % 6000) == 10 ) { LP_privkey_updates(ctx,pubsock,0); } @@ -368,7 +368,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->rate != 0 ) coin->updaterate = 0; }*/ - if ( (rand() % 10000) == 0 ) + if ( (rand() % 100000) == 0 ) { post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); From 50e34a7d7812fa08853e42e48649cfce94c727a7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 23:26:12 +0200 Subject: [PATCH 0640/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 14210edbc..24f54eb05 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -368,7 +368,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->rate != 0 ) coin->updaterate = 0; }*/ - if ( (rand() % 100000) == 0 ) + if ( (rand() % 10000) == 0 ) { post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); From 767d5b821eba1c05226b653c2c7f9f38e4687c3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 23:27:28 +0200 Subject: [PATCH 0641/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 57c56fdee..a0e96cd24 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -793,7 +793,7 @@ void LP_main(void *ptr) LP_profitratio += profitmargin; if ( (port= juint(argjson,"rpcport")) < 1000 ) port = LP_RPCPORT; - LPinit(port,LP_RPCPORT+1,LP_RPCPORT+2,LP_RPCPORT+3,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(port,LP_RPCPORT+10,LP_RPCPORT+20,LP_RPCPORT+30,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 894b27baa2da4fefe9895c7cbb853285f273961d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Sep 2017 23:30:13 +0200 Subject: [PATCH 0642/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index a0e96cd24..57c56fdee 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -793,7 +793,7 @@ void LP_main(void *ptr) LP_profitratio += profitmargin; if ( (port= juint(argjson,"rpcport")) < 1000 ) port = LP_RPCPORT; - LPinit(port,LP_RPCPORT+10,LP_RPCPORT+20,LP_RPCPORT+30,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(port,LP_RPCPORT+1,LP_RPCPORT+2,LP_RPCPORT+3,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 8b85d6cbffce92cf3d4ede6b42e434d25faee415 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Sep 2017 05:30:53 +0200 Subject: [PATCH 0643/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 24f54eb05..5e9743a67 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -700,8 +700,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) - usleep(500000); - else usleep(50000); + usleep(50000); + else usleep(5000); } } From ad0dc4a2dbf1bd9116a5715f9f8af807002809ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Sep 2017 05:34:18 +0200 Subject: [PATCH 0644/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9afd05a61..c0ad3b6b8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1015,7 +1015,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel LP_txfees(&txfee,&desttxfee,base,rel); memset(&_bestA,0,sizeof(_bestA)); memset(&_bestB,0,sizeof(_bestB)); - destsatoshis = SATOSHIDEN * relvolume + desttxfee; + destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); _bestA = *autxo; From 74269170dcd38e84cb0878c2b9abebb4ecd7184b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Sep 2017 05:39:23 +0200 Subject: [PATCH 0645/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c0ad3b6b8..032be2256 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -132,7 +132,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) jadd64bits(retjson,"destsatoshis",qp->destsatoshis); if ( qp->satoshis != 0 ) { - price = (double)(qp->destsatoshis-qp->desttxfee) / (qp->satoshis - qp->txfee); + price = (double)qp->destsatoshis / (qp->satoshis - qp->txfee); jaddnum(retjson,"price",price); } } @@ -208,7 +208,7 @@ char *LP_quotereceived(cJSON *argjson) { struct LP_cacheinfo *ptr; double price; struct LP_quoteinfo Q; LP_quoteparse(&Q,argjson); - price = (double)(Q.destsatoshis-Q.desttxfee) / (Q.satoshis - Q.txfee); + price = (double)Q.destsatoshis / (Q.satoshis - Q.txfee); if ( (ptr= LP_cacheadd(Q.srccoin,Q.destcoin,Q.txid,Q.vout,price,&Q)) != 0 ) { ptr->Q = Q; @@ -308,7 +308,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-33); } if ( qp->satoshis != 0 ) - qprice = ((double)(qp->destsatoshis-qp->desttxfee) / (qp->satoshis-qp->txfee)); + qprice = ((double)qp->destsatoshis / (qp->satoshis-qp->txfee)); LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); if ( txfee < qp->txfee ) txfee = qp->txfee; From 9c949cb15af020cdc72f7081b5ff42986a57cd1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Sep 2017 05:43:43 +0200 Subject: [PATCH 0646/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 032be2256..0fde80a5c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -462,9 +462,9 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { - printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee),relvolume,price); + printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); if ( relvolume > dstr(desttxfee) && price > SMALLVAL ) - return(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + txfee); + return(SATOSHIDEN * (relvolume / price) + txfee); else return(0); } From 714be722e1a06affe692259c52f008ce675ea045 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Sep 2017 18:24:47 +0200 Subject: [PATCH 0647/2732] Faster --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 22 ++++++++++++---------- iguana/exchanges/LP_transaction.c | 2 ++ iguana/exchanges/LP_utxo.c | 4 +++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 06d16ad6f..f3666f833 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -182,7 +182,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; + uint32_t lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5e9743a67..42664d9ea 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -326,24 +326,19 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (rand() % 10000) == 0 ) { peer->errors--; - peer->diduquery = 0; + if ( peer->errors < LP_MAXPEER_ERRORS ) + peer->diduquery = 0; } if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) + if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 1000) == 0) ) { peer->lastpeers = now; if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - LP_peer_pricesquery(peer); - if ( peer->needping != 0 ) - { - if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) - free(retstr); - peer->needping = 0; - } + peer->diduquery = 0; } } if ( peer->diduquery == 0 ) @@ -351,6 +346,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_peer_pricesquery(peer); peer->diduquery = now; } + if ( peer->needping != 0 ) + { + if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) + free(retstr); + peer->needping = 0; + } } if ( (counter % 6000) == 10 ) { @@ -368,8 +369,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->rate != 0 ) coin->updaterate = 0; }*/ - if ( (rand() % 10000) == 0 ) + if ( now > coin->lastutxos+60 || (rand() % 10000) == 0 ) { + coin->lastutxos = now; post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ef8b778bc..c05ae4613 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -566,6 +566,8 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch //printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0)); } free_json(txobj); + //if ( value != 0 ) + // gettxout } if ( value == 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ca6e6f352..04127b1bd 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -680,7 +680,9 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); + char str[65],str2[65]; + if ( val != 0 && val2 != 0 ) + printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); if ( val == 0 ) LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,-1,1); if ( val2 == 0 ) From 20547949fbf7f65ebee51f4758e84338dfe755ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 17:59:39 +0300 Subject: [PATCH 0648/2732] New unspent sync --- iguana/exchanges/LP_include.h | 4 +- iguana/exchanges/LP_nativeDEX.c | 180 ++++++++++++++++++-------------- iguana/exchanges/LP_prices.c | 47 +++++++-- iguana/exchanges/LP_utxo.c | 94 +++++++++++------ iguana/exchanges/LP_utxos.c | 1 + iguana/exchanges/electrums | 1 + 6 files changed, 209 insertions(+), 118 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f3666f833..6a7499747 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -226,8 +226,8 @@ struct LP_address { UT_hash_handle hh; struct LP_address_utxo *utxos; - int64_t balance; - uint32_t monitor; + int64_t balance,total; + uint32_t timestamp,n; char coinaddr[40]; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 42664d9ea..673f951bc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -60,7 +60,7 @@ struct LP_globals { struct LP_utxoinfo *LP_utxoinfos,*LP_utxoinfos2; bits256 LP_mypub25519,LP_mypriv25519; - uint8_t LP_myrmd160[20]; + uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; int32_t LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting; char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41]; @@ -309,10 +309,108 @@ void command_rpcloop(void *myipaddr) } } +int32_t LP_utxos_sync(struct LP_peerinfo *peer) +{ + int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; + HASH_ITER(hh,LP_coins,coin,ctmp) + { + if ( coin->inactive != 0 ) + continue; + total = 0; + LP_listunspent_both(coin->symbol,coin->smartaddr); + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) + { + total2 = 0; + if ( (array2= cJSON_Parse(retstr)) != 0 ) + { + if ( (m= cJSON_GetArraySize(array2)) > 0 ) + { + for (i=0; iipaddr,jprint(item,0)); + if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) + free(retstr2); + posted++; + } + } + if ( 1 && posted != 0 ) + printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + } //else printf("%s matches\n",peer->ipaddr); + free_json(array2); + } + free(retstr); + } + } + if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) + { + if ( (array2= cJSON_Parse(retstr)) != 0 ) + { + if ( (m= cJSON_GetArraySize(array2)) > 0 ) + { + for (j=0; jtotal,ap->n) != metric ) + { + if ( ap->n < (metric & 0xffff) ) + { + if ( (retstr2= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) + { + if ( (array3= cJSON_Parse(retstr2)) != 0 ) + { + LP_unspents_array(coin,coinaddr,array3); + printf("pulled.(%s)\n",retstr2); + free_json(array3); + } + free(retstr2); + } + } else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap->n,(uint16_t)metric); + } + } + } + } + free_json(array2); + } + } + } + return(posted); +} + int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *retstr,*retstr2,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0; + struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t height,nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -339,6 +437,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; + LP_utxos_sync(peer); } } if ( peer->diduquery == 0 ) @@ -359,88 +458,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height,i,j,n,m,v,post; bits256 zero,txid; cJSON *array,*item,*item2,*array2; uint64_t total,total2; memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; - /*if ( coin->updaterate != 0 || (coin->electrum == 0 && coin->rate == 0.) ) - { - LP_getestimatedrate(coin); - if ( coin->rate != 0 ) - coin->updaterate = 0; - }*/ - if ( now > coin->lastutxos+60 || (rand() % 10000) == 0 ) - { - coin->lastutxos = now; - post = 0; - LP_listunspent_both(coin->symbol,coin->smartaddr); - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) - { - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - total = 0; - for (i=0; isymbol,coin->smartaddr,dstr(total),n); - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( strcmp(peer->ipaddr,LP_myipaddr) != 0 && peer->errors < LP_MAXPEER_ERRORS ) - { - total2 = m = 0; - if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) - { - if ( (array2= cJSON_Parse(retstr)) != 0 ) - { - if ( (m= cJSON_GetArraySize(array2)) > 0 ) - { - for (i=0; iipaddr,jprint(item,0)); - if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) - free(retstr2); - post++; - } - } - if ( 0 && post != 0 ) - printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - } //else printf("%s matches\n",peer->ipaddr); - free_json(array2); - } - free(retstr); - } - } - } - } - free_json(array); - } - //if ( post > 0 ) - // LP_postutxos(coin->symbol,coin->smartaddr); - } if ( coin->electrum != 0 ) continue; - memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { if ( (height= LP_getheight(coin)) > coin->longestchain ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 33348e387..5b7dcfc5d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -52,7 +52,7 @@ struct LP_pubkeyinfo bits256 pubkey; double matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; uint32_t timestamp,istrusted,numerrors; - uint8_t rmd160[20]; + uint8_t rmd160[20],pubsecp[33]; } *LP_pubkeyinfos; int32_t LP_pricevalid(double price) @@ -144,7 +144,10 @@ struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) pubp = calloc(1,sizeof(*pubp)); pubp->pubkey = pubkey; if ( bits256_cmp(G.LP_mypub25519,pubkey) == 0 ) + { memcpy(pubp->rmd160,G.LP_myrmd160,sizeof(pubp->rmd160)); + memcpy(pubp->pubsecp,G.LP_pubsecp,sizeof(pubp->pubsecp)); + } HASH_ADD_KEYPTR(hh,LP_pubkeyinfos,&pubp->pubkey,sizeof(pubp->pubkey),pubp); portable_mutex_unlock(&LP_pubkeymutex); if ( (pubp= LP_pubkeyfind(pubkey)) == 0 ) @@ -172,11 +175,32 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) return(clonestr("{\"error\":\"pubkey not found\"}")); } +uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) +{ + cJSON *array,*item; int32_t i,n; uint64_t metric=0,total; + LP_listunspent_both(coin->symbol,coinaddr); + if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + total = 0; + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; itaddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + if ((metric= LP_unspents_metric(coin,coinaddr)) != 0 ) + jadd64bits(item,base,metric); + } + jaddi(unspents,item); } jaddbits256(obj,"pubkey",pubp->pubkey); init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); jaddstr(obj,"rmd160",hexstr); + init_hexbytes_noT(hexstr,pubp->pubsecp,sizeof(pubp->pubsecp)); + jaddstr(obj,"pubsecp",hexstr); jaddnum(obj,"timestamp",pubp->timestamp); jadd(obj,"asks",array); + jadd(obj,"unspents",unspents); if ( pubp->istrusted != 0 ) jaddnum(obj,"istrusted",pubp->istrusted); return(obj); @@ -216,7 +251,7 @@ char *LP_prices() void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { static uint8_t zeroes[20]; - struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid,mismatch; char *base,*rel,*hexstr; double askprice; uint32_t now; + struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid,mismatch; char *base,*rel,*hexstr,*pubsecpstr; double askprice; uint32_t now; now = (uint32_t)time(NULL); pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) @@ -229,13 +264,13 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) else mismatch = 0; if ( bits256_cmp(pubkey,G.LP_mypub25519) == 0 && mismatch == 0 ) peer->needping = 0; - if ( mismatch != 0 && memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) + if ( mismatch != 0 && memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 && (pubsecpstr= jstr(obj,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { for (i=0; i<20; i++) printf("%02x",pubp->rmd160[i]); - char str[65]; printf(" -> rmd160.(%s) for %s\n",hexstr,bits256_str(str,pubkey)); + char str[65]; printf(" -> rmd160.(%s) for %s (%s)\n",hexstr,bits256_str(str,pubkey),pubsecpstr); memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - //LP_address_monitor(pubp); + decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),pubsecpstr); } } timestamp = juint(obj,"timestamp"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 04127b1bd..e0df1e85d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -239,27 +239,46 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 return(item); } +uint64_t _LP_unspents_metric(uint64_t total,int32_t n) { return((total<<16) | (n & 0xffff)); } + cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array; struct LP_address *ap=0; struct LP_address_utxo *up,*tmp; + cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { //portable_mutex_lock(&coin->addrmutex); if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) { + total = n = 0; DL_FOREACH_SAFE(ap->utxos,up,tmp) { //char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); if ( up->spendheight <= 0 && up->U.height > 0 ) { jaddi(array,LP_address_item(coin,up,electrumret)); + n++; + total += up->U.value; //printf("new array %s\n",jprint(array,0)); } } + ap->total = total; + ap->n = n; } //portable_mutex_unlock(&coin->addrmutex); } + else + { + HASH_ITER(hh,coin->addresses,ap,atmp) + { + if ( ap->total > 0 && ap->n > 0 ) + { + item = cJSON_CreateObject(); + jadd64bits(item,ap->coinaddr,_LP_unspents_metric(ap->total,ap->n)); + jaddi(array,item); + } + } + } //printf("%s %s utxos.(%s) ap.%p\n",coin->symbol,coinaddr,jprint(array,0),ap); return(array); } @@ -286,9 +305,49 @@ void LP_postutxos(char *symbol,char *coinaddr) } } +int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) +{ + int32_t i,n,v,ht,errs,height,count=0; uint64_t value,val; cJSON *item,*txobj; bits256 txid; + if ( (n= cJSON_GetArraySize(array)) <= 0 ) + return(0); + for (i=0; ielectrum == 0 && (txobj= LP_gettxout(coin->symbol,txid,v)) != 0 ) + { + value = LP_value_extract(txobj,0); + if ( value != 0 && value != val ) + { + char str[65]; printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",coin->symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(txobj,0)); + errs++; + } + if ( coin->height != 0 ) + ht = LP_getheight(coin) - jint(txobj,"confirmations"); + else ht = 0; + /*if ( ht != 0 && ht < height-2 ) + { + printf("REJECT %s %s/v%d ht.%d vs %d confs.%d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jint(txobj,"confirmations"),jprint(item,0)); + errs++; + }*/ + free_json(txobj); + } + if ( errs == 0 ) + { + LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); + count++; + } + } + return(count); +} + char *LP_postedutxos(cJSON *argjson) { - int32_t i,n,v,ht,errs,height; uint64_t value,val; cJSON *array,*item,*txobj; bits256 txid; char str[65],*symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; + int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; //printf("posted.(%s)\n",jprint(argjson,0)); if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig { @@ -296,35 +355,8 @@ char *LP_postedutxos(cJSON *argjson) { if ( (array= jarray(&n,argjson,"utxos")) != 0 ) { - for (i=0; ielectrum == 0 && (txobj= LP_gettxout(symbol,txid,v)) != 0 ) - { - value = LP_value_extract(txobj,0); - if ( value != 0 && value != val ) - { - printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(txobj,0)); - errs++; - } - if ( coin->height != 0 ) - ht = LP_getheight(coin) - jint(txobj,"confirmations"); - else ht = 0; - /*if ( ht != 0 && ht < height-2 ) - { - printf("REJECT %s %s/v%d ht.%d vs %d confs.%d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jint(txobj,"confirmations"),jprint(item,0)); - errs++; - }*/ - free_json(txobj); - } - if ( errs == 0 ) - LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); - } + LP_unspents_array(coin,coinaddr,array); + free_json(array); } } else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr)) != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0c76c1976..990c5f4d1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -709,6 +709,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan if ( coin->counter == 0 ) { coin->counter++; + memcpy(G.LP_pubsecp,coin->pubkey33,33); bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); LP_privkeyadd(privkey,G.LP_myrmd160); diff --git a/iguana/exchanges/electrums b/iguana/exchanges/electrums index 5e4db6c70..06efc8f02 100755 --- a/iguana/exchanges/electrums +++ b/iguana/exchanges/electrums @@ -1,5 +1,6 @@ ource userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CHIPS\",\"ipaddr\":\"173.212.225.176\",\"port\":50076}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"ARG\",\"ipaddr\":\"173.212.225.176\",\"port\":50081}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"136.243.45.140\",\"port\":50001}" From 7fb8414c19527065fd046bd1d0732a45b0fd0917 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 18:09:52 +0300 Subject: [PATCH 0649/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 673f951bc..255df4033 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -380,10 +380,11 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) item = jitem(array2,j); if ( (coinaddr= jfieldname(item)) != 0 ) { - metric = j64bits(item,0); + metric = j64bits(item,"coinaddr"); + printf("(%s) -> %.8f n.%d\n",coinaddr,dstr(metric>>16),(uint16_t)metric); if ( (ap= LP_addressfind(coin,coinaddr)) == 0 || _LP_unspents_metric(ap->total,ap->n) != metric ) { - if ( ap->n < (metric & 0xffff) ) + if ( ap == 0 || ap->n < (metric & 0xffff) ) { if ( (retstr2= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) { @@ -395,13 +396,14 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } free(retstr2); } - } else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap->n,(uint16_t)metric); + } else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap!=0?ap->n:-1,(uint16_t)metric); } } } } free_json(array2); } + free(retstr); } } return(posted); From 57490f793dba1c1488de8c17657348647e393be9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 18:15:49 +0300 Subject: [PATCH 0650/2732] Test --- iguana/exchanges/LP_utxo.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e0df1e85d..e1020e7fa 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -354,10 +354,7 @@ char *LP_postedutxos(cJSON *argjson) if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (array= jarray(&n,argjson,"utxos")) != 0 ) - { LP_unspents_array(coin,coinaddr,array); - free_json(array); - } } else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr)) != 0 ) free_json(array); From 0e3e89d7708ea7b9f950d4ba257104b918aa6d02 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 18:27:03 +0300 Subject: [PATCH 0651/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- iguana/exchanges/LP_prices.c | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 255df4033..85dbef365 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -381,7 +381,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( (coinaddr= jfieldname(item)) != 0 ) { metric = j64bits(item,"coinaddr"); - printf("(%s) -> %.8f n.%d\n",coinaddr,dstr(metric>>16),(uint16_t)metric); + //printf("(%s) -> %.8f n.%d\n",coinaddr,dstr(metric>>16),(uint16_t)metric); if ( (ap= LP_addressfind(coin,coinaddr)) == 0 || _LP_unspents_metric(ap->total,ap->n) != metric ) { if ( ap == 0 || ap->n < (metric & 0xffff) ) @@ -391,18 +391,19 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( (array3= cJSON_Parse(retstr2)) != 0 ) { LP_unspents_array(coin,coinaddr,array3); - printf("pulled.(%s)\n",retstr2); + //printf("pulled.(%s)\n",retstr2); free_json(array3); } free(retstr2); } - } else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap!=0?ap->n:-1,(uint16_t)metric); + } //else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap!=0?ap->n:-1,(uint16_t)metric); } } } } free_json(array2); } + printf("processed.(%s)\n",retstr); free(retstr); } } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5b7dcfc5d..3cc3856ba 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -197,7 +197,7 @@ uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { - int32_t baseid,relid; uint64_t metric; char *base,coinaddr[64],hexstr[41]; double price; cJSON *item,*array,*obj,*unspents; struct iguana_info *coin; + int32_t baseid,relid,i,j; uint64_t metric; char *base,coinaddr[64],hexstr[67],hexstr2[67]; double price; cJSON *item,*array,*obj,*unspents; struct iguana_info *coin; obj = cJSON_CreateObject(); array = cJSON_CreateArray(); unspents = cJSON_CreateArray(); @@ -226,10 +226,23 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) jaddi(unspents,item); } jaddbits256(obj,"pubkey",pubp->pubkey); - init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); - jaddstr(obj,"rmd160",hexstr); - init_hexbytes_noT(hexstr,pubp->pubsecp,sizeof(pubp->pubsecp)); - jaddstr(obj,"pubsecp",hexstr); + for (i=0; irmd160); i++) + { + if ( pubp->rmd160[i] != 0 ) + { + for (j=0; ipubsecp); i++) + { + if ( pubp->pubsecp[i] != 0 ) + { + init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); + jaddstr(obj,"rmd160",hexstr); + init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); + jaddstr(obj,"pubsecp",hexstr2); + printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); + } + } + } + } jaddnum(obj,"timestamp",pubp->timestamp); jadd(obj,"asks",array); jadd(obj,"unspents",unspents); From f1c4918b613ab4b107170cb25e32e28b0b6169e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 18:31:23 +0300 Subject: [PATCH 0652/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 85dbef365..2e94838d8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -355,13 +355,13 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( j == m ) { - printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); + //printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) free(retstr2); posted++; } } - if ( 1 && posted != 0 ) + if ( 0 && posted != 0 ) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); } //else printf("%s matches\n",peer->ipaddr); free_json(array2); @@ -403,7 +403,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } free_json(array2); } - printf("processed.(%s)\n",retstr); + //printf("processed.(%s)\n",retstr); free(retstr); } } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 3cc3856ba..79a15ade2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -238,7 +238,7 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) jaddstr(obj,"rmd160",hexstr); init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); jaddstr(obj,"pubsecp",hexstr2); - printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); + //printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); } } } From b3e5aa4b3a66755eb10de674309576babb5dfae2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 19:36:16 +0300 Subject: [PATCH 0653/2732] Test --- iguana/exchanges/LP_prices.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 79a15ade2..36b1f7462 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -197,10 +197,9 @@ uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { - int32_t baseid,relid,i,j; uint64_t metric; char *base,coinaddr[64],hexstr[67],hexstr2[67]; double price; cJSON *item,*array,*obj,*unspents; struct iguana_info *coin; + int32_t baseid,relid,i,j; char *base,hexstr[67],hexstr2[67]; double price; cJSON *item,*array,*obj; obj = cJSON_CreateObject(); array = cJSON_CreateArray(); - unspents = cJSON_CreateArray(); for (baseid=0; baseidtaddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - if ((metric= LP_unspents_metric(coin,coinaddr)) != 0 ) - jadd64bits(item,base,metric); - } - jaddi(unspents,item); } jaddbits256(obj,"pubkey",pubp->pubkey); for (i=0; irmd160); i++) @@ -239,13 +230,14 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); jaddstr(obj,"pubsecp",hexstr2); //printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); + break; } } + break; } } jaddnum(obj,"timestamp",pubp->timestamp); jadd(obj,"asks",array); - jadd(obj,"unspents",unspents); if ( pubp->istrusted != 0 ) jaddnum(obj,"istrusted",pubp->istrusted); return(obj); From b0e3393747035804813f5877c7e4fa02ec6f4e63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 19:52:06 +0300 Subject: [PATCH 0654/2732] Test --- iguana/exchanges/LP_ordermatch.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0fde80a5c..5f443beaf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -670,6 +670,16 @@ char *LP_connectedalice(cJSON *argjson) // alice autxo = &A; butxo = &B; LP_abutxo_set(autxo,butxo,&Q); + if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) + { + printf("cant find autxo in quote\n"); + return(clonestr("{\"error\":\"quote autxo find error\"}")); + } + if ( autxo->S.swap != 0 ) + { + printf("swap already pending\n"); + return(clonestr("{\"error\":\"swap already pending\"}")); + } if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); From b2a491c0d75038c14cc89301643f81da76e7b385 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 19:59:50 +0300 Subject: [PATCH 0655/2732] Test --- iguana/exchanges/LP_prices.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 36b1f7462..a418b0ac6 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -269,13 +269,16 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) else mismatch = 0; if ( bits256_cmp(pubkey,G.LP_mypub25519) == 0 && mismatch == 0 ) peer->needping = 0; - if ( mismatch != 0 && memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 && (pubsecpstr= jstr(obj,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) + if ( mismatch != 0 && memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) { for (i=0; i<20; i++) printf("%02x",pubp->rmd160[i]); - char str[65]; printf(" -> rmd160.(%s) for %s (%s)\n",hexstr,bits256_str(str,pubkey),pubsecpstr); memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),pubsecpstr); + if ( (pubsecpstr= jstr(obj,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) + { + decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),pubsecpstr); + char str[65]; printf(" -> rmd160.(%s) for %s (%s)\n",hexstr,bits256_str(str,pubkey),pubsecpstr); + } } } timestamp = juint(obj,"timestamp"); From 73dfa150eb966556b4414c992ac9783785aaae4b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 20:00:36 +0300 Subject: [PATCH 0656/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d65652d86..e3f63ca96 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -142,7 +142,7 @@ dividends(coin, height, )\n\ return(jprint(retjson,1)); } if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,G.USERPASS) != 0 ) - return(clonestr("{\"error\":\"authentication error\"}")); + return(clonestr("{\"error\":\"authentication error you need to make sure userpass is set\"}")); jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) { From cdf87cd0add6d3b4d298e4d3cda7a71f15804337 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 20:04:01 +0300 Subject: [PATCH 0657/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a418b0ac6..b5d9d22cb 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -297,7 +297,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { - //char str[65]; printf("%s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); + char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; if ( (relpp= LP_priceinfofind(rel)) != 0 ) { From 2c99b7b4ffc755c9e90a2d8673cdf24a63831d35 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 20:47:05 +0300 Subject: [PATCH 0658/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_utxo.c | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e3f63ca96..a1f4db3bc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -474,13 +474,13 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"notify") == 0 ) { - char *rmd160str,str[65]; bits256 pub; struct LP_pubkeyinfo *pubp; + char *rmd160str; bits256 pub; struct LP_pubkeyinfo *pubp; pub = jbits256(argjson,"pub"); if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) { if ( (pubp= LP_pubkeyadd(pub)) != 0 ) decode_hex(pubp->rmd160,20,rmd160str); - printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); + //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); } retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b5d9d22cb..7c3574286 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -297,7 +297,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { - char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); + //char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; if ( (relpp= LP_priceinfofind(rel)) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e1020e7fa..580a669cd 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -310,6 +310,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) int32_t i,n,v,ht,errs,height,count=0; uint64_t value,val; cJSON *item,*txobj; bits256 txid; if ( (n= cJSON_GetArraySize(array)) <= 0 ) return(0); + printf("%s %s LP_unspents.(%s)\n",coin->symbol,coinaddr,jprint(array,0)); for (i=0; isymbol,"LBC") == 0 ) + printf("(%s)\n",jprint(item,0)); if ( coin->electrum == 0 && (txobj= LP_gettxout(coin->symbol,txid,v)) != 0 ) { value = LP_value_extract(txobj,0); From a92caa82224d4e9333f1103356ba8c71ac98a8b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 20:50:49 +0300 Subject: [PATCH 0659/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 580a669cd..2a93fd278 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -210,7 +210,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 0 && height > 0 ) + if ( 1 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From c849a147f670b426abaacd1e579640c187e4b05b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 20:55:28 +0300 Subject: [PATCH 0660/2732] Test --- iguana/exchanges/LP_prices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7c3574286..72680478d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -694,6 +694,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * minsatoshis *= price; maxsatoshis *= price; } + printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) { From 2a4946d0dea22f88504bcabcbf6904f883de2225 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 21:05:29 +0300 Subject: [PATCH 0661/2732] Test --- iguana/exchanges/LP_prices.c | 53 +++++------------------------- iguana/exchanges/LP_statemachine.c | 29 ++++++++++++++++ iguana/exchanges/LP_utxo.c | 2 +- 3 files changed, 38 insertions(+), 46 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 72680478d..0d9f82450 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -221,12 +221,12 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { if ( pubp->rmd160[i] != 0 ) { + init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); + jaddstr(obj,"rmd160",hexstr); for (j=0; ipubsecp); i++) { if ( pubp->pubsecp[i] != 0 ) { - init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); - jaddstr(obj,"rmd160",hexstr); init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); jaddstr(obj,"pubsecp",hexstr2); //printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); @@ -618,12 +618,8 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); - //if ( op->minsatoshis != 0 ) - jaddnum(item,"minvolume",dstr(op->minsatoshis)); - //if ( op->maxsatoshis != 0 ) - jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); - //jaddbits256(item,"txid",op->txid); - //jaddnum(item,"vout",op->vout); + jaddnum(item,"minvolume",dstr(op->minsatoshis)); + jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); jaddbits256(item,"pubkey",op->pubkey); jaddnum(item,"age",time(NULL)-op->timestamp); } @@ -635,10 +631,6 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) { - //op->txid = txid; - //op->vout = vout; - //op->txid2 = txid2; - //op->vout2 = vout2; safecopy(op->coinaddr,address,sizeof(op->coinaddr)); op->price = price; op->numutxos = numutxos; @@ -650,15 +642,6 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d return(op); } -/*int32_t LP_orderbookfind(struct LP_orderbookentry **array,int32_t num,bits256 txid,int32_t vout) -{ - int32_t i; - for (i=0; ivout == vout && bits256_cmp(array[i]->txid,txid) == 0) || (array[i]->vout2 == vout && bits256_cmp(array[i]->txid2,txid) == 0) ) - return(i); - return(-1); -}*/ - int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis; @@ -672,18 +655,14 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * memset(zeroes,0,sizeof(zeroes)); HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { - //if ( pubp->timestamp < oldest ) - // continue; if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) + { + printf("skip pubp since no rmd160\n"); continue; + } bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); minsatoshis = maxsatoshis = n = 0; ap = 0; - //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); - //if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL ) - //if ( polarity > 0 ) - // minsatoshis = utxo->S.satoshis; - //else minsatoshis = utxo->S.satoshis * price; if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL ) { if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) @@ -694,29 +673,13 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * minsatoshis *= price; maxsatoshis *= price; } - printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); + //printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; } - /*if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) - { - if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) - continue; - if ( polarity > 0 ) - basesatoshis = utxo->S.satoshis; - else basesatoshis = utxo->S.satoshis * price; - //char str[65]; printf("found utxo not in orderbook %s/v%d %.8f %.8f\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,dstr(basesatoshis),polarity > 0 ? price : 1./price); - if ( (op= LP_orderbookentry(base,rel,utxo->payment.txid,utxo->payment.vout,utxo->deposit.txid,utxo->deposit.vout,polarity > 0 ? price : 1./price,basesatoshis,utxo->pubkey,now - pubp->timestamp)) != 0 ) - { - *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); - (*arrayp)[num++] = op; - if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) - LP_utxo_clientpublish(utxo); - } - }*/ } //printf("pubp.(%s) %.8f %p\n",coinaddr,price,ap); } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 4f2e21d35..b70c7342a 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1900,6 +1900,35 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu } }*/ +/*int32_t LP_orderbookfind(struct LP_orderbookentry **array,int32_t num,bits256 txid,int32_t vout) + { + int32_t i; + for (i=0; ivout == vout && bits256_cmp(array[i]->txid,txid) == 0) || (array[i]->vout2 == vout && bits256_cmp(array[i]->txid2,txid) == 0) ) + return(i); + return(-1); + }*/ +//char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); +//if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL ) +//if ( polarity > 0 ) +// minsatoshis = utxo->S.satoshis; +//else minsatoshis = utxo->S.satoshis * price; +/*if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) + { + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) + continue; + if ( polarity > 0 ) + basesatoshis = utxo->S.satoshis; + else basesatoshis = utxo->S.satoshis * price; + //char str[65]; printf("found utxo not in orderbook %s/v%d %.8f %.8f\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,dstr(basesatoshis),polarity > 0 ? price : 1./price); + if ( (op= LP_orderbookentry(base,rel,utxo->payment.txid,utxo->payment.vout,utxo->deposit.txid,utxo->deposit.vout,polarity > 0 ? price : 1./price,basesatoshis,utxo->pubkey,now - pubp->timestamp)) != 0 ) + { + *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); + (*arrayp)[num++] = op; + if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) + LP_utxo_clientpublish(utxo); + } + }*/ #ifdef oldway struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2a93fd278..81273ece5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -310,7 +310,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) int32_t i,n,v,ht,errs,height,count=0; uint64_t value,val; cJSON *item,*txobj; bits256 txid; if ( (n= cJSON_GetArraySize(array)) <= 0 ) return(0); - printf("%s %s LP_unspents.(%s)\n",coin->symbol,coinaddr,jprint(array,0)); + //printf("%s %s LP_unspents.(%s)\n",coin->symbol,coinaddr,jprint(array,0)); for (i=0; i Date: Thu, 28 Sep 2017 21:18:38 +0300 Subject: [PATCH 0662/2732] Test --- iguana/exchanges/LP_commands.c | 9 ++++++++- iguana/exchanges/LP_nativeDEX.c | 9 ++++++++- iguana/exchanges/LP_ordermatch.c | 13 +++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a1f4db3bc..bb16a60ee 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -474,12 +474,19 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"notify") == 0 ) { - char *rmd160str; bits256 pub; struct LP_pubkeyinfo *pubp; + char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; pub = jbits256(argjson,"pub"); if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) { if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + { decode_hex(pubp->rmd160,20,rmd160str); + if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) + { + decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); + printf("got pubkey.(%s)\n",secpstr); + } + } //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); } retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2e94838d8..07af4de99 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -413,13 +413,14 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t height,nonz = 0; + struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t needpings,height,nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; if ( mypeer == 0 ) myipaddr = "127.0.0.1"; numpeers = LP_numpeers(); + needpings = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors >= LP_MAXPEER_ERRORS ) @@ -450,11 +451,17 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->needping != 0 ) { + needpings++; if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); peer->needping = 0; } } + if ( needpings != 0 ) + { + printf("needpings.%d send notify\n",needpings); + LP_notify_pubkeys(ctx,pubsock); + } if ( (counter % 6000) == 10 ) { LP_privkey_updates(ctx,pubsock,0); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5f443beaf..9a536a236 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -231,6 +231,19 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re return(clonestr("{\"result\":\"success\"}")); } +void LP_notify_pubkeys(void *ctx,int32_t pubsock) +{ + bits256 zero; char *msg,secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","notify"); + jaddstr(reqjson,"rmd160",G.LP_myrmd160str); + jaddbits256(reqjson,"pub",G.LP_mypub25519); + init_hexbytes_noT(secpstr,G.LP_pubsecp,33); + jaddstr(reqjson,"pubsecp",secpstr); + msg = jprint(reqjson,1); + LP_broadcast_message(pubsock,"","",zero,msg); +} + char *LP_postedprice(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; From b6c9603b75bf22a82387de7f278e6489f6066df8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 21:29:08 +0300 Subject: [PATCH 0663/2732] Test --- iguana/exchanges/LP_utxo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 81273ece5..a38aef168 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -210,7 +210,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 1 && height > 0 ) + if ( 0 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); @@ -319,8 +319,8 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) v = jint(item,"tx_pos"); height = jint(item,"height"); val = j64bits(item,"value"); - if ( strcmp(coin->symbol,"LBC") == 0 ) - printf("(%s)\n",jprint(item,0)); + //if ( strcmp(coin->symbol,"LBC") == 0 ) + // printf("(%s)\n",jprint(item,0)); if ( coin->electrum == 0 && (txobj= LP_gettxout(coin->symbol,txid,v)) != 0 ) { value = LP_value_extract(txobj,0); From f263049b6f4c9ad659e52cde43069845254ac0c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 21:33:33 +0300 Subject: [PATCH 0664/2732] Test --- iguana/exchanges/LP_commands.c | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index bb16a60ee..9afc92556 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -428,6 +428,25 @@ dividends(coin, height, )\n\ firsttime = (uint32_t)(time(NULL)-30*24*3600); return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); } + else if ( strcmp(method,"notify") == 0 ) + { + char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; + pub = jbits256(argjson,"pub"); + if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) + { + if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + { + decode_hex(pubp->rmd160,20,rmd160str); + if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) + { + decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); + printf("got pubkey.(%s)\n",secpstr); + } + } + //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); + } + retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); + } if ( IAMLP != 0 ) { if ( strcmp(method,"register") == 0 ) @@ -472,25 +491,6 @@ dividends(coin, height, )\n\ return(LP_psock(myipaddr,jint(argjson,"ispaired"))); else return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); } - else if ( strcmp(method,"notify") == 0 ) - { - char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; - pub = jbits256(argjson,"pub"); - if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) - { - if ( (pubp= LP_pubkeyadd(pub)) != 0 ) - { - decode_hex(pubp->rmd160,20,rmd160str); - if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) - { - decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); - printf("got pubkey.(%s)\n",secpstr); - } - } - //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); - } - retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); - } } else { From 9677a385f0d8821ad0ed023b02c845246fbf359e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 21:43:42 +0300 Subject: [PATCH 0665/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9afc92556..df62ebfb1 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -440,7 +440,7 @@ dividends(coin, height, )\n\ if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) { decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); - printf("got pubkey.(%s)\n",secpstr); + //printf("got pubkey.(%s)\n",secpstr); } } //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); From bed61a7abd5ed0e2d16cf10a1989575db7703b29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 21:45:20 +0300 Subject: [PATCH 0666/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 07af4de99..e9810ba40 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -457,9 +457,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int peer->needping = 0; } } - if ( needpings != 0 ) + if ( needpings != 0 || (counter % 6000) == 5 ) { - printf("needpings.%d send notify\n",needpings); + //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) From 85ee2a87719b799d71d740f00173067c590040e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 22:21:44 +0300 Subject: [PATCH 0667/2732] Test --- iguana/exchanges/LP_ordermatch.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9a536a236..95a3d616f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -683,16 +683,17 @@ char *LP_connectedalice(cJSON *argjson) // alice autxo = &A; butxo = &B; LP_abutxo_set(autxo,butxo,&Q); - if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) - { - printf("cant find autxo in quote\n"); - return(clonestr("{\"error\":\"quote autxo find error\"}")); - } - if ( autxo->S.swap != 0 ) + if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); } + autxo = LP_utxoadd(0,LP_mypubsock,Q.destcoin,Q.desttxid,Q.destvout,Q.destsatoshis,Q.feetxid,Q.feevout,0,"",Q.destaddr,Q.desthash,LP_gui,G.LP_sessionid); + if ( autxo == 0 ) + { + printf("couldnt create autxo\n"); + return(clonestr("{\"error\":\"couldnt create autxo\"}")); + } if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); From c9c0ec3b542c9818b2c64ba09e756cf473488390 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 22:38:23 +0300 Subject: [PATCH 0668/2732] Test --- iguana/exchanges/LP_ordermatch.c | 17 +++++++++++------ iguana/exchanges/LP_swap.c | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 95a3d616f..7ebda4f53 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -679,11 +679,16 @@ char *LP_connectedalice(cJSON *argjson) // alice clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); - printf("CONNECTED.(%s)\n",jprint(argjson,0)); + printf("CONNECTED.(%s) numpending.%d\n",jprint(argjson,0),G.LP_pendingswaps); + if ( G.LP_pendingswaps > 0 ) + { + printf("swap already pending\n"); + return(clonestr("{\"error\":\"swap already pending\"}")); + } autxo = &A; butxo = &B; LP_abutxo_set(autxo,butxo,&Q); - if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) + /*if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); @@ -693,11 +698,11 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("couldnt create autxo\n"); return(clonestr("{\"error\":\"couldnt create autxo\"}")); - } + }*/ if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); - G.LP_pendingswaps--; + //G.LP_pendingswaps--; printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } @@ -705,7 +710,7 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); - G.LP_pendingswaps--; + //G.LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } // SPV validate bobs @@ -713,7 +718,7 @@ char *LP_connectedalice(cJSON *argjson) // alice price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { - G.LP_pendingswaps--; + //G.LP_pendingswaps--; return(clonestr("{\"error\":\"cant get alicecoin\"}")); } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 32d255a5b..3821605c7 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -821,6 +821,7 @@ void LP_aliceloop(void *_swap) nn_close(swap->N.pair); swap->N.pair = -1; } + G.LP_pendingswaps--; } bits256 instantdex_derivekeypair(void *ctx,bits256 *newprivp,uint8_t pubkey[33],bits256 privkey,bits256 orderhash) From d512b2f13e76751592274f1e79a32fe7df139c7e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 23:39:09 +0300 Subject: [PATCH 0669/2732] Test --- iguana/exchanges/LP_swap.c | 8 ++++++-- iguana/exchanges/LP_transaction.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 3821605c7..306cab38c 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -613,8 +613,11 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 rawtx->I.actualtxid = LP_broadcast_tx(rawtx->name,rawtx->coin->symbol,rawtx->txbytes,rawtx->I.datalen); if ( bits256_cmp(rawtx->I.actualtxid,rawtx->I.signedtxid) != 0 ) { - //printf("%s rawtxsend.[%d] %s vs %s\n",rawtx->name,rawtx->I.datalen,bits256_str(str,rawtx->I.signedtxid),bits256_str(str2,rawtx->I.actualtxid)); - rawtx->I.actualtxid = rawtx->I.signedtxid; + char str[65],str2[65]; + printf("%s rawtxsend.[%d] %s vs %s\n",rawtx->name,rawtx->I.datalen,bits256_str(str,rawtx->I.signedtxid),bits256_str(str2,rawtx->I.actualtxid)); + if ( bits256_nonz(rawtx->I.signedtxid) != 0 ) + rawtx->I.actualtxid = rawtx->I.signedtxid; + else rawtx->I.signedtxid = rawtx->I.actualtxid; } if ( bits256_nonz(rawtx->I.actualtxid) != 0 && msgbits != 0 ) { @@ -662,6 +665,7 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t sleep(10); if ( sleeptime < divisor*60 ) sleeptime = divisor * 60; + //check for completed one being spent, prevent autxo reuse, add extra hash to keypair25519, sign, spv check while ( time(NULL) < expiration ) { if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index c05ae4613..489de1632 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -70,6 +70,8 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi break; sleep(3); } + if ( sentflag != 0 ) + return(expectedtxid); return(txid); } From 68d230eb0e7d3336eced903d9edd3c9b8854a82e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 11:20:38 +0300 Subject: [PATCH 0670/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 2af0d9f9f..006b4b6cf 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -495,7 +495,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } if ( time(NULL) > expiration || numconfirms >= 0 ) break; - usleep(500000); + sleep(10); } if ( numconfirms <= 0 ) numconfirms = LP_numconfirms(symbol,coinaddr,txid,vout,1); From 6405f8f37e82e85ac914fe79c0c44804c389ee28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 11:24:41 +0300 Subject: [PATCH 0671/2732] Iterate through sellers --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7ebda4f53..0869399f2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1070,7 +1070,7 @@ exit(-1); continue; //return(clonestr("{\"error\":\"quote validation error\"}")); } - break; + //break; } //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); From a5ec865a41ef0167f7298b291e5568877744ab52 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 14:13:53 +0300 Subject: [PATCH 0672/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 -- iguana/exchanges/LP_swap.c | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e9810ba40..41c2267f5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,10 +23,10 @@ // bittrex balancing // detect port conflicts on enable // stats -// dynamic txid2 allocation // unduplicated bugs: // swap cancel should cleanly cancel +// check for completed one being spent, prevent autxo reuse, add extra hash to keypair25519, sign, spv check #include #include "LP_include.h" @@ -514,7 +514,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_getestimatedrate(coin); break; } - if ( (counter % 6000) == 60 ) + if ( 0 && (counter % 6000) == 60 ) { if ( (retstr= basilisk_swapentry(0,0)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0869399f2..e61e92913 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -713,7 +713,6 @@ char *LP_connectedalice(cJSON *argjson) // alice //G.LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } - // SPV validate bobs printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) @@ -1066,7 +1065,6 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); -exit(-1); continue; //return(clonestr("{\"error\":\"quote validation error\"}")); } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 306cab38c..55341236f 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -665,7 +665,6 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t sleep(10); if ( sleeptime < divisor*60 ) sleeptime = divisor * 60; - //check for completed one being spent, prevent autxo reuse, add extra hash to keypair25519, sign, spv check while ( time(NULL) < expiration ) { if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) From be872ded56b4062131aecdae868eacdfa7941a0c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 15:06:57 +0300 Subject: [PATCH 0673/2732] Reentrancy --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_ordermatch.c | 12 ++++++------ iguana/exchanges/LP_swap.c | 7 +++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6a7499747..fa0eb746d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -298,6 +298,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); +void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 41c2267f5..25b34acd7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -26,7 +26,8 @@ // unduplicated bugs: // swap cancel should cleanly cancel -// check for completed one being spent, prevent autxo reuse, add extra hash to keypair25519, sign, spv check +// check for completed one being spent +// prevent autxo reuse, add extra hash to keypair25519, sign, spv check #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e61e92913..6c249ff39 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -674,7 +674,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) @@ -685,8 +685,8 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); } - autxo = &A; - butxo = &B; + autxo = calloc(1,sizeof(*autxo)); + butxo = calloc(1,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); /*if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { @@ -798,7 +798,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); @@ -811,8 +811,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - autxo = &A; - butxo = &B; + autxo = calloc(1,sizeof(*autxo)); + butxo = calloc(1,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 55341236f..90e565c6d 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -121,7 +121,10 @@ void basilisk_swap_finished(struct basilisk_swap *swap) { int32_t i; if ( swap->utxo != 0 && swap->sentflag == 0 ) + { LP_availableset(swap->utxo); + LP_butxo_swapfields_set(swap->utxo); + } swap->I.finished = (uint32_t)time(NULL); // save to permanent storage basilisk_rawtx_purge(&swap->bobdeposit); @@ -815,8 +818,6 @@ void LP_aliceloop(void *_swap) } } } - basilisk_swap_finished(swap); - free(swap); } free(data); if ( swap->N.pair >= 0 ) @@ -824,6 +825,8 @@ void LP_aliceloop(void *_swap) nn_close(swap->N.pair); swap->N.pair = -1; } + basilisk_swap_finished(swap); + free(swap); G.LP_pendingswaps--; } From 8d029bfe68751c7c5513b58bd2957c75689564b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 22:56:30 +0300 Subject: [PATCH 0674/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6c249ff39..e61e92913 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -674,7 +674,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) @@ -685,8 +685,8 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); } - autxo = calloc(1,sizeof(*autxo)); - butxo = calloc(1,sizeof(*butxo)); + autxo = &A; + butxo = &B; LP_abutxo_set(autxo,butxo,&Q); /*if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { @@ -798,7 +798,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); @@ -811,8 +811,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - autxo = calloc(1,sizeof(*autxo)); - butxo = calloc(1,sizeof(*butxo)); + autxo = &A; + butxo = &B; LP_abutxo_set(autxo,butxo,&Q); LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) From 9ca0c5f7142052c0af9af80e9a360ef1343df587 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 22:59:47 +0300 Subject: [PATCH 0675/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e61e92913..98676988f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1068,7 +1068,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel continue; //return(clonestr("{\"error\":\"quote validation error\"}")); } - //break; + break; } //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); From 7f248db8b8c3d4a6d6177ee7f6ddb67229ce865c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 23:03:08 +0300 Subject: [PATCH 0676/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 98676988f..115c81ff8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -674,7 +674,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) @@ -685,8 +685,8 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); } - autxo = &A; - butxo = &B; + autxo = calloc(1,sizeof(*autxo));//&A; + butxo = calloc(1,sizeof(*butxo));//&B; LP_abutxo_set(autxo,butxo,&Q); /*if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { @@ -798,7 +798,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); @@ -811,8 +811,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - autxo = &A; - butxo = &B; + autxo = calloc(1,sizeof(*autxo));//&A; + butxo = calloc(1,sizeof(*butxo));//&B; LP_abutxo_set(autxo,butxo,&Q); LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) From a4dac78ecd1f4848f4921988005c3454fbe67ddb Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Sep 2017 23:10:05 +0300 Subject: [PATCH 0677/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 115c81ff8..98676988f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -674,7 +674,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) @@ -685,8 +685,8 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); } - autxo = calloc(1,sizeof(*autxo));//&A; - butxo = calloc(1,sizeof(*butxo));//&B; + autxo = &A; + butxo = &B; LP_abutxo_set(autxo,butxo,&Q); /*if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { @@ -798,7 +798,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); @@ -811,8 +811,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(-3); } price = ask; - autxo = calloc(1,sizeof(*autxo));//&A; - butxo = calloc(1,sizeof(*butxo));//&B; + autxo = &A; + butxo = &B; LP_abutxo_set(autxo,butxo,&Q); LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) From 9a2f5c735cc2f3ba4d1f4b0e9d08d3513b4fa5b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 13:34:18 +0300 Subject: [PATCH 0678/2732] fixes detect port conflicts on enable check for completed swap tx being spent prevent autxo reuse add extra hash to keypair25519 --- iguana/exchanges/LP_coins.c | 13 +++ iguana/exchanges/LP_commands.c | 10 ++- iguana/exchanges/LP_include.h | 12 ++- iguana/exchanges/LP_nativeDEX.c | 13 +-- iguana/exchanges/LP_ordermatch.c | 125 +++++++++++++++-------------- iguana/exchanges/LP_prices.c | 46 +++++++++++ iguana/exchanges/LP_statemachine.c | 20 +++++ iguana/exchanges/LP_swap.c | 3 +- iguana/exchanges/LP_utxo.c | 37 +++++---- iguana/exchanges/LP_utxos.c | 49 ++++------- 10 files changed, 204 insertions(+), 124 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index f9ae0c9a8..bf02bc11a 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -201,6 +201,19 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) return(item); } +struct iguana_info *LP_conflicts_find(struct iguana_info *refcoin) +{ + struct iguana_info *coin=0,*tmp; + HASH_ITER(hh,LP_coins,coin,tmp) + { + if ( coin->inactive != 0 || coin->electrum != 0 || coin == refcoin ) + continue; + if ( strcmp(coin->serverport,refcoin->serverport) == 0 ) + break; + } + return(coin); +} + cJSON *LP_coinsjson(int32_t showwif) { struct iguana_info *coin,*tmp; cJSON *array = cJSON_CreateArray(); diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index df62ebfb1..bb7d1e49b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -112,7 +112,7 @@ getcoins()\n\ getcoin(coin)\n\ portfolio()\n\ getpeers()\n\ -passphrase(passphrase)\n\ +passphrase(passphrase, gui)\n\ listunspent(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ @@ -166,7 +166,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"passphrase") == 0 ) { - if ( LP_passphrase_init(jstr(argjson,"passphrase")) < 0 ) + if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 ) return(clonestr("{\"error\":\"couldnt change passphrase\"}")); { retjson = cJSON_CreateObject(); @@ -253,7 +253,11 @@ dividends(coin, height, )\n\ if ( strcmp(method,"enable") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) - ptr->inactive = 0; + { + if ( LP_conflicts_find(ptr) == 0 ) + ptr->inactive = 0; + else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); + } return(jprint(LP_coinsjson(0),1)); } else if ( strcmp(method,"disable") == 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index fa0eb746d..233c1a70e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -212,7 +212,7 @@ struct LP_utxoinfo int32_t iambob,iamlp; uint8_t key[sizeof(bits256) + sizeof(int32_t)]; uint8_t key2[sizeof(bits256) + sizeof(int32_t)]; - char coin[16],coinaddr[64],spendscript[256],gui[16]; + char coin[16],coinaddr[64],gui[16];//spendscript[256]; }; struct LP_address_utxo @@ -226,9 +226,11 @@ struct LP_address { UT_hash_handle hh; struct LP_address_utxo *utxos; + bits256 pubkey; int64_t balance,total; uint32_t timestamp,n; char coinaddr[40]; + uint8_t pubsecp[33],pad; }; struct LP_peerinfo @@ -297,8 +299,10 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); +struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr); +struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr); int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); -void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo); +//void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); @@ -310,10 +314,12 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); int32_t LP_listunspent_both(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); -int32_t LP_butxo_findeither(bits256 txid,int32_t vout); +//int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid); double LP_getestimatedrate(struct iguana_info *coin); +struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout); +struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid,int32_t vout); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 25b34acd7..945c2a1d8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,14 +20,17 @@ // marketmaker // // new features: +// sign, spv check // bittrex balancing -// detect port conflicts on enable // stats +// -detect port conflicts on enable +// -check for completed one being spent +// -prevent autxo reuse +// -add extra hash to keypair25519 + // unduplicated bugs: // swap cancel should cleanly cancel -// check for completed one being spent -// prevent autxo reuse, add extra hash to keypair25519, sign, spv check #include #include "LP_include.h" @@ -64,7 +67,7 @@ struct LP_globals uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; int32_t LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting; - char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41]; + char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41],gui[16]; struct LP_privkey LP_privkeys[100]; } G; @@ -693,7 +696,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("initcoins\n"); LP_initcoins(ctx,pubsock,jobj(argjson,"coins")); G.waiting = 1; - LP_passphrase_init(passphrase); + LP_passphrase_init(passphrase,jstr(argjson,"gui")); if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) { printf("error launching LP_psockloop for (%s)\n",myipaddr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 98676988f..02b67ddf9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -435,7 +435,7 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -struct LP_utxoinfo BUTXOS[100]; +/*struct LP_utxoinfo BUTXOS[100]; int32_t LP_butxo_findeither(bits256 txid,int32_t vout) { @@ -452,7 +452,7 @@ int32_t LP_butxo_findeither(bits256 txid,int32_t vout) } portable_mutex_unlock(&LP_butxomutex); return(retval); -} +}*/ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { @@ -481,12 +481,12 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d else return(0); } -struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,int32_t avoidflag,uint64_t desttxfee) +struct LP_utxoinfo *LP_address_utxopair(struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,uint64_t desttxfee) { - struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; + struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { - if ( (m= LP_address_utxo_ptrs(utxos,max,ap,avoidflag)) > 1 ) + if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) { targetval = LP_basesatoshis(volume,price,txfee,desttxfee); if ( 0 ) @@ -505,18 +505,12 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre { if ( up != 0 && (up2= utxos[mini]) != 0 ) { - safecopy(utxo->coin,coin->symbol,sizeof(utxo->coin)); - safecopy(utxo->coinaddr,coinaddr,sizeof(utxo->coinaddr)); - utxo->payment.txid = up->U.txid; - utxo->payment.vout = up->U.vout; - utxo->payment.value = up->U.value; - utxo->iambob = 1; - utxo->deposit.txid = up2->U.txid; - utxo->deposit.vout = up2->U.vout; - utxo->deposit.value = up2->U.value; - utxo->S.satoshis = targetval; - printf("targetval %.8f, found val %.8f | targetval2 %.8f val2 %.8f\n",dstr(targetval),dstr(up->U.value),dstr(targetval2),dstr(up2->U.value)); - return(utxo); + if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) + { + utxo->S.satoshis = targetval; + printf("targetval %.8f, found val %.8f | targetval2 %.8f val2 %.8f\n",dstr(targetval),dstr(up->U.value),dstr(targetval2),dstr(up2->U.value)); + return(utxo); + } } } } @@ -525,7 +519,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_utxoinfo *utxo,struct LP_addre return(0); } -struct LP_utxoinfo *_LP_butxo_find(struct LP_utxoinfo *butxo) +/*struct LP_utxoinfo *_LP_butxo_find(struct LP_utxoinfo *butxo) { int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); //portable_mutex_lock(&LP_butxomutex); @@ -586,7 +580,7 @@ void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) { LP_butxo_swapfields_copy(setutxo,butxo); } -} +}*/ void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) { @@ -668,37 +662,49 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ nn_close(pair); LP_availableset(utxo); } else LP_unavailableset(utxo,utxo->S.otherpubkey); - LP_butxo_swapfields(utxo); + //LP_butxo_swapfields(utxo); return(retval); } char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; uint64_t value,value2; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s) numpending.%d\n",jprint(argjson,0),G.LP_pendingswaps); - if ( G.LP_pendingswaps > 0 ) + /*if ( G.LP_pendingswaps > 0 ) { printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); - } - autxo = &A; - butxo = &B; - LP_abutxo_set(autxo,butxo,&Q); - /*if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) + }*/ + if ( (autxo= LP_utxopairfind(1,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { - printf("swap already pending\n"); - return(clonestr("{\"error\":\"swap already pending\"}")); + printf("cant find autxo\n"); + return(clonestr("{\"error\":\"cant find autxo\"}")); } - autxo = LP_utxoadd(0,LP_mypubsock,Q.destcoin,Q.desttxid,Q.destvout,Q.destsatoshis,Q.feetxid,Q.feevout,0,"",Q.destaddr,Q.desthash,LP_gui,G.LP_sessionid); - if ( autxo == 0 ) + LP_abutxo_set(autxo,0,&Q); + if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) { - printf("couldnt create autxo\n"); - return(clonestr("{\"error\":\"couldnt create autxo\"}")); - }*/ + value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + if ( value == 0 || value2 == 0 ) + { + printf("zero value %.8f or value2 %.8f\n",dstr(value),dstr(value2)); + return(clonestr("{\"error\":\"spent txid or txid2 for bob?\"}")); + } + if ( (butxo= LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0)) == 0 ) + { + printf("cant find or create butxo\n"); + return(clonestr("{\"error\":\"cant find or create butxo\"}")); + } + if ( value < Q.satoshis ) + { + printf("butxo value %.8f less satoshis %.8f\n",dstr(value),dstr(Q.satoshis)); + return(clonestr("{\"error\":\"butxo value less than satoshis\"}")); + } + } if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); @@ -713,7 +719,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //G.LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } - printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); + printf("%s/%s bid %.8f ask %.8f values %.8f %.8f\n",Q.srccoin,Q.destcoin,bid,ask,dstr(butxo->payment.value),dstr(butxo->deposit.value)); price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { @@ -813,22 +819,26 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price = ask; autxo = &A; butxo = &B; + memset(autxo,0,sizeof(*autxo)); + memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); - LP_butxo_swapfields(butxo); + //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { - if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + if ( LP_unallocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_unallocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { LP_listunspent_both(Q.srccoin,Q.coinaddr); - butxo = LP_address_utxopair(butxo,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,1,Q.desttxfee); - Q.txid = butxo->payment.txid; - Q.vout = butxo->payment.vout; - Q.txid2 = butxo->deposit.txid; - Q.vout2 = butxo->deposit.vout; - LP_abutxo_set(0,butxo,&Q); - LP_butxo_swapfields(butxo); - } - } + if ( (butxo= LP_address_utxopair(utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) + { + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; + } + //LP_abutxo_set(0,butxo,&Q); + //LP_butxo_swapfields(butxo); + } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65]; printf("couldnt find bob utxos for autxo %s/v%d %.8f\n",bits256_str(str,autxo->payment.txid),autxo->payment.vout,dstr(autxo->S.satoshis)); @@ -869,7 +879,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, msg2 = clonestr(msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); - LP_butxo_swapfields_set(butxo); + //LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(2); } @@ -882,12 +892,12 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); - LP_butxo_swapfields_set(butxo); + //LP_butxo_swapfields_set(butxo); return(3); } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } - LP_butxo_swapfields_set(butxo); + //LP_butxo_swapfields_set(butxo); } } return(retval); @@ -925,8 +935,6 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q if ( aliceutxo->S.swap != 0 ) break; sleep(3); - //price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); - //LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); } if ( aliceutxo->S.swap == 0 ) { @@ -957,7 +965,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) +struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,j,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; *ordermatchpricep = 0.; @@ -996,7 +1004,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); - if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(space,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,0,desttxfee)) != 0 ) + if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); @@ -1031,7 +1039,7 @@ struct LP_utxoinfo *LP_buyutxo(struct LP_utxoinfo *space,double *ordermatchprice char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { - uint64_t desttxfee,txfee; int32_t numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,_bestB,_bestA,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + uint64_t desttxfee,txfee; int32_t numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; printf("LP_autobuy %s/%s price %.8f vol %.8f\n",base,rel,maxprice,relvolume); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; @@ -1041,18 +1049,14 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"invalid parameter\"}")); memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); - memset(&_bestA,0,sizeof(_bestA)); - memset(&_bestB,0,sizeof(_bestB)); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - _bestA = *autxo; - autxo = &_bestA; if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis; while ( 1 ) { - if ( (bestutxo= LP_buyutxo(&_bestB,&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); @@ -1064,9 +1068,8 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) { - printf("quote validate error %.0f\n",qprice); + printf("continue searching, quote validate error %.0f\n",qprice); continue; - //return(clonestr("{\"error\":\"quote validation error\"}")); } break; } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0d9f82450..bf347411d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -126,6 +126,52 @@ struct LP_cacheinfo *LP_cachefind(char *base,char *rel,bits256 txid,int32_t vout return(ptr); } +struct LP_pubkeyinfo *LP_pubkey_rmd160find(uint8_t rmd160[20]) +{ + struct LP_pubkeyinfo *pubp=0,*tmp; + portable_mutex_lock(&LP_pubkeymutex); + HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) + { + if ( memcmp(rmd160,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) + break; + pubp = 0; + } + portable_mutex_unlock(&LP_pubkeymutex); + return(pubp); +} + +struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) +{ + uint8_t rmd160[20],addrtype; struct LP_address *ap; struct LP_pubkeyinfo *pubp; + HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); + if ( bits256_nonz(ap->pubkey) == 0 ) + { + bitcoin_addr2rmd160(coin->taddr,&addrtype,rmd160,coinaddr); + if ( (pubp= LP_pubkey_rmd160find(rmd160)) != 0 ) + { + ap->pubkey = pubp->pubkey; + memcpy(ap->pubsecp,pubp->pubsecp,sizeof(ap->pubsecp)); + } + } + return(ap); +} + +struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) +{ + uint8_t rmd160[20],addrtype; struct LP_address *ap; struct LP_pubkeyinfo *pubp; + ap = calloc(1,sizeof(*ap)); + safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); + bitcoin_addr2rmd160(coin->taddr,&addrtype,rmd160,coinaddr); + if ( (pubp= LP_pubkey_rmd160find(rmd160)) != 0 ) + { + ap->pubkey = pubp->pubkey; + memcpy(ap->pubsecp,pubp->pubsecp,sizeof(ap->pubsecp)); + } + //printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); + HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); + return(ap); +} + struct LP_pubkeyinfo *LP_pubkeyfind(bits256 pubkey) { struct LP_pubkeyinfo *pubp=0; diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index b70c7342a..073832675 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1608,6 +1608,26 @@ int32_t LP_utxopurge(int32_t allutxos) portable_mutex_unlock(&LP_utxomutex); return(n); } +struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson) +{ + struct LP_utxoinfo *utxo; + if ( jobj(argjson,"iambob") == 0 || iambob != jint(argjson,"iambob") ) + { + printf("LP_utxoaddjson: iambob.%d != arg.%d obj.%p (%s)\n",iambob,jint(argjson,"iambob"),jobj(argjson,"iambob"),jprint(argjson,0)); + return(0); + } + portable_mutex_lock(&LP_UTXOmutex); + utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"session")); + if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) + { + utxo->T.lasttime = (uint32_t)time(NULL); + printf("set lasttime!\n"); + } + portable_mutex_unlock(&LP_UTXOmutex); + return(utxo); +} + + int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t now) { struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; bits256 txid; struct LP_utxoinfo *utxo; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 90e565c6d..6300e0dbf 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -123,7 +123,8 @@ void basilisk_swap_finished(struct basilisk_swap *swap) if ( swap->utxo != 0 && swap->sentflag == 0 ) { LP_availableset(swap->utxo); - LP_butxo_swapfields_set(swap->utxo); + swap->utxo = 0; + //LP_butxo_swapfields_set(swap->utxo); } swap->I.finished = (uint32_t)time(NULL); // save to permanent storage diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a38aef168..6cd607f4b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -69,23 +69,6 @@ int32_t LP_txdestaddr(char *destaddr,bits256 txid,int32_t vout,cJSON *txobj) return(retval); } -struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); - return(ap); -} - -struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) -{ - struct LP_address *ap; - ap = calloc(1,sizeof(*ap)); - safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); - //printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); - HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); - return(ap); -} - struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) { struct LP_address *ap = 0; @@ -138,14 +121,29 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } -int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,int32_t avoidflag) +struct LP_utxoinfo *LP_unallocated(bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo; + if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + return(0); + if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + return(0); + if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + return(0); + if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + return(0); + return(utxo); +} + +int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) { struct LP_address_utxo *up,*tmp; int32_t n = 0; + portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->spendheight <= 0 ) { - if ( avoidflag == 0 || LP_butxo_findeither(up->U.txid,up->U.vout) == 0 ) + if ( LP_unallocated(up->U.txid,up->U.vout) != 0 ) { utxos[n++] = up; if ( n >= max ) @@ -153,6 +151,7 @@ int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct L } } } + portable_mutex_unlock(&LP_utxomutex); return(n); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 990c5f4d1..94487dc3b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -206,7 +206,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) jaddbits256(item,"pubkey",utxo->pubkey); //jaddnum(item,"profit",utxo->S.profitmargin); jaddstr(item,"base",utxo->coin); - jaddstr(item,"script",utxo->spendscript); + //jaddstr(item,"script",utxo->spendscript); return(item); } @@ -278,12 +278,12 @@ char *LP_spentcheck(cJSON *argjson) return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); } -struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) +struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; - if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) + if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { - printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); + printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } if ( iambob != 0 ) @@ -343,7 +343,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(tmpsatoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); } u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || tmpsatoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(spendscript,utxo->spendscript) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) + if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || tmpsatoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) { utxo->T.errors++; char str[65],str2[65],str3[65],str4[65],str5[65],str6[65]; @@ -353,7 +353,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit // utxo->T.spentflag = (uint32_t)time(NULL); printf("original utxo pair not valid\n"); if ( dispflag != 0 ) - printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(spendscript,utxo->spendscript) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); + printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); utxo = 0; } } @@ -373,7 +373,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit safecopy(utxo->gui,gui,sizeof(utxo->gui)); safecopy(utxo->coin,symbol,sizeof(utxo->coin)); safecopy(utxo->coinaddr,coinaddr,sizeof(utxo->coinaddr)); - safecopy(utxo->spendscript,spendscript,sizeof(utxo->spendscript)); + //safecopy(utxo->spendscript,spendscript,sizeof(utxo->spendscript)); utxo->payment.txid = txid; utxo->payment.vout = vout; utxo->payment.value = value; @@ -418,25 +418,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit return(utxo); } -struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson) -{ - struct LP_utxoinfo *utxo; - if ( jobj(argjson,"iambob") == 0 || iambob != jint(argjson,"iambob") ) - { - printf("LP_utxoaddjson: iambob.%d != arg.%d obj.%p (%s)\n",iambob,jint(argjson,"iambob"),jobj(argjson,"iambob"),jprint(argjson,0)); - return(0); - } - portable_mutex_lock(&LP_UTXOmutex); - utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"session")); - if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) - { - utxo->T.lasttime = (uint32_t)time(NULL); - printf("set lasttime!\n"); - } - portable_mutex_unlock(&LP_UTXOmutex); - return(utxo); -} - cJSON *LP_inventory(char *symbol) { struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; int32_t iambob = 0; @@ -610,14 +591,14 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) { } } else { //printf("call utxoadd\n"); - if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) { } } @@ -742,9 +723,10 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan } else free_json(retjson); } } - G.LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); - G.LP_mypriv25519 = privkey; - //printf("privkey.(%s) -> LP_mypub25519.(%s)\n",bits256_str(str,privkey),bits256_str(str2,LP_mypub25519)); + vcalc_sha256(0,checkkey.bytes,privkey.bytes,sizeof(privkey)); + checkkey.bytes[0] &= 248, checkkey.bytes[31] &= 127, checkkey.bytes[31] |= 64; + G.LP_mypub25519 = *pubkeyp = curve25519(checkkey,curve25519_basepoint9()); + G.LP_mypriv25519 = checkkey; return(privkey); } @@ -772,7 +754,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) } } -int32_t LP_passphrase_init(char *passphrase) +int32_t LP_passphrase_init(char *passphrase,char *gui) { static void *ctx; struct LP_utxoinfo *utxo,*tmp; if ( ctx == 0 ) @@ -780,6 +762,8 @@ int32_t LP_passphrase_init(char *passphrase) if ( G.LP_pendingswaps != 0 ) return(-1); G.initializing = 1; + if ( gui == 0 ) + gui = "cli"; while ( G.waiting == 0 ) { printf("waiting for G.waiting\n"); @@ -805,6 +789,7 @@ int32_t LP_passphrase_init(char *passphrase) LP_privkey_updates(ctx,LP_mypubsock,passphrase); init_hexbytes_noT(G.LP_myrmd160str,G.LP_myrmd160,20); G.LP_sessionid = (uint32_t)time(NULL); + safecopy(G.gui,gui,sizeof(G.gui)); return(0); } From b821e216c30006e932a3f3d6c4c8dd57d0fb1607 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 13:48:07 +0300 Subject: [PATCH 0679/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index bf347411d..0a051e362 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -144,7 +144,7 @@ struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) { uint8_t rmd160[20],addrtype; struct LP_address *ap; struct LP_pubkeyinfo *pubp; HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); - if ( bits256_nonz(ap->pubkey) == 0 ) + if ( ap != 0 && bits256_nonz(ap->pubkey) == 0 ) { bitcoin_addr2rmd160(coin->taddr,&addrtype,rmd160,coinaddr); if ( (pubp= LP_pubkey_rmd160find(rmd160)) != 0 ) From 781a8fe03472a43c3d9dbb2b84d1eae09d6f47b1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 13:57:25 +0300 Subject: [PATCH 0680/2732] Test --- iguana/exchanges/LP_utxos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 94487dc3b..1698afa57 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -420,11 +420,13 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t cJSON *LP_inventory(char *symbol) { - struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; int32_t iambob = 0; + struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; int32_t iambob = 0; struct iguana_info *coin; array = cJSON_CreateArray(); if ( LP_mypeer != 0 ) myipaddr = LP_mypeer->ipaddr; else myipaddr = "127.0.0.1"; + if ( (coin= LP_coinfind(symbol)) != 0 ) + LP_listunspent_both(symbol,coin->smartaddr); HASH_ITER(hh,G.LP_utxoinfos,utxo,tmp) { char str[65]; From 714bff33e275ab375b03088defe443c6bac3a561 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 14:03:30 +0300 Subject: [PATCH 0681/2732] Test --- iguana/exchanges/LP_utxo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6cd607f4b..76aa1fb30 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -373,13 +373,13 @@ void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo=0; uint8_t key[sizeof(txid) + sizeof(vout)]; - if ( iambob != 0 ) + /*if ( iambob != 0 ) { static uint32_t counter; if ( counter++ < 3 ) printf("_LP_utxofind deprecated iambob\n"); return(0); - } + }*/ LP_utxosetkey(key,txid,vout); HASH_FIND(hh,G.LP_utxoinfos,key,sizeof(key),utxo); return(utxo); @@ -388,11 +388,11 @@ struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; uint8_t key2[sizeof(txid2) + sizeof(vout2)]; - if ( iambob != 0 ) + /*if ( iambob != 0 ) { printf("_LP_utxo2find deprecated iambob\n"); return(0); - } + }*/ LP_utxosetkey(key2,txid2,vout2); HASH_FIND(hh2,G.LP_utxoinfos2,key2,sizeof(key2),utxo); return(utxo); @@ -401,11 +401,11 @@ struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) struct LP_utxoinfo *LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo=0; - if ( iambob != 0 ) + /*if ( iambob != 0 ) { printf("LP_utxofind deprecated iambob\n"); return(0); - } + }*/ portable_mutex_lock(&LP_utxomutex); utxo = _LP_utxofind(iambob,txid,vout); portable_mutex_unlock(&LP_utxomutex); @@ -415,11 +415,11 @@ struct LP_utxoinfo *LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) struct LP_utxoinfo *LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; - if ( iambob != 0 ) + /*if ( iambob != 0 ) { printf("LP_utxo2find deprecated iambob\n"); return(0); - } + }*/ portable_mutex_lock(&LP_utxomutex); utxo = _LP_utxo2find(iambob,txid2,vout2); portable_mutex_unlock(&LP_utxomutex); From 5b666b01a972eb5317e042d063786beb61ba916e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 14:08:04 +0300 Subject: [PATCH 0682/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 02b67ddf9..b7609e229 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -996,11 +996,12 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i break; if ( j != numavoids ) continue; - //printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); + printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); n = LP_listunspent_both(base,coinaddr); + printf("unspent.(%s) n.%d\n",coinaddr,n); if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); From c66ee29f76090e19a6ddc0d154aaf568bad7d367 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 14:12:01 +0300 Subject: [PATCH 0683/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b7609e229..07e917fbf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -489,7 +489,7 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_address_utxo **utxos,int32_t m if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) { targetval = LP_basesatoshis(volume,price,txfee,desttxfee); - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; i Date: Sat, 30 Sep 2017 14:15:29 +0300 Subject: [PATCH 0684/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 07e917fbf..206bb80c9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -514,8 +514,8 @@ struct LP_utxoinfo *LP_address_utxopair(struct LP_address_utxo **utxos,int32_t m } } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); } - } - } + } else printf("no utxos pass LP_address_utxo_ptrs filter\n"); + } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); return(0); } From 7ffdef7d26ae5f825c32672555b5fdbb9b070b0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 14:20:33 +0300 Subject: [PATCH 0685/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 206bb80c9..97ac19e96 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -481,12 +481,12 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d else return(0); } -struct LP_utxoinfo *LP_address_utxopair(struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,uint64_t desttxfee) +struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,uint64_t desttxfee) { struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { - if ( (m= LP_address_utxo_ptrs(utxos,max,ap)) > 1 ) + if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap)) > 1 ) { targetval = LP_basesatoshis(volume,price,txfee,desttxfee); if ( 1 ) @@ -828,7 +828,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( LP_unallocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_unallocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { LP_listunspent_both(Q.srccoin,Q.coinaddr); - if ( (butxo= LP_address_utxopair(utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) + if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { Q.txid = butxo->payment.txid; Q.vout = butxo->payment.vout; @@ -1005,7 +1005,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); - if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) + if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) { bestutxo->pubkey = pubp->pubkey; safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 76aa1fb30..4eaaece84 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -121,21 +121,23 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } -struct LP_utxoinfo *LP_unallocated(bits256 txid,int32_t vout) +struct LP_utxoinfo *LP_unallocated(int32_t iambob,bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo; - if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) - return(0); - if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) - return(0); - if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + if ( (utxo= _LP_utxofind(iambob,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); return(0); - if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + } + if ( (utxo= _LP_utxo2find(iambob,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); return(0); + } return(utxo); } -int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) +int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) { struct LP_address_utxo *up,*tmp; int32_t n = 0; portable_mutex_lock(&LP_utxomutex); @@ -143,7 +145,7 @@ int32_t LP_address_utxo_ptrs(struct LP_address_utxo **utxos,int32_t max,struct L { if ( up->spendheight <= 0 ) { - if ( LP_unallocated(up->U.txid,up->U.vout) != 0 ) + if ( LP_unallocated(iambob,up->U.txid,up->U.vout) != 0 ) { utxos[n++] = up; if ( n >= max ) From 32704381dd8ec17461a15af71ec206183b7f26dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 14:42:49 +0300 Subject: [PATCH 0686/2732] Test --- iguana/exchanges/LP_utxo.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4eaaece84..32e7d5df1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -121,20 +121,30 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } -struct LP_utxoinfo *LP_unallocated(int32_t iambob,bits256 txid,int32_t vout) +struct LP_utxoinfo *LP_unallocated(bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo; - if ( (utxo= _LP_utxofind(iambob,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); - return(0); + return(utxo); } - if ( (utxo= _LP_utxo2find(iambob,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); - return(0); + return(utxo); } - return(utxo); + if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); + return(utxo); + } + if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); + return(utxo); + } + return(0); } int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) @@ -145,7 +155,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 { if ( up->spendheight <= 0 ) { - if ( LP_unallocated(iambob,up->U.txid,up->U.vout) != 0 ) + if ( LP_unallocated(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max ) From a59682132b1f38ceabf24a5bbde0da3ec5179a28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 15:02:31 +0300 Subject: [PATCH 0687/2732] Test --- iguana/exchanges/LP_ordermatch.c | 16 +++++++++------- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 97ac19e96..20da8791e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -481,21 +481,22 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d else return(0); } -struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double volume,double price,uint64_t desttxfee) +struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price,uint64_t desttxfee) { struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap)) > 1 ) { - targetval = LP_basesatoshis(volume,price,txfee,desttxfee); + targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); if ( 1 ) { int32_t i; for (i=0; iU.value)); - printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),volume,price,dstr(txfee)); + printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),relvolume,price,dstr(txfee)); } + mini = -1; if ( targetval != 0 && (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { up = utxos[mini]; @@ -513,7 +514,8 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** } } } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); - } + } else if ( targetval != 0 && mini >= 0 ) + printf("targetval %.8f mini.%d ratio %.8f\n",dstr(targetval),mini,(double)utxos[mini]->U.value/targetval); } else printf("no utxos pass LP_address_utxo_ptrs filter\n"); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); return(0); @@ -825,7 +827,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { - if ( LP_unallocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_unallocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + if ( LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { LP_listunspent_both(Q.srccoin,Q.coinaddr); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) @@ -996,12 +998,12 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i break; if ( j != numavoids ) continue; - printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); + //printf("%s pubcmp %d\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519)); if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); n = LP_listunspent_both(base,coinaddr); - printf("unspent.(%s) n.%d\n",coinaddr,n); + //printf("unspent.(%s) n.%d\n",coinaddr,n); if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 32e7d5df1..ed740ffad 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -121,7 +121,7 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } -struct LP_utxoinfo *LP_unallocated(bits256 txid,int32_t vout) +struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo; if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) @@ -155,7 +155,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 { if ( up->spendheight <= 0 ) { - if ( LP_unallocated(up->U.txid,up->U.vout) == 0 ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 1698afa57..034f72e38 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -332,6 +332,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t val = value; val2 = value2; } + dispflag = 1; if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; From 59ef13c7fc629996791dbb2a2cd4bbf1a643b425 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 15:11:27 +0300 Subject: [PATCH 0688/2732] Test --- iguana/exchanges/LP_utxos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 034f72e38..fa0aebdc4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -283,6 +283,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { + char str[65],str2[65]; printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } From 82d2401b3fa9bdddfb60bf2945a9f4bd12765097 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 15:11:46 +0300 Subject: [PATCH 0689/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fa0aebdc4..e1496b174 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -283,7 +283,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { - char str[65],str2[65]; printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); + char str[65],str2[65]; printf("%s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } From 4a496c751faed353d609f15142e629adf80efe54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 15:15:31 +0300 Subject: [PATCH 0690/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e1496b174..255d595c3 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -281,10 +281,10 @@ char *LP_spentcheck(cJSON *argjson) struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; - if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) + if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { char str[65],str2[65]; printf("%s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); - printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); + printf("session.%u addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } if ( iambob != 0 ) From cb94dc218cacfc195fef659556e6e64b2749a345 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 15:17:25 +0300 Subject: [PATCH 0691/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 255d595c3..fbd5defa4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -287,11 +287,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("session.%u addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } - if ( iambob != 0 ) + /*if ( iambob != 0 ) { printf("deprecated bob utxos\n"); return(0); - } + }*/ if ( (coin= LP_coinfind(symbol)) == 0 || (IAMLP == 0 && coin->inactive != 0) ) { printf("LP_utxoadd reject inactive %s\n",symbol); From c45761becbd88f5296c401a29dfab05bc5d324f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 19:29:28 +0300 Subject: [PATCH 0692/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 20da8791e..30e2fb408 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -843,7 +843,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { - char str[65]; printf("couldnt find bob utxos for autxo %s/v%d %.8f\n",bits256_str(str,autxo->payment.txid),autxo->payment.vout,dstr(autxo->S.satoshis)); + char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(autxo->S.satoshis)); return(1); } printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); From 2403fc95813f2f13410cf6f0a3d2c2ab399e5cd3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 19:44:15 +0300 Subject: [PATCH 0693/2732] Test --- iguana/exchanges/LP_ordermatch.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 30e2fb408..35cc517c3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -509,7 +509,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) { utxo->S.satoshis = targetval; - printf("targetval %.8f, found val %.8f | targetval2 %.8f val2 %.8f\n",dstr(targetval),dstr(up->U.value),dstr(targetval2),dstr(up2->U.value)); + char str[65],str2[65]; printf("targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",dstr(targetval),dstr(up->U.value),bits256_str(str,up->U.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,up2->U.txid)); return(utxo); } } @@ -836,17 +836,23 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - } + char str[65],str2[65]; printf("set utxo %s/v%d %s/v%d %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(autxo->S.satoshis)); + } else printf("cant find utxopair\n"); //LP_abutxo_set(0,butxo,&Q); //LP_butxo_swapfields(butxo); - } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + } + else + { + printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); + butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + } } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(autxo->S.satoshis)); return(1); } - printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); From 6c69eeb09fabc4660879d013404965371d957b95 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 20:00:38 +0300 Subject: [PATCH 0694/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxos.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 35cc517c3..3054f8940 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -836,7 +836,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - char str[65],str2[65]; printf("set utxo %s/v%d %s/v%d %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(autxo->S.satoshis)); + char str[65],str2[65]; printf("set utxo %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else printf("cant find utxopair\n"); //LP_abutxo_set(0,butxo,&Q); //LP_butxo_swapfields(butxo); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fbd5defa4..25cc2ea0d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -302,7 +302,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t { if ( value2 > 2*txfee ) tmpsatoshis = (((value2 - 2*txfee) / 9) << 3); - else return(0); + else + { + printf("value2 %.8f <= 2 * %.8f\n",dstr(value2),dstr(txfee)); + return(0); + } } else tmpsatoshis = (value - txfee); char str[65],str2[65],dispflag = 0;//(iambob == 0); if ( iambob == 0 && bits256_cmp(pubkey,G.LP_mypub25519) != 0 ) @@ -339,7 +343,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t dispflag = 1; if ( (utxo= LP_utxofinds(iambob,txid,vout,txid2,vout2)) != 0 ) { - if ( 0 && LP_ismine(utxo) == 0 ) + //if ( 0 && LP_ismine(utxo) == 0 ) { char str2[65],str3[65]; printf("iambob.%d %s %s utxoadd.(%.8f %.8f) %s %s\n",iambob,bits256_str(str3,pubkey),symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(tmpsatoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); @@ -366,6 +370,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t //else if ( profitmargin > SMALLVAL ) // utxo->S.profitmargin = profitmargin; utxo->T.lasttime = (uint32_t)time(NULL); + printf("return existing utxo\n"); return(utxo); } } From 61f674400dfb33d3e328ec72d629eb9a34154a8f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 20:01:12 +0300 Subject: [PATCH 0695/2732] Test --- iguana/exchanges/LP_utxos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 25cc2ea0d..d61df3473 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -318,7 +318,9 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t { if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); + static uint32_t counter; + if ( counter++ < 3 ) + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) From 0e7283022e125fe26895c22fa356d8fb25e10fb0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 20:14:51 +0300 Subject: [PATCH 0696/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 +++++--- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3054f8940..5a45ee9e5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -509,7 +509,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) { utxo->S.satoshis = targetval; - char str[65],str2[65]; printf("targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",dstr(targetval),dstr(up->U.value),bits256_str(str,up->U.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,up2->U.txid)); + char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,up->U.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,up2->U.txid)); return(utxo); } } @@ -827,8 +827,10 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { + char str[65],str2[65]; if ( LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { + printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); LP_listunspent_both(Q.srccoin,Q.coinaddr); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { @@ -836,7 +838,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - char str[65],str2[65]; printf("set utxo %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); + printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else printf("cant find utxopair\n"); //LP_abutxo_set(0,butxo,&Q); //LP_butxo_swapfields(butxo); @@ -847,7 +849,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); } } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); - printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); + printf("butxo.%p TRADECOMMAND.(%s)\n",butxo,jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(autxo->S.satoshis)); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index d61df3473..349f3ad22 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -345,7 +345,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t dispflag = 1; if ( (utxo= LP_utxofinds(iambob,txid,vout,txid2,vout2)) != 0 ) { - //if ( 0 && LP_ismine(utxo) == 0 ) + if ( 0 && LP_ismine(utxo) == 0 ) { char str2[65],str3[65]; printf("iambob.%d %s %s utxoadd.(%.8f %.8f) %s %s\n",iambob,bits256_str(str3,pubkey),symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(tmpsatoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); From 8dce8b57652f4d60d6de63642d5d2e662bcd146b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 20:33:22 +0300 Subject: [PATCH 0697/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_utxos.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5a45ee9e5..6e902dcd3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -509,7 +509,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) { utxo->S.satoshis = targetval; - char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,up->U.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,up2->U.txid)); + char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); return(utxo); } } @@ -824,6 +824,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); + printf("A %p, B %p\n",autxo,butxo); //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 633633af3..107cca7a0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -614,9 +614,9 @@ double _LP_getestimatedrate(struct iguana_info *coin) rate = atof(retstr) / 1024.; if ( rate < 0.00000020 ) rate = 0.00000020; - rate *= 1.25; + rate *= 1.1; if ( coin->electrum != 0 ) - rate *= 1.25; + rate *= 1.667; if ( fabs(rate - coin->rate) > SMALLVAL ) printf("t%u estimated rate.(%s) (%s) -> %.8f %.8f\n",coin->ratetime,coin->symbol,retstr,rate,coin->rate); coin->rate = rate; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 349f3ad22..f3f269b5f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -283,7 +283,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { - char str[65],str2[65]; printf("%s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); + char str[65],str2[65]; printf("REJECT %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); printf("session.%u addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } @@ -372,7 +372,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t //else if ( profitmargin > SMALLVAL ) // utxo->S.profitmargin = profitmargin; utxo->T.lasttime = (uint32_t)time(NULL); - printf("return existing utxo\n"); + printf("return existing utxo %s %s\n",bits256_str(str,utxo->payment.txid),bits256_str(str2,utxo->deposit.txid)); return(utxo); } } @@ -409,7 +409,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - printf(" %s %.8f %.8f addutxo.%d pubkey.%s session.%u\n",symbol,dstr(value),dstr(value2),LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); + printf(" %s %.8f %.8f %p addutxo.%d pubkey.%s session.%u\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,G.LP_utxoinfos,utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From 2a2dcf6210380ac4c1f174ff09332e83da8d0c15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 20:39:23 +0300 Subject: [PATCH 0698/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6e902dcd3..a83a6e230 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -806,7 +806,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received %s\n",method); @@ -850,6 +850,12 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); } } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + if ( butxo == 0 ) + { + value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); + } printf("butxo.%p TRADECOMMAND.(%s)\n",butxo,jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { From 69db057143414660d95af502ba158c6c1a1d7571 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 20:55:50 +0300 Subject: [PATCH 0699/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxos.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a83a6e230..2f1700f02 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -859,7 +859,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("butxo.%p TRADECOMMAND.(%s)\n",butxo,jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { - char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f\n",bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(autxo->S.satoshis)); + char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f -> %.8f\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,dstr(Q.satoshis),dstr(Q.destsatoshis)); return(1); } if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f3f269b5f..679cda5e7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -339,7 +339,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t val = value; val2 = value2; } - dispflag = 1; + dispflag = 0; if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; @@ -372,7 +372,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t //else if ( profitmargin > SMALLVAL ) // utxo->S.profitmargin = profitmargin; utxo->T.lasttime = (uint32_t)time(NULL); - printf("return existing utxo %s %s\n",bits256_str(str,utxo->payment.txid),bits256_str(str2,utxo->deposit.txid)); + printf("return existing utxo[%d] %s %s\n",iambob,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid)); return(utxo); } } @@ -409,7 +409,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - printf(" %s %.8f %.8f %p addutxo.%d pubkey.%s session.%u\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); + printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,G.LP_utxoinfos,utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From edde7e3dae41b78d887cc06e8f612e1d492abfd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:03:19 +0300 Subject: [PATCH 0700/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 35 ++++++++++++++++++--------------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 945c2a1d8..931906904 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -62,7 +62,7 @@ struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; struct LP_globals { - struct LP_utxoinfo *LP_utxoinfos,*LP_utxoinfos2; + struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; bits256 LP_mypub25519,LP_mypriv25519; uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ed740ffad..28cb9cfca 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -393,7 +393,7 @@ struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) return(0); }*/ LP_utxosetkey(key,txid,vout); - HASH_FIND(hh,G.LP_utxoinfos,key,sizeof(key),utxo); + HASH_FIND(hh,G.LP_utxoinfos[iambob],key,sizeof(key),utxo); return(utxo); } @@ -406,7 +406,7 @@ struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) return(0); }*/ LP_utxosetkey(key2,txid2,vout2); - HASH_FIND(hh2,G.LP_utxoinfos2,key2,sizeof(key2),utxo); + HASH_FIND(hh2,G.LP_utxoinfos2[iambob],key2,sizeof(key2),utxo); return(utxo); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 679cda5e7..e9783ca29 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -212,13 +212,13 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { - uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; + uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; int32_t iambob = 0; if ( symbol == 0 || destsatoshis == 0 ) { printf("LP_utxo_bestfit error symbol.%p %.8f\n",symbol,dstr(destsatoshis)); return(0); } - HASH_ITER(hh,G.LP_utxoinfos,utxo,tmp) + HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( strcmp(symbol,utxo->coin) != 0 ) @@ -411,9 +411,9 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t } printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); portable_mutex_lock(&LP_utxomutex); - HASH_ADD_KEYPTR(hh,G.LP_utxoinfos,utxo->key,sizeof(utxo->key),utxo); + HASH_ADD_KEYPTR(hh,G.LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) - HASH_ADD_KEYPTR(hh2,G.LP_utxoinfos2,utxo->key2,sizeof(utxo->key2),utxo); + HASH_ADD_KEYPTR(hh2,G.LP_utxoinfos2[iambob],utxo->key2,sizeof(utxo->key2),utxo); portable_mutex_unlock(&LP_utxomutex); if ( iambob != 0 ) { @@ -436,7 +436,7 @@ cJSON *LP_inventory(char *symbol) else myipaddr = "127.0.0.1"; if ( (coin= LP_coinfind(symbol)) != 0 ) LP_listunspent_both(symbol,coin->smartaddr); - HASH_ITER(hh,G.LP_utxoinfos,utxo,tmp) + HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { char str[65]; //printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); @@ -767,7 +767,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) int32_t LP_passphrase_init(char *passphrase,char *gui) { - static void *ctx; struct LP_utxoinfo *utxo,*tmp; + static void *ctx; int32_t iambob; struct LP_utxoinfo *utxo,*tmp; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( G.LP_pendingswaps != 0 ) @@ -780,20 +780,23 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) printf("waiting for G.waiting\n"); sleep(5); } - if ( G.LP_utxoinfos != 0 ) + for (iambob=0; iambob<2; iambob++) { - HASH_ITER(hh,G.LP_utxoinfos,utxo,tmp) + if ( G.LP_utxoinfos[iambob] != 0 ) { - HASH_DELETE(hh,G.LP_utxoinfos,utxo); - free(utxo); + HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) + { + HASH_DELETE(hh,G.LP_utxoinfos[iambob],utxo); + free(utxo); + } } - } - if ( G.LP_utxoinfos2 != 0 ) - { - HASH_ITER(hh,G.LP_utxoinfos2,utxo,tmp) + if ( G.LP_utxoinfos2[iambob] != 0 ) { - HASH_DELETE(hh,G.LP_utxoinfos2,utxo); - free(utxo); + HASH_ITER(hh,G.LP_utxoinfos2[iambob],utxo,tmp) + { + HASH_DELETE(hh,G.LP_utxoinfos2[iambob],utxo); + free(utxo); + } } } memset(&G,0,sizeof(G)); From 59d2919d3a65c5ccd802fcabb485c151a442d55c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:10:36 +0300 Subject: [PATCH 0701/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxos.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2f1700f02..a9dec4dfd 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -681,7 +681,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); }*/ - if ( (autxo= LP_utxopairfind(1,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) + if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { printf("cant find autxo\n"); return(clonestr("{\"error\":\"cant find autxo\"}")); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e9783ca29..83885e4e1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -372,7 +372,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t //else if ( profitmargin > SMALLVAL ) // utxo->S.profitmargin = profitmargin; utxo->T.lasttime = (uint32_t)time(NULL); - printf("return existing utxo[%d] %s %s\n",iambob,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid)); + //printf("return existing utxo[%d] %s %s\n",iambob,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid)); return(utxo); } } @@ -409,7 +409,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); + //printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,G.LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From 8c57f70db6b7301c8ffdde7173afbd9a33ccf7a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:13:30 +0300 Subject: [PATCH 0702/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a9dec4dfd..48ad01f89 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1067,7 +1067,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"invalid parameter\"}")); memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); - destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; + destsatoshis = SATOSHIDEN * relvolume + 3*desttxfee; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) From fdbe1c744c2f3086cd71c2116c9e65cdfcd11bb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:17:10 +0300 Subject: [PATCH 0703/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 48ad01f89..c444653a7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1065,9 +1065,10 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel timeout = LP_AUTOTRADE_TIMEOUT; if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); + maxprice *= 1.005; memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); - destsatoshis = SATOSHIDEN * relvolume + 3*desttxfee; + destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0a051e362..f60b025b4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -703,7 +703,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * { if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) { - printf("skip pubp since no rmd160\n"); + //printf("skip pubp since no rmd160\n"); continue; } bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); From fdc370461f4c2389aa2ec805a9f2a66e22fd9a4b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:30:26 +0300 Subject: [PATCH 0704/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_swap.c | 7 ++++--- iguana/exchanges/LP_transaction.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c444653a7..cfc356d81 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -686,7 +686,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("cant find autxo\n"); return(clonestr("{\"error\":\"cant find autxo\"}")); } - LP_abutxo_set(autxo,0,&Q); + //LP_abutxo_set(autxo,0,&Q); if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) { value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 6300e0dbf..50fd58e36 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -412,10 +412,10 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) > 0 ) { - //printf("start wait\n"); + printf("start wait\n"); if ( (datalen= nn_recv(pairsock,&data,NN_MSG,0)) >= 0 ) { - //printf("wait for got.%d\n",datalen); + printf("wait for got.%d\n",datalen); retval = (*verify)(swap,data,datalen); nn_freemsg(data); //printf("retval.%d\n",retval); @@ -827,7 +827,8 @@ void LP_aliceloop(void *_swap) swap->N.pair = -1; } basilisk_swap_finished(swap); - free(swap); + printf("finish swap.%p\n",swap); + //free(swap); G.LP_pendingswaps--; } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 489de1632..1facc6725 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1329,12 +1329,12 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); basilisk_dontforget_update(swap,&swap->bobdeposit); //LP_importaddress(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr); - /*for (i=0; ibobdeposit.I.datalen; i++) + int32_t i; char str[65]; for (i=0; ibobdeposit.I.datalen; i++) printf("%02x",swap->bobdeposit.txbytes[i]); printf(" <- bobdeposit.%d %s\n",swap->bobdeposit.I.datalen,bits256_str(str,swap->bobdeposit.I.signedtxid)); for (i=0; ibobdeposit.I.redeemlen; i++) printf("%02x",swap->bobdeposit.redeemscript[i]); - printf(" <- bobdeposit redeem %d %s suppress.%d\n",i,swap->bobdeposit.I.destaddr,swap->aliceclaim.I.suppress_pubkeys);*/ + printf(" <- bobdeposit redeem %d %s suppress.%d\n",i,swap->bobdeposit.I.destaddr,swap->aliceclaim.I.suppress_pubkeys); memcpy(swap->aliceclaim.redeemscript,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); swap->aliceclaim.I.redeemlen = swap->bobdeposit.I.redeemlen; memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); From 34d4d38b41c8eb90957f09f9da7bd4f3b2848b99 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:38:51 +0300 Subject: [PATCH 0705/2732] Test --- iguana/exchanges/LP_utxo.c | 6 +++--- iguana/exchanges/LP_utxos.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 28cb9cfca..3224428b0 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -596,16 +596,16 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int numconfirms = jint(txobj,"confirmations"); free_json(txobj); } - else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) + if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) numconfirms = 0; } else { if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) numconfirms = (LP_getheight(coin) - ht + 1); - else if ( mempool != 0 ) + if ( mempool != 0 ) { - if (LP_waitmempool(symbol,coinaddr,txid,vout,30) >= 0 ) + if ( LP_waitmempool(symbol,coinaddr,txid,vout,30) >= 0 ) numconfirms = 0; } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 83885e4e1..f3cc3ad7e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -323,12 +323,12 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,1)) <= 0 ) { printf("LP_utxoadd reject numconfirms.%d %s.%s\n",numconfirms,symbol,bits256_str(str,txid)); return(0); } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,vout2,0)) <= 0 ) + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,vout2,1)) <= 0 ) { printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); From 2c076856e6e321fe1177d91efd5867139e76b4de Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:43:49 +0300 Subject: [PATCH 0706/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 94f689a22..d7ca44dcd 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -324,7 +324,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep free_json(retjson); else { - printf("external unspent has no gettxout\n"); + //printf("external unspent has no gettxout\n"); flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,0,1); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f3cc3ad7e..b35e2e9c5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -218,6 +218,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) printf("LP_utxo_bestfit error symbol.%p %.8f\n",symbol,dstr(destsatoshis)); return(0); } + // jl777 remove mempool HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); @@ -323,12 +324,12 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,1)) <= 0 ) + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) { printf("LP_utxoadd reject numconfirms.%d %s.%s\n",numconfirms,symbol,bits256_str(str,txid)); return(0); } - if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,vout2,1)) <= 0 ) + if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,vout2,0)) <= 0 ) { printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); From 320f0294c9b31b520b3649334aa08d184869dbe0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 21:48:09 +0300 Subject: [PATCH 0707/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3224428b0..b109e3130 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -596,14 +596,14 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int numconfirms = jint(txobj,"confirmations"); free_json(txobj); } - if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) + else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) numconfirms = 0; } else { if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) numconfirms = (LP_getheight(coin) - ht + 1); - if ( mempool != 0 ) + else if ( mempool != 0 ) { if ( LP_waitmempool(symbol,coinaddr,txid,vout,30) >= 0 ) numconfirms = 0; From f45a9670ec263fc0d0d6a8eddb4729537c9ce140 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 22:00:55 +0300 Subject: [PATCH 0708/2732] Test --- iguana/exchanges/LP_utxos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b35e2e9c5..49009c739 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -506,6 +506,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { + printf("%s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) @@ -620,8 +621,6 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } //else printf("nothing near i.%d\n",i); } else break; } - if ( iambob == 1 ) - free(values); if ( enable_utxos == 0 ) break; } @@ -630,6 +629,8 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( flag != 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } + if ( values != 0 ) + free(values); //printf("privkey.%s %.8f\n",symbol,dstr(total)); return(flag); } From 8b8c7856e89092059956ec7f57680d78da39d189 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 22:10:53 +0300 Subject: [PATCH 0709/2732] Test --- iguana/exchanges/LP_ordermatch.c | 86 +----------------------------- iguana/exchanges/LP_statemachine.c | 81 ++++++++++++++++++++++++++++ iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 84 insertions(+), 85 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cfc356d81..32d740ab7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -435,25 +435,6 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -/*struct LP_utxoinfo BUTXOS[100]; - -int32_t LP_butxo_findeither(bits256 txid,int32_t vout) -{ - struct LP_utxoinfo *utxo; int32_t i,retval = 0; - portable_mutex_lock(&LP_butxomutex); - for (i=0; ipayment.vout && bits256_cmp(txid,utxo->payment.txid)) == 0 || (vout == utxo->deposit.vout && bits256_cmp(txid,utxo->deposit.txid) == 0) ) - { - retval = 1; - break; - } - } - portable_mutex_unlock(&LP_butxomutex); - return(retval); -}*/ - int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60); @@ -489,7 +470,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; ipayment.vout == utxo->payment.vout && butxo->deposit.vout == utxo->deposit.vout && bits256_nonz(butxo->payment.txid) != 0 && bits256_nonz(butxo->deposit.txid) != 0 && bits256_cmp(butxo->payment.txid,utxo->payment.txid) == 0 && bits256_cmp(butxo->deposit.txid,utxo->deposit.txid) == 0 ) - break; - if ( utxo->S.swap == 0 && now > utxo->T.swappending ) - memset(utxo,0,sizeof(*utxo)); - utxo = 0; - } - //portable_mutex_unlock(&LP_butxomutex); - return(utxo); -} - -struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) -{ - static struct LP_utxoinfo zeroes; - int32_t i; struct LP_utxoinfo *utxo=0; - portable_mutex_lock(&LP_butxomutex); - if ( (utxo= _LP_butxo_find(butxo)) == 0 ) - { - for (i=0; iS = srcutxo->S; - destutxo->T = srcutxo->T; -} - -void LP_butxo_swapfields(struct LP_utxoinfo *butxo) -{ - struct LP_utxoinfo *getutxo=0; - portable_mutex_lock(&LP_butxomutex); - if ( (getutxo= _LP_butxo_find(butxo)) != 0 ) - LP_butxo_swapfields_copy(butxo,getutxo); - portable_mutex_unlock(&LP_butxomutex); -} - -void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) -{ - struct LP_utxoinfo *setutxo; - if ( (setutxo= LP_butxo_add(butxo)) != 0 ) - { - LP_butxo_swapfields_copy(setutxo,butxo); - } -}*/ - void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) { if ( butxo != 0 ) @@ -824,7 +742,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); - printf("A %p, B %p\n",autxo,butxo); //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { @@ -974,6 +891,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } else { + printf("invalid price %.8f\n",price); jaddnum(bestitem,"maxprice",maxprice); jaddstr(bestitem,"status","no response to request"); } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 073832675..29af48553 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1608,6 +1608,87 @@ int32_t LP_utxopurge(int32_t allutxos) portable_mutex_unlock(&LP_utxomutex); return(n); } +/*struct LP_utxoinfo *_LP_butxo_find(struct LP_utxoinfo *butxo) + { + int32_t i; struct LP_utxoinfo *utxo=0; uint32_t now = (uint32_t)time(NULL); + //portable_mutex_lock(&LP_butxomutex); + for (i=0; ipayment.vout == utxo->payment.vout && butxo->deposit.vout == utxo->deposit.vout && bits256_nonz(butxo->payment.txid) != 0 && bits256_nonz(butxo->deposit.txid) != 0 && bits256_cmp(butxo->payment.txid,utxo->payment.txid) == 0 && bits256_cmp(butxo->deposit.txid,utxo->deposit.txid) == 0 ) + break; + if ( utxo->S.swap == 0 && now > utxo->T.swappending ) + memset(utxo,0,sizeof(*utxo)); + utxo = 0; + } + //portable_mutex_unlock(&LP_butxomutex); + return(utxo); + } + + struct LP_utxoinfo *LP_butxo_add(struct LP_utxoinfo *butxo) + { + static struct LP_utxoinfo zeroes; + int32_t i; struct LP_utxoinfo *utxo=0; + portable_mutex_lock(&LP_butxomutex); + if ( (utxo= _LP_butxo_find(butxo)) == 0 ) + { + for (i=0; iS = srcutxo->S; + destutxo->T = srcutxo->T; + } + + void LP_butxo_swapfields(struct LP_utxoinfo *butxo) + { + struct LP_utxoinfo *getutxo=0; + portable_mutex_lock(&LP_butxomutex); + if ( (getutxo= _LP_butxo_find(butxo)) != 0 ) + LP_butxo_swapfields_copy(butxo,getutxo); + portable_mutex_unlock(&LP_butxomutex); + } + + void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo) + { + struct LP_utxoinfo *setutxo; + if ( (setutxo= LP_butxo_add(butxo)) != 0 ) + { + LP_butxo_swapfields_copy(setutxo,butxo); + } + }*/ +/*struct LP_utxoinfo BUTXOS[100]; + + int32_t LP_butxo_findeither(bits256 txid,int32_t vout) + { + struct LP_utxoinfo *utxo; int32_t i,retval = 0; + portable_mutex_lock(&LP_butxomutex); + for (i=0; ipayment.vout && bits256_cmp(txid,utxo->payment.txid)) == 0 || (vout == utxo->deposit.vout && bits256_cmp(txid,utxo->deposit.txid) == 0) ) + { + retval = 1; + break; + } + } + portable_mutex_unlock(&LP_butxomutex); + return(retval); + }*/ + struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson) { struct LP_utxoinfo *utxo; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 49009c739..e98fd497a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -506,7 +506,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - printf("%s %s\n",coin->symbol,jprint(array,0)); + //printf("%s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) From 75f83217536ccf99460473708f36511e24b69c82 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 22:15:46 +0300 Subject: [PATCH 0710/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 32d740ab7..de9658f40 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -398,7 +398,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L break; } } - usleep(1000000); + usleep(250000); } return(price); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f60b025b4..2755710a7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -392,12 +392,12 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i ptr->price = (double)ptr->Q.destsatoshis / ptr->Q.satoshis; if ( LP_pricevalid(ptr->price) <= 0 ) ptr->price = 0.; - //printf("LP_pricecache: set %s/%s ptr->price %.8f\n",base,rel,ptr->price); + printf("LP_pricecache: set %s/%s ptr->price %.8f\n",base,rel,ptr->price); } - //printf("found %s/%s %.8f\n",base,rel,ptr->price); + printf("found %s/%s %.8f\n",base,rel,ptr->price); return(ptr->price); } - //char str[65]; printf("cachemiss %s/%s %s/v%d\n",base,rel,bits256_str(str,txid),vout); + char str[65]; printf("cachemiss %s/%s %s/v%d\n",base,rel,bits256_str(str,txid),vout); return(0.); } From 884c33f6a641579085ec0f6dd68d5c3d35bc3fb5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 22:32:03 +0300 Subject: [PATCH 0711/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index de9658f40..b32108f0b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -983,7 +983,9 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel timeout = LP_AUTOTRADE_TIMEOUT; if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); - maxprice *= 1.005; + if ( strcmp("BTC",rel) == 0 ) + maxprice *= 1.01; + else maxprice *= 1.001; memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; From 2b9e3c7ba5b86f2ddf58a9b877642f8eba3696dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 09:34:41 +0300 Subject: [PATCH 0712/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ++++++----- iguana/exchanges/electrums | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 931906904..f5ca48945 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,14 +20,15 @@ // marketmaker // // new features: +// -check for completed one being spent +// make remember remember // sign, spv check // bittrex balancing // stats - -// -detect port conflicts on enable -// -check for completed one being spent -// -prevent autxo reuse -// -add extra hash to keypair25519 +// so alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot +// gettxout mempool a few other local network calls +// electrum cache for blockchain.transaction.get +// scan history for electrum after swap // unduplicated bugs: // swap cancel should cleanly cancel diff --git a/iguana/exchanges/electrums b/iguana/exchanges/electrums index 06efc8f02..43b4d8811 100755 --- a/iguana/exchanges/electrums +++ b/iguana/exchanges/electrums @@ -1,5 +1,6 @@ -ource userpass +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"REVS\",\"ipaddr\":\"173.212.225.176\",\"port\":50050}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CHIPS\",\"ipaddr\":\"173.212.225.176\",\"port\":50076}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"ARG\",\"ipaddr\":\"173.212.225.176\",\"port\":50081}" From 436c57d0adb8e54a852f79db63eeb9588ba11291 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 09:56:58 +0300 Subject: [PATCH 0713/2732] Test --- iguana/exchanges/LP_coins.c | 1 + iguana/exchanges/LP_socket.c | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index bf02bc11a..e1eca4ab0 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -174,6 +174,7 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) { struct electrum_info *ep; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); + jaddnum(item,"height",coin->height); if ( showwif != 0 ) { bitcoin_priv2wif(coin->wiftaddr,wifstr,G.LP_mypriv25519,coin->wiftype); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d7ca44dcd..d72b9d1b3 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -253,16 +253,6 @@ struct electrum_info } *Electrums[8192]; int32_t Num_electrums; -// purge timedout -/* -if ( (retjson= electrum_address_listunspent(symbol,ep,&retjson,addr)) != 0 ) -you can call it like the above, where symbol is the coin, ep is the electrum server info pointer, the 0 is a callback ptr where 0 means to block till it is done -all the API calls have the same three args -if the callback ptr is &retjson, then on completion it will put the cJSON *ptr into it, so to spawn a bunch of calls you need to call with symbol,ep,&retjsons[i],... -default timeout is set to 2 seconds, not sure if that is enough, on each receive from any server, requests that are timeout are purged (and if a callback set, will just return and "error" timeout JSON -a null value for ep will make it choose a random server for that coin - */ - struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) { struct electrum_info *rbuf[128],*recent_ep; uint32_t recent,mostrecent = 0; int32_t i,n = 0; @@ -442,8 +432,6 @@ cJSON *electrum_hasharg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,c return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } -//" "--blockchain.numblocks.subscribe", "--blockchain.address.get_proof", "--blockchain.utxo.get_address", - cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.version",ELECTRUM_TIMEOUT)); } cJSON *electrum_banner(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.banner",ELECTRUM_TIMEOUT)); } cJSON *electrum_donation(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.donation_address",ELECTRUM_TIMEOUT)); } @@ -517,7 +505,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); @@ -700,7 +688,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) *(ep->heighttimep) = (uint32_t)time(NULL); if ( (coin= LP_coinfind(ep->symbol)) != 0 ) coin->updaterate = (uint32_t)time(NULL); - printf("%s ELECTRUM >>>>>>>>> set height.%d\n",ep->symbol,height); + //printf("%s ELECTRUM >>>>>>>>> set height.%d\n",ep->symbol,height); } } idnum = juint(strjson,"id"); From 54f39a1b3d3dc4178f567b5cdf59e4bbcc876c5e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 09:58:15 +0300 Subject: [PATCH 0714/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d72b9d1b3..7ae75f3ad 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -529,7 +529,7 @@ cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp, cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { - char str[65]; printf("%s TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); + char str[65]; printf("%s add cache here -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 ) return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); else return(cJSON_Parse("{\"error\":\"null txid\"}")); From 0fff37ae5a829dee74dad63995557e8971382dc1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:22:15 +0300 Subject: [PATCH 0715/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 107cca7a0..88ab41795 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -259,7 +259,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (retjson= electrum_transaction(symbol,coin->electrum,&retjson,txid)) != 0 ) { hexstr = jprint(retjson,1); if ( strlen(hexstr) > 20000 ) @@ -313,7 +313,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { printf("gettxout v%d\n",vout); sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (hexobj= electrum_transaction(symbol,coin->electrum,&hexobj,txid)) != 0 ) { hexstr = jprint(hexobj,1); if ( strlen(hexstr) > 20000 ) From bf87f475770cb5c4266d26d9ded2a069ed439ce6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:25:08 +0300 Subject: [PATCH 0716/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7ae75f3ad..efac000e8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -505,7 +505,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 46e80013974ef86ba70d3c4f59e681e238fa4f20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:30:39 +0300 Subject: [PATCH 0717/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index efac000e8..f4809d1f1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -501,7 +501,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 ) + if ( 1 || strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { From 8e3bb99773f64b4816d8977f2dd4940804c76938 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:41:33 +0300 Subject: [PATCH 0718/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b32108f0b..3f114c46d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -470,7 +470,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; i Date: Mon, 2 Oct 2017 10:45:05 +0300 Subject: [PATCH 0719/2732] Test --- iguana/exchanges/enable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/enable b/iguana/exchanges/enable index bb2b70d30..c4b2a56e3 100755 --- a/iguana/exchanges/enable +++ b/iguana/exchanges/enable @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"BTC\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"REVS\"}" From ad3dbdc24c5e98153d02988570561182334b8378 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:46:48 +0300 Subject: [PATCH 0720/2732] Test --- iguana/exchanges/inv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/inv b/iguana/exchanges/inv index 1a86e88f4..bdd1d58c1 100755 --- a/iguana/exchanges/inv +++ b/iguana/exchanges/inv @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"REVS\"}" From baa5e38cf03c3499e363b1294af17672b602f9db Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:49:19 +0300 Subject: [PATCH 0721/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3f114c46d..9df87e3fa 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -475,7 +475,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** int32_t i; for (i=0; iU.value)); - printf("targetval %.8f vol %.8f price %.8f txfee %.8f\n",dstr(targetval),relvolume,price,dstr(txfee)); + printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr); } mini = -1; if ( targetval != 0 && (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) From db6f65706ac010703a48fd92c4490a4e7c915137 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:54:02 +0300 Subject: [PATCH 0722/2732] Test --- iguana/exchanges/LP_rpc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 88ab41795..d84e55dc2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -488,7 +488,10 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) if ( coin->electrum != 0 ) { if ( (retjson= electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + { n = cJSON_GetArraySize(retjson); + printf("LP_listunspent_issue %s.%d %s\n",coinaddr,n,jprint(retjson,0)); + } } else { From 3e71c2f28ef60c2ad20b7e4f297ffcf8d852bc8f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 10:56:02 +0300 Subject: [PATCH 0723/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d84e55dc2..4f7e66fdc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -490,7 +490,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) if ( (retjson= electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)) != 0 ) { n = cJSON_GetArraySize(retjson); - printf("LP_listunspent_issue %s.%d %s\n",coinaddr,n,jprint(retjson,0)); + printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); } } else From b2dce8dcca1115d40afcf10770e574c9f20a4b68 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:02:18 +0300 Subject: [PATCH 0724/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9df87e3fa..ee90ee06a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -923,15 +923,15 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { item = jitem(asks,i); price = jdouble(item,"price"); + pubkey = jbits256(item,"pubkey"); + printf("%s pubcmp %d price %.8f vs maxprice %.8f\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { - pubkey = jbits256(item,"pubkey"); for (j=0; jtaddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); From 903a90af5ede0810acc3f144def39211400ddbb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:07:52 +0300 Subject: [PATCH 0725/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_prices.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 233c1a70e..a83393913 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -182,7 +182,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime; + uint32_t lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f5ca48945..9c3197e16 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -478,6 +478,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; if ( coin->electrum != 0 ) continue; + if ( coin->obooktime == 0 ) + continue; if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { if ( (height= LP_getheight(coin)) > coin->longestchain ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2755710a7..93733a9b0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -746,6 +746,8 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) baseid = basepp->ind; relid = relpp->ind; now = (uint32_t)time(NULL); + basecoin->obooktime = now; + relcoin->obooktime = now; cachenumbids = numbids, cachenumasks = numasks; //printf("start cache.(%d %d) numbids.%d numasks.%d\n",cachenumbids,cachenumasks,numbids,numasks); numasks = LP_orderbook_utxoentries(now,1,base,rel,&asks,numasks,cachenumasks,duration); From 1bd1f35047cc37304ac5f4491b632de761cd0684 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:16:35 +0300 Subject: [PATCH 0726/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_rpc.c | 1 + iguana/exchanges/LP_scan.c | 1 + 4 files changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9c3197e16..be9a939bb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,6 +322,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( coin->inactive != 0 ) continue; total = 0; + printf("from utxos_sync\n"); LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ee90ee06a..38e5e9685 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -695,6 +695,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) //printf("issue path electrum.%p\n",coin->electrum); //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) // free_json(array); + printf("listunspent_both\n"); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4f7e66fdc..25a3479c4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -481,6 +481,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; +printf("LP_listunspent_issue.%s %s\n",symbol,coinaddr); if ( symbol == 0 || symbol[0] == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 006b4b6cf..f8ec39a14 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -481,6 +481,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } free(array); } + printf("from waitmempool\n"); LP_listunspent_issue(coin->symbol,coinaddr); struct LP_address_utxo *up; if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) From 198448308f70819bb0fb8c859a8690318cbe66f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:18:17 +0300 Subject: [PATCH 0727/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index be9a939bb..3fe84aff7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -319,7 +319,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; HASH_ITER(hh,LP_coins,coin,ctmp) { - if ( coin->inactive != 0 ) + if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; total = 0; printf("from utxos_sync\n"); From 164b5c285c9b67832b979e7b355487ad6a4ed9a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:25:44 +0300 Subject: [PATCH 0728/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 1 + iguana/exchanges/LP_rpc.c | 1 - iguana/exchanges/LP_scan.c | 1 - 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3fe84aff7..e906b24fc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,7 +322,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; total = 0; - printf("from utxos_sync\n"); + //printf("from utxos_sync\n"); LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 38e5e9685..bd4ba1ae3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -695,7 +695,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) //printf("issue path electrum.%p\n",coin->electrum); //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) // free_json(array); - printf("listunspent_both\n"); + //printf("listunspent_both\n"); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 93733a9b0..5cbff8581 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -224,6 +224,7 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) { cJSON *array,*item; int32_t i,n; uint64_t metric=0,total; + printf("unspents metric\n"); LP_listunspent_both(coin->symbol,coinaddr); if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 25a3479c4..4f7e66fdc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -481,7 +481,6 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; -printf("LP_listunspent_issue.%s %s\n",symbol,coinaddr); if ( symbol == 0 || symbol[0] == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f8ec39a14..006b4b6cf 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -481,7 +481,6 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } free(array); } - printf("from waitmempool\n"); LP_listunspent_issue(coin->symbol,coinaddr); struct LP_address_utxo *up; if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) From 943d261e7ca5cd0970609a178462f8f034c48daf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:30:05 +0300 Subject: [PATCH 0729/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e906b24fc..3fe84aff7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,7 +322,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; total = 0; - //printf("from utxos_sync\n"); + printf("from utxos_sync\n"); LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bd4ba1ae3..38e5e9685 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -695,7 +695,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) //printf("issue path electrum.%p\n",coin->electrum); //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) // free_json(array); - //printf("listunspent_both\n"); + printf("listunspent_both\n"); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4f7e66fdc..973fa2f5e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -491,7 +491,9 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { n = cJSON_GetArraySize(retjson); printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); - } + if ( strcmp(symbol,"ARG") == 0 ) + assert(0); + } } else { From 3ef1dc48076f106a6412df22ead93a62bf116afc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:37:13 +0300 Subject: [PATCH 0730/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_ordermatch.c | 1 - iguana/exchanges/LP_portfolio.c | 6 +++++- iguana/exchanges/LP_prices.c | 1 - iguana/exchanges/LP_rpc.c | 4 +--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3fe84aff7..e15ab19b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,7 +322,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; total = 0; - printf("from utxos_sync\n"); LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 38e5e9685..ee90ee06a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -695,7 +695,6 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) //printf("issue path electrum.%p\n",coin->electrum); //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) // free_json(array); - printf("listunspent_both\n"); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 585f236f1..e648e3381 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -89,7 +89,7 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 ) + if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; if ( iter == 0 ) { @@ -184,12 +184,16 @@ char *LP_portfolio_goal(char *symbol,double goal) coin->goal = kmdbtc * 0.5; if ( (coin= LP_coinfind("BTC")) != 0 && coin->inactive == 0 ) coin->goal = kmdbtc * 0.5; + if ( coin->goal != 0 ) + coin->obooktime = (uint32_t)time(NULL); return(LP_portfolio()); } else if ( (coin= LP_coinfind(symbol)) != 0 && coin->inactive == 0 ) { coin->goal = goal; printf("set %s goal %f\n",coin->symbol,goal); + if ( coin->goal != 0 ) + coin->obooktime = (uint32_t)time(NULL); return(LP_portfolio()); } else return(clonestr("{\"error\":\"cant set goal for inactive coin\"}")); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5cbff8581..93733a9b0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -224,7 +224,6 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) { cJSON *array,*item; int32_t i,n; uint64_t metric=0,total; - printf("unspents metric\n"); LP_listunspent_both(coin->symbol,coinaddr); if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 973fa2f5e..4f7e66fdc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -491,9 +491,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { n = cJSON_GetArraySize(retjson); printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); - if ( strcmp(symbol,"ARG") == 0 ) - assert(0); - } + } } else { From a07824a362f33dce10fa37e84c5000f40d19096e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:43:27 +0300 Subject: [PATCH 0731/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ee90ee06a..ef3cefd06 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -924,7 +924,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i item = jitem(asks,i); price = jdouble(item,"price"); pubkey = jbits256(item,"pubkey"); - printf("%s pubcmp %d price %.8f vs maxprice %.8f\n",jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); + printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { for (j=0; jelectrum,&retjson,coinaddr)) != 0 ) { n = cJSON_GetArraySize(retjson); - printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); + //printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); } } else From 760a31b337e12326a8c30eaf2da28bca741957ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 12:59:44 +0300 Subject: [PATCH 0732/2732] Electrum tx cache --- iguana/exchanges/LP_include.h | 8 +- iguana/exchanges/LP_prices.c | 4 +- iguana/exchanges/LP_rpc.c | 161 +++++++++++++--------------------- iguana/exchanges/LP_socket.c | 77 ++++++++++++++-- iguana/exchanges/LP_utxo.c | 8 +- 5 files changed, 143 insertions(+), 115 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a83393913..d1a85727e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -172,7 +172,8 @@ struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvi struct LP_transaction { UT_hash_handle hh; - bits256 txid; int32_t height,numvouts,numvins; //uint32_t timestamp; + bits256 txid; int32_t height,numvouts,numvins,len; //uint32_t timestamp; + uint8_t *serialized; struct LP_outpoint outpoints[]; }; @@ -303,6 +304,8 @@ struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr); int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); //void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo); +struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout); +int32_t LP_destaddr(char *destaddr,cJSON *item); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); @@ -310,10 +313,11 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); -cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout); +cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); int32_t LP_listunspent_both(char *symbol,char *coinaddr); uint16_t LP_randpeer(char *destip); +cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys); //int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 93733a9b0..b7c9e04b0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -394,10 +394,10 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i ptr->price = 0.; printf("LP_pricecache: set %s/%s ptr->price %.8f\n",base,rel,ptr->price); } - printf("found %s/%s %.8f\n",base,rel,ptr->price); + printf(">>>>>>>>>> found %s/%s %.8f\n",base,rel,ptr->price); return(ptr->price); } - char str[65]; printf("cachemiss %s/%s %s/v%d\n",base,rel,bits256_str(str,txid),vout); + //char str[65]; printf("cachemiss %s/%s %s/v%d\n",base,rel,bits256_str(str,txid),vout); return(0.); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3a632d6c1..deffe3bf6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -243,7 +243,7 @@ cJSON *LP_paxprice(char *fiat) cJSON *LP_gettx(char *symbol,bits256 txid) { - char buf[128],str[65],*hexstr; int32_t len; bits256 checktxid; cJSON *retjson; struct iguana_info *coin; struct iguana_msgtx msgtx; uint8_t *extraspace,*serialized; + struct iguana_info *coin; char buf[512],str[65]; cJSON *retjson; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); @@ -258,49 +258,38 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else { - sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); if ( (retjson= electrum_transaction(symbol,coin->electrum,&retjson,txid)) != 0 ) - { - hexstr = jprint(retjson,1); - if ( strlen(hexstr) > 20000 ) - { - static uint32_t counter; - if ( counter++ < 3 ) - printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); - free(hexstr); - return(cJSON_Parse("{\"error\":\"transaction too big\"}")); - } - if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) - hexstr[strlen(hexstr)-1] = 0; - if ( (len= is_hexstr(hexstr+1,0)) > 2 ) - { - memset(&msgtx,0,sizeof(msgtx)); - len = (int32_t)strlen(hexstr+1) >> 1; - serialized = malloc(len); - decode_hex(serialized,len,hexstr+1); - free(hexstr); - //printf("DATA.(%s)\n",hexstr+1); - extraspace = calloc(1,1000000); - retjson = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); - free(serialized); - free(extraspace); - //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); - return(retjson); - } else printf("non-hex tx.(%s)\n",hexstr); - free(hexstr); - return(cJSON_Parse("{\"error\":\"non hex transaction\"}")); - } else printf("failed blockchain.transaction.get %s %s\n",coin->symbol,buf); + return(retjson); + else printf("failed blockchain.transaction.get %s %s\n",coin->symbol,buf); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); } } -cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) +cJSON *LP_gettxout_json(bits256 txid,int32_t vout,int32_t height,char *coinaddr,uint64_t value) +{ + cJSON *retjson,*addresses,*sobj; + retjson = cJSON_CreateObject(); + jaddnum(retjson,"value",dstr(value)); + jaddnum(retjson,"height",height); + jaddbits256(retjson,"txid",txid); + jaddnum(retjson,"vout",vout); + addresses = cJSON_CreateArray(); + jaddistr(addresses,coinaddr); + sobj = cJSON_CreateObject(); + jaddnum(sobj,"reqSigs",1); + jaddstr(sobj,"type","pubkey"); + jadd(sobj,"addresses",addresses); + jadd(retjson,"scriptPubKey",sobj); + printf("GETTXOUT.(%s)\n",jprint(retjson,0)); + return(retjson); +} + +cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65]; cJSON *item,*array,*vouts,*txobj,*retjson=0; int32_t i,v,n; bits256 t; struct iguana_info *coin; struct LP_transaction *tx; struct LP_address_utxo *up; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); - coin = LP_coinfind(symbol); - if ( coin == 0 ) + if ( (coin= LP_coinfind(symbol)) == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( bits256_nonz(txid) == 0 ) return(cJSON_Parse("{\"error\":\"null txid\"}")); @@ -311,84 +300,52 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) } else { - printf("gettxout v%d\n",vout); - sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (hexobj= electrum_transaction(symbol,coin->electrum,&hexobj,txid)) != 0 ) + if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts ) + { + if ( tx->outpoints[vout].spendheight > 0 ) + return(0); + return(LP_gettxout_json(txid,vout,tx->height,tx->outpoints[vout].coinaddr,tx->outpoints[vout].value)); + } + if ( coinaddr[0] == 0 ) + { + if ( (txobj= electrum_transaction(symbol,coin->electrum,&txobj,txid)) != 0 ) + { + if ( (vouts= jarray(&n,txobj,"vout")) != 0 && n > 0 ) + LP_destaddr(coinaddr,jitem(vouts,vout)); + free_json(txobj); + } + } + if ( coinaddr[0] != 0 ) { - hexstr = jprint(hexobj,1); - if ( strlen(hexstr) > 20000 ) + if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) { - static uint32_t counter; - if ( counter++ < 3 ) - printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); - free(hexstr); - return(cJSON_Parse("{\"error\":\"transaction too big\"}")); + if ( up->spendheight > 0 ) + return(0); + return(LP_gettxout_json(txid,vout,up->U.height,coinaddr,up->U.value)); } - if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) - hexstr[strlen(hexstr)-1] = 0; - if ( (len= is_hexstr(hexstr+1,0)) > 2 ) + if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) { - len = (int32_t)strlen(hexstr+1) >> 1; - serialized = malloc(len); - decode_hex(serialized,len,hexstr+1); - LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout); - //printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value)); - free(hexstr); - if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) + //printf("array.(%s)\n",jprint(array,0)); + if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - //printf("array.(%s)\n",jprint(array,0)); - if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) + for (i=0; isymbol,txid,v)) != 0 ) + if ( (retjson= LP_gettxout(coin->symbol,coinaddr,txid,v)) != 0 ) free_json(retjson); else { @@ -527,12 +527,79 @@ cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjso cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } +cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) +{ + uint8_t *extraspace; cJSON *txobj; char str[65],str2[65]; struct iguana_msgtx msgtx; bits256 checktxid; + extraspace = calloc(1,1000000); + memset(&msgtx,0,sizeof(msgtx)); + txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); + //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); + free(extraspace); + if ( bits256_cmp(txid,checktxid) != 0 ) + { + printf("LP_transaction_fromdata mismatched txid %s vs %s\n",bits256_str(str,txid),bits256_str(str2,checktxid)); + free_json(txobj); + txobj = 0; + } + return(txobj); +} + cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { - char str[65]; printf("%s add cache here -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); - if ( bits256_nonz(txid) != 0 ) - return(electrum_hasharg(symbol,ep,retjsonp,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT)); - else return(cJSON_Parse("{\"error\":\"null txid\"}")); + char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; + if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) + { + char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); + if ( (txobj= LP_transaction_fromdata(coin,txid,tx->serialized,tx->len)) != 0 ) + { + *retjsonp = txobj; + return(txobj); + } + } + hexjson = electrum_hasharg(symbol,ep,&hexjson,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT); + hexstr = jprint(hexjson,1); + if ( strlen(hexstr) > 60000 ) + { + static uint32_t counter; + if ( counter++ < 3 ) + printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); + free(hexstr); + *retjsonp = cJSON_Parse("{\"error\":\"transaction too big\"}"); + return(*retjsonp); + } + if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' ) + hexstr[strlen(hexstr)-1] = 0; + if ( (len= is_hexstr(hexstr+1,0)) > 2 ) + { + len = (int32_t)strlen(hexstr+1) >> 1; + serialized = malloc(len); + decode_hex(serialized,len,hexstr+1); + free(hexstr); + //printf("DATA.(%s)\n",hexstr+1); + if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) + { + txobj = LP_transactioninit(coin,txid,0,0); + LP_transactioninit(coin,txid,1,txobj); + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + { + tx->serialized = serialized; + tx->len = len; + } + else + { + printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); + free(serialized); + } + } + *retjsonp = txobj; + return(*retjsonp); + } else printf("non-hex tx.(%s)\n",hexstr); + free(hexstr); + } + *retjsonp = cJSON_Parse("{\"error\":\"null txid\"}"); + return(*retjsonp); } cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b109e3130..202af4e49 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -332,7 +332,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) val = j64bits(item,"value"); //if ( strcmp(coin->symbol,"LBC") == 0 ) // printf("(%s)\n",jprint(item,0)); - if ( coin->electrum == 0 && (txobj= LP_gettxout(coin->symbol,txid,v)) != 0 ) + if ( coin->electrum == 0 && (txobj= LP_gettxout(coin->symbol,coinaddr,txid,v)) != 0 ) { value = LP_value_extract(txobj,0); if ( value != 0 && value != val ) @@ -475,7 +475,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf uint64_t interest,value = 0; cJSON *txobj; *interestp = 0; destaddr[0] = 0; - if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) + if ( (txobj= LP_gettxout(coin->symbol,destaddr,txid,vout)) != 0 ) { if ( (value= LP_value_extract(txobj,0)) == 0 ) { @@ -591,7 +591,7 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int if ( coin->electrum == 0 ) { numconfirms = -1; - if ( (txobj= LP_gettxout(symbol,txid,vout)) != 0 ) + if ( (txobj= LP_gettxout(symbol,coinaddr,txid,vout)) != 0 ) { numconfirms = jint(txobj,"confirmations"); free_json(txobj); @@ -663,7 +663,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) } else { - if ( (txobj= LP_gettxout(coin->symbol,txid,vout)) != 0 ) + if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) != 0 ) { value = LP_value_extract(txobj,0);//SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); if ( coinaddr == 0 ) From 9e790d2f20541e674cad517d2a450293118b15bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:04:42 +0300 Subject: [PATCH 0733/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1a953c9af..66ccabd59 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -577,7 +577,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso serialized = malloc(len); decode_hex(serialized,len,hexstr+1); free(hexstr); - //printf("DATA.(%s)\n",hexstr+1); + printf("DATA.(%s)\n",hexstr+1); if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) { txobj = LP_transactioninit(coin,txid,0,0); @@ -594,6 +594,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso } } *retjsonp = txobj; + printf("return from electrum_transaction\n"); return(*retjsonp); } else printf("non-hex tx.(%s)\n",hexstr); free(hexstr); From eff4c7440858669e15a98dfdd59b98ac25880c85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:06:44 +0300 Subject: [PATCH 0734/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 66ccabd59..ed9f47392 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -533,7 +533,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se extraspace = calloc(1,1000000); memset(&msgtx,0,sizeof(msgtx)); txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); - //printf("TX.(%s) match.%d\n",jprint(retjson,0),bits256_cmp(txid,checktxid)); + printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); free(extraspace); if ( bits256_cmp(txid,checktxid) != 0 ) { @@ -547,6 +547,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; + printf("electrum_transaction %s\n",bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) From 167f5cf8b752681845786bd57290c91225bbf904 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:11:17 +0300 Subject: [PATCH 0735/2732] Test --- iguana/exchanges/LP_socket.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index ed9f47392..7fae05545 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -547,7 +547,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; - printf("electrum_transaction %s\n",bits256_str(str,txid)); + printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) @@ -560,13 +560,14 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso } } hexjson = electrum_hasharg(symbol,ep,&hexjson,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT); - hexstr = jprint(hexjson,1); + hexstr = jprint(hexjson,0); if ( strlen(hexstr) > 60000 ) { static uint32_t counter; if ( counter++ < 3 ) printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); free(hexstr); + free_json(hexjson); *retjsonp = cJSON_Parse("{\"error\":\"transaction too big\"}"); return(*retjsonp); } @@ -578,7 +579,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso serialized = malloc(len); decode_hex(serialized,len,hexstr+1); free(hexstr); - printf("DATA.(%s)\n",hexstr+1); + printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) { txobj = LP_transactioninit(coin,txid,0,0); @@ -595,10 +596,12 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso } } *retjsonp = txobj; + free_json(hexjson); printf("return from electrum_transaction\n"); return(*retjsonp); - } else printf("non-hex tx.(%s)\n",hexstr); + } else printf("non-hex tx.(%s)\n",jprint(hexjson,0)); free(hexstr); + free_json(hexjson); } *retjsonp = cJSON_Parse("{\"error\":\"null txid\"}"); return(*retjsonp); From f0e4ea026af479f358d2d82eb0ab69fa4d0fc9f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:16:05 +0300 Subject: [PATCH 0736/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7fae05545..7cbbe6036 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -582,7 +582,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) { - txobj = LP_transactioninit(coin,txid,0,0); + txobj = LP_transactioninit(coin,txid,0,LP_transaction_fromdata(coin,txid,serialized,len)); LP_transactioninit(coin,txid,1,txobj); if ( (tx= LP_transactionfind(coin,txid)) != 0 ) { From 73340b4cda1eecf54a33e13eaa305b4e6ae2f2f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:19:54 +0300 Subject: [PATCH 0737/2732] Test --- iguana/exchanges/LP_socket.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7cbbe6036..365e7ba3f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -547,7 +547,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; - printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); + //printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) @@ -579,21 +579,23 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso serialized = malloc(len); decode_hex(serialized,len,hexstr+1); free(hexstr); - printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); + //printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); + txobj = LP_transaction_fromdata(coin,txid,serialized,len); if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) { - txobj = LP_transactioninit(coin,txid,0,LP_transaction_fromdata(coin,txid,serialized,len)); + txobj = LP_transactioninit(coin,txid,0,txobj); LP_transactioninit(coin,txid,1,txobj); - if ( (tx= LP_transactionfind(coin,txid)) != 0 ) - { - tx->serialized = serialized; - tx->len = len; - } - else - { - printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); - free(serialized); - } + tx = LP_transactionfind(coin,txid); + } + if ( tx != 0 ) + { + tx->serialized = serialized; + tx->len = len; + } + else + { + printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); + free(serialized); } *retjsonp = txobj; free_json(hexjson); From f2b93ce4a9236d4231cfe5ae119368d7554d02d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:21:45 +0300 Subject: [PATCH 0738/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 365e7ba3f..3e3a05765 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -533,7 +533,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se extraspace = calloc(1,1000000); memset(&msgtx,0,sizeof(msgtx)); txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); - printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); + //printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); free(extraspace); if ( bits256_cmp(txid,checktxid) != 0 ) { @@ -599,7 +599,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso } *retjsonp = txobj; free_json(hexjson); - printf("return from electrum_transaction\n"); + //printf("return from electrum_transaction\n"); return(*retjsonp); } else printf("non-hex tx.(%s)\n",jprint(hexjson,0)); free(hexstr); From 04781e77b7b1e74bd60c180b1709784e3dd3c48e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:26:28 +0300 Subject: [PATCH 0739/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3e3a05765..d0759257d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -552,7 +552,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) { - char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); + //char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); if ( (txobj= LP_transaction_fromdata(coin,txid,tx->serialized,tx->len)) != 0 ) { *retjsonp = txobj; From f9638cfa35f8bfdd4a8fd2788490e0671da51a65 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:42:09 +0300 Subject: [PATCH 0740/2732] #!/bin/bash --- iguana/exchanges/autofill | 1 + iguana/exchanges/autoprice | 1 + iguana/exchanges/autotrade | 1 + iguana/exchanges/balance_loop | 1 + iguana/exchanges/bestfit | 1 + iguana/exchanges/buy | 1 + iguana/exchanges/cancelorder | 1 + iguana/exchanges/client | 1 + iguana/exchanges/client_osx | 1 + iguana/exchanges/debug | 1 + iguana/exchanges/deletemessages | 1 + iguana/exchanges/disable | 1 + iguana/exchanges/dividends | 1 + iguana/exchanges/electrum | 1 + iguana/exchanges/electrum.chips | 1 + iguana/exchanges/electrum.chips2 | 1 + iguana/exchanges/electrum.kmd | 1 + iguana/exchanges/electrum.kmd2 | 1 + iguana/exchanges/electrum.kmd3 | 1 + iguana/exchanges/electrums | 1 + iguana/exchanges/enable | 1 + iguana/exchanges/getcoin | 1 + iguana/exchanges/getcoins | 1 + iguana/exchanges/getmessages | 1 + iguana/exchanges/getpeers | 1 + iguana/exchanges/getpeersIP | 1 + iguana/exchanges/getprices | 1 + iguana/exchanges/getutxos | 1 + iguana/exchanges/goal | 1 + iguana/exchanges/goals | 1 + iguana/exchanges/help | 1 + iguana/exchanges/install | 1 + iguana/exchanges/inv | 1 + iguana/exchanges/listunspent | 1 + iguana/exchanges/loop | 1 + iguana/exchanges/message | 1 + iguana/exchanges/myprice | 1 + iguana/exchanges/myprices | 1 + iguana/exchanges/numutxos | 1 + iguana/exchanges/orderbook | 1 + iguana/exchanges/ordermatch | 1 + iguana/exchanges/portfolio | 1 + iguana/exchanges/pricearray | 1 + iguana/exchanges/pub | 1 + iguana/exchanges/register | 1 + iguana/exchanges/registerall | 1 + iguana/exchanges/run | 1 + iguana/exchanges/run_osx | 1 + iguana/exchanges/secretaddresses | 1 + iguana/exchanges/sell | 1 + iguana/exchanges/setprice | 1 + iguana/exchanges/snapshot | 1 + iguana/exchanges/snapshot_balance | 1 + iguana/exchanges/snapshot_loop | 1 + iguana/exchanges/status | 1 + iguana/exchanges/swapstatus | 1 + iguana/exchanges/trade | 1 + iguana/exchanges/utxos | 1 + 58 files changed, 58 insertions(+) diff --git a/iguana/exchanges/autofill b/iguana/exchanges/autofill index f05962ea7..b0724a9db 100755 --- a/iguana/exchanges/autofill +++ b/iguana/exchanges/autofill @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autofill\",\"base\":\"KMD\",\"rel\":\"BTC\",\"price\":0.0005,\"relvolume\":0.1}" diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index b709aa0e4..a95a3f5e3 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,3 +1,4 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" diff --git a/iguana/exchanges/autotrade b/iguana/exchanges/autotrade index 0ea5e5f11..72e14f84a 100755 --- a/iguana/exchanges/autotrade +++ b/iguana/exchanges/autotrade @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autotrade\",\"base\":\"REVS\",\"rel\":\"KMD\",\"relvolume\":1.01,\"price\":1.234}" diff --git a/iguana/exchanges/balance_loop b/iguana/exchanges/balance_loop index 8a75e0e22..ad28ac741 100755 --- a/iguana/exchanges/balance_loop +++ b/iguana/exchanges/balance_loop @@ -1,3 +1,4 @@ +#!/bin/bash source userpass ht=$1 while true diff --git a/iguana/exchanges/bestfit b/iguana/exchanges/bestfit index c926713ff..bae6a79ac 100755 --- a/iguana/exchanges/bestfit +++ b/iguana/exchanges/bestfit @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bestfit\",\"rel\":\"KMD\",\"relvolume\":1.01}" diff --git a/iguana/exchanges/buy b/iguana/exchanges/buy index 4bed65f19..cf83a91df 100755 --- a/iguana/exchanges/buy +++ b/iguana/exchanges/buy @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"buy\",\"base\":\"KMD\",\"rel\":\"BTC\",\"relvolume\":0.005,\"price\":0.0005}" diff --git a/iguana/exchanges/cancelorder b/iguana/exchanges/cancelorder index 78394c4c7..31fe7ea8c 100755 --- a/iguana/exchanges/cancelorder +++ b/iguana/exchanges/cancelorder @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":9999999.99}" diff --git a/iguana/exchanges/client b/iguana/exchanges/client index 8b3f8a7ba..a36758376 100755 --- a/iguana/exchanges/client +++ b/iguana/exchanges/client @@ -1,3 +1,4 @@ +#!/bin/bash source passphrase source coins pkill -15 marketmaker; diff --git a/iguana/exchanges/client_osx b/iguana/exchanges/client_osx index 9e1cada67..463a08eb4 100755 --- a/iguana/exchanges/client_osx +++ b/iguana/exchanges/client_osx @@ -1,3 +1,4 @@ +#!/bin/bash source passphrase source coins pkill -15 marketmaker; diff --git a/iguana/exchanges/debug b/iguana/exchanges/debug index 02017001a..a4f2297a3 100755 --- a/iguana/exchanges/debug +++ b/iguana/exchanges/debug @@ -1,3 +1,4 @@ +#!/bin/bash source passphrase source coins pkill -15 marketmaker; diff --git a/iguana/exchanges/deletemessages b/iguana/exchanges/deletemessages index a65985a7e..5aba784a4 100755 --- a/iguana/exchanges/deletemessages +++ b/iguana/exchanges/deletemessages @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"deletemessages\",\"firsti\":0,\"num\":10}" diff --git a/iguana/exchanges/disable b/iguana/exchanges/disable index e32c24a6f..636fc952f 100755 --- a/iguana/exchanges/disable +++ b/iguana/exchanges/disable @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"disable\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/dividends b/iguana/exchanges/dividends index c5b2ac714..5385b9454 100755 --- a/iguana/exchanges/dividends +++ b/iguana/exchanges/dividends @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"dividends\",\"coin\":\"KMD\",\"height\":$1,\"prefix\":\"fiat/jumblr sendtoaddress\",\"suffix\":\"\",\"dividend\":50000,\"dust\":1}" diff --git a/iguana/exchanges/electrum b/iguana/exchanges/electrum index e7f562b41..375d3d8f4 100755 --- a/iguana/exchanges/electrum +++ b/iguana/exchanges/electrum @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"BTC\",\"ipaddr\":\"173.212.225.176\",\"port\":50001}" diff --git a/iguana/exchanges/electrum.chips b/iguana/exchanges/electrum.chips index be36abd88..f5cd61e8c 100755 --- a/iguana/exchanges/electrum.chips +++ b/iguana/exchanges/electrum.chips @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CHIPS\",\"ipaddr\":\"173.212.225.176\",\"port\":50076}" diff --git a/iguana/exchanges/electrum.chips2 b/iguana/exchanges/electrum.chips2 index 72e3f2f70..2be709e78 100755 --- a/iguana/exchanges/electrum.chips2 +++ b/iguana/exchanges/electrum.chips2 @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"CHIPS\",\"ipaddr\":\"136.243.45.140\",\"port\":50076}" diff --git a/iguana/exchanges/electrum.kmd b/iguana/exchanges/electrum.kmd index 747fba203..865205062 100755 --- a/iguana/exchanges/electrum.kmd +++ b/iguana/exchanges/electrum.kmd @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"96.44.166.176\",\"port\":8777}" diff --git a/iguana/exchanges/electrum.kmd2 b/iguana/exchanges/electrum.kmd2 index 46b11276b..40bd30c93 100755 --- a/iguana/exchanges/electrum.kmd2 +++ b/iguana/exchanges/electrum.kmd2 @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"173.212.225.176\",\"port\":50011}" diff --git a/iguana/exchanges/electrum.kmd3 b/iguana/exchanges/electrum.kmd3 index 5fb7a6b9a..4bf1a6c10 100755 --- a/iguana/exchanges/electrum.kmd3 +++ b/iguana/exchanges/electrum.kmd3 @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"KMD\",\"ipaddr\":\"136.243.45.140\",\"port\":50011}" diff --git a/iguana/exchanges/electrums b/iguana/exchanges/electrums index 43b4d8811..a4cabe5e3 100755 --- a/iguana/exchanges/electrums +++ b/iguana/exchanges/electrums @@ -1,3 +1,4 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"REVS\",\"ipaddr\":\"173.212.225.176\",\"port\":50050}" diff --git a/iguana/exchanges/enable b/iguana/exchanges/enable index c4b2a56e3..d6a287b3a 100755 --- a/iguana/exchanges/enable +++ b/iguana/exchanges/enable @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/getcoin b/iguana/exchanges/getcoin index 063185f57..b37ccc666 100755 --- a/iguana/exchanges/getcoin +++ b/iguana/exchanges/getcoin @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoin\",\"coin\":\"LTC\"}" diff --git a/iguana/exchanges/getcoins b/iguana/exchanges/getcoins index 71778acfb..64b1d7461 100755 --- a/iguana/exchanges/getcoins +++ b/iguana/exchanges/getcoins @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoins\"}" diff --git a/iguana/exchanges/getmessages b/iguana/exchanges/getmessages index 0bfadf518..121e8ec0b 100755 --- a/iguana/exchanges/getmessages +++ b/iguana/exchanges/getmessages @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getmessages\",\"firsti\":0,\"num\":10}" diff --git a/iguana/exchanges/getpeers b/iguana/exchanges/getpeers index ea91cb791..9ed1daf77 100755 --- a/iguana/exchanges/getpeers +++ b/iguana/exchanges/getpeers @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getpeers\"}" diff --git a/iguana/exchanges/getpeersIP b/iguana/exchanges/getpeersIP index c5a7fdd74..7c532e609 100755 --- a/iguana/exchanges/getpeersIP +++ b/iguana/exchanges/getpeersIP @@ -1,3 +1,4 @@ +#!/bin/bash curl --url "http://5.9.253.195:7783" --data "{\"method\":\"getpeers\"}" curl --url "http://5.9.253.196:7783" --data "{\"method\":\"getpeers\"}" curl --url "http://5.9.253.197:7783" --data "{\"method\":\"getpeers\"}" diff --git a/iguana/exchanges/getprices b/iguana/exchanges/getprices index 2a0428d1c..57031035c 100755 --- a/iguana/exchanges/getprices +++ b/iguana/exchanges/getprices @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getprices\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/getutxos b/iguana/exchanges/getutxos index 38f26f654..4782c9a0a 100755 --- a/iguana/exchanges/getutxos +++ b/iguana/exchanges/getutxos @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/goal b/iguana/exchanges/goal index ecfd491e6..74fd1fcda 100755 --- a/iguana/exchanges/goal +++ b/iguana/exchanges/goal @@ -1,3 +1,4 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"val\":99}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"val\":10}" diff --git a/iguana/exchanges/goals b/iguana/exchanges/goals index b29e0f49f..22f31bab8 100755 --- a/iguana/exchanges/goals +++ b/iguana/exchanges/goals @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\"}" diff --git a/iguana/exchanges/help b/iguana/exchanges/help index f51f15b8d..a16fa1181 100755 --- a/iguana/exchanges/help +++ b/iguana/exchanges/help @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"help\"}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 3b1981f97..a3632447b 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,3 +1,4 @@ +#!/bin/bash cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/inv b/iguana/exchanges/inv index bdd1d58c1..a42ac5d51 100755 --- a/iguana/exchanges/inv +++ b/iguana/exchanges/inv @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"REVS\"}" diff --git a/iguana/exchanges/listunspent b/iguana/exchanges/listunspent index 98c5b137d..aa7ca4963 100755 --- a/iguana/exchanges/listunspent +++ b/iguana/exchanges/listunspent @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"BTC\",\"address\":\"1DPDsPCNNCF5SHhPPrddXcJe78rM6CBcH3\"}" diff --git a/iguana/exchanges/loop b/iguana/exchanges/loop index 43228b96e..2ad08f45b 100755 --- a/iguana/exchanges/loop +++ b/iguana/exchanges/loop @@ -1,3 +1,4 @@ +#!/bin/bash while true do source userpass diff --git a/iguana/exchanges/message b/iguana/exchanges/message index 0182aa093..f36c45c81 100755 --- a/iguana/exchanges/message +++ b/iguana/exchanges/message @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"sendmessage\",\"message\":\"some sort of message\"}" diff --git a/iguana/exchanges/myprice b/iguana/exchanges/myprice index 8080023ed..6dfac2dbb 100755 --- a/iguana/exchanges/myprice +++ b/iguana/exchanges/myprice @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"myprice\",\"base\":\"REVS\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/myprices b/iguana/exchanges/myprices index 3fef298b2..1c82512c0 100755 --- a/iguana/exchanges/myprices +++ b/iguana/exchanges/myprices @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"myprices\"}" diff --git a/iguana/exchanges/numutxos b/iguana/exchanges/numutxos index f8d921078..9455dd239 100755 --- a/iguana/exchanges/numutxos +++ b/iguana/exchanges/numutxos @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"numutxos\"}" diff --git a/iguana/exchanges/orderbook b/iguana/exchanges/orderbook index 8ca15bc87..0f6e553b4 100755 --- a/iguana/exchanges/orderbook +++ b/iguana/exchanges/orderbook @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"JUMBLR\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/ordermatch b/iguana/exchanges/ordermatch index 85c74cfea..f4b2ca61c 100755 --- a/iguana/exchanges/ordermatch +++ b/iguana/exchanges/ordermatch @@ -1,3 +1,4 @@ +#!/bin/bash source userpass #ordermatch(base, txfee=0, rel, desttxfee=0, price, txid, vout, feetxid, feevout, duration=3600)\n\ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"ordermatch\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234,\"duration\":600,\"txfee\":0,\"desttxfee\":0,\"txid\":\"$1\",\"vout\":$2,\"feetxid\":\"$3\",\"feevout\":$4}" diff --git a/iguana/exchanges/portfolio b/iguana/exchanges/portfolio index 92bd9f236..b22adbc06 100755 --- a/iguana/exchanges/portfolio +++ b/iguana/exchanges/portfolio @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"portfolio\"}" diff --git a/iguana/exchanges/pricearray b/iguana/exchanges/pricearray index f39ab51ae..dc812dba6 100755 --- a/iguana/exchanges/pricearray +++ b/iguana/exchanges/pricearray @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"pricearray\",\"base\":\"KMD\",\"rel\":\"BTC\",\"timescale\":60}" diff --git a/iguana/exchanges/pub b/iguana/exchanges/pub index 8d9712607..2e3241fee 100755 --- a/iguana/exchanges/pub +++ b/iguana/exchanges/pub @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"6578099f6474d9b8bd66a7a136b922029a989818ec0309aee962dd6ac1862b74\",\"method\":\"forward\",\"method2\":\"publish\",\"data\":\"nonsense\"}" diff --git a/iguana/exchanges/register b/iguana/exchanges/register index ca64e4ace..d00160beb 100755 --- a/iguana/exchanges/register +++ b/iguana/exchanges/register @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://5.9.253.195:7783" --data "{\"userpass\":\"9bb4846d24136fc7c33515e45bccbab5c8fb7b57b411aa20057b371da9358255\",\"agent\":\"stats\",\"method\":\"register\",\"client\":\"6d3332be4904feafd326609bd76b66528dc7b2e2d75a7bd110c6bf8d19c4cf58\",\"pushaddr\":\"5.9.253.195\",\"pushport\":\"10000\"}" diff --git a/iguana/exchanges/registerall b/iguana/exchanges/registerall index b3cfe5f06..927f0b2f9 100755 --- a/iguana/exchanges/registerall +++ b/iguana/exchanges/registerall @@ -1,3 +1,4 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"registerall\",\"numnodes\":10}" diff --git a/iguana/exchanges/run b/iguana/exchanges/run index 59e4ec2e4..ec549c0c7 100755 --- a/iguana/exchanges/run +++ b/iguana/exchanges/run @@ -1,3 +1,4 @@ +#!/bin/bash source passphrase source coins pkill -15 marketmaker; diff --git a/iguana/exchanges/run_osx b/iguana/exchanges/run_osx index c8924d6f4..970217843 100755 --- a/iguana/exchanges/run_osx +++ b/iguana/exchanges/run_osx @@ -1,3 +1,4 @@ +#!/bin/bash source passphrase source coins pkill -15 marketmaker; diff --git a/iguana/exchanges/secretaddresses b/iguana/exchanges/secretaddresses index a2d6ba2d2..29ebd0041 100755 --- a/iguana/exchanges/secretaddresses +++ b/iguana/exchanges/secretaddresses @@ -1,3 +1,4 @@ +#!/bin/bash source userpass echo "usage: ./secretaddresses 'passphrase'" diff --git a/iguana/exchanges/sell b/iguana/exchanges/sell index 5f48ff299..6410148c8 100755 --- a/iguana/exchanges/sell +++ b/iguana/exchanges/sell @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"BTC\",\"basevolume\":10.0\"price\":0.0005}" diff --git a/iguana/exchanges/setprice b/iguana/exchanges/setprice index 0909118fb..40b88e0a5 100755 --- a/iguana/exchanges/setprice +++ b/iguana/exchanges/setprice @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":1.234}" diff --git a/iguana/exchanges/snapshot b/iguana/exchanges/snapshot index e9056f1cf..75a0a60aa 100755 --- a/iguana/exchanges/snapshot +++ b/iguana/exchanges/snapshot @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$1}" diff --git a/iguana/exchanges/snapshot_balance b/iguana/exchanges/snapshot_balance index 88b0f9823..b66f1a9e4 100644 --- a/iguana/exchanges/snapshot_balance +++ b/iguana/exchanges/snapshot_balance @@ -1,3 +1,4 @@ +#!/bin/bash source userpass ht=$1 curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index 38a0c3156..05bedaa82 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -1,3 +1,4 @@ +#!/bin/bash source userpass ht=$1 while true diff --git a/iguana/exchanges/status b/iguana/exchanges/status index a05aa72ee..0499bba6b 100755 --- a/iguana/exchanges/status +++ b/iguana/exchanges/status @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\"}" diff --git a/iguana/exchanges/swapstatus b/iguana/exchanges/swapstatus index ce9dbbed0..abc6dbb64 100755 --- a/iguana/exchanges/swapstatus +++ b/iguana/exchanges/swapstatus @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\",\"requestid\":2291973695,\"quoteid\":3387529385}" diff --git a/iguana/exchanges/trade b/iguana/exchanges/trade index 155de037a..1bad74aa9 100755 --- a/iguana/exchanges/trade +++ b/iguana/exchanges/trade @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"trade\",\"price\":1.234,\"base\":\"REVS\",\"rel\":\"KMD\",\"quote\":{}}" diff --git a/iguana/exchanges/utxos b/iguana/exchanges/utxos index 38f26f654..4782c9a0a 100755 --- a/iguana/exchanges/utxos +++ b/iguana/exchanges/utxos @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" From aa08f922c65d423450dd80251ce04ffb64ab3531 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 13:46:13 +0300 Subject: [PATCH 0741/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ef3cefd06..940b0b4bc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -284,13 +284,19 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str { if (LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { - printf("bob not eligible\n"); + printf("bob not eligible %s\n",jprint(LP_quotejson(qp),1)); return(-2); } if ( bits256_cmp(butxo->deposit.txid,qp->txid2) != 0 || butxo->deposit.vout != qp->vout2 ) + { + char str[65],str2[65]; printf("%s != %s v%d != %d\n",bits256_str(str,butxo->deposit.txid),bits256_str(str2,qp->txid2),butxo->deposit.vout,qp->vout2); return(-6); + } if ( strcmp(butxo->coinaddr,qp->coinaddr) != 0 ) + { + printf("(%s) != (%s)\n",butxo->coinaddr,qp->coinaddr); return(-7); + } } if ( autxo != 0 && LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { From b495c46421b1ce9e1fc76980fccc3bbbe93d15ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 14:03:24 +0300 Subject: [PATCH 0742/2732] Test --- iguana/exchanges/LP_ordermatch.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 940b0b4bc..028661339 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -779,7 +779,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); } - printf("butxo.%p TRADECOMMAND.(%s)\n",butxo,jprint(argjson,0)); + char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f -> %.8f\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,dstr(Q.satoshis),dstr(Q.destsatoshis)); @@ -855,7 +855,7 @@ char *LP_bestfit(char *rel,double relvolume) char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { - struct LP_utxoinfo *aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; + struct LP_utxoinfo *aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) { char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); @@ -876,17 +876,21 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q break; sleep(3); } - if ( aliceutxo->S.swap == 0 ) + jaddnum(bestitem,"quotedprice",price); + jaddnum(bestitem,"maxprice",maxprice); + if ( (swap= aliceutxo->S.swap) == 0 ) { if ( (pubp= LP_pubkeyadd(qp->srchash)) != 0 ) pubp->numerrors++; jaddstr(bestitem,"status","couldnt establish connection"); - } else jaddstr(bestitem,"status","connected"); - jaddnum(bestitem,"quotedprice",price); - jaddnum(bestitem,"maxprice",maxprice); - jaddnum(bestitem,"requestid",qp->R.requestid); - jaddnum(bestitem,"quoteid",qp->R.quoteid); - printf("Alice r.%u qp->%u\n",qp->R.requestid,qp->R.quoteid); + } + else + { + jaddstr(bestitem,"status","connected"); + jaddnum(bestitem,"requestid",swap->I.req.requestid); + jaddnum(bestitem,"quoteid",swap->I.req.quoteid); + printf("Alice r.%u qp->%u\n",swap->I.req.requestid,swap->I.req.quoteid); + } } else { From 8e1d1f0a0912b37c1834ff75ce231cc171f6edfb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 14:19:15 +0300 Subject: [PATCH 0743/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 028661339..0fa47c237 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -464,7 +464,7 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d { printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); if ( relvolume > dstr(desttxfee) && price > SMALLVAL ) - return(SATOSHIDEN * (relvolume / price) + txfee); + return(SATOSHIDEN * (relvolume / price) + 2*txfee); else return(0); } From a5969147fe7aa790c4d8545629f8dd0988bddc5e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 16:59:58 +0300 Subject: [PATCH 0744/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d0759257d..c3b4ede4d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -605,7 +605,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso free(hexstr); free_json(hexjson); } - *retjsonp = cJSON_Parse("{\"error\":\"null txid\"}"); + *retjsonp = 0; return(*retjsonp); } From aea3d93920f9800ef8cee742f04a3870b0339a06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:07:28 +0300 Subject: [PATCH 0745/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e98fd497a..fbd875dd5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -506,7 +506,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - //printf("%s %s\n",coin->symbol,jprint(array,0)); + printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) From 5fc86e18a9ab35628e9d82a042504bb8f6401134 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:10:10 +0300 Subject: [PATCH 0746/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c3b4ede4d..c0855ab41 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -505,7 +505,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From e96941c0770de1f7b79bd575091b675640880dfd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:12:35 +0300 Subject: [PATCH 0747/2732] Test --- iguana/exchanges/LP_utxos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fbd875dd5..a1fe1800c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -501,6 +501,8 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri return(0); } //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); + if ( coin->inactive == 0 ) + LP_listunspent_issue(coin->symbol,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0); From 4897ac61a0b048136f82e9fe752bad965bc0bedc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:14:40 +0300 Subject: [PATCH 0748/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index bb7d1e49b..b52500832 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -303,6 +303,7 @@ dividends(coin, height, )\n\ //LP_utxopurge(0); if ( bits256_nonz(G.LP_mypriv25519) != 0 ) LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); + else printf("no LP_mypriv25519\n"); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"coin",coin); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a1fe1800c..7a52aaefc 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -500,7 +500,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri printf("coin not active\n"); return(0); } - //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); + printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) From 6fffc5232db8069f48468df4b687d46738ae6a07 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:16:34 +0300 Subject: [PATCH 0749/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7a52aaefc..d3303a259 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -495,7 +495,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri { int32_t enable_utxos = 0; char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,flag=0,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; - if ( coin == 0 ) + if ( coin == 0 || coin->inactive != 0 ) { printf("coin not active\n"); return(0); From d273e99876b835d0e74f42401b99fef514544786 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:22:52 +0300 Subject: [PATCH 0750/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c0855ab41..c3b4ede4d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -505,7 +505,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index d3303a259..9f975ca4f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -500,7 +500,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri printf("coin not active\n"); return(0); } - printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); + //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) @@ -508,7 +508,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); + //printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) From 108ab2019f1eb6c21f60e4b8ade789369e4cf121 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 17:46:26 +0300 Subject: [PATCH 0751/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0fa47c237..e719ea9e6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -748,6 +748,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); + if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) + butxo = &B; //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { @@ -770,9 +772,10 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else { printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); - butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); } - } else butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + } + if ( butxo == 0 || butxo == &B ) + butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 ) { value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); From c5954cf6ad6d95e070d1d1c24ca9e747754dd1fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 18:01:46 +0300 Subject: [PATCH 0752/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_portfolio.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e15ab19b5..15a821f18 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -319,7 +319,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; HASH_ITER(hh,LP_coins,coin,ctmp) { - if ( coin->inactive != 0 || coin->obooktime == 0 ) + if ( coin->inactive != 0 || (coin->electrum != 0 && coin->obooktime == 0) ) continue; total = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); @@ -478,8 +478,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; if ( coin->electrum != 0 ) continue; - if ( coin->obooktime == 0 ) - continue; + //if ( coin->obooktime == 0 ) + // continue; if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { if ( (height= LP_getheight(coin)) > coin->longestchain ) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index e648e3381..b328e8138 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -89,7 +89,7 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 || coin->obooktime == 0 ) + if ( coin->inactive != 0 || (coin->electrum != 0 && coin->obooktime == 0) ) continue; if ( iter == 0 ) { From 629677ebad611d10406c81b01e4ec362b3be05f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 18:09:23 +0300 Subject: [PATCH 0753/2732] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 006b4b6cf..23e76098e 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -497,8 +497,8 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int break; sleep(10); } - if ( numconfirms <= 0 ) - numconfirms = LP_numconfirms(symbol,coinaddr,txid,vout,1); + //if ( numconfirms <= 0 ) + // numconfirms = LP_numconfirms(symbol,coinaddr,txid,vout,1); // no, no recursion occurs! return(numconfirms); } From 6078af69a2ffd14064714e95b9c818b752c7ddfe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 18:22:58 +0300 Subject: [PATCH 0754/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_ordermatch.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b52500832..615976163 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -385,7 +385,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"connected") == 0 ) { - printf("CONNECTED.(%s)\n",jprint(argjson,0)); + //printf("CONNECTED.(%s)\n",jprint(argjson,0)); retstr = LP_connectedalice(argjson); } else if ( strcmp(method,"checktxid") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e719ea9e6..a192b195b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -594,7 +594,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; uint64_t value,value2; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; uint64_t value,value2; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) @@ -610,8 +610,12 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("cant find autxo\n"); return(clonestr("{\"error\":\"cant find autxo\"}")); } - //LP_abutxo_set(autxo,0,&Q); - if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) + if ( autxo->S.swap != 0 ) + return(clonestr("{\"error\":\"ignore duplicate swap\"}")); + butxo = &B; + memset(butxo,0,sizeof(*butxo)); + LP_abutxo_set(0,butxo,&Q); + /*if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) { value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); @@ -630,7 +634,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("butxo value %.8f less satoshis %.8f\n",dstr(value),dstr(Q.satoshis)); return(clonestr("{\"error\":\"butxo value less than satoshis\"}")); } - } + }*/ if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); From 3334759043caad8f32776f52f4c50ce580036537 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 18:47:50 +0300 Subject: [PATCH 0755/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a192b195b..a3570d889 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -594,7 +594,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; uint64_t value,value2; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; //uint64_t value,value2; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 202af4e49..f16749018 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -601,6 +601,7 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } else { + LP_listunspent_issue(symbol,coinaddr); if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) numconfirms = (LP_getheight(coin) - ht + 1); else if ( mempool != 0 ) From 7d1a36c5b97b56a4e9f4713315a7733fdd8f7193 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 20:30:13 +0300 Subject: [PATCH 0756/2732] Balance api --- iguana/exchanges/LP_commands.c | 7 +++++++ iguana/exchanges/LP_utxo.c | 15 +++++++++++++++ iguana/exchanges/balance | 3 +++ 3 files changed, 25 insertions(+) create mode 100755 iguana/exchanges/balance diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 615976163..e76f2c691 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -114,6 +114,7 @@ portfolio()\n\ getpeers()\n\ passphrase(passphrase, gui)\n\ listunspent(coin, address)\n\ +balance(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ @@ -374,6 +375,12 @@ dividends(coin, height, )\n\ return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"balance") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"result\":\"at least one of coins disabled\"}")); else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f16749018..fe7040494 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -294,6 +294,21 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum return(array); } +cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electrumret) +{ + cJSON *array,*retjson; double balance = 0.; + if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + + } + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddstr(retjson,"coin",coin->symbol); + jaddstr(retjson,"address",coinaddr); + jaddnum(retjson,"balance",balance); + return(retjson); +} + void LP_postutxos(char *symbol,char *coinaddr) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); diff --git a/iguana/exchanges/balance b/iguana/exchanges/balance new file mode 100755 index 000000000..4a184f8f4 --- /dev/null +++ b/iguana/exchanges/balance @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balance\",\"coin\":\"BTC\",\"address\":\"1DPDsPCNNCF5SHhPPrddXcJe78rM6CBcH3\"}" From a6b934d24d64882325034dee551896e6b70ed647 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 20:33:01 +0300 Subject: [PATCH 0757/2732] Test --- iguana/exchanges/LP_utxo.c | 10 +++++++--- iguana/exchanges/balance | 2 +- iguana/exchanges/install | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fe7040494..ab9219412 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -296,16 +296,20 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*retjson; double balance = 0.; + cJSON *array,*retjson; int32_t i,n; uint64_t balance = 0; if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { - + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; isymbol); jaddstr(retjson,"address",coinaddr); - jaddnum(retjson,"balance",balance); + jaddnum(retjson,"balance",dstr(balance)); return(retjson); } diff --git a/iguana/exchanges/balance b/iguana/exchanges/balance index 4a184f8f4..22f84cdee 100755 --- a/iguana/exchanges/balance +++ b/iguana/exchanges/balance @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balance\",\"coin\":\"BTC\",\"address\":\"1DPDsPCNNCF5SHhPPrddXcJe78rM6CBcH3\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balance\",\"coin\":\"KMD\",\"address\":\"RHV2As4rox97BuE3LK96vMeNY8VsGRTmBj\"}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index a3632447b..3f64033f1 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . #echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 941275ecfaef91dd6824511bcce426795739be9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 20:38:32 +0300 Subject: [PATCH 0758/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 15a821f18..8fe03c09e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -319,7 +319,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; HASH_ITER(hh,LP_coins,coin,ctmp) { - if ( coin->inactive != 0 || (coin->electrum != 0 && coin->obooktime == 0) ) + if ( coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; total = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index b328e8138..80ce16c7b 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -89,7 +89,7 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 || (coin->electrum != 0 && coin->obooktime == 0) ) + if ( coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; if ( iter == 0 ) { From a4d2a05883ccc1e804f15dd929d7f412d15972d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 3 Oct 2017 19:46:48 +0300 Subject: [PATCH 0759/2732] Dont use /tmp --- iguana/exchanges/LP_nativeDEX.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8fe03c09e..cddae12d2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,14 +21,12 @@ // // new features: // -check for completed one being spent -// make remember remember +// make remember remember or maybe to just fix? // sign, spv check // bittrex balancing -// stats +// withdraw +// stats, fix pricearray // so alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot -// gettxout mempool a few other local network calls -// electrum cache for blockchain.transaction.get -// scan history for electrum after swap // unduplicated bugs: // swap cancel should cleanly cancel @@ -655,9 +653,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_messagemutex); portable_mutex_init(&LP_portfoliomutex); portable_mutex_init(&LP_butxomutex); - if ( system("curl -s4 checkip.amazonaws.com > /tmp/myipaddr") == 0 ) + if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) { - if ( (myipaddr= OS_filestr(&filesize,"/tmp/myipaddr")) != 0 && myipaddr[0] != 0 ) + if ( (myipaddr= OS_filestr(&filesize,"DB/myipaddr")) != 0 && myipaddr[0] != 0 ) { n = strlen(myipaddr); if ( myipaddr[n-1] == '\n' ) From 8fd398bb42c0b6976c8d2c66687c54f8b4b29c3e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 14:38:10 +0300 Subject: [PATCH 0760/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- iguana/exchanges/LP_remember.c | 15 +++++++++------ iguana/exchanges/LP_transaction.c | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cddae12d2..0c43d6503 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -26,7 +26,9 @@ // bittrex balancing // withdraw // stats, fix pricearray -// so alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot +// better error message in ordermatch +// verify portfolio +// alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot // unduplicated bugs: // swap cancel should cleanly cancel diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 74f0f4f53..eefab2383 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -957,9 +957,12 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Apaymentspent = txids[BASILISK_BOBSPEND]; else Apaymentspent = txids[BASILISK_ALICERECLAIM]; } - bits256_str(str,paymentspent), jaddbits256(item,"paymentspent",paymentspent); - bits256_str(str,Apaymentspent), jaddbits256(item,"Apaymentspent",Apaymentspent); - bits256_str(str,depositspent), jaddbits256(item,"depositspent",depositspent); + jaddbits256(item,"bobdeposit",txids[BASILISK_BOBDEPOSIT]); + jaddbits256(item,"alicepayment",txids[BASILISK_ALICEPAYMENT]); + jaddbits256(item,"bobpayment",txids[BASILISK_BOBPAYMENT]); + jaddbits256(item,"paymentspent",paymentspent); + jaddbits256(item,"Apaymentspent",Apaymentspent); + jaddbits256(item,"depositspent",depositspent); if ( origfinishedflag == 0 && finishedflag != 0 ) { //printf("SWAP %u-%u finished!\n",requestid,quoteid); @@ -1014,7 +1017,7 @@ char *basilisk_swaplist() } jaddstr(retjson,"result","success"); jadd(retjson,"swaps",array); - if ( cJSON_GetArraySize(array) > 0 ) + if ( 0 && cJSON_GetArraySize(array) > 0 ) { totalsobj = cJSON_CreateObject(); for (Btotal=i=0; i 0 ) jaddnum(retjson,"avesell",(double)-Btotal/Ktotal); } - array = cJSON_CreateArray(); - /*for (i=0; ilinfos)/sizeof(*myinfo->linfos); i++) + /*array = cJSON_CreateArray(); + for (i=0; ilinfos)/sizeof(*myinfo->linfos); i++) { if ( myinfo->linfos[i].base[0] != 0 && myinfo->linfos[i].rel[0] != 0 ) jaddi(array,linfo_json(&myinfo->linfos[i])); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 1facc6725..2c8bcff35 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -49,7 +49,10 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi { decode_hex(txid.bytes,32,retstr); if ( bits256_cmp(txid,expectedtxid) == 0 || (bits256_nonz(expectedtxid) == 0 && bits256_nonz(txid) != 0) ) + { sentflag = 1; + expectedtxid = txid; + } } else if ( (retjson= cJSON_Parse(retstr)) != 0 ) { From 66a538e671dde868f45ec39f2c6796e55a300467 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 16:07:19 +0300 Subject: [PATCH 0761/2732] Test --- iguana/exchanges/LP_remember.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index eefab2383..303d27935 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -921,6 +921,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti finishedflag = basilisk_swap_isfinished(iambob,txids,sentflags,paymentspent,Apaymentspent,depositspent); jaddnum(item,"requestid",requestid); jaddnum(item,"quoteid",quoteid); + jaddnum(item,"iambob",iambob); + jaddstr(item,"bob",bob->symbol); + jaddnum(item,"bobamount",dstr(values[BASILISK_BOBPAYMENT])); + jaddnum(item,"bobtxfee",dstr(Btxfee)); + jaddstr(item,"alice",alice->symbol); + jaddnum(item,"aliceamount",dstr(values[BASILISK_ALICEPAYMENT])); + jaddnum(item,"alicetxfee",dstr(Atxfee)); jadd(item,"txs",array); array = cJSON_CreateArray(); for (i=0; i Date: Wed, 4 Oct 2017 19:42:21 +0300 Subject: [PATCH 0762/2732] Cleanup code --- iguana/exchanges/LP_remember.c | 664 +++++++++++++++++---------------- 1 file changed, 347 insertions(+), 317 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 303d27935..b685b4a98 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -396,99 +396,188 @@ uint32_t LP_extract(uint32_t requestid,uint32_t quoteid,char *rootfname,char *fi return(t); } -cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) +void LP_totals_update(int32_t iambob,char *alicecoin,char *bobcoin,int64_t *KMDtotals,int64_t *BTCtotals,int32_t *sentflags,int64_t *values) // update to handle all coins { - static void *ctx; - FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,Predeemlen,Dredeemlen,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],Predeemscript[1024],Dredeemscript[1024],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*rstr,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t Atxfee=0,Btxfee=0; - if ( ctx == 0 ) - ctx = bitcoin_ctx(); - bobpaymentaddr[0] = bobdepositaddr[0] = alicepaymentaddr[0] = 0; - memset(Predeemscript,0,sizeof(Predeemscript)); - memset(Dredeemscript,0,sizeof(Dredeemscript)); - Predeemlen = Dredeemlen = 0; - memset(values,0,sizeof(values)); - memset(txids,0,sizeof(txids)); - memset(secretAm,0,sizeof(secretAm)); - memset(secretAm256,0,sizeof(secretAm256)); - memset(secretBn,0,sizeof(secretBn)); - memset(secretBn256,0,sizeof(secretBn256)); - memset(pubkey33,0,sizeof(pubkey33)); - memset(txbytes,0,sizeof(txbytes)); - memset(sentflags,0,sizeof(sentflags)); - memset(myprivs,0,sizeof(myprivs)); - Apaymentspent = paymentspent = depositspent = rev = zero = pubA0 = pubB0 = pubB1 = privAm = privBn = myprivs[0]; - plocktime = dlocktime = 0; - src[0] = dest[0] = bobcoin[0] = alicecoin[0] = 0; + values[BASILISK_OTHERFEE] = 0; + if ( iambob == 0 ) + { + if ( strcmp(alicecoin,"BTC") == 0 ) + { + BTCtotals[BASILISK_ALICEPAYMENT] -= values[BASILISK_ALICEPAYMENT] * sentflags[BASILISK_ALICEPAYMENT]; + BTCtotals[BASILISK_ALICERECLAIM] += values[BASILISK_ALICEPAYMENT] * sentflags[BASILISK_ALICERECLAIM]; + BTCtotals[BASILISK_MYFEE] -= values[BASILISK_MYFEE] * sentflags[BASILISK_MYFEE]; + } + else if ( strcmp(alicecoin,"KMD") == 0 ) + { + KMDtotals[BASILISK_ALICEPAYMENT] -= values[BASILISK_ALICEPAYMENT] * sentflags[BASILISK_ALICEPAYMENT]; + KMDtotals[BASILISK_ALICERECLAIM] += values[BASILISK_ALICEPAYMENT] * sentflags[BASILISK_ALICERECLAIM]; + KMDtotals[BASILISK_MYFEE] -= values[BASILISK_MYFEE] * sentflags[BASILISK_MYFEE]; + } + if ( strcmp(bobcoin,"KMD") == 0 ) + { + KMDtotals[BASILISK_ALICESPEND] += values[BASILISK_BOBPAYMENT] * sentflags[BASILISK_ALICESPEND]; + KMDtotals[BASILISK_ALICECLAIM] += values[BASILISK_BOBDEPOSIT] * sentflags[BASILISK_ALICECLAIM]; + } + else if ( strcmp(bobcoin,"BTC") == 0 ) + { + BTCtotals[BASILISK_ALICESPEND] += values[BASILISK_BOBPAYMENT] * sentflags[BASILISK_ALICESPEND]; + BTCtotals[BASILISK_ALICECLAIM] += values[BASILISK_BOBDEPOSIT] * sentflags[BASILISK_ALICECLAIM]; + } + } + else + { + if ( strcmp(bobcoin,"BTC") == 0 ) + { + BTCtotals[BASILISK_BOBPAYMENT] -= values[BASILISK_BOBPAYMENT] * sentflags[BASILISK_BOBPAYMENT]; + BTCtotals[BASILISK_BOBDEPOSIT] -= values[BASILISK_BOBDEPOSIT] * sentflags[BASILISK_BOBDEPOSIT]; + BTCtotals[BASILISK_BOBREFUND] += values[BASILISK_BOBREFUND] * sentflags[BASILISK_BOBREFUND]; + BTCtotals[BASILISK_BOBRECLAIM] += values[BASILISK_BOBRECLAIM] * sentflags[BASILISK_BOBRECLAIM]; + BTCtotals[BASILISK_MYFEE] -= values[BASILISK_MYFEE] * sentflags[BASILISK_MYFEE]; + } + else if ( strcmp(bobcoin,"KMD") == 0 ) + { + KMDtotals[BASILISK_BOBPAYMENT] -= values[BASILISK_BOBPAYMENT] * sentflags[BASILISK_BOBPAYMENT]; + KMDtotals[BASILISK_BOBDEPOSIT] -= values[BASILISK_BOBDEPOSIT] * sentflags[BASILISK_BOBDEPOSIT]; + KMDtotals[BASILISK_BOBREFUND] += values[BASILISK_BOBDEPOSIT] * sentflags[BASILISK_BOBREFUND]; + KMDtotals[BASILISK_BOBRECLAIM] += values[BASILISK_BOBPAYMENT] * sentflags[BASILISK_BOBRECLAIM]; + KMDtotals[BASILISK_MYFEE] -= values[BASILISK_MYFEE] * sentflags[BASILISK_MYFEE]; + } + if ( strcmp(alicecoin,"KMD") == 0 ) + { + KMDtotals[BASILISK_BOBSPEND] += values[BASILISK_BOBSPEND] * sentflags[BASILISK_BOBSPEND]; + } + else if ( strcmp(alicecoin,"BTC") == 0 ) + { + BTCtotals[BASILISK_BOBSPEND] += values[BASILISK_ALICEPAYMENT] * sentflags[BASILISK_BOBSPEND]; + } + } +} + +struct LP_swap_remember +{ + bits256 pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)]; + uint64_t Atxfee,Btxfee,srcamount,destamount; int64_t values[sizeof(txnames)/sizeof(*txnames)]; + uint32_t requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; + int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; + uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],Predeemscript[1024],Dredeemscript[1024]; + char src[64],dest[64],destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; +}; + +cJSON *LP_swap_json(struct LP_swap_remember *rswap) +{ + cJSON *item,*array; int32_t i; + item = cJSON_CreateObject(); + jaddnum(item,"requestid",rswap->requestid); + jaddnum(item,"quoteid",rswap->quoteid); + jaddnum(item,"iambob",rswap->iambob); + jaddstr(item,"bob",rswap->src); + jaddnum(item,"srcamount",dstr(rswap->srcamount)); + jaddnum(item,"bobtxfee",dstr(rswap->Btxfee)); + jaddstr(item,"alice",rswap->dest); + jaddnum(item,"destamount",dstr(rswap->destamount)); + jaddnum(item,"alicetxfee",dstr(rswap->Atxfee)); + array = cJSON_CreateArray(); + for (i=0; isentflags[i] != 0 ) + jaddistr(array,txnames[i]); + if ( rswap->txbytes[i] != 0 ) + free(rswap->txbytes[i]); + } + jadd(item,"sentflags",array); + array = cJSON_CreateArray(); + for (i=0; ivalues[i])); + jadd(item,"values",array); + jaddstr(item,"result","success"); + if ( rswap->finishedflag != 0 ) + jaddstr(item,"status","finished"); + else jaddstr(item,"status","pending"); + jaddbits256(item,"bobdeposit",rswap->txids[BASILISK_BOBDEPOSIT]); + jaddbits256(item,"alicepayment",rswap->txids[BASILISK_ALICEPAYMENT]); + jaddbits256(item,"bobpayment",rswap->txids[BASILISK_BOBPAYMENT]); + jaddbits256(item,"paymentspent",rswap->paymentspent); + jaddbits256(item,"Apaymentspent",rswap->Apaymentspent); + jaddbits256(item,"depositspent",rswap->depositspent); + return(item); +} + +int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t quoteid) +{ + char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; uint32_t r,q; int32_t i,j,n; + memset(rswap,0,sizeof(*rswap)); + rswap->requestid = requestid; + rswap->quoteid = quoteid; sprintf(fname,"%s/SWAPS/%u-%u",GLOBAL_DBDIR,requestid,quoteid), OS_compatible_path(fname); if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) { if ( (item= cJSON_Parse(fstr)) != 0 ) { - iambob = jint(item,"iambob"); + rswap->iambob = jint(item,"iambob"); if ( (secretstr= jstr(item,"secretAm")) != 0 && strlen(secretstr) == 40 ) - decode_hex(secretAm,20,secretstr); + decode_hex(rswap->secretAm,20,secretstr); if ( (secretstr= jstr(item,"secretAm256")) != 0 && strlen(secretstr) == 64 ) - decode_hex(secretAm256,32,secretstr); + decode_hex(rswap->secretAm256,32,secretstr); if ( (secretstr= jstr(item,"secretBn")) != 0 && strlen(secretstr) == 40 ) - decode_hex(secretBn,20,secretstr); + decode_hex(rswap->secretBn,20,secretstr); if ( (secretstr= jstr(item,"secretBn256")) != 0 && strlen(secretstr) == 64 ) - decode_hex(secretBn256,32,secretstr); + decode_hex(rswap->secretBn256,32,secretstr); if ( (srcstr= jstr(item,"src")) != 0 ) - safecopy(src,srcstr,sizeof(src)); + safecopy(rswap->src,srcstr,sizeof(rswap->src)); if ( (deststr= jstr(item,"dest")) != 0 ) - safecopy(dest,deststr,sizeof(dest)); + safecopy(rswap->dest,deststr,sizeof(rswap->dest)); if ( (dest33= jstr(item,"dest33")) != 0 && strlen(dest33) == 66 ) { - decode_hex(pubkey33,33,dest33); + decode_hex(rswap->pubkey33,33,dest33); //for (i=0; i<33; i++) // printf("%02x",pubkey33[i]); //printf(" <- %s dest33\n",dest33); } - if ( (plocktime= juint(item,"plocktime")) == 0 ) - plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); - if ( (dlocktime= juint(item,"dlocktime")) == 0 ) - dlocktime = LP_extract(requestid,quoteid,fname,"dlocktime"); + if ( (rswap->plocktime= juint(item,"plocktime")) == 0 ) + rswap->plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); + if ( (rswap->dlocktime= juint(item,"dlocktime")) == 0 ) + rswap->dlocktime = LP_extract(requestid,quoteid,fname,"dlocktime"); r = juint(item,"requestid"); q = juint(item,"quoteid"); - Atxfee = j64bits(item,"Atxfee"); - Btxfee = j64bits(item,"Btxfee"); - pubA0 = jbits256(item,"pubA0"); - pubB0 = jbits256(item,"pubB0"); - pubB1 = jbits256(item,"pubB1"); + rswap->Atxfee = j64bits(item,"Atxfee"); + rswap->Btxfee = j64bits(item,"Btxfee"); + rswap->pubA0 = jbits256(item,"pubA0"); + rswap->pubB0 = jbits256(item,"pubB0"); + rswap->pubB1 = jbits256(item,"pubB1"); privkey = jbits256(item,"myprivs0"); if ( bits256_nonz(privkey) != 0 ) - myprivs[0] = privkey; + rswap->myprivs[0] = privkey; privkey = jbits256(item,"myprivs1"); if ( bits256_nonz(privkey) != 0 ) - myprivs[1] = privkey; + rswap->myprivs[1] = privkey; privkey = jbits256(item,"privAm"); if ( bits256_nonz(privkey) != 0 ) { - privAm = privkey; + rswap->privAm = privkey; //printf("set privAm <- %s\n",bits256_str(str,privAm)); } privkey = jbits256(item,"privBn"); if ( bits256_nonz(privkey) != 0 ) { - privBn = privkey; + rswap->privBn = privkey; //printf("set privBn <- %s\n",bits256_str(str,privBn)); } - expiration = juint(item,"expiration"); - state = jint(item,"state"); - otherstate = jint(item,"otherstate"); - srcamount = SATOSHIDEN * jdouble(item,"srcamount"); - destamount = SATOSHIDEN * jdouble(item,"destamount"); - txids[BASILISK_BOBDEPOSIT] = jbits256(item,"Bdeposit"); - txids[BASILISK_BOBREFUND] = jbits256(item,"Brefund"); - txids[BASILISK_ALICECLAIM] = jbits256(item,"Aclaim"); - txids[BASILISK_BOBPAYMENT] = jbits256(item,"Bpayment"); - txids[BASILISK_ALICESPEND] = jbits256(item,"Aspend"); - txids[BASILISK_BOBRECLAIM] = jbits256(item,"Breclaim"); - txids[BASILISK_ALICEPAYMENT] = jbits256(item,"Apayment"); - txids[BASILISK_BOBSPEND] = jbits256(item,"Bspend"); - txids[BASILISK_ALICERECLAIM] = jbits256(item,"Areclaim"); - txids[BASILISK_MYFEE] = jbits256(item,"myfee"); - txids[BASILISK_OTHERFEE] = jbits256(item,"otherfee"); + rswap->expiration = juint(item,"expiration"); + rswap->state = jint(item,"state"); + rswap->otherstate = jint(item,"otherstate"); + rswap->srcamount = SATOSHIDEN * jdouble(item,"srcamount"); + rswap->destamount = SATOSHIDEN * jdouble(item,"destamount"); + rswap->txids[BASILISK_BOBDEPOSIT] = jbits256(item,"Bdeposit"); + rswap->txids[BASILISK_BOBREFUND] = jbits256(item,"Brefund"); + rswap->txids[BASILISK_ALICECLAIM] = jbits256(item,"Aclaim"); + rswap->txids[BASILISK_BOBPAYMENT] = jbits256(item,"Bpayment"); + rswap->txids[BASILISK_ALICESPEND] = jbits256(item,"Aspend"); + rswap->txids[BASILISK_BOBRECLAIM] = jbits256(item,"Breclaim"); + rswap->txids[BASILISK_ALICEPAYMENT] = jbits256(item,"Apayment"); + rswap->txids[BASILISK_BOBSPEND] = jbits256(item,"Bspend"); + rswap->txids[BASILISK_ALICERECLAIM] = jbits256(item,"Areclaim"); + rswap->txids[BASILISK_MYFEE] = jbits256(item,"myfee"); + rswap->txids[BASILISK_OTHERFEE] = jbits256(item,"otherfee"); free_json(item); } free(fstr); @@ -499,12 +588,12 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti //printf("%s -> (%s)\n",fname,fstr); if ( (txobj= cJSON_Parse(fstr)) != 0 ) { - paymentspent = jbits256(txobj,"paymentspent"); - Apaymentspent = jbits256(txobj,"Apaymentspent"); - depositspent = jbits256(txobj,"depositspent"); + rswap->paymentspent = jbits256(txobj,"paymentspent"); + rswap->Apaymentspent = jbits256(txobj,"Apaymentspent"); + rswap->depositspent = jbits256(txobj,"depositspent"); if ( (array= jarray(&n,txobj,"values")) != 0 ) for (i=0; ivalues[i] = SATOSHIDEN * jdouble(jitem(array,i),0); if ( (array= jarray(&n,txobj,"sentflags")) != 0 ) { for (i=0; isentflags[j] = 1; //printf("finished.%s\n",txnames[j]); break; } @@ -522,59 +611,61 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } } - origfinishedflag = finishedflag = 1; + rswap->origfinishedflag = rswap->finishedflag = 1; free(fstr); } - if ( iambob < 0 ) - return(0); - item = cJSON_CreateObject(); - array = cJSON_CreateArray(); + return(rswap->iambob); +} + +int32_t LP_swap_load(struct LP_swap_remember *rswap) +{ + int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj; bits256 txid,checktxid; uint64_t value; for (i=0; irequestid,rswap->quoteid,txnames[i]), OS_compatible_path(fname); if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) { - if ( 0 && finishedflag == 0 ) + if ( 0 && rswap->finishedflag == 0 ) printf("%s\n",fname); //printf("%s -> (%s)\n",fname,fstr); if ( (txobj= cJSON_Parse(fstr)) != 0 ) { //printf("TXOBJ.(%s)\n",jprint(txobj,0)); - iambob = jint(txobj,"iambob"); + rswap->iambob = jint(txobj,"iambob"); txid = jbits256(txobj,"txid"); if ( bits256_nonz(txid) == 0 ) continue; - txids[i] = txid; + rswap->txids[i] = txid; if ( jstr(txobj,"Apayment") != 0 ) - strcpy(alicepaymentaddr,jstr(txobj,"Apayment")); + safecopy(rswap->alicepaymentaddr,jstr(txobj,"Apayment"),sizeof(rswap->alicepaymentaddr)); if ( jstr(txobj,"Bpayment") != 0 ) - strcpy(bobpaymentaddr,jstr(txobj,"Bpayment")); + safecopy(rswap->bobpaymentaddr,jstr(txobj,"Bpayment"),sizeof(rswap->bobpaymentaddr)); if ( jstr(txobj,"Bdeposit") != 0 ) - strcpy(bobdepositaddr,jstr(txobj,"Bdeposit")); + safecopy(rswap->bobdepositaddr,jstr(txobj,"Bdeposit"),sizeof(rswap->bobdepositaddr)); if ( jobj(txobj,"tx") != 0 ) { - txbytes[i] = clonestr(jstr(txobj,"tx")); + rswap->txbytes[i] = clonestr(jstr(txobj,"tx")); //printf("[%s] TX.(%s)\n",txnames[i],txbytes[i]); } - if ( strcmp(txnames[i],"bobpayment") == 0 && (rstr= jstr(txobj,"redeem")) != 0 && (Predeemlen= is_hexstr(rstr,0)) > 0 ) + if ( strcmp(txnames[i],"bobpayment") == 0 && (rstr= jstr(txobj,"redeem")) != 0 && (rswap->Predeemlen= is_hexstr(rstr,0)) > 0 ) { - Predeemlen >>= 1; - decode_hex(Predeemscript,Predeemlen,rstr); + rswap->Predeemlen >>= 1; + decode_hex(rswap->Predeemscript,rswap->Predeemlen,rstr); } - else if ( strcmp(txnames[i],"bobdeposit") == 0 && (rstr= jstr(txobj,"redeem")) != 0 && (Dredeemlen= is_hexstr(rstr,0)) > 0 ) + else if ( strcmp(txnames[i],"bobdeposit") == 0 && (rstr= jstr(txobj,"redeem")) != 0 && (rswap->Dredeemlen= is_hexstr(rstr,0)) > 0 ) { - Dredeemlen >>= 1; - decode_hex(Dredeemscript,Dredeemlen,rstr); + rswap->Dredeemlen >>= 1; + decode_hex(rswap->Dredeemscript,rswap->Dredeemlen,rstr); } - values[i] = value = LP_value_extract(txobj,1); + rswap->values[i] = value = LP_value_extract(txobj,1); if ( (symbol= jstr(txobj,"coin")) != 0 ) { if ( i == BASILISK_ALICESPEND || i == BASILISK_BOBPAYMENT || i == BASILISK_BOBDEPOSIT || i == BASILISK_BOBREFUND || i == BASILISK_BOBRECLAIM || i == BASILISK_ALICECLAIM ) - safecopy(bobcoin,symbol,sizeof(bobcoin)); + safecopy(rswap->bobcoin,symbol,sizeof(rswap->bobcoin)); else if ( i == BASILISK_BOBSPEND || i == BASILISK_ALICEPAYMENT || i == BASILISK_ALICERECLAIM ) - safecopy(alicecoin,symbol,sizeof(alicecoin)); - if ( finishedflag == 0 ) + safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin)); + if ( rswap->finishedflag == 0 ) { if ( (sentobj= LP_gettx(symbol,txid)) == 0 ) { @@ -594,58 +685,80 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( bits256_cmp(checktxid,txid) == 0 ) { //printf(">>>>>> %s txid %s\n",jprint(sentobj,0),bits256_str(str,txid)); - sentflags[i] = 1; + rswap->sentflags[i] = 1; } free_json(sentobj); } - if ( finishedflag == 0 ) + if ( rswap->finishedflag == 0 ) printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); } } } //else printf("no symbol\n"); free(fstr); - } else if ( 0 && finishedflag == 0 ) + } else if ( 0 && rswap->finishedflag == 0 ) printf("%s not finished\n",fname); } - //printf("alicepayment.%s bobpayment.%s bobdeposit.%s\n",alicepaymentaddr,bobpaymentaddr,bobdepositaddr); - //printf("iambob.%d src.%s dest.%s bob.%s alice.%s pubA0.(%s)\n",iambob,src,dest,bobcoin,alicecoin,bits256_str(str,pubA0)); - Adestaddr[0] = destaddr[0] = 0; + return(rswap->finishedflag); +} + +/*{ + if ( txbytes[BASILISK_BOBREFUND] != 0 ) + { + txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",bobcoin,txbytes[BASILISK_BOBREFUND],zero); + if ( bits256_nonz(txids[BASILISK_BOBREFUND]) != 0 ) // tested + { + sentflags[BASILISK_BOBREFUND] = 1; + depositspent = txids[BASILISK_BOBREFUND]; + } + } +}*/ + +cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) +{ + static void *ctx; + struct LP_swap_remember rswap; int32_t i,j,len,secretstart,redeemlen; char str[65],*Adest,*Bdest,*AAdest,*ABdest; cJSON *item,*sentobj; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) + return(0); + LP_swap_load(&rswap); + memset(zero.bytes,0,sizeof(zero)); Adest = Bdest = AAdest = ABdest = 0; - if ( bobcoin[0] == 0 || alicecoin[0] == 0 ) + if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) return(0); - alice = LP_coinfind(alicecoin); - bob = LP_coinfind(bobcoin); - Atxfee = LP_txfeecalc(alice,Atxfee); - Btxfee = LP_txfeecalc(bob,Btxfee); + alice = LP_coinfind(rswap.alicecoin); + bob = LP_coinfind(rswap.bobcoin); + rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee); + rswap.Btxfee = LP_txfeecalc(bob,rswap.Btxfee); //printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,privBn),Bdest,ABdest); - if ( finishedflag == 0 && bobcoin[0] != 0 && alicecoin[0] != 0 ) + if ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 ) { - if ( iambob == 0 ) + if ( rswap.iambob == 0 ) { if ( alice != 0 ) { - bitcoin_address(Adestaddr,alice->taddr,alice->pubtype,pubkey33,33); - AAdest = Adestaddr; + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + AAdest = rswap.Adestaddr; } - if ( (bob= LP_coinfind(bobcoin)) != 0 ) + if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { - bitcoin_address(destaddr,bob->taddr,bob->pubtype,pubkey33,33); - Adest = destaddr; + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + Adest = rswap.destaddr; } } else { if ( bob != 0 ) { - bitcoin_address(destaddr,bob->taddr,bob->pubtype,pubkey33,33); - Bdest = destaddr; + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + Bdest = rswap.destaddr; } - if ( (alice= LP_coinfind(alicecoin)) != 0 ) + if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { - bitcoin_address(Adestaddr,alice->taddr,alice->pubtype,pubkey33,33); - ABdest = Adestaddr; + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + ABdest = rswap.Adestaddr; } } if ( bob == 0 || alice == 0 ) @@ -655,328 +768,245 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( alice->inactive != 0 || bob->inactive != 0 ) { - printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",alicecoin,alice->inactive,bobcoin,bob->inactive); + printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",rswap.alicecoin,alice->inactive,rswap.bobcoin,bob->inactive); return(0); } - if ( sentflags[BASILISK_ALICEPAYMENT] == 0 && bits256_nonz(txids[BASILISK_ALICEPAYMENT]) != 0 ) + if ( rswap.sentflags[BASILISK_ALICEPAYMENT] == 0 && bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) != 0 ) { - printf("txbytes.%p Apayment.%s\n",txbytes[BASILISK_ALICEPAYMENT],bits256_str(str,txids[BASILISK_ALICEPAYMENT])); - if ( txbytes[BASILISK_ALICEPAYMENT] != 0 ) - sentflags[BASILISK_ALICEPAYMENT] = 1; - else if ( (sentobj= LP_gettx(alicecoin,txids[BASILISK_ALICEPAYMENT])) != 0 ) + printf("txbytes.%p Apayment.%s\n",rswap.txbytes[BASILISK_ALICEPAYMENT],bits256_str(str,rswap.txids[BASILISK_ALICEPAYMENT])); + if ( rswap.txbytes[BASILISK_ALICEPAYMENT] != 0 ) + rswap.sentflags[BASILISK_ALICEPAYMENT] = 1; + else if ( (sentobj= LP_gettx(rswap.alicecoin,rswap.txids[BASILISK_ALICEPAYMENT])) != 0 ) { - sentflags[BASILISK_ALICEPAYMENT] = 1; + rswap.sentflags[BASILISK_ALICEPAYMENT] = 1; free_json(sentobj); } } - paymentspent = basilisk_swap_spendupdate(bobcoin,sentflags,txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); - Apaymentspent = basilisk_swap_spendupdate(alicecoin,sentflags,txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); - depositspent = basilisk_swap_spendupdate(bobcoin,sentflags,txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); - finishedflag = basilisk_swap_isfinished(iambob,txids,sentflags,paymentspent,Apaymentspent,depositspent); - if ( iambob == 0 ) + rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); + rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); + rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); + rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); + if ( rswap.iambob == 0 ) { - if ( sentflags[BASILISK_ALICESPEND] == 0 ) + if ( rswap.sentflags[BASILISK_ALICESPEND] == 0 ) { - if ( sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(paymentspent) == 0 ) + if ( rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.paymentspent) == 0 ) { //if ( txbytes[BASILISK_ALICESPEND] == 0 ) { - if ( bits256_nonz(txids[BASILISK_BOBPAYMENT]) != 0 ) + if ( bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 ) { // alicespend + memset(rev.bytes,0,sizeof(rev)); for (j=0; j<32; j++) - rev.bytes[j] = privAm.bytes[31 - j]; + rev.bytes[j] = rswap.privAm.bytes[31 - j]; //revcalc_rmd160_sha256(secretAm,rev);//privAm); //vcalc_sha256(0,secretAm256,rev.bytes,sizeof(rev)); - if ( Predeemlen != 0 ) - redeemlen = Predeemlen, memcpy(redeemscript,Predeemscript,Predeemlen); - else redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,plocktime,pubA0,pubB0,pubB1,rev,privBn,secretAm,secretAm256,secretBn,secretBn256); - len = basilisk_swapuserdata(userdata,rev,0,myprivs[0],redeemscript,redeemlen); + if ( rswap.Predeemlen != 0 ) + redeemlen = rswap.Predeemlen, memcpy(redeemscript,rswap.Predeemscript,rswap.Predeemlen); + else redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,rswap.plocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rev,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); + len = basilisk_swapuserdata(userdata,rev,0,rswap.myprivs[0],redeemscript,redeemlen); { char privaddr[64]; uint8_t privpub33[33]; - bitcoin_pubkey33(ctx,privpub33,myprivs[0]); + bitcoin_pubkey33(ctx,privpub33,rswap.myprivs[0]); bitcoin_address(privaddr,0,60,privpub33,33); - printf("alicespend len.%d redeemlen.%d priv0addr.(%s) priv0.(%s)\n",len,redeemlen,privaddr,bits256_str(str,myprivs[0])); + printf("alicespend len.%d redeemlen.%d priv0addr.(%s) priv0.(%s)\n",len,redeemlen,privaddr,bits256_str(str,rswap.myprivs[0])); } for (j=0; j<32; j++) - rev.bytes[j] = myprivs[0].bytes[31 - j]; - if ( (txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"alicespend",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,1,expiration,&values[BASILISK_ALICESPEND],0,0,bobpaymentaddr,1)) != 0 ) - printf("alicespend.(%s)\n",txbytes[BASILISK_ALICESPEND]); + rev.bytes[j] = rswap.myprivs[0].bytes[31 - j]; + if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1)) != 0 ) + printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]); } } - if ( txbytes[BASILISK_ALICESPEND] != 0 ) + if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 ) { - txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",bobcoin,txbytes[BASILISK_ALICESPEND],zero); - if ( bits256_nonz(txids[BASILISK_ALICESPEND]) != 0 ) // tested + rswap.txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],zero); + if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) // tested { - sentflags[BASILISK_ALICESPEND] = 1; - paymentspent = txids[BASILISK_ALICESPEND]; + rswap.sentflags[BASILISK_ALICESPEND] = 1; + rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; } } } } - if ( sentflags[BASILISK_ALICECLAIM] == 0 && sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(depositspent) == 0 ) + if ( rswap.sentflags[BASILISK_ALICECLAIM] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { - if ( time(NULL) > expiration ) + if ( time(NULL) > rswap.expiration ) { //if ( txbytes[BASILISK_ALICECLAIM] == 0 ) { - if ( Dredeemlen != 0 ) - redeemlen = Dredeemlen, memcpy(redeemscript,Dredeemscript,Dredeemlen); - else redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,zero,secretAm,secretAm256,secretBn,secretBn256); + if ( rswap.Dredeemlen != 0 ) + redeemlen = rswap.Dredeemlen, memcpy(redeemscript,rswap.Dredeemscript,rswap.Dredeemlen); + else redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,zero,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); if ( redeemlen > 0 ) { - len = basilisk_swapuserdata(userdata,zero,1,myprivs[0],redeemscript,redeemlen); - if ( (txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"aliceclaim",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,0,expiration,&values[BASILISK_ALICECLAIM],0,0,bobdepositaddr,1)) != 0 ) - printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,privBn),txbytes[BASILISK_ALICECLAIM]); + len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen); + if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1)) != 0 ) + printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); } } - if ( txbytes[BASILISK_ALICECLAIM] != 0 ) + if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) { - txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",bobcoin,txbytes[BASILISK_ALICECLAIM],zero); - if ( bits256_nonz(txids[BASILISK_ALICECLAIM]) != 0 ) // tested + rswap.txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],zero); + if ( bits256_nonz(rswap.txids[BASILISK_ALICECLAIM]) != 0 ) // tested { - sentflags[BASILISK_ALICECLAIM] = 1; - depositspent = txids[BASILISK_ALICECLAIM]; + rswap.sentflags[BASILISK_ALICECLAIM] = 1; + rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; } } - } else printf("now %u before expiration %u\n",(uint32_t)time(NULL),expiration); + } else printf("now %u before expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } - if ( sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(Apaymentspent) == 0 && sentflags[BASILISK_ALICECLAIM] == 0 ) + if ( rswap.sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(rswap.Apaymentspent) == 0 && rswap.sentflags[BASILISK_ALICECLAIM] == 0 ) { //if ( txbytes[BASILISK_ALICERECLAIM] == 0 ) { - privBn = basilisk_swap_privBn_extract(&txids[BASILISK_BOBREFUND],bobcoin,txids[BASILISK_BOBDEPOSIT],privBn); - if ( bits256_nonz(txids[BASILISK_ALICEPAYMENT]) != 0 && bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) + rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn); + if ( bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) != 0 && bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) { - if ( (txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",alicecoin,Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_ALICERECLAIM],alicepaymentaddr)) != 0 ) - printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,privBn),txbytes[BASILISK_ALICERECLAIM]); + if ( (rswap.txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_ALICERECLAIM],rswap.alicepaymentaddr)) != 0 ) + printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICERECLAIM]); } } - if ( txbytes[BASILISK_ALICERECLAIM] != 0 ) + if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 ) { - txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",alicecoin,txbytes[BASILISK_ALICERECLAIM],zero); - if ( bits256_nonz(txids[BASILISK_ALICERECLAIM]) != 0 ) // tested + rswap.txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],zero); + if ( bits256_nonz(rswap.txids[BASILISK_ALICERECLAIM]) != 0 ) // tested { - sentflags[BASILISK_ALICERECLAIM] = 1; - Apaymentspent = txids[BASILISK_ALICERECLAIM]; + rswap.sentflags[BASILISK_ALICERECLAIM] = 1; + rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; } } } } - else if ( iambob == 1 ) + else if ( rswap.iambob == 1 ) { - if ( sentflags[BASILISK_BOBSPEND] == 0 && bits256_nonz(Apaymentspent) == 0 ) + if ( rswap.sentflags[BASILISK_BOBSPEND] == 0 && bits256_nonz(rswap.Apaymentspent) == 0 ) { - printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,txids[BASILISK_ALICESPEND]),bits256_nonz(privAm)); - if ( bits256_nonz(txids[BASILISK_ALICESPEND]) != 0 || bits256_nonz(privAm) != 0 ) + printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); + if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 || bits256_nonz(rswap.privAm) != 0 ) { //if ( txbytes[BASILISK_BOBSPEND] == 0 ) { - if ( bits256_nonz(privAm) == 0 ) + if ( bits256_nonz(rswap.privAm) == 0 ) { - privAm = basilisk_swap_privbob_extract(bobcoin,txids[BASILISK_ALICESPEND],0,1); + rswap.privAm = basilisk_swap_privbob_extract(rswap.bobcoin,rswap.txids[BASILISK_ALICESPEND],0,1); } - if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) + if ( bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) { - if ( (txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",alicecoin,Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_BOBSPEND],alicepaymentaddr)) != 0 ) - printf("bobspend.(%s)\n",txbytes[BASILISK_BOBSPEND]); + if ( (rswap.txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_BOBSPEND],rswap.alicepaymentaddr)) != 0 ) + printf("bobspend.(%s)\n",rswap.txbytes[BASILISK_BOBSPEND]); } } - if ( txbytes[BASILISK_BOBSPEND] != 0 ) + if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 ) { - txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",alicecoin,txbytes[BASILISK_BOBSPEND],zero); - if ( bits256_nonz(txids[BASILISK_BOBSPEND]) != 0 ) // tested + rswap.txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],zero); + if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) // tested { - sentflags[BASILISK_BOBSPEND] = 1; - Apaymentspent = txids[BASILISK_BOBSPEND]; + rswap.sentflags[BASILISK_BOBSPEND] = 1; + rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; } } } } - if ( sentflags[BASILISK_BOBRECLAIM] == 0 && sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > expiration && bits256_nonz(paymentspent) == 0 ) + if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > rswap.expiration && bits256_nonz(rswap.paymentspent) == 0 ) { //if ( txbytes[BASILISK_BOBRECLAIM] == 0 ) { // bobreclaim - redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,plocktime,pubA0,pubB0,pubB1,zero,privBn,secretAm,secretAm256,secretBn,secretBn256); + redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,rswap.plocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,zero,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); if ( redeemlen > 0 ) { - len = basilisk_swapuserdata(userdata,zero,1,myprivs[1],redeemscript,redeemlen); - if ( (txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[1],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,0,expiration,&values[BASILISK_BOBRECLAIM],0,0,bobpaymentaddr,1)) != 0 ) + len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[1],redeemscript,redeemlen); + if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1)) != 0 ) { int32_t z; for (z=0; z<20; z++) - printf("%02x",secretAm[z]); - printf(" secretAm, myprivs[1].(%s) bobreclaim.(%s)\n",bits256_str(str,myprivs[1]),txbytes[BASILISK_BOBRECLAIM]); + printf("%02x",rswap.secretAm[z]); + printf(" secretAm, myprivs[1].(%s) bobreclaim.(%s)\n",bits256_str(str,rswap.myprivs[1]),rswap.txbytes[BASILISK_BOBRECLAIM]); } } } - if ( txbytes[BASILISK_BOBRECLAIM] != 0 ) + if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 ) { - txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",bobcoin,txbytes[BASILISK_BOBRECLAIM],zero); - if ( bits256_nonz(txids[BASILISK_BOBRECLAIM]) != 0 ) // tested + rswap.txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],zero); + if ( bits256_nonz(rswap.txids[BASILISK_BOBRECLAIM]) != 0 ) // tested { - sentflags[BASILISK_BOBRECLAIM] = 1; - paymentspent = txids[BASILISK_BOBRECLAIM]; + rswap.sentflags[BASILISK_BOBRECLAIM] = 1; + rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; } } } - if ( sentflags[BASILISK_BOBREFUND] == 0 && sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(depositspent) == 0 ) + if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { - if ( bits256_nonz(paymentspent) != 0 || time(NULL) > expiration ) + if ( bits256_nonz(rswap.paymentspent) != 0 || time(NULL) > rswap.expiration ) { printf("do the refund!\n"); //if ( txbytes[BASILISK_BOBREFUND] == 0 ) { - revcalc_rmd160_sha256(secretBn,privBn); - vcalc_sha256(0,secretBn256,privBn.bytes,sizeof(privBn)); - redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,privBn,secretAm,secretAm256,secretBn,secretBn256); - len = basilisk_swapuserdata(userdata,privBn,0,myprivs[0],redeemscript,redeemlen); - if ( (txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,1,expiration,&values[BASILISK_BOBREFUND],0,0,bobdepositaddr,1)) != 0 ) - printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,pubB1),txbytes[BASILISK_BOBREFUND]); + revcalc_rmd160_sha256(rswap.secretBn,rswap.privBn); + vcalc_sha256(0,rswap.secretBn256,rswap.privBn.bytes,sizeof(rswap.privBn)); + redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); + len = basilisk_swapuserdata(userdata,rswap.privBn,0,rswap.myprivs[0],redeemscript,redeemlen); + if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1)) != 0 ) + printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } - if ( txbytes[BASILISK_BOBREFUND] != 0 ) + if ( rswap.txbytes[BASILISK_BOBREFUND] != 0 ) { - txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",bobcoin,txbytes[BASILISK_BOBREFUND],zero); - if ( bits256_nonz(txids[BASILISK_BOBREFUND]) != 0 ) // tested + rswap.txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],zero); + if ( bits256_nonz(rswap.txids[BASILISK_BOBREFUND]) != 0 ) // tested { - sentflags[BASILISK_BOBREFUND] = 1; - depositspent = txids[BASILISK_BOBREFUND]; + rswap.sentflags[BASILISK_BOBREFUND] = 1; + rswap.depositspent = rswap.txids[BASILISK_BOBREFUND]; } } - } else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),expiration); + } else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } } } //printf("finish.%d iambob.%d REFUND %d %d %d %d\n",finishedflag,iambob,sentflags[BASILISK_BOBREFUND] == 0,sentflags[BASILISK_BOBDEPOSIT] != 0,bits256_nonz(txids[BASILISK_BOBDEPOSIT]) != 0,bits256_nonz(depositspent) == 0); - if ( sentflags[BASILISK_ALICESPEND] != 0 || sentflags[BASILISK_BOBRECLAIM] != 0 ) - sentflags[BASILISK_BOBPAYMENT] = 1; - if ( sentflags[BASILISK_ALICERECLAIM] != 0 || sentflags[BASILISK_BOBSPEND] != 0 ) - sentflags[BASILISK_ALICEPAYMENT] = 1; - if ( sentflags[BASILISK_ALICECLAIM] != 0 || sentflags[BASILISK_BOBREFUND] != 0 ) - sentflags[BASILISK_BOBDEPOSIT] = 1; - for (i=0; isymbol); - jaddnum(item,"bobamount",dstr(values[BASILISK_BOBPAYMENT])); - jaddnum(item,"bobtxfee",dstr(Btxfee)); - jaddstr(item,"alice",alice->symbol); - jaddnum(item,"aliceamount",dstr(values[BASILISK_ALICEPAYMENT])); - jaddnum(item,"alicetxfee",dstr(Atxfee)); - jadd(item,"txs",array); - array = cJSON_CreateArray(); + if ( rswap.sentflags[BASILISK_ALICESPEND] != 0 || rswap.sentflags[BASILISK_BOBRECLAIM] != 0 ) + rswap.sentflags[BASILISK_BOBPAYMENT] = 1; + if ( rswap.sentflags[BASILISK_ALICERECLAIM] != 0 || rswap.sentflags[BASILISK_BOBSPEND] != 0 ) + rswap.sentflags[BASILISK_ALICEPAYMENT] = 1; + if ( rswap.sentflags[BASILISK_ALICECLAIM] != 0 || rswap.sentflags[BASILISK_BOBREFUND] != 0 ) + rswap.sentflags[BASILISK_BOBDEPOSIT] = 1; for (i=0; i Date: Wed, 4 Oct 2017 19:55:48 +0300 Subject: [PATCH 0763/2732] Test --- iguana/exchanges/LP_remember.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b685b4a98..02a9ea564 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -840,9 +840,14 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti else redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,zero,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); if ( redeemlen > 0 ) { - len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1)) != 0 ) - printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); + if ( bits256_nonz(rswap.privBn) == 0 ) + rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn); + if ( bits256_nonz(rswap.privBn) != 0 ) + { + len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen); + if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1)) != 0 ) + printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); + } } } if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) From 5012acea8638003d8ba141961f98bd05f7c567bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 20:35:02 +0300 Subject: [PATCH 0764/2732] Test --- iguana/exchanges/LP_remember.c | 24 +++++++++++++++++++++++- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 02a9ea564..15c48c4ed 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -713,6 +713,24 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) } }*/ +int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) +{ + cJSON *sentobj; char str[65]; + if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) + { + printf("[%s] txbytes.%p Apayment.%s\n",txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi])); + if ( rswap->txbytes[txi] != 0 ) + rswap->sentflags[txi] = 1; + else if ( (sentobj= LP_gettx(symbol,rswap->txids[txi])) != 0 ) + { + rswap->sentflags[txi] = 1; + free_json(sentobj); + return(1); + } + } + return(0); +} + cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; @@ -771,6 +789,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",rswap.alicecoin,alice->inactive,rswap.bobcoin,bob->inactive); return(0); } + LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); + LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); + LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); +/* if ( rswap.sentflags[BASILISK_ALICEPAYMENT] == 0 && bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) != 0 ) { printf("txbytes.%p Apayment.%s\n",rswap.txbytes[BASILISK_ALICEPAYMENT],bits256_str(str,rswap.txids[BASILISK_ALICEPAYMENT])); @@ -781,7 +803,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_ALICEPAYMENT] = 1; free_json(sentobj); } - } + }*/ rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index deffe3bf6..c612cfa3f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -623,7 +623,7 @@ char *LP_sendrawtransaction(char *symbol,char *signedtx) //electrum sendrawtx (the transaction was rejected by network rules.\n\ntransaction already in block chain) if ( strstr(retstr,"already in block") != 0 ) alreadyflag = 1; - printf("electrum sendrawtx.(%s) -> %s already.%d\n",signedtx,retstr,alreadyflag); + //printf("electrum sendrawtx.(%s) -> %s already.%d\n",signedtx,retstr,alreadyflag); if ( alreadyflag != 0 ) { errobj = cJSON_CreateObject(); From 02f9ec624c539549073d31308b300fc1bb475bf7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 20:45:42 +0300 Subject: [PATCH 0765/2732] Test --- iguana/exchanges/LP_remember.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 15c48c4ed..57ba7f142 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -246,16 +246,12 @@ bits256 basilisk_swap_privBn_extract(bits256 *bobrefundp,char *bobcoin,bits256 b bits256 basilisk_swap_spendupdate(char *symbol,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr) { - bits256 spendtxid,txid; char destaddr[64]; + bits256 spendtxid,txid; char destaddr[64],str[65]; txid = txids[utxoind]; memset(&spendtxid,0,sizeof(spendtxid)); - /*if ( aliceaddr != 0 ) - printf("aliceaddr.(%s)\n",aliceaddr); - if ( bobaddr != 0 ) - printf("bobaddr.(%s)\n",bobaddr);*/ if ( bits256_nonz(txid) != 0 ) { - //char str[65]; + destaddr[0] = 0; spendtxid = LP_swap_spendtxid(symbol,destaddr,txid,vout); if ( bits256_nonz(spendtxid) != 0 ) { @@ -290,7 +286,7 @@ bits256 basilisk_swap_spendupdate(char *symbol,int32_t *sentflags,bits256 *txids txids[alicespent] = spendtxid; } } - } + } else printf("no spend of %s/v%d detected\n",bits256_str(str,txid),vout); } else printf("utxoind.%d null txid\n",utxoind); return(spendtxid); } @@ -734,7 +730,7 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,len,secretstart,redeemlen; char str[65],*Adest,*Bdest,*AAdest,*ABdest; cJSON *item,*sentobj; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + struct LP_swap_remember rswap; int32_t i,j,len,secretstart,redeemlen; char str[65],*Adest,*Bdest,*AAdest,*ABdest; cJSON *item; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) @@ -792,18 +788,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); -/* - if ( rswap.sentflags[BASILISK_ALICEPAYMENT] == 0 && bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) != 0 ) - { - printf("txbytes.%p Apayment.%s\n",rswap.txbytes[BASILISK_ALICEPAYMENT],bits256_str(str,rswap.txids[BASILISK_ALICEPAYMENT])); - if ( rswap.txbytes[BASILISK_ALICEPAYMENT] != 0 ) - rswap.sentflags[BASILISK_ALICEPAYMENT] = 1; - else if ( (sentobj= LP_gettx(rswap.alicecoin,rswap.txids[BASILISK_ALICEPAYMENT])) != 0 ) - { - rswap.sentflags[BASILISK_ALICEPAYMENT] = 1; - free_json(sentobj); - } - }*/ rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); From aa6ec20c13f0fb97ca1fd8b69beb42e289de677f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 20:54:31 +0300 Subject: [PATCH 0766/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0c43d6503..ac628c15f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -511,7 +511,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht; continue; } - //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); From bab2b8530587d1b1f7967fa27a16eefd0950062f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 21:45:49 +0300 Subject: [PATCH 0767/2732] Test --- iguana/exchanges/LP_remember.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 57ba7f142..fc0bada18 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -244,9 +244,17 @@ bits256 basilisk_swap_privBn_extract(bits256 *bobrefundp,char *bobcoin,bits256 b return(privBn); } -bits256 basilisk_swap_spendupdate(char *symbol,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr) +bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr) { - bits256 spendtxid,txid; char destaddr[64],str[65]; + bits256 spendtxid,txid; char destaddr[64],str[65]; struct iguana_info *coin; cJSON *histobj; + if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum != 0 ) + { + if ( (histobj= electrum_address_gethistory(symbol,coin->electrum,&histobj,spentaddr)) != 0 ) + { + printf("processed history.(%s)\n",jprint(histobj,0)); + free_json(histobj); + } + } txid = txids[utxoind]; memset(&spendtxid,0,sizeof(spendtxid)); if ( bits256_nonz(txid) != 0 ) @@ -788,9 +796,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); - rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); - rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); - rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); + rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); + rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); + rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); if ( rswap.iambob == 0 ) { From 0e0558c7e5e20aa345083c3db1f63bc1a617ce64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 21:47:21 +0300 Subject: [PATCH 0768/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ac628c15f..0c43d6503 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -511,7 +511,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht; continue; } - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); From 241188e9a08308699079bdc72561e08725151d73 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 21:50:27 +0300 Subject: [PATCH 0769/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index fc0bada18..b70fc10ff 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -251,7 +251,7 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag { if ( (histobj= electrum_address_gethistory(symbol,coin->electrum,&histobj,spentaddr)) != 0 ) { - printf("processed history.(%s)\n",jprint(histobj,0)); + //printf("processed history.(%s)\n",jprint(histobj,0)); free_json(histobj); } } From 602d865f2a6ee2e76fc58df99974a721f94496bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 21:52:02 +0300 Subject: [PATCH 0770/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c3b4ede4d..e4727bada 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -469,7 +469,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * height = jint(item,"height"); if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { - char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); + //char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); txobj = LP_transactioninit(coin,txid,0,0); txobj = LP_transactioninit(coin,txid,1,txobj); if ( txobj != 0 ) From 3d08de4ade28bfcf991cd9d96211904b2c62ced2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 21:57:16 +0300 Subject: [PATCH 0771/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ----- iguana/exchanges/LP_swap.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0c43d6503..5968100d5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,17 +21,12 @@ // // new features: // -check for completed one being spent -// make remember remember or maybe to just fix? // sign, spv check // bittrex balancing // withdraw // stats, fix pricearray // better error message in ordermatch // verify portfolio -// alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot - -// unduplicated bugs: -// swap cancel should cleanly cancel #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 50fd58e36..1a475a377 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -756,7 +756,7 @@ void LP_bobloop(void *_swap) } } basilisk_swap_finished(swap); - free(swap); + //free(swap); } else printf("swap timed out\n"); } From 7ae3b102a36e9105a3d884cfee7c3eaf2d31d687 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 22:17:39 +0300 Subject: [PATCH 0772/2732] Detect and skip status for realtime swaps --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- iguana/exchanges/LP_remember.c | 18 +++++++++++++----- iguana/exchanges/LP_swap.c | 3 +++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5968100d5..7923911c3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,11 +21,11 @@ // // new features: // -check for completed one being spent +// better error message in ordermatch +// withdraw // sign, spv check // bittrex balancing -// withdraw // stats, fix pricearray -// better error message in ordermatch // verify portfolio #include @@ -53,16 +53,16 @@ int32_t LP_mypullsock = -1; int32_t LP_showwif,IAMLP = 0; double LP_profitratio = 1.; - struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; struct LP_globals { struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; bits256 LP_mypub25519,LP_mypriv25519; + uint64_t LP_skipstatus[10000]; uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; - int32_t LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting; + int32_t LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting,LP_numskips; char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41],gui[16]; struct LP_privkey LP_privkeys[100]; } G; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b70fc10ff..edfb8ac2a 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1037,7 +1037,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti char *basilisk_swaplist() { - char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i; + char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i; portable_mutex_lock(&LP_swaplistmutex); memset(KMDtotals,0,sizeof(KMDtotals)); memset(BTCtotals,0,sizeof(BTCtotals)); @@ -1052,13 +1052,21 @@ char *basilisk_swaplist() while ( fread(&requestid,1,sizeof(requestid),fp) == sizeof(requestid) && fread("eid,1,sizeof(quoteid),fp) == sizeof(quoteid) ) { flag = 0; - /*for (i=0; inumswaps; i++) - if ( (swap= myinfo->swaps[i]) != 0 && swap->I.req.requestid == requestid && swap->I.req.quoteid == quoteid ) + for (i=0; i> 32); + q = (uint32_t)G.LP_skipstatus[i]; + if ( r == requestid && q == quoteid ) { - jaddi(array,basilisk_swapjson(swap)); + item = cJSON_CreateObject(); + jaddstr(item,"status","realtime"); + jaddnum(item,"requestid",r); + jaddnum(item,"quoteid",q); + jaddi(array,item); flag = 1; break; - }*/ + } + } if ( flag == 0 ) { if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 1a475a377..e08f3aa36 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1071,6 +1071,9 @@ struct basilisk_swap *LP_swapinit(int32_t iambob,int32_t optionduration,bits256 swap->ctx = bitcoin_ctx(); vcalc_sha256(0,swap->I.orderhash.bytes,(uint8_t *)rp,sizeof(*rp)); swap->I.req = *rp; + G.LP_skipstatus[G.LP_numskips] = ((uint64_t)rp->requestid << 32) | rp->quoteid; + if ( G.LP_numskips < sizeof(G.LP_skipstatus)/sizeof(*G.LP_skipstatus) ) + G.LP_numskips++; printf("basilisk_thread_start request.%u iambob.%d (%s/%s) quoteid.%u\n",rp->requestid,iambob,rp->src,rp->dest,rp->quoteid); bitcoin_pubkey33(swap->ctx,pubkey33,privkey); pubkey25519 = curve25519(privkey,curve25519_basepoint9()); From 6ab3edcd50002cc20949835e929bff36ae05a085 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 22:19:02 +0300 Subject: [PATCH 0773/2732] test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7923911c3..f122b1ddd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -516,7 +516,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_getestimatedrate(coin); break; } - if ( 0 && (counter % 6000) == 60 ) + if ( (counter % 6000) == 60 ) { if ( (retstr= basilisk_swapentry(0,0)) != 0 ) { From c53ef2042eb1250fd86c70679e63f6996f22107d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Oct 2017 06:52:28 +0300 Subject: [PATCH 0774/2732] 4 new coins --- iguana/exchanges/LP_nativeDEX.c | 9 +++++---- iguana/exchanges/coins | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f122b1ddd..e2dda7882 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,13 +20,14 @@ // marketmaker // // new features: -// -check for completed one being spent // better error message in ordermatch // withdraw -// sign, spv check -// bittrex balancing +// sign packets +// spv check // stats, fix pricearray // verify portfolio +// bittrex balancing +// -check for completed one being spent #include #include "LP_include.h" @@ -513,7 +514,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int continue; } coin->lastscanht++; - LP_getestimatedrate(coin); + //LP_getestimatedrate(coin); break; } if ( (counter % 6000) == 60 ) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 258a3be5e..25af22269 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From d96af63dbbfbab8b0cd751ff578e6766aa1ae1ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 15:48:41 +0300 Subject: [PATCH 0775/2732] MNZ support --- iguana/coins/basilisk/mnz | 2 ++ iguana/coins/mnz_7776 | 2 ++ iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/iguana_notary.c | 2 +- iguana/m_notary | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 iguana/coins/basilisk/mnz create mode 100755 iguana/coins/mnz_7776 diff --git a/iguana/coins/basilisk/mnz b/iguana/coins/basilisk/mnz new file mode 100755 index 000000000..d08d34075 --- /dev/null +++ b/iguana/coins/basilisk/mnz @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"MNZ.conf\",\"path\":\"${HOME#"/"}/.komodo/MNZ\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":0,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"MNZ\",\"name\":\"MNZ\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"53d06fde\",\"p2p\":14336,\"rpc\":14337,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" + diff --git a/iguana/coins/mnz_7776 b/iguana/coins/mnz_7776 new file mode 100755 index 000000000..cdbe97124 --- /dev/null +++ b/iguana/coins/mnz_7776 @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"MNZ.conf\",\"path\":\"${HOME#"/"}/.komodo/MNZ\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"MNZ\",\"name\":\"MNZ\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"53d06fde\",\"p2p\":14336,\"rpc\":14337,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" + diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e2dda7882..769670543 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -24,9 +24,11 @@ // withdraw // sign packets // spv check +// dPoW security // stats, fix pricearray // verify portfolio // bittrex balancing + // -check for completed one being spent #include diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index a8518be7b..b04431d4d 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -435,7 +435,7 @@ STRING_ARG(iguana,addnotary,ipaddr) char NOTARY_CURRENCIES[][16] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", - "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "LTC" }; + "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "LTC", "MNZ" }; ZERO_ARGS(dpow,notarychains) { diff --git a/iguana/m_notary b/iguana/m_notary index d2c82c7c0..d514d2680 100755 --- a/iguana/m_notary +++ b/iguana/m_notary @@ -41,6 +41,7 @@ coins/wlc_7776 coins/kv_7776 coins/ceal_7776 coins/mesh_7776 +coins/mnz_7776 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"passthru\",\"method\":\"paxfiats\",\"timeout\":900000}" #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" From 0d6084aa088d333b0c344953285825d8c89c93f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 17:59:36 +0300 Subject: [PATCH 0776/2732] Merle test --- iguana/exchanges/LP_utxo.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ab9219412..ef164c345 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -252,12 +252,40 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 uint64_t _LP_unspents_metric(uint64_t total,int32_t n) { return((total<<16) | (n & 0xffff)); } +bits256 iguana_merkle(bits256 *tree,int32_t txn_count) +{ + int32_t i,n=0,prev; uint8_t serialized[sizeof(bits256) * 2]; + if ( txn_count == 1 ) + return(tree[0]); + prev = 0; + while ( txn_count > 1 ) + { + if ( (txn_count & 1) != 0 ) + tree[prev + txn_count] = tree[prev + txn_count-1], txn_count++; + n += txn_count; + for (i=0; i> 1)] = bits256_doublesha256(0,serialized,sizeof(serialized)); + } + prev = n; + txn_count >>= 1; + } + return(tree[n]); +} + cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; + cJSON *array,*item,*merkobj; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { + if ( (ep= coin->electrum) != 0 ) + { + if ( (backupep= ep->prev) == 0 ) + backupep = ep; + } //portable_mutex_lock(&coin->addrmutex); if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) { @@ -267,6 +295,14 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum //char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); if ( up->spendheight <= 0 && up->U.height > 0 ) { + if ( up->SPV == 0 && up->U.height > 0 ) + { + if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) + { + char str[65]; printf("MERK %s -> %s\n",bits256_str(str,up->U.txid),jprint(merkobj,0)); + free_json(merkobj); + } + } jaddi(array,LP_address_item(coin,up,electrumret)); n++; total += up->U.value; From cb95701c3953db18b0ad1699d923b9256b7fc88f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 18:14:50 +0300 Subject: [PATCH 0777/2732] Test --- iguana/exchanges/LP_utxo.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ef164c345..cf4fc0296 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -277,7 +277,7 @@ bits256 iguana_merkle(bits256 *tree,int32_t txn_count) cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item,*merkobj; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; + cJSON *array,*item,*merkobj,*merkles; int32_t n,i,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -299,7 +299,18 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { - char str[65]; printf("MERK %s -> %s\n",bits256_str(str,up->U.txid),jprint(merkobj,0)); + //MERK 746738d4fba8b2dd1f47ceb8c363ca6d06472460fb97f84ff6dd2a9ff306f3c3 -> {"pos":1,"merkle":["641f8f00ba9b4f392d0cd74166569e3fa78cfdf0b15e0dc7d92693b2fd49b072", "33c9b7dd243fba0529b48e009354cf740a5e153bba81067d1addd266b9ee405b"],"block_height":521774} + // 2a15d9873ab12b27bde5571521be1bf0e187916d177ad436096a9f5b79b00fd8 + char str[65],str2[65]; bits256 tree[256],roothash; + memset(roothash.bytes,0,sizeof(roothash)); + if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 && n > 0 && n < 15 ) + { + tree[0] = up->U.txid; + for (i=0; i %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); free_json(merkobj); } } From 9104efcbf09ccfe6c10dcadeec9cdc7677b8c1ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 18:15:24 +0300 Subject: [PATCH 0778/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index cf4fc0296..003ac3a83 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -295,7 +295,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum //char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( up->SPV == 0 && up->U.height > 0 ) + if ( 0 && up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { From a0b3a3673dcbe8033df2f60f28917e09f8325c51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 18:47:36 +0300 Subject: [PATCH 0779/2732] Targetval --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a3570d889..8ad3dff78 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -488,7 +488,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { up = utxos[mini]; utxos[mini] = 0; - targetval2 = (up->U.value / 8) * 9 + 2*txfee; + targetval2 = (targetval / 8) * 9 + 2*txfee; if ( (mini= LP_nearest_utxovalue(utxos,m,targetval2)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) From 234909b7b31d59447c02add26264cde0d104d84e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:07:17 +0300 Subject: [PATCH 0780/2732] Test --- iguana/exchanges/LP_utxo.c | 3 --- iguana/exchanges/mm.c | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 003ac3a83..d4969edac 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -292,15 +292,12 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum total = n = 0; DL_FOREACH_SAFE(ap->utxos,up,tmp) { - //char str[65]; printf("LP_address_utxos %s/v%d %.8f ht.%d spend.%d\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),up->U.height,up->spendheight); if ( up->spendheight <= 0 && up->U.height > 0 ) { if ( 0 && up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { - //MERK 746738d4fba8b2dd1f47ceb8c363ca6d06472460fb97f84ff6dd2a9ff306f3c3 -> {"pos":1,"merkle":["641f8f00ba9b4f392d0cd74166569e3fa78cfdf0b15e0dc7d92693b2fd49b072", "33c9b7dd243fba0529b48e009354cf740a5e153bba81067d1addd266b9ee405b"],"block_height":521774} - // 2a15d9873ab12b27bde5571521be1bf0e187916d177ad436096a9f5b79b00fd8 char str[65],str2[65]; bits256 tree[256],roothash; memset(roothash.bytes,0,sizeof(roothash)); if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 && n > 0 && n < 15 ) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 57c56fdee..b2b64c3fb 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -784,9 +784,34 @@ void marketmaker(double minask,double maxbid,char *baseaddr,char *reladdr,double #include "LP_nativeDEX.c" +/*MERK d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a ht.518777 -> {"pos":1,"merkle":["526f8be81718beccc16a541a2c550b612123218d80fa884d9f080f18284e2bd8", "f68b03a7b6e418c9b306d8d8b21917ae5a584696f9b0b8cb0741733d7097fdfd"],"block_height":518777} root.(0000000000000000000000000000000000000000000000000000000000000000) + MERK c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543 ht.518777 -> {"pos":2,"merkle":["fdff0962fb95120a86a07ddf1ec784fcc5554a2d0a3791a8db2083d593920501", "8c116e974c842ad3ad8b3ddbd71da3debb150e3fe692f5bd628381bc167311a7"],"block_height":518777} root.(0000000000000000000000000000000000000000000000000000000000000000)*/ +/*526f8be81718beccc16a541a2c550b612123218d80fa884d9f080f18284e2bd8 +d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a +c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543 +fdff0962fb95120a86a07ddf1ec784fcc5554a2d0a3791a8db2083d593920501*/ + +void testmerk() +{ + bits256 tree[256],roothash; int32_t i; + memset(tree,0,sizeof(tree)); + decode_hex(tree[0].bytes,32,"526f8be81718beccc16a541a2c550b612123218d80fa884d9f080f18284e2bd8"); + decode_hex(tree[1].bytes,32,"d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a"); + decode_hex(tree[2].bytes,32,"c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543"); + decode_hex(tree[3].bytes,32,"fdff0962fb95120a86a07ddf1ec784fcc5554a2d0a3791a8db2083d593920501"); + roothash = iguana_merkle(tree,4); + for (i=0; i<256; i++) + { + if ( bits256_nonz(tree[i]) == 0 ) + break; + char str[65]; printf("%d: %s\n",i,bits256_str(str,tree[i])); + } +} + void LP_main(void *ptr) { char *passphrase; double profitmargin; uint16_t port; cJSON *argjson = ptr; + testmerk(); if ( (passphrase= jstr(argjson,"passphrase")) != 0 ) { profitmargin = jdouble(argjson,"profitmargin"); From 7d074ec7e9fcee43d8807d0eafdfbde6ce053f05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:30:27 +0300 Subject: [PATCH 0781/2732] Test --- iguana/exchanges/mm.c | 58 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index b2b64c3fb..9f9abc66e 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -791,9 +791,51 @@ d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543 fdff0962fb95120a86a07ddf1ec784fcc5554a2d0a3791a8db2083d593920501*/ +/*0: 526f8be81718beccc16a541a2c550b612123218d80fa884d9f080f18284e2bd8 +1: d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a +2: c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543 +3: fdff0962fb95120a86a07ddf1ec784fcc5554a2d0a3791a8db2083d593920501 +4: 8c116e974c842ad3ad8b3ddbd71da3debb150e3fe692f5bd628381bc167311a7 +5: f68b03a7b6e418c9b306d8d8b21917ae5a584696f9b0b8cb0741733d7097fdfd +6: a87ee259560f20b20182760c0e7cc7896d44381f0ad58a2e755a2b6b895b01ec*/ + +/* +0 1 2 3 + 4 5 + 6 + +1 -> [0, 5] +2 -> [3, 4] + +if odd -> right, else left +then /= 2 +*/ + +bits256 validate_merkle(int32_t pos,bits256 txid,bits256 *proof,int32_t proofsize) +{ + int32_t i; uint8_t serialized[sizeof(bits256) * 2]; bits256 hash; + hash = txid; + for (i=0; i>= 1; + } + return(hash); +} + void testmerk() { - bits256 tree[256],roothash; int32_t i; + bits256 tree[256],roothash,txid; int32_t i; char str[65]; memset(tree,0,sizeof(tree)); decode_hex(tree[0].bytes,32,"526f8be81718beccc16a541a2c550b612123218d80fa884d9f080f18284e2bd8"); decode_hex(tree[1].bytes,32,"d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a"); @@ -804,8 +846,20 @@ void testmerk() { if ( bits256_nonz(tree[i]) == 0 ) break; - char str[65]; printf("%d: %s\n",i,bits256_str(str,tree[i])); + printf("%d: %s\n",i,bits256_str(str,tree[i])); } + memset(tree,0,sizeof(tree)); + decode_hex(tree[0].bytes,32,"526f8be81718beccc16a541a2c550b612123218d80fa884d9f080f18284e2bd8"); + decode_hex(tree[1].bytes,32,"f68b03a7b6e418c9b306d8d8b21917ae5a584696f9b0b8cb0741733d7097fdfd"); + decode_hex(txid.bytes,32,"d6071f9b03d1428b648d51ae1268f1605d97f44422ed55ad0335b13fa655f61a"); + roothash = validate_merkle(1,txid,tree,2); + printf("validate 1: %s\n",bits256_str(str,roothash)); + memset(tree,0,sizeof(tree)); + decode_hex(tree[0].bytes,32,"fdff0962fb95120a86a07ddf1ec784fcc5554a2d0a3791a8db2083d593920501"); + decode_hex(tree[1].bytes,32,"8c116e974c842ad3ad8b3ddbd71da3debb150e3fe692f5bd628381bc167311a7"); + decode_hex(txid.bytes,32,"c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543"); + roothash = validate_merkle(2,txid,tree,2); + printf("validate 2: %s\n",bits256_str(str,roothash)); } void LP_main(void *ptr) From 6a3acf5afaf4796e2d87d79a047df31e7b032697 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:32:56 +0300 Subject: [PATCH 0782/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 9f9abc66e..bf8e6c035 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -817,7 +817,7 @@ bits256 validate_merkle(int32_t pos,bits256 txid,bits256 *proof,int32_t proofsiz hash = txid; for (i=0; i Date: Fri, 6 Oct 2017 19:38:32 +0300 Subject: [PATCH 0783/2732] Test --- iguana/exchanges/LP_utxo.c | 36 +++++++++++++++++++++++++++--------- iguana/exchanges/mm.c | 27 ++------------------------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d4969edac..1c9feea00 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -275,6 +275,29 @@ bits256 iguana_merkle(bits256 *tree,int32_t txn_count) return(tree[n]); } +bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proofsize) +{ + int32_t i; uint8_t serialized[sizeof(bits256) * 2]; bits256 hash,proof; + hash = txid; + for (i=0; i>= 1; + } + return(hash); +} + cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { cJSON *array,*item,*merkobj,*merkles; int32_t n,i,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; @@ -294,19 +317,14 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( 0 && up->SPV == 0 && up->U.height > 0 ) + if ( 1 && up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { - char str[65],str2[65]; bits256 tree[256],roothash; + char str[65],str2[65]; bits256 roothash; memset(roothash.bytes,0,sizeof(roothash)); - if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 && n > 0 && n < 15 ) - { - tree[0] = up->U.txid; - for (i=0; iU.txid,merkles,m); printf("MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); free_json(merkobj); } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index bf8e6c035..618b9d494 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -811,29 +811,7 @@ if odd -> right, else left then /= 2 */ -bits256 validate_merkle(int32_t pos,bits256 txid,bits256 *proof,int32_t proofsize) -{ - int32_t i; uint8_t serialized[sizeof(bits256) * 2]; bits256 hash; - hash = txid; - for (i=0; i>= 1; - } - return(hash); -} - -void testmerk() +/*void testmerk() { bits256 tree[256],roothash,txid; int32_t i; char str[65]; memset(tree,0,sizeof(tree)); @@ -860,12 +838,11 @@ void testmerk() decode_hex(txid.bytes,32,"c007e9c1881a83be453cb6ed3d1bd3bda85efd3b5ce60532c2e20ae3f8a82543"); roothash = validate_merkle(2,txid,tree,2); printf("validate 2: %s\n",bits256_str(str,roothash)); -} +}*/ void LP_main(void *ptr) { char *passphrase; double profitmargin; uint16_t port; cJSON *argjson = ptr; - testmerk(); if ( (passphrase= jstr(argjson,"passphrase")) != 0 ) { profitmargin = jdouble(argjson,"profitmargin"); From 8912c00c3f2d1d03e605244143a2ce8b577738ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:39:04 +0300 Subject: [PATCH 0784/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1c9feea00..3802df60d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -317,7 +317,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( 1 && up->SPV == 0 && up->U.height > 0 ) + if ( 0 && up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { From 4225a2a0aabc02491cc0ab1cf2987f4abeaa4f18 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:46:48 +0300 Subject: [PATCH 0785/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_remember.c | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e76f2c691..ecf6de1a7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -326,7 +326,7 @@ dividends(coin, height, )\n\ uint32_t requestid,quoteid; if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) return(basilisk_swapentry(requestid,quoteid)); - else return(basilisk_swaplist()); + else return(basilisk_swaplist(0,0)); } else if ( strcmp(method,"myprices") == 0 ) return(LP_myprices()); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index edfb8ac2a..c5e5b059e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1035,7 +1035,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti return(item); } -char *basilisk_swaplist() +char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) { char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i; portable_mutex_lock(&LP_swaplistmutex); @@ -1058,12 +1058,15 @@ char *basilisk_swaplist() q = (uint32_t)G.LP_skipstatus[i]; if ( r == requestid && q == quoteid ) { - item = cJSON_CreateObject(); - jaddstr(item,"status","realtime"); - jaddnum(item,"requestid",r); - jaddnum(item,"quoteid",q); - jaddi(array,item); - flag = 1; + if ( r != origrequestid || q != origquoteid ) + { + item = cJSON_CreateObject(); + jaddstr(item,"status","realtime"); + jaddnum(item,"requestid",r); + jaddnum(item,"quoteid",q); + jaddi(array,item); + flag = 1; + } break; } } @@ -1114,7 +1117,7 @@ char *basilisk_swaplist() char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) { char *liststr,*retstr = 0; cJSON *retjson,*array,*item; int32_t i,n; - if ( (liststr= basilisk_swaplist()) != 0 ) + if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) { if ( (retjson= cJSON_Parse(liststr)) != 0 ) { From 292c05aa5ae0da809568d1fa0f4511918bbeec21 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:54:16 +0300 Subject: [PATCH 0786/2732] Merle proof --- iguana/exchanges/LP_utxo.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3802df60d..90bfca3b1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -300,7 +300,7 @@ bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proof cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item,*merkobj,*merkles; int32_t n,i,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; + cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,i,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -317,15 +317,27 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( 0 && up->SPV == 0 && up->U.height > 0 ) + if ( 1 && up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { - char str[65],str2[65]; bits256 roothash; + char str[65],str2[65],str3[65]; memset(roothash.bytes,0,sizeof(roothash)); if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) + { roothash = validate_merkle(jint(merkobj,"pos"),up->U.txid,merkles,m); - printf("MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + if ( (hdrobj= electrum_getheader(coin->symbol,backupep,&hdrobj,up->U.height)) != 0 ) + { + merkleroot = jbits256(hdrobj,"merkle_root"); + if ( bits256_cmp(merkleroot,roothash) == 0 ) + { + up->SPV = up->U.height; + printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + } + else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + free_json(hdrobj); + } + } free_json(merkobj); } } From 44504f2f0ad86802c1b3e6e6f6a481f6abefd77a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 19:56:27 +0300 Subject: [PATCH 0787/2732] Test --- iguana/exchanges/LP_utxo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 90bfca3b1..dc4e1e5b2 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -300,7 +300,7 @@ bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proof cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,i,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0; + cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -317,7 +317,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( 1 && up->SPV == 0 && up->U.height > 0 ) + if ( up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { @@ -332,7 +332,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum if ( bits256_cmp(merkleroot,roothash) == 0 ) { up->SPV = up->U.height; - printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); free_json(hdrobj); From 0971d41d8fabbb01de27904159a21e664f39534d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 20:06:08 +0300 Subject: [PATCH 0788/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 769670543..03759b69b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,7 +23,7 @@ // better error message in ordermatch // withdraw // sign packets -// spv check +// require spv validated for using in trades // dPoW security // stats, fix pricearray // verify portfolio From e5cf23cbdb071bf264a290b41a559678d5571b7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 20:08:47 +0300 Subject: [PATCH 0789/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8ad3dff78..f398f277d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -446,7 +446,7 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60); for (i=0; ispendheight == 0 && utxos[i]->SPV > 0 ) { dist = (utxos[i]->U.value - targetval); if ( dist >= 0 && dist < mindist ) From bafad249cf2f7d218d117c8917fd3804323ffda7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 20:11:55 +0300 Subject: [PATCH 0790/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +---- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 03759b69b..542b1e24a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,16 +20,13 @@ // marketmaker // // new features: -// better error message in ordermatch -// withdraw // sign packets -// require spv validated for using in trades // dPoW security +// withdraw // stats, fix pricearray // verify portfolio // bittrex balancing -// -check for completed one being spent #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f398f277d..4083fdb6c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -441,12 +441,12 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) +int32_t LP_nearest_utxovalue(int32_t noSPV,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60); for (i=0; ispendheight == 0 && utxos[i]->SPV > 0 ) + if ( utxos[i] != 0 && (noSPV != 0 || (utxos[i]->spendheight == 0 && utxos[i]->SPV > 0)) ) { dist = (utxos[i]->U.value - targetval); if ( dist >= 0 && dist < mindist ) @@ -484,12 +484,12 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr); } mini = -1; - if ( targetval != 0 && (mini= LP_nearest_utxovalue(utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) + if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; - if ( (mini= LP_nearest_utxovalue(utxos,m,targetval2)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { From d43def4da8ebcd3561f0d4baa4b80c8f95e61500 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 20:42:04 +0300 Subject: [PATCH 0791/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 542b1e24a..1aede1210 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,10 +20,10 @@ // marketmaker // // new features: +// stats, fix pricearray // sign packets // dPoW security // withdraw -// stats, fix pricearray // verify portfolio // bittrex balancing @@ -506,7 +506,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht; continue; } - //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); From 5d3172ee747da944bafedfeaeb9f5b4d45e86447 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Oct 2017 21:59:47 +0300 Subject: [PATCH 0792/2732] Prints --- iguana/exchanges/LP_swap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e08f3aa36..5ee3d4b6b 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -677,6 +677,7 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t { if ( jstr(retjson,"status") != 0 && strcmp(jstr(retjson,"status"),"finished") == 0 ) break; + else printf("NOT FINISHED.(%s)\n",jprint(retjson,0)); free_json(retjson); retjson = 0; } From a859d30f10e2d82fb04f1803c2bf99d325d075d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 7 Oct 2017 11:35:11 +0300 Subject: [PATCH 0793/2732] Extern QUERY waiting time --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1aede1210..0dac58e60 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // LP_nativeDEX.c // marketmaker // +// SPV at tx level // new features: // stats, fix pricearray // sign packets diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4083fdb6c..fe2a2fc2f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -394,7 +394,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L sleep(3); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); } else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - for (i=0; i<30; i++) + for (i=0; i<20; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) { @@ -404,7 +404,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L break; } } - usleep(250000); + sleep(1); } return(price); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9f975ca4f..5e702286f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -619,7 +619,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } portable_mutex_unlock(&LP_UTXOmutex); total += value; - } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); + } // else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); } //else printf("nothing near i.%d\n",i); } else break; } From 1ce9aa236ee2f357f3599b5fee4c4a2f87237411 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 9 Oct 2017 15:06:25 +0400 Subject: [PATCH 0794/2732] Building under Windows. Initial commit. --- OSlibs/win/mingw.h | 2 + iguana/exchanges/LP_coins.c | 4 +- iguana/exchanges/mm.c | 8 +- iguana/exchanges/stats.c | 20 ++- marketmaker.sln | 28 ++++ marketmaker.vcxproj | 257 +++++++++++++++++++++++++++++++ marketmaker.vcxproj.filters | 297 ++++++++++++++++++++++++++++++++++++ 7 files changed, 612 insertions(+), 4 deletions(-) create mode 100644 marketmaker.sln create mode 100644 marketmaker.vcxproj create mode 100644 marketmaker.vcxproj.filters diff --git a/OSlibs/win/mingw.h b/OSlibs/win/mingw.h index 6be81f99b..aa5ae5274 100755 --- a/OSlibs/win/mingw.h +++ b/OSlibs/win/mingw.h @@ -38,6 +38,8 @@ * @author - fadedreamz@gmail.com */ //TODO: need to update other values to match with WSAPoll() function +#define POLLRDNORM 0x0100 +#define POLLRDBAND 0x0200 #define POLLIN POLLRDNORM | POLLRDBAND /* There is data to read */ #define POLLOUT POLLWRNORM /* Writing now will not block */ #else diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index e1eca4ab0..6cc7fe983 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -96,7 +96,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name #endif if ( strcmp(symbol,"BTC") == 0 ) { -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(NATIVE_WINDOWS) strcat(fname,"Bitcoin"); #else strcat(fname,".bitcoin"); @@ -120,7 +120,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name } else { -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(NATIVE_WINDOWS) strcat(fname,"Komodo"); #else strcat(fname,".komodo"); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 618b9d494..84758ac24 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -22,7 +22,13 @@ #define FROM_MARKETMAKER #include #include -#include "OS_portable.h" +#ifndef NATIVE_WINDOWS + #include "OS_portable.h" +#else + #include "../../crypto777/OS_portable.h" +#endif // !_WIN_32 + + #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #include "stats.c" diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 81562a46c..94a99ab53 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -19,6 +19,8 @@ // Copyright © 2017 SuperNET. All rights reserved. // + + #include #include #include "../../crypto777/OS_portable.h" @@ -70,7 +72,23 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) * it is standard posix function and is correctly supported in win32/win64/linux * @author - fadedreamz@gmail.com */ + + + #if defined(_M_X64) + typedef struct addrinfo + { + int ai_flags; // AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST + int ai_family; // PF_xxx + int ai_socktype; // SOCK_xxx + int ai_protocol; // 0 or IPPROTO_xxx for IPv4 and IPv6 + size_t ai_addrlen; // Length of ai_addr + char * ai_canonname; // Canonical name for nodename + _Field_size_bytes_(ai_addrlen) struct sockaddr * ai_addr; // Binary address + struct addrinfo * ai_next; // Next structure in linked list + } + ADDRINFOA, *PADDRINFOA; + struct addrinfo *addrresult = NULL; struct addrinfo *returnptr = NULL; struct addrinfo hints; @@ -82,7 +100,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; #endif - + if ( parse_ipaddr(ipaddr,hostname) != 0 ) port = parse_ipaddr(ipaddr,hostname); diff --git a/marketmaker.sln b/marketmaker.sln new file mode 100644 index 000000000..98097205c --- /dev/null +++ b/marketmaker.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marketmaker", "marketmaker.vcxproj", "{BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Debug|x64.ActiveCfg = Debug|x64 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Debug|x64.Build.0 = Debug|x64 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Debug|x86.ActiveCfg = Debug|Win32 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Debug|x86.Build.0 = Debug|Win32 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Release|x64.ActiveCfg = Release|x64 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Release|x64.Build.0 = Release|x64 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Release|x86.ActiveCfg = Release|Win32 + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/marketmaker.vcxproj b/marketmaker.vcxproj new file mode 100644 index 000000000..20a6dec01 --- /dev/null +++ b/marketmaker.vcxproj @@ -0,0 +1,257 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {BE4A118A-115D-44B5-B9D9-AD17C1C1AAE8} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)\includes;$(ProjectDir)\includes\curl;$(IncludePath) + $(ProjectDir)\OSlibs\win;$(LibraryPath) + + + true + $(SolutionDir)/includes;$(SolutionDir)/includes/curl;$(IncludePath) + + + false + $(ProjectDir)\includes;$(ProjectDir)\includes\curl;$(IncludePath) + $(ProjectDir)\OSlibs\win;$(LibraryPath) + + + false + false + $(ProjectDir)\includes;$(ProjectDir)\includes\curl;$(IncludePath) + + + + + + Level2 + Disabled + _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_DEBUG;_CONSOLE;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) + 1Byte + .\iguana;%(AdditionalIncludeDirectories) + + + Console + true + Ws2_32.lib;pthreadVC2.lib;nanomsg.lib;libcurl.lib;%(AdditionalDependencies) + .\iguana;.\OSlibs\win;%(AdditionalLibraryDirectories) + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;NATIVE_WINDOWS;WIN32;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) + 1Byte + + + Console + true + .\OSlibs\win\x64;%(AdditionalLibraryDirectories) + pthread_lib.lib;Ws2_32.lib;nanomsg.lib;libcurl.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) + 1Byte + + + MachineX86 + true + Console + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN64;_WIN64;_CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) + 1Byte + MultiThreaded + + + Console + true + true + true + Ws2_32.lib;Advapi32.lib;$(SolutionDir)OSlibs\win\x64\pthread_lib.lib;libcurl.lib;nanomsg.lib;%(AdditionalDependencies) + .\OSlibs\win\x64\release;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/marketmaker.vcxproj.filters b/marketmaker.vcxproj.filters new file mode 100644 index 000000000..7875d7cf3 --- /dev/null +++ b/marketmaker.vcxproj.filters @@ -0,0 +1,297 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + + \ No newline at end of file From 39507b8b9007f6f92c2c336188c456d6a1c23a64 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 9 Oct 2017 15:44:28 +0400 Subject: [PATCH 0795/2732] Ugly fix problem with WinSock2.h and Windows.h included twice. warning C4005: 'AF_IPX': macro redefinition and same problems. TODO: Need to properly include windows.h and WinSock2.h in all project. --- OSlibs/win/mingw.h | 3 +++ iguana/exchanges/LP_socket.c | 37 +++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/OSlibs/win/mingw.h b/OSlibs/win/mingw.h index aa5ae5274..37e1ea879 100755 --- a/OSlibs/win/mingw.h +++ b/OSlibs/win/mingw.h @@ -5,6 +5,8 @@ #include #define _USE_W32_SOCKETS 1 +//#define WIN32_LEAN_AND_MEAN +//#define _WINSOCKAPI_ #include #define PTW32_STATIC_LIB #include "pthread.h" @@ -40,6 +42,7 @@ //TODO: need to update other values to match with WSAPoll() function #define POLLRDNORM 0x0100 #define POLLRDBAND 0x0200 +#define POLLWRNORM 0x0010 #define POLLIN POLLRDNORM | POLLRDBAND /* There is data to read */ #define POLLOUT POLLWRNORM /* Writing now will not block */ #else diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e4727bada..30f6ce0b7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -21,10 +21,12 @@ * @remarks - #if (defined(_M_X64) || defined(__amd64__)) && defined(WIN32) * is equivalent to #if defined(_M_X64) as _M_X64 is defined for MSVC only */ -#if defined(_M_X64) -#define WIN32_LEAN_AND_MEAN -#include -#endif + +//#if defined(_M_X64) +//#define WIN32_LEAN_AND_MEAN +//#define _WINSOCKAPI_ +//#include +//#endif #define ELECTRUM_TIMEOUT 5 @@ -42,6 +44,20 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) * @author - fadedreamz@gmail.com */ #if defined(_M_X64) + + typedef struct addrinfo + { + int ai_flags; // AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST + int ai_family; // PF_xxx + int ai_socktype; // SOCK_xxx + int ai_protocol; // 0 or IPPROTO_xxx for IPv4 and IPv6 + size_t ai_addrlen; // Length of ai_addr + char * ai_canonname; // Canonical name for nodename + _Field_size_bytes_(ai_addrlen) struct sockaddr * ai_addr; // Binary address + struct addrinfo * ai_next; // Next structure in linked list + } + ADDRINFOA, *PADDRINFOA; + struct addrinfo *addrresult = NULL; struct addrinfo *returnptr = NULL; struct addrinfo hints; @@ -805,7 +821,18 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { - struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; +#if defined(_M_X64) + typedef struct pollfd { + + SOCKET fd; + SHORT events; + SHORT revents; + + } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; +#endif + + struct pollfd fds; + int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 ) From e95dbcb0fc8b505461f3317d28b6264e51c8b18e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 15:33:23 +0300 Subject: [PATCH 0796/2732] Fix "DB/myipaddr" violation with ipfname Thanks decker! --- iguana/exchanges/LP_nativeDEX.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0dac58e60..0d7d1917d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,10 +20,10 @@ // marketmaker // // SPV at tx level -// new features: // stats, fix pricearray // sign packets // dPoW security +// electrum peers // withdraw // verify portfolio // bittrex balancing @@ -653,7 +653,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_butxomutex); if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) { - if ( (myipaddr= OS_filestr(&filesize,"DB/myipaddr")) != 0 && myipaddr[0] != 0 ) + char ipfname[64]; + strcpy(ipfname,"DB/myipaddr"); + if ( (myipaddr= OS_filestr(&filesize,ipfname)) != 0 && myipaddr[0] != 0 ) { n = strlen(myipaddr); if ( myipaddr[n-1] == '\n' ) From 94d322bc768ac7f668aa7e85034845dc599d401a Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 9 Oct 2017 16:41:38 +0400 Subject: [PATCH 0797/2732] Fix "DB/myipaddr" violation with ipfname Thx jl777. --- iguana/exchanges/LP_nativeDEX.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0dac58e60..1147fbfb9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -593,6 +593,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) { + char *myip_path = ""; char *myipaddr=0; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) @@ -653,7 +654,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_butxomutex); if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) { - if ( (myipaddr= OS_filestr(&filesize,"DB/myipaddr")) != 0 && myipaddr[0] != 0 ) + char ipfname[64]; + strcpy(ipfname, "DB/myipaddr"); + if ((myipaddr = OS_filestr(&filesize, ipfname)) != 0 && myipaddr[0] != 0) { n = strlen(myipaddr); if ( myipaddr[n-1] == '\n' ) From 71d864661829e2e92fc94679a1c608fa93833cdf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 16:24:45 +0300 Subject: [PATCH 0798/2732] Fiddle windows.c --- crypto777/OS_nonportable.c | 8 ++++---- crypto777/nanosrc/utils/win.h | 2 +- iguana/exchanges/LP_socket.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crypto777/OS_nonportable.c b/crypto777/OS_nonportable.c index 9e4e3f281..87e167afb 100755 --- a/crypto777/OS_nonportable.c +++ b/crypto777/OS_nonportable.c @@ -26,10 +26,10 @@ * not from the mingw header, so we need to include the windows header * if we are compiling in windows 64bit */ -#if defined(_M_X64) -#define WIN32_LEAN_AND_MEAN -#include -#endif +//#if defined(_M_X64) +//#define WIN32_LEAN_AND_MEAN +//#include +//#endif #include "OS_portable.h" diff --git a/crypto777/nanosrc/utils/win.h b/crypto777/nanosrc/utils/win.h index dcfe06af6..587480cad 100755 --- a/crypto777/nanosrc/utils/win.h +++ b/crypto777/nanosrc/utils/win.h @@ -27,8 +27,8 @@ #define WIN32_LEAN_AND_MEAN #endif -#include #include +//#include #include #include #include diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e4727bada..8bb30cfd7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -21,10 +21,10 @@ * @remarks - #if (defined(_M_X64) || defined(__amd64__)) && defined(WIN32) * is equivalent to #if defined(_M_X64) as _M_X64 is defined for MSVC only */ -#if defined(_M_X64) -#define WIN32_LEAN_AND_MEAN -#include -#endif +//#if defined(_M_X64) +//#define WIN32_LEAN_AND_MEAN +//#include +//#endif #define ELECTRUM_TIMEOUT 5 From 7f21b819adc3eab89fb790f6ae61b50fd69fcd28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 16:34:08 +0300 Subject: [PATCH 0799/2732] Test --- crypto777/nanosrc/utils/win.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/utils/win.h b/crypto777/nanosrc/utils/win.h index 587480cad..288713712 100755 --- a/crypto777/nanosrc/utils/win.h +++ b/crypto777/nanosrc/utils/win.h @@ -28,7 +28,7 @@ #endif #include -//#include +#include #include #include #include From c439db23a4093a6f0337d055862205fb9934f787 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:54:28 +0300 Subject: [PATCH 0800/2732] Test --- iguana/exchanges/LP_statemachine.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 29af48553..b32dbc83a 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -17,6 +17,25 @@ // LP_statemachine.c // marketmaker // + +else +{ + CTransaction tx; uint256 hashBlock; int32_t numvouts,len; uint8_t *ptr; + if ( GetTransaction(NOTARIZED_DESTTXID,tx,hashBlock,true) == 0 ) + { + fprintf(stderr,"error finding") + return(-1); + } + if ( (numvouts= tx.vout.size()) > 0 ) + { + ptr = (uint8_t *)tx.vout[numvouts - 1].scriptPubKey.data(); + len = tx.vout[numvouts - 1].scriptPubKey.size(); + retval = komodo_verifynotarizedscript(height,ptr,len,NOTARIZED_HASH); + printf("direct verify ht.%d -> %d\n",height,retval); + return(retval); + } +} + /*struct LP_cacheinfo *ptr,*tmp; HASH_ITER(hh,LP_cacheinfos,ptr,tmp) { From 145ea3ec97a3925c9f9a24f004368a9589f240f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 19:17:48 +0300 Subject: [PATCH 0801/2732] Fix portfolio balance calc --- iguana/exchanges/LP_utxo.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index dc4e1e5b2..1ef05630a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -33,10 +33,14 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { - double val = 0.; uint64_t value = 0; - if ( (val= jdouble(obj,"amount")) < SMALLVAL ) - val = jdouble(obj,"value"); - value = (val + 0.0000000049) * SATOSHIDEN; + double val = 0.; uint64_t value = 0; int32_t electrumflag; + electrumflag = (jobj(obj,"tx_hash") != 0); + if ( electrumflag == 0 ) + { + if ( (val= jdouble(obj,"amount")) < SMALLVAL ) + val = jdouble(obj,"value"); + value = (val + 0.0000000049) * SATOSHIDEN; + } else value = j64bits(obj,"value"); if ( value != 0 ) { if ( addinterest != 0 && jobj(obj,"interest") != 0 ) From 3d552f664dacf77c5603e6fd48ee31e06ab1035a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 19:25:59 +0300 Subject: [PATCH 0802/2732] Avoid SPV for no electrum --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1ef05630a..6b5ce26ba 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -321,7 +321,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( up->SPV == 0 && up->U.height > 0 ) + if ( ep != 0 && up->SPV == 0 && up->U.height > 0 ) { if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) { From 8c92ff7df8799233804f9b210aeb81ee73916971 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 9 Oct 2017 20:44:57 +0400 Subject: [PATCH 0803/2732] correct windows.h / winsock2.h include order - changes to correctly include winsock2.h, according to this article: https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms738562(v=vs.85).aspx - removed ugly "typedef struct addrinfo" definitions in code - added WIN32_LEAN_AND_MEAN flag in preprocessor directives - removed unused myip_path in LP_nativeDEX, error with "DB/myipaddr" violation with ipfname alredy fixed by jl777 --- OSlibs/win/mingw.h | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_socket.c | 24 +++++------------------- iguana/exchanges/stats.c | 15 --------------- marketmaker.vcxproj | 2 +- 5 files changed, 9 insertions(+), 39 deletions(-) diff --git a/OSlibs/win/mingw.h b/OSlibs/win/mingw.h index 37e1ea879..76802c56e 100755 --- a/OSlibs/win/mingw.h +++ b/OSlibs/win/mingw.h @@ -5,8 +5,8 @@ #include #define _USE_W32_SOCKETS 1 -//#define WIN32_LEAN_AND_MEAN -//#define _WINSOCKAPI_ +#define WIN32_LEAN_AND_MEAN +#include #include #define PTW32_STATIC_LIB #include "pthread.h" diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1147fbfb9..921a47d13 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -593,8 +593,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) { - char *myip_path = ""; - char *myipaddr=0; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); + char *myipaddr=0; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 30f6ce0b7..750b5cbed 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -22,11 +22,11 @@ * is equivalent to #if defined(_M_X64) as _M_X64 is defined for MSVC only */ -//#if defined(_M_X64) -//#define WIN32_LEAN_AND_MEAN -//#define _WINSOCKAPI_ -//#include -//#endif +#if defined(_M_X64) +#define WIN32_LEAN_AND_MEAN +#define _WINSOCKAPI_ +#include +#endif #define ELECTRUM_TIMEOUT 5 @@ -44,20 +44,6 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) * @author - fadedreamz@gmail.com */ #if defined(_M_X64) - - typedef struct addrinfo - { - int ai_flags; // AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST - int ai_family; // PF_xxx - int ai_socktype; // SOCK_xxx - int ai_protocol; // 0 or IPPROTO_xxx for IPv4 and IPv6 - size_t ai_addrlen; // Length of ai_addr - char * ai_canonname; // Canonical name for nodename - _Field_size_bytes_(ai_addrlen) struct sockaddr * ai_addr; // Binary address - struct addrinfo * ai_next; // Next structure in linked list - } - ADDRINFOA, *PADDRINFOA; - struct addrinfo *addrresult = NULL; struct addrinfo *returnptr = NULL; struct addrinfo hints; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 94a99ab53..52372a68a 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -73,22 +73,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) * @author - fadedreamz@gmail.com */ - - #if defined(_M_X64) - typedef struct addrinfo - { - int ai_flags; // AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST - int ai_family; // PF_xxx - int ai_socktype; // SOCK_xxx - int ai_protocol; // 0 or IPPROTO_xxx for IPv4 and IPv6 - size_t ai_addrlen; // Length of ai_addr - char * ai_canonname; // Canonical name for nodename - _Field_size_bytes_(ai_addrlen) struct sockaddr * ai_addr; // Binary address - struct addrinfo * ai_next; // Next structure in linked list - } - ADDRINFOA, *PADDRINFOA; - struct addrinfo *addrresult = NULL; struct addrinfo *returnptr = NULL; struct addrinfo hints; diff --git a/marketmaker.vcxproj b/marketmaker.vcxproj index 20a6dec01..b441d6ab4 100644 --- a/marketmaker.vcxproj +++ b/marketmaker.vcxproj @@ -140,7 +140,7 @@ MaxSpeed true true - WIN64;_WIN64;_CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) + WIN64;_WIN64;_CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;_CONSOLE;NDEBUG;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) 1Byte MultiThreaded From c07333fa24e39844fbe8fc4a1acab8ad3029b720 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 23:30:51 +0300 Subject: [PATCH 0804/2732] mnz_7776 fix --- iguana/coins/mnz_7776 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/coins/mnz_7776 b/iguana/coins/mnz_7776 index cdbe97124..10d68be4c 100755 --- a/iguana/coins/mnz_7776 +++ b/iguana/coins/mnz_7776 @@ -1,2 +1,2 @@ -curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"MNZ.conf\",\"path\":\"${HOME#"/"}/.komodo/MNZ\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"MNZ\",\"name\":\"MNZ\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"53d06fde\",\"p2p\":14336,\"rpc\":14337,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"MNZ.conf\",\"path\":\"${HOME#"/"}/.komodo/MNZ\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"MNZ\",\"name\":\"MNZ\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"53d06fde\",\"p2p\":14336,\"rpc\":14337,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" From 6213593e4a9a906cf2a19552dba93fb6f6d45a22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 23:38:57 +0300 Subject: [PATCH 0805/2732] Add 1% room for deposit --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fe2a2fc2f..d61cafe5f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -489,7 +489,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; - if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2 * 1.01)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { From 14c8faa4d617521c46125aa5e2a628fe2974ff57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 23:40:56 +0300 Subject: [PATCH 0806/2732] Extra margin for deposit --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fe2a2fc2f..d61cafe5f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -489,7 +489,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; - if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2 * 1.01)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { From 735624a27ffdf77aadfa03da75c4cb3022df9a5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 00:39:18 +0300 Subject: [PATCH 0807/2732] 10 sec electrum timeout --- iguana/exchanges/LP_nativeDEX.c | 4 ++++ iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0d7d1917d..73f07350c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,10 @@ // LP_nativeDEX.c // marketmaker // +// n41r0j [12:21 AM] +// when i remove funds from my smart addresses, the first time i do ./inv, it shows up empty, but after that, the old values come back +//[12:23] a restart of client fixes it though + // SPV at tx level // stats, fix pricearray // sign packets diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8bb30cfd7..9fda77bda 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,7 +26,7 @@ //#include //#endif -#define ELECTRUM_TIMEOUT 5 +#define ELECTRUM_TIMEOUT 10 int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { From 79b2ea4054ab64a33a8050c793b1f2acb4945d01 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 00:57:03 +0300 Subject: [PATCH 0808/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9fda77bda..a56737148 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -501,7 +501,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( 1 || strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 ) + if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { From 87d95da15cb75bb8cf11cc4e41fe020dd46beff4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 00:58:22 +0300 Subject: [PATCH 0809/2732] Test --- iguana/exchanges/LP_utxos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5e702286f..9d6ab89f5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -436,7 +436,10 @@ cJSON *LP_inventory(char *symbol) myipaddr = LP_mypeer->ipaddr; else myipaddr = "127.0.0.1"; if ( (coin= LP_coinfind(symbol)) != 0 ) + { + coin->unspenttime = (uint32_t)time(NULL) - 777; LP_listunspent_both(symbol,coin->smartaddr); + } HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { char str[65]; From 12389444576b0186d5a78bfeefd4cec8489c1d38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 01:26:43 +0300 Subject: [PATCH 0810/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d61cafe5f..154c05eb9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -557,7 +557,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ { if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { - LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-2*qp->txfee,rel,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); printf("call swapinit\n"); swap = LP_swapinit(1,0,privkey,&qp->R,qp); printf("swapinit.%p\n",swap); @@ -667,7 +667,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //timeout = 1; //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); swap->N.pair = pairsock; autxo->S.swap = swap; @@ -875,7 +875,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q if ( price <= maxprice ) { price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); - LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-2*qp->txfee,qp->destcoin,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); expiration = (uint32_t)time(NULL) + timeout; while ( time(NULL) < expiration ) { From f0492858f7d5b6b360b352bb4f1b95abaa2684c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 01:30:37 +0300 Subject: [PATCH 0811/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 154c05eb9..53fd437f0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -316,12 +316,12 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str if ( strcmp(autxo->coinaddr,qp->destaddr) != 0 ) return(-10); } - if ( autxo != 0 && destvalue < qp->desttxfee+qp->destsatoshis ) + if ( autxo != 0 && destvalue < 2*qp->desttxfee+qp->destsatoshis ) { printf("destvalue %.8f destsatoshis %.8f is too small txfee %.8f?\n",dstr(destvalue),dstr(qp->destsatoshis),dstr(qp->desttxfee)); return(-11); } - if ( butxo != 0 && srcvalue < qp->txfee+qp->satoshis ) + if ( butxo != 0 && srcvalue < 2*qp->txfee+qp->satoshis ) { printf("srcvalue %.8f [%.8f] satoshis %.8f is too small txfee %.8f?\n",dstr(srcvalue),dstr(srcvalue) - dstr(qp->txfee+qp->satoshis),dstr(qp->satoshis),dstr(qp->txfee)); return(-33); From 0962cfc4d9d76392e16e9e4e8cce6ba7005238c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 01:41:11 +0300 Subject: [PATCH 0812/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 73f07350c..4abddda35 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,7 +23,7 @@ // when i remove funds from my smart addresses, the first time i do ./inv, it shows up empty, but after that, the old values come back //[12:23] a restart of client fixes it though -// SPV at tx level +// SPV at tx level and limit SPV proofing // stats, fix pricearray // sign packets // dPoW security From ee09ad921d4a7f29a6caf46598ce8dd1bb6984bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 10:35:39 +0300 Subject: [PATCH 0813/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c5e5b059e..f0ec76fa9 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1126,7 +1126,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) for (i=0; i Date: Tue, 10 Oct 2017 10:42:34 +0300 Subject: [PATCH 0814/2732] Test --- iguana/exchanges/LP_remember.c | 41 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f0ec76fa9..b18468fe5 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1044,21 +1044,26 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) //,statebits; int32_t optionduration; struct basilisk_request R; bits256 privkey; retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); - sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname); - if ( (fp= fopen(fname,"rb")) != 0 ) + if ( origrequestid != 0 && origquoteid != 0 ) { - //struct basilisk_swap *swap; - int32_t flag = 0; - while ( fread(&requestid,1,sizeof(requestid),fp) == sizeof(requestid) && fread("eid,1,sizeof(quoteid),fp) == sizeof(quoteid) ) + if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 ) + jaddi(array,item); + } + else + { + sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname); + if ( (fp= fopen(fname,"rb")) != 0 ) { - flag = 0; - for (i=0; i> 32); - q = (uint32_t)G.LP_skipstatus[i]; - if ( r == requestid && q == quoteid ) + flag = 0; + for (i=0; i> 32); + q = (uint32_t)G.LP_skipstatus[i]; + if ( r == requestid && q == quoteid ) { item = cJSON_CreateObject(); jaddstr(item,"status","realtime"); @@ -1066,21 +1071,17 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) jaddnum(item,"quoteid",q); jaddi(array,item); flag = 1; + break; } - break; } - } - if ( flag == 0 ) - { - if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) + if ( flag == 0 ) { - jaddi(array,item); - //if ( (status= jstr(item,"status")) != 0 && strcmp(status,"pending") == 0 ) - // break; + if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) + jaddi(array,item); } } + fclose(fp); } - fclose(fp); } jaddstr(retjson,"result","success"); jadd(retjson,"swaps",array); From c6f0dd4e355b8e4ad4e52723af1b7b07cc1ed248 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 10:46:26 +0300 Subject: [PATCH 0815/2732] Test --- iguana/exchanges/LP_remember.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b18468fe5..78aa697aa 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1046,8 +1046,10 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) array = cJSON_CreateArray(); if ( origrequestid != 0 && origquoteid != 0 ) { + printf("orig req.%u q.%u\n",origrequestid,origquoteid); if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 ) jaddi(array,item); + printf("got.(%s)\n",jprint(item,0)); } else { @@ -1120,6 +1122,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) char *liststr,*retstr = 0; cJSON *retjson,*array,*item; int32_t i,n; if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) { + printf("swapentry.(%s)\n",liststr); if ( (retjson= cJSON_Parse(liststr)) != 0 ) { if ( (array= jarray(&n,retjson,"swaps")) != 0 ) From cd94697ab5bcde622e9817cd868d0b0f0d401348 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 11:18:03 +0300 Subject: [PATCH 0816/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 78aa697aa..e65362b3c 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -742,12 +742,12 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) - return(0); + return(cJSON_Parse("{\"error\":\"couldnt initialize rswap, are all coins active?\"}")); LP_swap_load(&rswap); memset(zero.bytes,0,sizeof(zero)); Adest = Bdest = AAdest = ABdest = 0; if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) - return(0); + return(cJSON_Parse("{\"error\":\"mismatched bob/alice vs src/dest coins??\"}")); alice = LP_coinfind(rswap.alicecoin); bob = LP_coinfind(rswap.bobcoin); rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee); From 2ef15d5d465ccfb83feb767f677a706ccf486368 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 11:29:35 +0300 Subject: [PATCH 0817/2732] Test --- iguana/exchanges/LP_remember.c | 62 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index e65362b3c..948281c42 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -334,7 +334,6 @@ int32_t basilisk_isbobcoin(int32_t iambob,int32_t ind) } } -// add blocktrail presence requirement for BTC int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflags,bits256 paymentspent,bits256 Apaymentspent,bits256 depositspent) { int32_t i,n = 0; @@ -615,7 +614,8 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t } } } - rswap->origfinishedflag = rswap->finishedflag = 1; + rswap->origfinishedflag = basilisk_swap_isfinished(rswap->iambob,rswap->txids,rswap->sentflags,rswap->paymentspent,rswap->Apaymentspent,rswap->depositspent); + rswap->finishedflag = rswap->origfinishedflag; free(fstr); } return(rswap->iambob); @@ -752,42 +752,42 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti bob = LP_coinfind(rswap.bobcoin); rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee); rswap.Btxfee = LP_txfeecalc(bob,rswap.Btxfee); - //printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); - //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); - //printf("privBn.(%s) %p/%p\n",bits256_str(str,privBn),Bdest,ABdest); - if ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 ) + if ( rswap.iambob == 0 ) { - if ( rswap.iambob == 0 ) + if ( alice != 0 ) { - if ( alice != 0 ) - { - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - AAdest = rswap.Adestaddr; - } - if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) - { - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); - Adest = rswap.destaddr; - } + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + AAdest = rswap.Adestaddr; } - else + if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { - if ( bob != 0 ) - { - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); - Bdest = rswap.destaddr; - } - if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) - { - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - ABdest = rswap.Adestaddr; - } + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + Adest = rswap.destaddr; } - if ( bob == 0 || alice == 0 ) + } + else + { + if ( bob != 0 ) { - printf("Bob.%p is null or Alice.%p is null\n",bob,alice); - return(0); + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + Bdest = rswap.destaddr; + } + if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) + { + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + ABdest = rswap.Adestaddr; } + } + if ( bob == 0 || alice == 0 ) + { + printf("Bob.%p is null or Alice.%p is null\n",bob,alice); + return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); + } + printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); + printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); + printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); + if ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 ) + { if ( alice->inactive != 0 || bob->inactive != 0 ) { printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",rswap.alicecoin,alice->inactive,rswap.bobcoin,bob->inactive); From 2aab2758ab49de21f15ff7102e5b66402d1ea3f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 11:35:08 +0300 Subject: [PATCH 0818/2732] Test --- iguana/exchanges/LP_remember.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 948281c42..9781ecfa3 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -747,7 +747,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti memset(zero.bytes,0,sizeof(zero)); Adest = Bdest = AAdest = ABdest = 0; if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) + { + printf("BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); return(cJSON_Parse("{\"error\":\"mismatched bob/alice vs src/dest coins??\"}")); + } alice = LP_coinfind(rswap.alicecoin); bob = LP_coinfind(rswap.bobcoin); rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee); From ce5d9b420b0fb3eb7f58e5ee6b2ca9faab67f7fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 11:40:49 +0300 Subject: [PATCH 0819/2732] Test --- iguana/exchanges/LP_remember.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 9781ecfa3..75d03a222 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -624,6 +624,7 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t int32_t LP_swap_load(struct LP_swap_remember *rswap) { int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj; bits256 txid,checktxid; uint64_t value; + rswap->iambob = -1; for (i=0; iiambob = jint(txobj,"iambob"); + if ( jobj(txobj,"iambob") != 0 ) + rswap->iambob = jint(txobj,"iambob"); txid = jbits256(txobj,"txid"); if ( bits256_nonz(txid) == 0 ) continue; @@ -663,6 +665,26 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) decode_hex(rswap->Dredeemscript,rswap->Dredeemlen,rstr); } rswap->values[i] = value = LP_value_extract(txobj,1); + if ( (symbol= jstr(txobj,"src")) != 0 ) + { + safecopy(rswap->src,symbol,sizeof(rswap->src)); + if ( rswap->iambob >= 0 ) + { + if ( rswap->iambob > 0 ) + safecopy(rswap->bobcoin,symbol,sizeof(rswap->bobcoin)); + else safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin)); + } + } + if ( (symbol= jstr(txobj,"dest")) != 0 ) + { + safecopy(rswap->dest,symbol,sizeof(rswap->dest)); + if ( rswap->iambob >= 0 ) + { + if ( rswap->iambob == 0 ) + safecopy(rswap->bobcoin,symbol,sizeof(rswap->bobcoin)); + else safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin)); + } + } if ( (symbol= jstr(txobj,"coin")) != 0 ) { if ( i == BASILISK_ALICESPEND || i == BASILISK_BOBPAYMENT || i == BASILISK_BOBDEPOSIT || i == BASILISK_BOBREFUND || i == BASILISK_BOBRECLAIM || i == BASILISK_ALICECLAIM ) From 949640417226a06ab9e1310f03cc6ff5ac6e02e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 11:43:51 +0300 Subject: [PATCH 0820/2732] Test --- iguana/exchanges/LP_remember.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 75d03a222..3bc160aed 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -724,6 +724,14 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) } else if ( 0 && rswap->finishedflag == 0 ) printf("%s not finished\n",fname); } + if ( rswap->bobcoin[0] == 0 ) + strcpy(rswap->bobcoin,rswap->src); + if ( rswap->alicecoin[0] == 0 ) + strcpy(rswap->alicecoin,rswap->dest); + if ( rswap->src[0] == 0 ) + strcpy(rswap->src,rswap->bobcoin); + if ( rswap->dest[0] == 0 ) + strcpy(rswap->dest,rswap->alicecoin); return(rswap->finishedflag); } From 9f632c021bc87c236e0b425fffc2feb459e05f42 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 11:50:55 +0300 Subject: [PATCH 0821/2732] Fixed swapstatus --- iguana/exchanges/LP_remember.c | 62 +++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 3bc160aed..30da44c5f 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -735,7 +735,53 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) return(rswap->finishedflag); } -/*{ +/* +if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 ) +{ + rswap.txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],zero); + if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) // tested + { + rswap.sentflags[BASILISK_ALICESPEND] = 1; + rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; + } +} +if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) +{ + rswap.txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],zero); + if ( bits256_nonz(rswap.txids[BASILISK_ALICECLAIM]) != 0 ) // tested + { + rswap.sentflags[BASILISK_ALICECLAIM] = 1; + rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; + } +} +if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 ) +{ + rswap.txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],zero); + if ( bits256_nonz(rswap.txids[BASILISK_ALICERECLAIM]) != 0 ) // tested + { + rswap.sentflags[BASILISK_ALICERECLAIM] = 1; + rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; + } +} +if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 ) +{ + rswap.txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],zero); + if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) // tested + { + rswap.sentflags[BASILISK_BOBSPEND] = 1; + rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; + } +} +if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 ) +{ + rswap.txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],zero); + if ( bits256_nonz(rswap.txids[BASILISK_BOBRECLAIM]) != 0 ) // tested + { + rswap.sentflags[BASILISK_BOBRECLAIM] = 1; + rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; + } +} +{ if ( txbytes[BASILISK_BOBREFUND] != 0 ) { txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",bobcoin,txbytes[BASILISK_BOBREFUND],zero); @@ -816,9 +862,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } - printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); - printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); - printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); + //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); + //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); + //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); if ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 ) { if ( alice->inactive != 0 || bob->inactive != 0 ) @@ -1079,10 +1125,10 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) array = cJSON_CreateArray(); if ( origrequestid != 0 && origquoteid != 0 ) { - printf("orig req.%u q.%u\n",origrequestid,origquoteid); + //printf("orig req.%u q.%u\n",origrequestid,origquoteid); if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 ) jaddi(array,item); - printf("got.(%s)\n",jprint(item,0)); + //printf("got.(%s)\n",jprint(item,0)); } else { @@ -1155,7 +1201,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) char *liststr,*retstr = 0; cJSON *retjson,*array,*item; int32_t i,n; if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) { - printf("swapentry.(%s)\n",liststr); + //printf("swapentry.(%s)\n",liststr); if ( (retjson= cJSON_Parse(liststr)) != 0 ) { if ( (array= jarray(&n,retjson,"swaps")) != 0 ) @@ -1163,7 +1209,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) for (i=0; i Date: Tue, 10 Oct 2017 13:11:25 +0300 Subject: [PATCH 0822/2732] Test --- iguana/exchanges/LP_remember.c | 92 +++++++++++----------------------- 1 file changed, 28 insertions(+), 64 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 30da44c5f..ee91914bf 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -735,63 +735,21 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) return(rswap->finishedflag); } -/* -if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 ) +void LP_txbytes_update(char *symbol,char *name,char *txbytes,bits256 *txidp,bits256 *ptr,int32_t *flagp) { - rswap.txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],zero); - if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) // tested - { - rswap.sentflags[BASILISK_ALICESPEND] = 1; - rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; - } -} -if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) -{ - rswap.txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],zero); - if ( bits256_nonz(rswap.txids[BASILISK_ALICECLAIM]) != 0 ) // tested - { - rswap.sentflags[BASILISK_ALICECLAIM] = 1; - rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; - } -} -if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 ) -{ - rswap.txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],zero); - if ( bits256_nonz(rswap.txids[BASILISK_ALICERECLAIM]) != 0 ) // tested - { - rswap.sentflags[BASILISK_ALICERECLAIM] = 1; - rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; - } -} -if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 ) -{ - rswap.txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],zero); - if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) // tested - { - rswap.sentflags[BASILISK_BOBSPEND] = 1; - rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; - } -} -if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 ) -{ - rswap.txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],zero); - if ( bits256_nonz(rswap.txids[BASILISK_BOBRECLAIM]) != 0 ) // tested - { - rswap.sentflags[BASILISK_BOBRECLAIM] = 1; - rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; - } -} -{ - if ( txbytes[BASILISK_BOBREFUND] != 0 ) + bits256 zero; + memset(zero.bytes,0,sizeof(zero)); + if ( txbytes != 0 ) { - txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",bobcoin,txbytes[BASILISK_BOBREFUND],zero); - if ( bits256_nonz(txids[BASILISK_BOBREFUND]) != 0 ) // tested + *txidp = LP_broadcast(name,symbol,txbytes,zero); + if ( bits256_nonz(*txidp) != 0 ) { - sentflags[BASILISK_BOBREFUND] = 1; - depositspent = txids[BASILISK_BOBREFUND]; + *flagp = 1; + if ( ptr != 0 ) + *ptr = *txidp; } } -}*/ +} int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) { @@ -911,7 +869,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]); } } - if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 ) + LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); + /*if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 ) { rswap.txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],zero); if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) // tested @@ -919,7 +878,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_ALICESPEND] = 1; rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; } - } + }*/ } } if ( rswap.sentflags[BASILISK_ALICECLAIM] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) @@ -943,7 +902,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } } - if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) + LP_txbytes_update("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],&rswap.txids[BASILISK_ALICECLAIM],&rswap.depositspent,&rswap.sentflags[BASILISK_ALICECLAIM]); + /*if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) { rswap.txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],zero); if ( bits256_nonz(rswap.txids[BASILISK_ALICECLAIM]) != 0 ) // tested @@ -951,7 +911,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_ALICECLAIM] = 1; rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; } - } + }*/ } else printf("now %u before expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } if ( rswap.sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(rswap.Apaymentspent) == 0 && rswap.sentflags[BASILISK_ALICECLAIM] == 0 ) @@ -965,7 +925,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICERECLAIM]); } } - if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 ) + LP_txbytes_update("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],&rswap.txids[BASILISK_ALICERECLAIM],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_ALICERECLAIM]); + /*if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 ) { rswap.txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],zero); if ( bits256_nonz(rswap.txids[BASILISK_ALICERECLAIM]) != 0 ) // tested @@ -973,7 +934,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_ALICERECLAIM] = 1; rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; } - } + }*/ } } else if ( rswap.iambob == 1 ) @@ -995,7 +956,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("bobspend.(%s)\n",rswap.txbytes[BASILISK_BOBSPEND]); } } - if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 ) + LP_txbytes_update("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],&rswap.txids[BASILISK_BOBSPEND],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_BOBSPEND]); + /*if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 ) { rswap.txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],zero); if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) // tested @@ -1003,7 +965,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_BOBSPEND] = 1; rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; } - } + }*/ } } if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > rswap.expiration && bits256_nonz(rswap.paymentspent) == 0 ) @@ -1024,7 +986,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } } - if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 ) + LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]); + /*if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 ) { rswap.txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],zero); if ( bits256_nonz(rswap.txids[BASILISK_BOBRECLAIM]) != 0 ) // tested @@ -1032,7 +995,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_BOBRECLAIM] = 1; rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; } - } + }*/ } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { @@ -1048,7 +1011,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1)) != 0 ) printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } - if ( rswap.txbytes[BASILISK_BOBREFUND] != 0 ) + LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]); + /*if ( rswap.txbytes[BASILISK_BOBREFUND] != 0 ) { rswap.txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],zero); if ( bits256_nonz(rswap.txids[BASILISK_BOBREFUND]) != 0 ) // tested @@ -1056,7 +1020,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.sentflags[BASILISK_BOBREFUND] = 1; rswap.depositspent = rswap.txids[BASILISK_BOBREFUND]; } - } + }*/ } else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } } From 2905ea6322a8f5d39899cb4bb77a1d25aeca3585 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 16:42:32 +0300 Subject: [PATCH 0823/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 --- iguana/exchanges/LP_utxos.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4abddda35..5db9a7f24 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,9 +19,6 @@ // LP_nativeDEX.c // marketmaker // -// n41r0j [12:21 AM] -// when i remove funds from my smart addresses, the first time i do ./inv, it shows up empty, but after that, the old values come back -//[12:23] a restart of client fixes it though // SPV at tx level and limit SPV proofing // stats, fix pricearray diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9d6ab89f5..9a67d2cda 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -36,6 +36,20 @@ int32_t LP_isavailable(struct LP_utxoinfo *utxo) int32_t LP_isunspent(struct LP_utxoinfo *utxo) { + struct LP_address_utxo *up; struct _LP_utxoinfo u; struct iguana_info *coin; + if ( (coin= LP_coinfind(utxo->coin)) == 0 ) + return(0); + if ( (up= LP_address_utxofind(coin,utxo->coinaddr,utxo->payment.txid,utxo->payment.vout)) != 0 && up->spendheight > 0 ) + { + utxo->T.spentflag = up->spendheight; + return(0); + } + u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; + if ( (up= LP_address_utxofind(coin,utxo->coinaddr,u.txid,u.vout)) != 0 && up->spendheight > 0 ) + { + utxo->T.spentflag = up->spendheight; + return(0); + } if ( utxo != 0 && utxo->T.spentflag == 0 && LP_isavailable(utxo) > 0 ) return(1); else return(0); From 857b20e8a52c9a7c144ebad233df9cbad983bf0d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 17:13:27 +0300 Subject: [PATCH 0824/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 30 +++++++++++++---- iguana/exchanges/LP_utxo.c | 56 ++++++++++++++++++-------------- 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5db9a7f24..3e1189b98 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,6 +21,7 @@ // // SPV at tx level and limit SPV proofing + // stats, fix pricearray // sign packets // dPoW security diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 53fd437f0..943a755d6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -441,17 +441,33 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -int32_t LP_nearest_utxovalue(int32_t noSPV,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) +int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { - int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60); + int32_t i,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; char str[65]; int64_t dist; uint64_t mindist = (1LL << 60); + if ( (ep= coin->electrum) != 0 ) + { + if ( (backupep= ep->prev) == 0 ) + backupep = ep; + } for (i=0; ispendheight == 0 && utxos[i]->SPV > 0)) ) + if ( (up= utxos[i]) != 0 && up->spendheight == 0 ) { - dist = (utxos[i]->U.value - targetval); + if ( coin->electrum != 0 ) + { + if (up->SPV == 0 ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + if ( up->SPV < 0 ) + { + printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); + continue; + } + } + dist = (up->U.value - targetval); if ( dist >= 0 && dist < mindist ) { - printf("(%.8f %.8f %.8f).%d ",dstr(utxos[i]->U.value),dstr(dist),dstr(mindist),mini); + printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); mini = i; mindist = dist; } @@ -484,12 +500,12 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr); } mini = -1; - if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) + if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; - if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2 * 1.01)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6b5ce26ba..5916b14b9 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -302,9 +302,37 @@ bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proof return(hash); } +int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) +{ + cJSON *merkobj,*merkles,*hdrobj; bits256 roothash,merkleroot; int32_t m,SPV = 0; + if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) + { + char str[65],str2[65],str3[65]; + SPV = -1; + memset(roothash.bytes,0,sizeof(roothash)); + if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) + { + roothash = validate_merkle(jint(merkobj,"pos"),txid,merkles,m); + if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 ) + { + merkleroot = jbits256(hdrobj,"merkle_root"); + if ( bits256_cmp(merkleroot,roothash) == 0 ) + { + SPV = height; + //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + } + else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + free_json(hdrobj); + } + } + free_json(merkobj); + } + return(SPV); +} + cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0; + cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -321,30 +349,8 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( ep != 0 && up->SPV == 0 && up->U.height > 0 ) - { - if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) - { - char str[65],str2[65],str3[65]; - memset(roothash.bytes,0,sizeof(roothash)); - if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) - { - roothash = validate_merkle(jint(merkobj,"pos"),up->U.txid,merkles,m); - if ( (hdrobj= electrum_getheader(coin->symbol,backupep,&hdrobj,up->U.height)) != 0 ) - { - merkleroot = jbits256(hdrobj,"merkle_root"); - if ( bits256_cmp(merkleroot,roothash) == 0 ) - { - up->SPV = up->U.height; - //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); - } - else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); - free_json(hdrobj); - } - } - free_json(merkobj); - } - } + if ( backupep != 0 && up->SPV == 0 ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); jaddi(array,LP_address_item(coin,up,electrumret)); n++; total += up->U.value; From 4bfdef2451dc6de80cad1d000f0616d975d6c3cb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 19:14:49 +0300 Subject: [PATCH 0825/2732] Fix mintxfee --- iguana/exchanges/LP_coins.c | 3 ++- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/LP_transaction.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index e1eca4ab0..627cbbe2a 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -280,7 +280,8 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->taddr = taddr; coin->wiftaddr = wiftaddr; coin->longestchain = longestchain; - coin->txfee = txfee; + if ( (coin->txfee= txfee) > 0 && txfee < LP_MIN_TXFEE ) + coin->txfee = LP_MIN_TXFEE; coin->pubtype = pubtype; coin->p2shtype = p2shtype; coin->wiftype = wiftype; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 5ee3d4b6b..22bf882aa 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -584,7 +584,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } - if ( j64bits(vout,"satoshis") >= rawtx->I.amount && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( j64bits(vout,"satoshis") >= rawtx->I.amount+txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 2c8bcff35..3766b3936 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -551,6 +551,8 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + if ( txfee > 0 && txfee < 10000 ) + txfee = 10000; *destamountp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); if ( finalseqid == 0 ) From 27533473d33f8328155cec14cf469c89584aa287 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 11 Oct 2017 05:59:38 +0300 Subject: [PATCH 0826/2732] Remove need for win to call curl --- iguana/exchanges/LP_nativeDEX.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3e1189b98..95d382d12 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,7 +21,7 @@ // // SPV at tx level and limit SPV proofing - +// coins file // stats, fix pricearray // sign packets // dPoW security @@ -653,6 +653,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_messagemutex); portable_mutex_init(&LP_portfoliomutex); portable_mutex_init(&LP_butxomutex); +#ifndef _WIN32 if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) { char ipfname[64]; @@ -665,6 +666,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu strcpy(LP_myipaddr,myipaddr); } else printf("error getting myipaddr\n"); } else printf("error issuing curl\n"); +#else + myipaddr = clonestr("127.0.0.1"); +#endif if ( IAMLP != 0 ) { pubsock = -1; From 2d429835718297121ad27c209bec69c149874561 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 11 Oct 2017 06:11:09 +0300 Subject: [PATCH 0827/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 95d382d12..c1b456048 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -595,7 +595,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint 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; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); + char *myipaddr=0; long filesize,n; int32_t 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(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { @@ -701,7 +701,23 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //LP_deadman_switch = (uint32_t)time(NULL); printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); printf("initcoins\n"); - LP_initcoins(ctx,pubsock,jobj(argjson,"coins")); + if ( (coinsjson= jobj(argjson,"coins")) == 0 ) + { + if ( (coins_str= OS_filestr(&filesize,"coins")) != 0 ) + { + unstringify(coins_str); + printf("UNSTRINGIFIED.(%s)\n",coins_str); + coinsjson = cJSON_Parse(coins_str); + free(coins_str); + // yes I know this coinsjson is not freed, not sure about if it is referenced + } + } + if ( coinsjson == 0 ) + { + printf("no coins object or coins file, must abort\n"); + exit(-1); + } + LP_initcoins(ctx,pubsock,coinsjson); G.waiting = 1; LP_passphrase_init(passphrase,jstr(argjson,"gui")); if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) From d0b96776e8efe3658eda22824e58484de2b057e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 11 Oct 2017 06:14:22 +0300 Subject: [PATCH 0828/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c1b456048..b418d6af8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -703,7 +703,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("initcoins\n"); if ( (coinsjson= jobj(argjson,"coins")) == 0 ) { - if ( (coins_str= OS_filestr(&filesize,"coins")) != 0 ) + if ( (coins_str= OS_filestr(&filesize,"coins.json")) != 0 ) { unstringify(coins_str); printf("UNSTRINGIFIED.(%s)\n",coins_str); From e56fa4c798ec6884a8e89f5836a4c59a3079adb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 11 Oct 2017 06:19:38 +0300 Subject: [PATCH 0829/2732] coins.json support the logic is if there is no coins object in the command line json, it will look for a file called coins.json in the same directory as the executable in unix and osx that is one dir above so I copied the coins file to ../coins.json then edit it to remove the inital shell script definition and the "" around the [] internally i call unstringify to remove all the backslashes, so basically the same file contents as coins can be used --- iguana/exchanges/LP_nativeDEX.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b418d6af8..3126fc07e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -700,7 +700,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu LP_mybussock = LP_coinbus(mybusport); //LP_deadman_switch = (uint32_t)time(NULL); printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); - printf("initcoins\n"); if ( (coinsjson= jobj(argjson,"coins")) == 0 ) { if ( (coins_str= OS_filestr(&filesize,"coins.json")) != 0 ) From 8fb6fa334f0ab327e6d8b533507628d4a2cc541d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 11 Oct 2017 06:37:56 +0300 Subject: [PATCH 0830/2732] Install script to handle coins.json --- iguana/exchanges/install | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 3f64033f1..4695b8e3a 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,6 @@ #!/bin/bash cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . #echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 044072757b98c6e35b742fe3f2b163f0afb0292c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 13:04:32 +0300 Subject: [PATCH 0831/2732] Disable filesystem get --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 81562a46c..a118f296a 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -337,7 +337,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po return(clonestr("{\"error\":\"cant find index7779\"}")); else return(filestr); } - else if ( (filestr= OS_filestr(&filesize,furl)) != 0 ) + /*else if ( (filestr= OS_filestr(&filesize,furl)) != 0 ) { *jsonflagp = 1; for (i=(int32_t)strlen(url)-1; i>0; i--) @@ -347,7 +347,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po strcpy(filetype,url+i+1); //printf("return filetype.(%s) size.%ld\n",filetype,filesize); return(filestr); - } + }*/ if ( strncmp(&url[i],"/api",strlen("/api")) == 0 ) { *jsonflagp = 1; From e46fbea7deefe305bb9dbfcb4b239f9a58263e25 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:03:15 +0300 Subject: [PATCH 0832/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- iguana/exchanges/stats.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index ee91914bf..2076d00f4 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1089,10 +1089,10 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) array = cJSON_CreateArray(); if ( origrequestid != 0 && origquoteid != 0 ) { - //printf("orig req.%u q.%u\n",origrequestid,origquoteid); + printf("orig req.%u q.%u\n",origrequestid,origquoteid); if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 ) jaddi(array,item); - //printf("got.(%s)\n",jprint(item,0)); + printf("got.(%s)\n",jprint(item,0)); } else { diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index a118f296a..c946dbc89 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -337,7 +337,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po return(clonestr("{\"error\":\"cant find index7779\"}")); else return(filestr); } - /*else if ( (filestr= OS_filestr(&filesize,furl)) != 0 ) + /*else if ( (filestr= OS_filestr(&filesize,furl)) != 0 ) allows arbitrary file access! { *jsonflagp = 1; for (i=(int32_t)strlen(url)-1; i>0; i--) From 321ead49f0f9dda47bc68eb5a2d9df1aaeb02b84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:13:04 +0300 Subject: [PATCH 0833/2732] Test --- iguana/exchanges/LP_transaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3766b3936..feeefb815 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -41,6 +41,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi memset(&txid,0,sizeof(txid)); for (i=0; i<2; i++) { + char str[65]; printf("LP_broadcast.%d %s %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag); if ( sentflag == 0 && LP_gettx_presence(symbol,expectedtxid) != 0 ) sentflag = 1; if ( sentflag == 0 && (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 ) @@ -63,6 +64,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi txid = expectedtxid; sentflag = 1; } + else printf("broadcast error.(%s)\n",retstr); } free_json(retjson); } From e7ae329967e4291109c138ec6497695d2f7954e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:13:50 +0300 Subject: [PATCH 0834/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3126fc07e..981a65e20 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -509,7 +509,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht; continue; } - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + if ( (coin->lastscanht % 1000) == 0 ) + printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); From eb684c9fba672a374c6fa26a48ee539daaf14cce Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:22:15 +0300 Subject: [PATCH 0835/2732] Test --- iguana/exchanges/LP_transaction.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index feeefb815..088553bc0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -37,8 +37,18 @@ int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid) bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxid) { - char *retstr; bits256 txid; cJSON *retjson,*errorobj; int32_t i,sentflag = 0; + char *retstr; bits256 txid; uint8_t *ptr; cJSON *retjson,*errorobj; int32_t i,len,sentflag = 0; memset(&txid,0,sizeof(txid)); + if ( txbytes == 0 || txbytes[0] == 0 ) + return(txid); + if ( bits256_nonz(expectedtxid) == 0 ) + { + len = (int32_t)strlen(txbytes) >> 1; + ptr = malloc(len); + decode_hex(ptr,len,txbytes); + expectedtxid = bits256_doublesha256(0,ptr,len); + free(ptr); + } for (i=0; i<2; i++) { char str[65]; printf("LP_broadcast.%d %s %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag); @@ -46,6 +56,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi sentflag = 1; if ( sentflag == 0 && (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 ) { + printf("retstr.(%s)\n",retstr); if ( is_hexstr(retstr,0) == 64 ) { decode_hex(txid.bytes,32,retstr); From 323ff895a87edfca176c5c02e3fffc661469ef4a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:26:15 +0300 Subject: [PATCH 0836/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_transaction.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 2076d00f4..eec276d4f 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -828,7 +828,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( alice->inactive != 0 || bob->inactive != 0 ) { printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",rswap.alicecoin,alice->inactive,rswap.bobcoin,bob->inactive); - return(0); + return(cJSON_Parse("{\"error\":\"inactive bob or alice coin\"}")); } LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 088553bc0..6961fe7e2 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -81,7 +81,8 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } char str[65]; printf("sentflag.%d [%s] %s RETSTR.(%s) %s.%s\n",sentflag,txname,txbytes,retstr,symbol,bits256_str(str,txid)); free(retstr); - } + } else if ( sentflag == 0 ) + printf("null retstr\n"); if ( sentflag != 0 ) break; sleep(3); From 36e4d994699967310ee9a693f0c06cbcc33b31a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:28:23 +0300 Subject: [PATCH 0837/2732] Test --- iguana/exchanges/LP_rpc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c612cfa3f..e8d24761c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -602,17 +602,23 @@ char *LP_sendrawtransaction(char *symbol,char *signedtx) { cJSON *array,*errobj; char *paramstr,*tmpstr,*retstr=0; int32_t n,alreadyflag = 0; cJSON *retjson; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) + { + printf("LP_sendrawtransaction null symbol\n"); return(0); + } coin = LP_coinfind(symbol); if ( coin == 0 ) + { + printf("LP_sendrawtransaction null coin\n"); return(0); + } if ( coin->electrum == 0 ) { array = cJSON_CreateArray(); jaddistr(array,signedtx); paramstr = jprint(array,1); retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"sendrawtransaction",paramstr); - //printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr); + printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr); free(paramstr); } else From 3e85468b321b607bba2f11e260e80681330f729f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:30:45 +0300 Subject: [PATCH 0838/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index eec276d4f..f5812c7dd 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -735,7 +735,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) return(rswap->finishedflag); } -void LP_txbytes_update(char *symbol,char *name,char *txbytes,bits256 *txidp,bits256 *ptr,int32_t *flagp) +void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits256 *ptr,int32_t *flagp) { bits256 zero; memset(zero.bytes,0,sizeof(zero)); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6961fe7e2..67a2b979c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -51,7 +51,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } for (i=0; i<2; i++) { - char str[65]; printf("LP_broadcast.%d %s %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag); + char str[65]; printf("LP_broadcast.%d (%s) %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag); if ( sentflag == 0 && LP_gettx_presence(symbol,expectedtxid) != 0 ) sentflag = 1; if ( sentflag == 0 && (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 ) From 0552ee5ad2ba28720fbd1344c91d23cbcab27b7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 15:32:30 +0300 Subject: [PATCH 0839/2732] Test --- iguana/exchanges/LP_transaction.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 67a2b979c..08fd99eb1 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -51,12 +51,11 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } for (i=0; i<2; i++) { - char str[65]; printf("LP_broadcast.%d (%s) %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag); + //char str[65]; printf("LP_broadcast.%d (%s) %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag); if ( sentflag == 0 && LP_gettx_presence(symbol,expectedtxid) != 0 ) sentflag = 1; if ( sentflag == 0 && (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 ) { - printf("retstr.(%s)\n",retstr); if ( is_hexstr(retstr,0) == 64 ) { decode_hex(txid.bytes,32,retstr); @@ -79,10 +78,9 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } free_json(retjson); } - char str[65]; printf("sentflag.%d [%s] %s RETSTR.(%s) %s.%s\n",sentflag,txname,txbytes,retstr,symbol,bits256_str(str,txid)); + //char str[65]; printf("sentflag.%d [%s] %s RETSTR.(%s) %s.%s\n",sentflag,txname,txbytes,retstr,symbol,bits256_str(str,txid)); free(retstr); - } else if ( sentflag == 0 ) - printf("null retstr\n"); + } if ( sentflag != 0 ) break; sleep(3); From 87b1cbd3198277fdba9a9fd501c8d1339d8bfaa8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 16:09:38 +0300 Subject: [PATCH 0840/2732] Test --- iguana/exchanges/LP_remember.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f5812c7dd..f34f92c43 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -266,21 +266,21 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag sentflags[utxoind] = 1; if ( aliceaddr != 0 && strcmp(destaddr,aliceaddr) == 0 ) { - //printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); + printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[alicespent] = 1; sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } else if ( bobaddr != 0 && strcmp(destaddr,bobaddr) == 0 ) { - //printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); + printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[bobspent] = 1; sentflags[alicespent] = 0; txids[bobspent] = spendtxid; } else { - //printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); + printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); if ( aliceaddr != 0 ) { sentflags[bobspent] = 1; From a20a82e21ce132325a73559593044b3c5d80e0b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 16:17:17 +0300 Subject: [PATCH 0841/2732] Json files --- .gitignore | 1 - iguana/exchanges/coins.json | 3 +++ iguana/help/InstantDEX_DEXratio.json | 1 + iguana/help/InstantDEX_accept.json | 1 + iguana/help/InstantDEX_allcoins.json | 1 + iguana/help/InstantDEX_allexchanges.json | 1 + iguana/help/InstantDEX_allpairs.json | 1 + iguana/help/InstantDEX_apikeypair.json | 1 + iguana/help/InstantDEX_automatched.json | 1 + iguana/help/InstantDEX_available.json | 1 + iguana/help/InstantDEX_balance.json | 1 + iguana/help/InstantDEX_buy.json | 1 + iguana/help/InstantDEX_cancelorder.json | 1 + iguana/help/InstantDEX_getswaplist.json | 1 + iguana/help/InstantDEX_incoming.json | 1 + iguana/help/InstantDEX_init.json | 1 + iguana/help/InstantDEX_openorders.json | 1 + iguana/help/InstantDEX_orderbook.json | 1 + iguana/help/InstantDEX_orderstatus.json | 1 + iguana/help/InstantDEX_pollgap.json | 1 + iguana/help/InstantDEX_request.json | 1 + iguana/help/InstantDEX_sell.json | 1 + iguana/help/InstantDEX_setuserid.json | 1 + iguana/help/InstantDEX_smartaddress.json | 1 + iguana/help/InstantDEX_smartaddresses.json | 1 + iguana/help/InstantDEX_supports.json | 1 + iguana/help/InstantDEX_tradehistory.json | 1 + iguana/help/InstantDEX_withdraw.json | 1 + iguana/help/SuperNET_activehandle.json | 1 + iguana/help/SuperNET_addr2rmd160.json | 1 + iguana/help/SuperNET_bitcoinrpc.json | 1 + iguana/help/SuperNET_broadcastcipher.json | 1 + iguana/help/SuperNET_broadcastdecipher.json | 1 + iguana/help/SuperNET_cipher.json | 1 + iguana/help/SuperNET_decipher.json | 1 + iguana/help/SuperNET_decryptjson.json | 1 + iguana/help/SuperNET_encryptjson.json | 1 + iguana/help/SuperNET_getpeers.json | 1 + iguana/help/SuperNET_help.json | 1 + iguana/help/SuperNET_html.json | 1 + iguana/help/SuperNET_keypair.json | 1 + iguana/help/SuperNET_layer.json | 1 + iguana/help/SuperNET_login.json | 1 + iguana/help/SuperNET_logout.json | 1 + iguana/help/SuperNET_multicastcipher.json | 1 + iguana/help/SuperNET_multicastdecipher.json | 1 + iguana/help/SuperNET_myipaddr.json | 1 + iguana/help/SuperNET_mypeers.json | 1 + iguana/help/SuperNET_priv2pub.json | 1 + iguana/help/SuperNET_priv2wif.json | 1 + iguana/help/SuperNET_rmd160conv.json | 1 + iguana/help/SuperNET_rosetta.json | 1 + iguana/help/SuperNET_saveconf.json | 1 + iguana/help/SuperNET_setmyipaddr.json | 1 + iguana/help/SuperNET_stop.json | 1 + iguana/help/SuperNET_utc2utime.json | 1 + iguana/help/SuperNET_utime2utc.json | 1 + iguana/help/SuperNET_wif2priv.json | 1 + iguana/help/basilisk_addrelay.json | 1 + iguana/help/basilisk_balances.json | 1 + iguana/help/basilisk_cancelrefresh.json | 1 + iguana/help/basilisk_dispatch.json | 1 + iguana/help/basilisk_forward.json | 1 + iguana/help/basilisk_geckoblock.json | 1 + iguana/help/basilisk_geckoget.json | 1 + iguana/help/basilisk_geckoheaders.json | 1 + iguana/help/basilisk_geckotx.json | 1 + iguana/help/basilisk_genesis_opreturn.json | 1 + iguana/help/basilisk_getmessage.json | 1 + iguana/help/basilisk_history.json | 1 + iguana/help/basilisk_mailbox.json | 1 + iguana/help/basilisk_paxfiats.json | 1 + iguana/help/basilisk_publish.json | 1 + iguana/help/basilisk_rawtx.json | 1 + iguana/help/basilisk_refresh.json | 1 + iguana/help/basilisk_sendmessage.json | 1 + iguana/help/basilisk_subscribe.json | 1 + iguana/help/basilisk_utxocombine.json | 1 + iguana/help/basilisk_utxorawtx.json | 1 + iguana/help/basilisk_value.json | 1 + iguana/help/bitcoinrpc_addmultisigaddress.json | 1 + iguana/help/bitcoinrpc_backupwallet.json | 1 + iguana/help/bitcoinrpc_checkwallet.json | 1 + iguana/help/bitcoinrpc_createmultisig.json | 1 + iguana/help/bitcoinrpc_createrawtransaction.json | 1 + iguana/help/bitcoinrpc_decoderawtransaction.json | 1 + iguana/help/bitcoinrpc_decodescript.json | 1 + iguana/help/bitcoinrpc_dumpprivkey.json | 1 + iguana/help/bitcoinrpc_dumpwallet.json | 1 + iguana/help/bitcoinrpc_encryptwallet.json | 1 + iguana/help/bitcoinrpc_getaccount.json | 1 + iguana/help/bitcoinrpc_getaccountaddress.json | 1 + iguana/help/bitcoinrpc_getaddressesbyaccount.json | 1 + iguana/help/bitcoinrpc_getbalance.json | 1 + iguana/help/bitcoinrpc_getbestblockhash.json | 1 + iguana/help/bitcoinrpc_getblock.json | 1 + iguana/help/bitcoinrpc_getblockcount.json | 1 + iguana/help/bitcoinrpc_getblockhash.json | 1 + iguana/help/bitcoinrpc_getdifficulty.json | 1 + iguana/help/bitcoinrpc_getinfo.json | 1 + iguana/help/bitcoinrpc_getnewaddress.json | 1 + iguana/help/bitcoinrpc_getrawchangeaddress.json | 1 + iguana/help/bitcoinrpc_getrawtransaction.json | 1 + iguana/help/bitcoinrpc_getreceivedbyaccount.json | 1 + iguana/help/bitcoinrpc_getreceivedbyaddress.json | 1 + iguana/help/bitcoinrpc_gettransaction.json | 1 + iguana/help/bitcoinrpc_gettxout.json | 1 + iguana/help/bitcoinrpc_gettxoutsetinfo.json | 1 + iguana/help/bitcoinrpc_importaddress.json | 1 + iguana/help/bitcoinrpc_importprivkey.json | 1 + iguana/help/bitcoinrpc_importwallet.json | 1 + iguana/help/bitcoinrpc_listaccounts.json | 1 + iguana/help/bitcoinrpc_listaddressgroupings.json | 1 + iguana/help/bitcoinrpc_listlockunspent.json | 1 + iguana/help/bitcoinrpc_listreceivedbyaccount.json | 1 + iguana/help/bitcoinrpc_listreceivedbyaddress.json | 1 + iguana/help/bitcoinrpc_listsinceblock.json | 1 + iguana/help/bitcoinrpc_listtransactions.json | 1 + iguana/help/bitcoinrpc_listunspent.json | 1 + iguana/help/bitcoinrpc_lockunspent.json | 1 + iguana/help/bitcoinrpc_move.json | 1 + iguana/help/bitcoinrpc_repairwallet.json | 1 + iguana/help/bitcoinrpc_sendfrom.json | 1 + iguana/help/bitcoinrpc_sendmany.json | 1 + iguana/help/bitcoinrpc_sendrawtransaction.json | 1 + iguana/help/bitcoinrpc_sendtoaddress.json | 1 + iguana/help/bitcoinrpc_setaccount.json | 1 + iguana/help/bitcoinrpc_settxfee.json | 1 + iguana/help/bitcoinrpc_signmessage.json | 1 + iguana/help/bitcoinrpc_signrawtransaction.json | 1 + iguana/help/bitcoinrpc_submitblock.json | 1 + iguana/help/bitcoinrpc_validateaddress.json | 1 + iguana/help/bitcoinrpc_validatepubkey.json | 1 + iguana/help/bitcoinrpc_validaterawtransaction.json | 1 + iguana/help/bitcoinrpc_verifymessage.json | 1 + iguana/help/bitcoinrpc_walletlock.json | 1 + iguana/help/bitcoinrpc_walletpassphrase.json | 1 + iguana/help/bitcoinrpc_walletpassphrasechange.json | 1 + iguana/help/dex_alladdresses.json | 1 + iguana/help/dex_checkaddress.json | 1 + iguana/help/dex_explorer.json | 1 + iguana/help/dex_getbalance.json | 1 + iguana/help/dex_getbestblockhash.json | 1 + iguana/help/dex_getblock.json | 1 + iguana/help/dex_getblockhash.json | 1 + iguana/help/dex_getinfo.json | 1 + iguana/help/dex_getmessage.json | 1 + iguana/help/dex_getnotaries.json | 1 + iguana/help/dex_gettransaction.json | 1 + iguana/help/dex_gettxin.json | 1 + iguana/help/dex_gettxout.json | 1 + iguana/help/dex_importaddress.json | 1 + iguana/help/dex_kvsearch.json | 1 + iguana/help/dex_kvupdate.json | 1 + iguana/help/dex_listspent.json | 1 + iguana/help/dex_listtransactions.json | 1 + iguana/help/dex_listtransactions2.json | 1 + iguana/help/dex_listunspent.json | 1 + iguana/help/dex_listunspent2.json | 1 + iguana/help/dex_psock.json | 1 + iguana/help/dex_send.json | 1 + iguana/help/dex_sendrawtransaction.json | 1 + iguana/help/dex_validateaddress.json | 1 + iguana/help/dpow_active.json | 1 + iguana/help/dpow_bindaddr.json | 1 + iguana/help/dpow_cancelratify.json | 1 + iguana/help/dpow_fundnotaries.json | 1 + iguana/help/dpow_notarychains.json | 1 + iguana/help/dpow_pending.json | 1 + iguana/help/dpow_ratify.json | 1 + iguana/help/hash_NXT.json | 1 + iguana/help/hash_base64_decode.json | 1 + iguana/help/hash_base64_encode.json | 1 + iguana/help/hash_crc32.json | 1 + iguana/help/hash_curve25519.json | 1 + iguana/help/hash_curve25519_pair.json | 1 + iguana/help/hash_hex.json | 1 + iguana/help/hash_md2.json | 1 + iguana/help/hash_md4.json | 1 + iguana/help/hash_md5.json | 1 + iguana/help/hash_rmd128.json | 1 + iguana/help/hash_rmd160.json | 1 + iguana/help/hash_rmd160_sha256.json | 1 + iguana/help/hash_rmd256.json | 1 + iguana/help/hash_rmd320.json | 1 + iguana/help/hash_sha1.json | 1 + iguana/help/hash_sha224.json | 1 + iguana/help/hash_sha256.json | 1 + iguana/help/hash_sha256_sha256.json | 1 + iguana/help/hash_sha384.json | 1 + iguana/help/hash_sha512.json | 1 + iguana/help/hash_tiger192_3.json | 1 + iguana/help/hash_unhex.json | 1 + iguana/help/hash_whirlpool.json | 1 + iguana/help/hmac_md2.json | 1 + iguana/help/hmac_md4.json | 1 + iguana/help/hmac_md5.json | 1 + iguana/help/hmac_rmd128.json | 1 + iguana/help/hmac_rmd160.json | 1 + iguana/help/hmac_rmd256.json | 1 + iguana/help/hmac_rmd320.json | 1 + iguana/help/hmac_sha1.json | 1 + iguana/help/hmac_sha224.json | 1 + iguana/help/hmac_sha256.json | 1 + iguana/help/hmac_sha384.json | 1 + iguana/help/hmac_sha512.json | 1 + iguana/help/hmac_tiger192_3.json | 1 + iguana/help/hmac_whirlpool.json | 1 + iguana/help/iguana_PoSweights.json | 1 + iguana/help/iguana_addcoin.json | 1 + iguana/help/iguana_addnode.json | 1 + iguana/help/iguana_addnotary.json | 1 + iguana/help/iguana_balance.json | 1 + iguana/help/iguana_bundleaddresses.json | 1 + iguana/help/iguana_bundlehashes.json | 1 + iguana/help/iguana_dividends.json | 1 + iguana/help/iguana_dpow.json | 1 + iguana/help/iguana_getconnectioncount.json | 1 + iguana/help/iguana_initfastfind.json | 1 + iguana/help/iguana_makekeypair.json | 1 + iguana/help/iguana_maxpeers.json | 1 + iguana/help/iguana_nodestatus.json | 1 + iguana/help/iguana_oneshot.json | 1 + iguana/help/iguana_passthru.json | 1 + iguana/help/iguana_pausecoin.json | 1 + iguana/help/iguana_peers.json | 1 + iguana/help/iguana_persistent.json | 1 + iguana/help/iguana_prices.json | 1 + iguana/help/iguana_rate.json | 1 + iguana/help/iguana_rates.json | 1 + iguana/help/iguana_removecoin.json | 1 + iguana/help/iguana_removenode.json | 1 + iguana/help/iguana_snapshot.json | 1 + iguana/help/iguana_spendmsig.json | 1 + iguana/help/iguana_splitfunds.json | 1 + iguana/help/iguana_stakers.json | 1 + iguana/help/iguana_startcoin.json | 1 + iguana/help/iguana_stopcoin.json | 1 + iguana/help/iguana_validate.json | 1 + iguana/help/jumblr_runsilent.json | 1 + iguana/help/jumblr_setpassphrase.json | 1 + iguana/help/jumblr_status.json | 1 + iguana/help/jumblr_totransparent.json | 1 + iguana/help/keyboard_key.json | 1 + iguana/help/komodo_passthru.json | 1 + iguana/help/mouse_change.json | 1 + iguana/help/mouse_click.json | 1 + iguana/help/mouse_close.json | 1 + iguana/help/mouse_image.json | 1 + iguana/help/mouse_leave.json | 1 + iguana/help/passthru_paxfiats.json | 1 + iguana/help/pax_start.json | 1 + iguana/help/tradebot_accumulate.json | 1 + iguana/help/tradebot_activebots.json | 1 + iguana/help/tradebot_allbalances.json | 1 + iguana/help/tradebot_amlp.json | 1 + iguana/help/tradebot_anchor.json | 1 + iguana/help/tradebot_aveprice.json | 1 + iguana/help/tradebot_divest.json | 1 + iguana/help/tradebot_gensvm.json | 1 + iguana/help/tradebot_goals.json | 1 + iguana/help/tradebot_liquidity.json | 1 + iguana/help/tradebot_monitor.json | 1 + iguana/help/tradebot_monitorall.json | 1 + iguana/help/tradebot_notlp.json | 1 + iguana/help/tradebot_openliquidity.json | 1 + iguana/help/tradebot_pause.json | 1 + iguana/help/tradebot_portfolio.json | 1 + iguana/help/tradebot_resume.json | 1 + iguana/help/tradebot_status.json | 1 + iguana/help/tradebot_stop.json | 1 + iguana/help/tradebot_unmonitor.json | 1 + iguana/help/zcash_passthru.json | 1 + 273 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 iguana/exchanges/coins.json create mode 100644 iguana/help/InstantDEX_DEXratio.json create mode 100644 iguana/help/InstantDEX_accept.json create mode 100644 iguana/help/InstantDEX_allcoins.json create mode 100644 iguana/help/InstantDEX_allexchanges.json create mode 100644 iguana/help/InstantDEX_allpairs.json create mode 100644 iguana/help/InstantDEX_apikeypair.json create mode 100644 iguana/help/InstantDEX_automatched.json create mode 100644 iguana/help/InstantDEX_available.json create mode 100644 iguana/help/InstantDEX_balance.json create mode 100644 iguana/help/InstantDEX_buy.json create mode 100644 iguana/help/InstantDEX_cancelorder.json create mode 100644 iguana/help/InstantDEX_getswaplist.json create mode 100644 iguana/help/InstantDEX_incoming.json create mode 100644 iguana/help/InstantDEX_init.json create mode 100644 iguana/help/InstantDEX_openorders.json create mode 100644 iguana/help/InstantDEX_orderbook.json create mode 100644 iguana/help/InstantDEX_orderstatus.json create mode 100644 iguana/help/InstantDEX_pollgap.json create mode 100644 iguana/help/InstantDEX_request.json create mode 100644 iguana/help/InstantDEX_sell.json create mode 100644 iguana/help/InstantDEX_setuserid.json create mode 100644 iguana/help/InstantDEX_smartaddress.json create mode 100644 iguana/help/InstantDEX_smartaddresses.json create mode 100644 iguana/help/InstantDEX_supports.json create mode 100644 iguana/help/InstantDEX_tradehistory.json create mode 100644 iguana/help/InstantDEX_withdraw.json create mode 100644 iguana/help/SuperNET_activehandle.json create mode 100644 iguana/help/SuperNET_addr2rmd160.json create mode 100644 iguana/help/SuperNET_bitcoinrpc.json create mode 100644 iguana/help/SuperNET_broadcastcipher.json create mode 100644 iguana/help/SuperNET_broadcastdecipher.json create mode 100644 iguana/help/SuperNET_cipher.json create mode 100644 iguana/help/SuperNET_decipher.json create mode 100644 iguana/help/SuperNET_decryptjson.json create mode 100644 iguana/help/SuperNET_encryptjson.json create mode 100644 iguana/help/SuperNET_getpeers.json create mode 100644 iguana/help/SuperNET_help.json create mode 100644 iguana/help/SuperNET_html.json create mode 100644 iguana/help/SuperNET_keypair.json create mode 100644 iguana/help/SuperNET_layer.json create mode 100644 iguana/help/SuperNET_login.json create mode 100644 iguana/help/SuperNET_logout.json create mode 100644 iguana/help/SuperNET_multicastcipher.json create mode 100644 iguana/help/SuperNET_multicastdecipher.json create mode 100644 iguana/help/SuperNET_myipaddr.json create mode 100644 iguana/help/SuperNET_mypeers.json create mode 100644 iguana/help/SuperNET_priv2pub.json create mode 100644 iguana/help/SuperNET_priv2wif.json create mode 100644 iguana/help/SuperNET_rmd160conv.json create mode 100644 iguana/help/SuperNET_rosetta.json create mode 100644 iguana/help/SuperNET_saveconf.json create mode 100644 iguana/help/SuperNET_setmyipaddr.json create mode 100644 iguana/help/SuperNET_stop.json create mode 100644 iguana/help/SuperNET_utc2utime.json create mode 100644 iguana/help/SuperNET_utime2utc.json create mode 100644 iguana/help/SuperNET_wif2priv.json create mode 100644 iguana/help/basilisk_addrelay.json create mode 100644 iguana/help/basilisk_balances.json create mode 100644 iguana/help/basilisk_cancelrefresh.json create mode 100644 iguana/help/basilisk_dispatch.json create mode 100644 iguana/help/basilisk_forward.json create mode 100644 iguana/help/basilisk_geckoblock.json create mode 100644 iguana/help/basilisk_geckoget.json create mode 100644 iguana/help/basilisk_geckoheaders.json create mode 100644 iguana/help/basilisk_geckotx.json create mode 100644 iguana/help/basilisk_genesis_opreturn.json create mode 100644 iguana/help/basilisk_getmessage.json create mode 100644 iguana/help/basilisk_history.json create mode 100644 iguana/help/basilisk_mailbox.json create mode 100644 iguana/help/basilisk_paxfiats.json create mode 100644 iguana/help/basilisk_publish.json create mode 100644 iguana/help/basilisk_rawtx.json create mode 100644 iguana/help/basilisk_refresh.json create mode 100644 iguana/help/basilisk_sendmessage.json create mode 100644 iguana/help/basilisk_subscribe.json create mode 100644 iguana/help/basilisk_utxocombine.json create mode 100644 iguana/help/basilisk_utxorawtx.json create mode 100644 iguana/help/basilisk_value.json create mode 100644 iguana/help/bitcoinrpc_addmultisigaddress.json create mode 100644 iguana/help/bitcoinrpc_backupwallet.json create mode 100644 iguana/help/bitcoinrpc_checkwallet.json create mode 100644 iguana/help/bitcoinrpc_createmultisig.json create mode 100644 iguana/help/bitcoinrpc_createrawtransaction.json create mode 100644 iguana/help/bitcoinrpc_decoderawtransaction.json create mode 100644 iguana/help/bitcoinrpc_decodescript.json create mode 100644 iguana/help/bitcoinrpc_dumpprivkey.json create mode 100644 iguana/help/bitcoinrpc_dumpwallet.json create mode 100644 iguana/help/bitcoinrpc_encryptwallet.json create mode 100644 iguana/help/bitcoinrpc_getaccount.json create mode 100644 iguana/help/bitcoinrpc_getaccountaddress.json create mode 100644 iguana/help/bitcoinrpc_getaddressesbyaccount.json create mode 100644 iguana/help/bitcoinrpc_getbalance.json create mode 100644 iguana/help/bitcoinrpc_getbestblockhash.json create mode 100644 iguana/help/bitcoinrpc_getblock.json create mode 100644 iguana/help/bitcoinrpc_getblockcount.json create mode 100644 iguana/help/bitcoinrpc_getblockhash.json create mode 100644 iguana/help/bitcoinrpc_getdifficulty.json create mode 100644 iguana/help/bitcoinrpc_getinfo.json create mode 100644 iguana/help/bitcoinrpc_getnewaddress.json create mode 100644 iguana/help/bitcoinrpc_getrawchangeaddress.json create mode 100644 iguana/help/bitcoinrpc_getrawtransaction.json create mode 100644 iguana/help/bitcoinrpc_getreceivedbyaccount.json create mode 100644 iguana/help/bitcoinrpc_getreceivedbyaddress.json create mode 100644 iguana/help/bitcoinrpc_gettransaction.json create mode 100644 iguana/help/bitcoinrpc_gettxout.json create mode 100644 iguana/help/bitcoinrpc_gettxoutsetinfo.json create mode 100644 iguana/help/bitcoinrpc_importaddress.json create mode 100644 iguana/help/bitcoinrpc_importprivkey.json create mode 100644 iguana/help/bitcoinrpc_importwallet.json create mode 100644 iguana/help/bitcoinrpc_listaccounts.json create mode 100644 iguana/help/bitcoinrpc_listaddressgroupings.json create mode 100644 iguana/help/bitcoinrpc_listlockunspent.json create mode 100644 iguana/help/bitcoinrpc_listreceivedbyaccount.json create mode 100644 iguana/help/bitcoinrpc_listreceivedbyaddress.json create mode 100644 iguana/help/bitcoinrpc_listsinceblock.json create mode 100644 iguana/help/bitcoinrpc_listtransactions.json create mode 100644 iguana/help/bitcoinrpc_listunspent.json create mode 100644 iguana/help/bitcoinrpc_lockunspent.json create mode 100644 iguana/help/bitcoinrpc_move.json create mode 100644 iguana/help/bitcoinrpc_repairwallet.json create mode 100644 iguana/help/bitcoinrpc_sendfrom.json create mode 100644 iguana/help/bitcoinrpc_sendmany.json create mode 100644 iguana/help/bitcoinrpc_sendrawtransaction.json create mode 100644 iguana/help/bitcoinrpc_sendtoaddress.json create mode 100644 iguana/help/bitcoinrpc_setaccount.json create mode 100644 iguana/help/bitcoinrpc_settxfee.json create mode 100644 iguana/help/bitcoinrpc_signmessage.json create mode 100644 iguana/help/bitcoinrpc_signrawtransaction.json create mode 100644 iguana/help/bitcoinrpc_submitblock.json create mode 100644 iguana/help/bitcoinrpc_validateaddress.json create mode 100644 iguana/help/bitcoinrpc_validatepubkey.json create mode 100644 iguana/help/bitcoinrpc_validaterawtransaction.json create mode 100644 iguana/help/bitcoinrpc_verifymessage.json create mode 100644 iguana/help/bitcoinrpc_walletlock.json create mode 100644 iguana/help/bitcoinrpc_walletpassphrase.json create mode 100644 iguana/help/bitcoinrpc_walletpassphrasechange.json create mode 100644 iguana/help/dex_alladdresses.json create mode 100644 iguana/help/dex_checkaddress.json create mode 100644 iguana/help/dex_explorer.json create mode 100644 iguana/help/dex_getbalance.json create mode 100644 iguana/help/dex_getbestblockhash.json create mode 100644 iguana/help/dex_getblock.json create mode 100644 iguana/help/dex_getblockhash.json create mode 100644 iguana/help/dex_getinfo.json create mode 100644 iguana/help/dex_getmessage.json create mode 100644 iguana/help/dex_getnotaries.json create mode 100644 iguana/help/dex_gettransaction.json create mode 100644 iguana/help/dex_gettxin.json create mode 100644 iguana/help/dex_gettxout.json create mode 100644 iguana/help/dex_importaddress.json create mode 100644 iguana/help/dex_kvsearch.json create mode 100644 iguana/help/dex_kvupdate.json create mode 100644 iguana/help/dex_listspent.json create mode 100644 iguana/help/dex_listtransactions.json create mode 100644 iguana/help/dex_listtransactions2.json create mode 100644 iguana/help/dex_listunspent.json create mode 100644 iguana/help/dex_listunspent2.json create mode 100644 iguana/help/dex_psock.json create mode 100644 iguana/help/dex_send.json create mode 100644 iguana/help/dex_sendrawtransaction.json create mode 100644 iguana/help/dex_validateaddress.json create mode 100644 iguana/help/dpow_active.json create mode 100644 iguana/help/dpow_bindaddr.json create mode 100644 iguana/help/dpow_cancelratify.json create mode 100644 iguana/help/dpow_fundnotaries.json create mode 100644 iguana/help/dpow_notarychains.json create mode 100644 iguana/help/dpow_pending.json create mode 100644 iguana/help/dpow_ratify.json create mode 100644 iguana/help/hash_NXT.json create mode 100644 iguana/help/hash_base64_decode.json create mode 100644 iguana/help/hash_base64_encode.json create mode 100644 iguana/help/hash_crc32.json create mode 100644 iguana/help/hash_curve25519.json create mode 100644 iguana/help/hash_curve25519_pair.json create mode 100644 iguana/help/hash_hex.json create mode 100644 iguana/help/hash_md2.json create mode 100644 iguana/help/hash_md4.json create mode 100644 iguana/help/hash_md5.json create mode 100644 iguana/help/hash_rmd128.json create mode 100644 iguana/help/hash_rmd160.json create mode 100644 iguana/help/hash_rmd160_sha256.json create mode 100644 iguana/help/hash_rmd256.json create mode 100644 iguana/help/hash_rmd320.json create mode 100644 iguana/help/hash_sha1.json create mode 100644 iguana/help/hash_sha224.json create mode 100644 iguana/help/hash_sha256.json create mode 100644 iguana/help/hash_sha256_sha256.json create mode 100644 iguana/help/hash_sha384.json create mode 100644 iguana/help/hash_sha512.json create mode 100644 iguana/help/hash_tiger192_3.json create mode 100644 iguana/help/hash_unhex.json create mode 100644 iguana/help/hash_whirlpool.json create mode 100644 iguana/help/hmac_md2.json create mode 100644 iguana/help/hmac_md4.json create mode 100644 iguana/help/hmac_md5.json create mode 100644 iguana/help/hmac_rmd128.json create mode 100644 iguana/help/hmac_rmd160.json create mode 100644 iguana/help/hmac_rmd256.json create mode 100644 iguana/help/hmac_rmd320.json create mode 100644 iguana/help/hmac_sha1.json create mode 100644 iguana/help/hmac_sha224.json create mode 100644 iguana/help/hmac_sha256.json create mode 100644 iguana/help/hmac_sha384.json create mode 100644 iguana/help/hmac_sha512.json create mode 100644 iguana/help/hmac_tiger192_3.json create mode 100644 iguana/help/hmac_whirlpool.json create mode 100644 iguana/help/iguana_PoSweights.json create mode 100644 iguana/help/iguana_addcoin.json create mode 100644 iguana/help/iguana_addnode.json create mode 100644 iguana/help/iguana_addnotary.json create mode 100644 iguana/help/iguana_balance.json create mode 100644 iguana/help/iguana_bundleaddresses.json create mode 100644 iguana/help/iguana_bundlehashes.json create mode 100644 iguana/help/iguana_dividends.json create mode 100644 iguana/help/iguana_dpow.json create mode 100644 iguana/help/iguana_getconnectioncount.json create mode 100644 iguana/help/iguana_initfastfind.json create mode 100644 iguana/help/iguana_makekeypair.json create mode 100644 iguana/help/iguana_maxpeers.json create mode 100644 iguana/help/iguana_nodestatus.json create mode 100644 iguana/help/iguana_oneshot.json create mode 100644 iguana/help/iguana_passthru.json create mode 100644 iguana/help/iguana_pausecoin.json create mode 100644 iguana/help/iguana_peers.json create mode 100644 iguana/help/iguana_persistent.json create mode 100644 iguana/help/iguana_prices.json create mode 100644 iguana/help/iguana_rate.json create mode 100644 iguana/help/iguana_rates.json create mode 100644 iguana/help/iguana_removecoin.json create mode 100644 iguana/help/iguana_removenode.json create mode 100644 iguana/help/iguana_snapshot.json create mode 100644 iguana/help/iguana_spendmsig.json create mode 100644 iguana/help/iguana_splitfunds.json create mode 100644 iguana/help/iguana_stakers.json create mode 100644 iguana/help/iguana_startcoin.json create mode 100644 iguana/help/iguana_stopcoin.json create mode 100644 iguana/help/iguana_validate.json create mode 100644 iguana/help/jumblr_runsilent.json create mode 100644 iguana/help/jumblr_setpassphrase.json create mode 100644 iguana/help/jumblr_status.json create mode 100644 iguana/help/jumblr_totransparent.json create mode 100644 iguana/help/keyboard_key.json create mode 100644 iguana/help/komodo_passthru.json create mode 100644 iguana/help/mouse_change.json create mode 100644 iguana/help/mouse_click.json create mode 100644 iguana/help/mouse_close.json create mode 100644 iguana/help/mouse_image.json create mode 100644 iguana/help/mouse_leave.json create mode 100644 iguana/help/passthru_paxfiats.json create mode 100644 iguana/help/pax_start.json create mode 100644 iguana/help/tradebot_accumulate.json create mode 100644 iguana/help/tradebot_activebots.json create mode 100644 iguana/help/tradebot_allbalances.json create mode 100644 iguana/help/tradebot_amlp.json create mode 100644 iguana/help/tradebot_anchor.json create mode 100644 iguana/help/tradebot_aveprice.json create mode 100644 iguana/help/tradebot_divest.json create mode 100644 iguana/help/tradebot_gensvm.json create mode 100644 iguana/help/tradebot_goals.json create mode 100644 iguana/help/tradebot_liquidity.json create mode 100644 iguana/help/tradebot_monitor.json create mode 100644 iguana/help/tradebot_monitorall.json create mode 100644 iguana/help/tradebot_notlp.json create mode 100644 iguana/help/tradebot_openliquidity.json create mode 100644 iguana/help/tradebot_pause.json create mode 100644 iguana/help/tradebot_portfolio.json create mode 100644 iguana/help/tradebot_resume.json create mode 100644 iguana/help/tradebot_status.json create mode 100644 iguana/help/tradebot_stop.json create mode 100644 iguana/help/tradebot_unmonitor.json create mode 100644 iguana/help/zcash_passthru.json diff --git a/.gitignore b/.gitignore index 323798336..c2c001dd5 100755 --- a/.gitignore +++ b/.gitignore @@ -170,7 +170,6 @@ iguana/help.json iguana/index7778.html -*.json iguana/DB/KMD/utxo.dat diff --git a/iguana/exchanges/coins.json b/iguana/exchanges/coins.json new file mode 100644 index 000000000..d97e39c22 --- /dev/null +++ b/iguana/exchanges/coins.json @@ -0,0 +1,3 @@ +[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}] + + diff --git a/iguana/help/InstantDEX_DEXratio.json b/iguana/help/InstantDEX_DEXratio.json new file mode 100644 index 000000000..cc7bbd980 --- /dev/null +++ b/iguana/help/InstantDEX_DEXratio.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"DEXratio","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_DEXratio_test.py"}]} diff --git a/iguana/help/InstantDEX_accept.json b/iguana/help/InstantDEX_accept.json new file mode 100644 index 000000000..92c1d4521 --- /dev/null +++ b/iguana/help/InstantDEX_accept.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"accept","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_accept_test.py"}]} diff --git a/iguana/help/InstantDEX_allcoins.json b/iguana/help/InstantDEX_allcoins.json new file mode 100644 index 000000000..41d3a3ac3 --- /dev/null +++ b/iguana/help/InstantDEX_allcoins.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"allcoins","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_allcoins_test.py"}]} diff --git a/iguana/help/InstantDEX_allexchanges.json b/iguana/help/InstantDEX_allexchanges.json new file mode 100644 index 000000000..1d3e588fa --- /dev/null +++ b/iguana/help/InstantDEX_allexchanges.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"allexchanges","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_allexchanges_test.py"}]} diff --git a/iguana/help/InstantDEX_allpairs.json b/iguana/help/InstantDEX_allpairs.json new file mode 100644 index 000000000..80b71c2b9 --- /dev/null +++ b/iguana/help/InstantDEX_allpairs.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"allpairs","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_allpairs_test.py"}]} diff --git a/iguana/help/InstantDEX_apikeypair.json b/iguana/help/InstantDEX_apikeypair.json new file mode 100644 index 000000000..ed6a4d911 --- /dev/null +++ b/iguana/help/InstantDEX_apikeypair.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"apikeypair","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_apikeypair_test.py"}]} diff --git a/iguana/help/InstantDEX_automatched.json b/iguana/help/InstantDEX_automatched.json new file mode 100644 index 000000000..b9626ec23 --- /dev/null +++ b/iguana/help/InstantDEX_automatched.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"automatched","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_automatched_test.py"}]} diff --git a/iguana/help/InstantDEX_available.json b/iguana/help/InstantDEX_available.json new file mode 100644 index 000000000..18ed08484 --- /dev/null +++ b/iguana/help/InstantDEX_available.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"available","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_available_test.py"}]} diff --git a/iguana/help/InstantDEX_balance.json b/iguana/help/InstantDEX_balance.json new file mode 100644 index 000000000..c70d5b99f --- /dev/null +++ b/iguana/help/InstantDEX_balance.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"balance","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_balance_test.py"}]} diff --git a/iguana/help/InstantDEX_buy.json b/iguana/help/InstantDEX_buy.json new file mode 100644 index 000000000..1c3636e07 --- /dev/null +++ b/iguana/help/InstantDEX_buy.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"buy","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_buy_test.py"}]} diff --git a/iguana/help/InstantDEX_cancelorder.json b/iguana/help/InstantDEX_cancelorder.json new file mode 100644 index 000000000..ea397f36d --- /dev/null +++ b/iguana/help/InstantDEX_cancelorder.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"cancelorder","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_cancelorder_test.py"}]} diff --git a/iguana/help/InstantDEX_getswaplist.json b/iguana/help/InstantDEX_getswaplist.json new file mode 100644 index 000000000..59caa393b --- /dev/null +++ b/iguana/help/InstantDEX_getswaplist.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"getswaplist","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_getswaplist_test.py"}]} diff --git a/iguana/help/InstantDEX_incoming.json b/iguana/help/InstantDEX_incoming.json new file mode 100644 index 000000000..f698f45d7 --- /dev/null +++ b/iguana/help/InstantDEX_incoming.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"incoming","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_incoming_test.py"}]} diff --git a/iguana/help/InstantDEX_init.json b/iguana/help/InstantDEX_init.json new file mode 100644 index 000000000..1caaab76f --- /dev/null +++ b/iguana/help/InstantDEX_init.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"init","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_init_test.py"}]} diff --git a/iguana/help/InstantDEX_openorders.json b/iguana/help/InstantDEX_openorders.json new file mode 100644 index 000000000..dfd406ecd --- /dev/null +++ b/iguana/help/InstantDEX_openorders.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"openorders","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_openorders_test.py"}]} diff --git a/iguana/help/InstantDEX_orderbook.json b/iguana/help/InstantDEX_orderbook.json new file mode 100644 index 000000000..beff23123 --- /dev/null +++ b/iguana/help/InstantDEX_orderbook.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"orderbook","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_orderbook_test.py"}]} diff --git a/iguana/help/InstantDEX_orderstatus.json b/iguana/help/InstantDEX_orderstatus.json new file mode 100644 index 000000000..613e54400 --- /dev/null +++ b/iguana/help/InstantDEX_orderstatus.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"orderstatus","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_orderstatus_test.py"}]} diff --git a/iguana/help/InstantDEX_pollgap.json b/iguana/help/InstantDEX_pollgap.json new file mode 100644 index 000000000..b90628331 --- /dev/null +++ b/iguana/help/InstantDEX_pollgap.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"pollgap","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_pollgap_test.py"}]} diff --git a/iguana/help/InstantDEX_request.json b/iguana/help/InstantDEX_request.json new file mode 100644 index 000000000..9dde5538e --- /dev/null +++ b/iguana/help/InstantDEX_request.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"request","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_request_test.py"}]} diff --git a/iguana/help/InstantDEX_sell.json b/iguana/help/InstantDEX_sell.json new file mode 100644 index 000000000..57a939570 --- /dev/null +++ b/iguana/help/InstantDEX_sell.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"sell","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_sell_test.py"}]} diff --git a/iguana/help/InstantDEX_setuserid.json b/iguana/help/InstantDEX_setuserid.json new file mode 100644 index 000000000..0b2dd819c --- /dev/null +++ b/iguana/help/InstantDEX_setuserid.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"setuserid","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_setuserid_test.py"}]} diff --git a/iguana/help/InstantDEX_smartaddress.json b/iguana/help/InstantDEX_smartaddress.json new file mode 100644 index 000000000..18924dca4 --- /dev/null +++ b/iguana/help/InstantDEX_smartaddress.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"smartaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_smartaddress_test.py"}]} diff --git a/iguana/help/InstantDEX_smartaddresses.json b/iguana/help/InstantDEX_smartaddresses.json new file mode 100644 index 000000000..39f3f1d20 --- /dev/null +++ b/iguana/help/InstantDEX_smartaddresses.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"smartaddresses","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_smartaddresses_test.py"}]} diff --git a/iguana/help/InstantDEX_supports.json b/iguana/help/InstantDEX_supports.json new file mode 100644 index 000000000..254fea7aa --- /dev/null +++ b/iguana/help/InstantDEX_supports.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"supports","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_supports_test.py"}]} diff --git a/iguana/help/InstantDEX_tradehistory.json b/iguana/help/InstantDEX_tradehistory.json new file mode 100644 index 000000000..5feba4639 --- /dev/null +++ b/iguana/help/InstantDEX_tradehistory.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"tradehistory","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_tradehistory_test.py"}]} diff --git a/iguana/help/InstantDEX_withdraw.json b/iguana/help/InstantDEX_withdraw.json new file mode 100644 index 000000000..45aa88599 --- /dev/null +++ b/iguana/help/InstantDEX_withdraw.json @@ -0,0 +1 @@ +{"agent":"InstantDEX","method":"withdraw","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_withdraw_test.py"}]} diff --git a/iguana/help/SuperNET_activehandle.json b/iguana/help/SuperNET_activehandle.json new file mode 100644 index 000000000..1530b8c01 --- /dev/null +++ b/iguana/help/SuperNET_activehandle.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"activehandle","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_activehandle_test.py"}]} diff --git a/iguana/help/SuperNET_addr2rmd160.json b/iguana/help/SuperNET_addr2rmd160.json new file mode 100644 index 000000000..a3a40aac4 --- /dev/null +++ b/iguana/help/SuperNET_addr2rmd160.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"addr2rmd160","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_addr2rmd160_test.py"}]} diff --git a/iguana/help/SuperNET_bitcoinrpc.json b/iguana/help/SuperNET_bitcoinrpc.json new file mode 100644 index 000000000..46422d4d7 --- /dev/null +++ b/iguana/help/SuperNET_bitcoinrpc.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"bitcoinrpc","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_bitcoinrpc_test.py"}]} diff --git a/iguana/help/SuperNET_broadcastcipher.json b/iguana/help/SuperNET_broadcastcipher.json new file mode 100644 index 000000000..7d762494d --- /dev/null +++ b/iguana/help/SuperNET_broadcastcipher.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"broadcastcipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_broadcastcipher_test.py"}]} diff --git a/iguana/help/SuperNET_broadcastdecipher.json b/iguana/help/SuperNET_broadcastdecipher.json new file mode 100644 index 000000000..d0c9a482a --- /dev/null +++ b/iguana/help/SuperNET_broadcastdecipher.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"broadcastdecipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_broadcastdecipher_test.py"}]} diff --git a/iguana/help/SuperNET_cipher.json b/iguana/help/SuperNET_cipher.json new file mode 100644 index 000000000..fe40ca2b7 --- /dev/null +++ b/iguana/help/SuperNET_cipher.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"cipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_cipher_test.py"}]} diff --git a/iguana/help/SuperNET_decipher.json b/iguana/help/SuperNET_decipher.json new file mode 100644 index 000000000..e9f3afeb0 --- /dev/null +++ b/iguana/help/SuperNET_decipher.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"decipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_decipher_test.py"}]} diff --git a/iguana/help/SuperNET_decryptjson.json b/iguana/help/SuperNET_decryptjson.json new file mode 100644 index 000000000..99f744a30 --- /dev/null +++ b/iguana/help/SuperNET_decryptjson.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"decryptjson","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_decryptjson_test.py"}]} diff --git a/iguana/help/SuperNET_encryptjson.json b/iguana/help/SuperNET_encryptjson.json new file mode 100644 index 000000000..ab8e48167 --- /dev/null +++ b/iguana/help/SuperNET_encryptjson.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"encryptjson","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_encryptjson_test.py"}]} diff --git a/iguana/help/SuperNET_getpeers.json b/iguana/help/SuperNET_getpeers.json new file mode 100644 index 000000000..0b0668d7c --- /dev/null +++ b/iguana/help/SuperNET_getpeers.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"getpeers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_getpeers_test.py"}]} diff --git a/iguana/help/SuperNET_help.json b/iguana/help/SuperNET_help.json new file mode 100644 index 000000000..6e15f801c --- /dev/null +++ b/iguana/help/SuperNET_help.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"help","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_help_test.py"}]} diff --git a/iguana/help/SuperNET_html.json b/iguana/help/SuperNET_html.json new file mode 100644 index 000000000..b964098e9 --- /dev/null +++ b/iguana/help/SuperNET_html.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"html","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_html_test.py"}]} diff --git a/iguana/help/SuperNET_keypair.json b/iguana/help/SuperNET_keypair.json new file mode 100644 index 000000000..cdd91ae55 --- /dev/null +++ b/iguana/help/SuperNET_keypair.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"keypair","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_keypair_test.py"}]} diff --git a/iguana/help/SuperNET_layer.json b/iguana/help/SuperNET_layer.json new file mode 100644 index 000000000..fe4ecf3d4 --- /dev/null +++ b/iguana/help/SuperNET_layer.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"layer","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_layer_test.py"}]} diff --git a/iguana/help/SuperNET_login.json b/iguana/help/SuperNET_login.json new file mode 100644 index 000000000..c95a70f88 --- /dev/null +++ b/iguana/help/SuperNET_login.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"login","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_login_test.py"}]} diff --git a/iguana/help/SuperNET_logout.json b/iguana/help/SuperNET_logout.json new file mode 100644 index 000000000..c81c52c82 --- /dev/null +++ b/iguana/help/SuperNET_logout.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"logout","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_logout_test.py"}]} diff --git a/iguana/help/SuperNET_multicastcipher.json b/iguana/help/SuperNET_multicastcipher.json new file mode 100644 index 000000000..f12acca5c --- /dev/null +++ b/iguana/help/SuperNET_multicastcipher.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"multicastcipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_multicastcipher_test.py"}]} diff --git a/iguana/help/SuperNET_multicastdecipher.json b/iguana/help/SuperNET_multicastdecipher.json new file mode 100644 index 000000000..6c7a28c63 --- /dev/null +++ b/iguana/help/SuperNET_multicastdecipher.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"multicastdecipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_multicastdecipher_test.py"}]} diff --git a/iguana/help/SuperNET_myipaddr.json b/iguana/help/SuperNET_myipaddr.json new file mode 100644 index 000000000..ca58efd1b --- /dev/null +++ b/iguana/help/SuperNET_myipaddr.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"myipaddr","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_myipaddr_test.py"}]} diff --git a/iguana/help/SuperNET_mypeers.json b/iguana/help/SuperNET_mypeers.json new file mode 100644 index 000000000..461a59d53 --- /dev/null +++ b/iguana/help/SuperNET_mypeers.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"mypeers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_mypeers_test.py"}]} diff --git a/iguana/help/SuperNET_priv2pub.json b/iguana/help/SuperNET_priv2pub.json new file mode 100644 index 000000000..279268c76 --- /dev/null +++ b/iguana/help/SuperNET_priv2pub.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"priv2pub","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_priv2pub_test.py"}]} diff --git a/iguana/help/SuperNET_priv2wif.json b/iguana/help/SuperNET_priv2wif.json new file mode 100644 index 000000000..8fc080527 --- /dev/null +++ b/iguana/help/SuperNET_priv2wif.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"priv2wif","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_priv2wif_test.py"}]} diff --git a/iguana/help/SuperNET_rmd160conv.json b/iguana/help/SuperNET_rmd160conv.json new file mode 100644 index 000000000..831ff50f7 --- /dev/null +++ b/iguana/help/SuperNET_rmd160conv.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"rmd160conv","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_rmd160conv_test.py"}]} diff --git a/iguana/help/SuperNET_rosetta.json b/iguana/help/SuperNET_rosetta.json new file mode 100644 index 000000000..58c3ef933 --- /dev/null +++ b/iguana/help/SuperNET_rosetta.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"rosetta","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_rosetta_test.py"}]} diff --git a/iguana/help/SuperNET_saveconf.json b/iguana/help/SuperNET_saveconf.json new file mode 100644 index 000000000..e78fbf542 --- /dev/null +++ b/iguana/help/SuperNET_saveconf.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"saveconf","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_saveconf_test.py"}]} diff --git a/iguana/help/SuperNET_setmyipaddr.json b/iguana/help/SuperNET_setmyipaddr.json new file mode 100644 index 000000000..02a73f5d8 --- /dev/null +++ b/iguana/help/SuperNET_setmyipaddr.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"setmyipaddr","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_setmyipaddr_test.py"}]} diff --git a/iguana/help/SuperNET_stop.json b/iguana/help/SuperNET_stop.json new file mode 100644 index 000000000..29f40aadd --- /dev/null +++ b/iguana/help/SuperNET_stop.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"stop","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_stop_test.py"}]} diff --git a/iguana/help/SuperNET_utc2utime.json b/iguana/help/SuperNET_utc2utime.json new file mode 100644 index 000000000..f5fa3556f --- /dev/null +++ b/iguana/help/SuperNET_utc2utime.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"utc2utime","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_utc2utime_test.py"}]} diff --git a/iguana/help/SuperNET_utime2utc.json b/iguana/help/SuperNET_utime2utc.json new file mode 100644 index 000000000..000d81603 --- /dev/null +++ b/iguana/help/SuperNET_utime2utc.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"utime2utc","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_utime2utc_test.py"}]} diff --git a/iguana/help/SuperNET_wif2priv.json b/iguana/help/SuperNET_wif2priv.json new file mode 100644 index 000000000..e0447b36b --- /dev/null +++ b/iguana/help/SuperNET_wif2priv.json @@ -0,0 +1 @@ +{"agent":"SuperNET","method":"wif2priv","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_wif2priv_test.py"}]} diff --git a/iguana/help/basilisk_addrelay.json b/iguana/help/basilisk_addrelay.json new file mode 100644 index 000000000..a0faa2c84 --- /dev/null +++ b/iguana/help/basilisk_addrelay.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"addrelay","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_addrelay_test.py"}]} diff --git a/iguana/help/basilisk_balances.json b/iguana/help/basilisk_balances.json new file mode 100644 index 000000000..85bdf0f7f --- /dev/null +++ b/iguana/help/basilisk_balances.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"balances","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_balances_test.py"}]} diff --git a/iguana/help/basilisk_cancelrefresh.json b/iguana/help/basilisk_cancelrefresh.json new file mode 100644 index 000000000..1d2db83c9 --- /dev/null +++ b/iguana/help/basilisk_cancelrefresh.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"cancelrefresh","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_cancelrefresh_test.py"}]} diff --git a/iguana/help/basilisk_dispatch.json b/iguana/help/basilisk_dispatch.json new file mode 100644 index 000000000..395902152 --- /dev/null +++ b/iguana/help/basilisk_dispatch.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"dispatch","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_dispatch_test.py"}]} diff --git a/iguana/help/basilisk_forward.json b/iguana/help/basilisk_forward.json new file mode 100644 index 000000000..868424a14 --- /dev/null +++ b/iguana/help/basilisk_forward.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"forward","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_forward_test.py"}]} diff --git a/iguana/help/basilisk_geckoblock.json b/iguana/help/basilisk_geckoblock.json new file mode 100644 index 000000000..ed730f081 --- /dev/null +++ b/iguana/help/basilisk_geckoblock.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"geckoblock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckoblock_test.py"}]} diff --git a/iguana/help/basilisk_geckoget.json b/iguana/help/basilisk_geckoget.json new file mode 100644 index 000000000..ddb097fab --- /dev/null +++ b/iguana/help/basilisk_geckoget.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"geckoget","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckoget_test.py"}]} diff --git a/iguana/help/basilisk_geckoheaders.json b/iguana/help/basilisk_geckoheaders.json new file mode 100644 index 000000000..30b600d6f --- /dev/null +++ b/iguana/help/basilisk_geckoheaders.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"geckoheaders","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckoheaders_test.py"}]} diff --git a/iguana/help/basilisk_geckotx.json b/iguana/help/basilisk_geckotx.json new file mode 100644 index 000000000..b55cf8582 --- /dev/null +++ b/iguana/help/basilisk_geckotx.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"geckotx","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckotx_test.py"}]} diff --git a/iguana/help/basilisk_genesis_opreturn.json b/iguana/help/basilisk_genesis_opreturn.json new file mode 100644 index 000000000..25c7e3277 --- /dev/null +++ b/iguana/help/basilisk_genesis_opreturn.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"genesis_opreturn","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_genesis_opreturn_test.py"}]} diff --git a/iguana/help/basilisk_getmessage.json b/iguana/help/basilisk_getmessage.json new file mode 100644 index 000000000..e4dbd9cdd --- /dev/null +++ b/iguana/help/basilisk_getmessage.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"getmessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_getmessage_test.py"}]} diff --git a/iguana/help/basilisk_history.json b/iguana/help/basilisk_history.json new file mode 100644 index 000000000..fd91aa8bc --- /dev/null +++ b/iguana/help/basilisk_history.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"history","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_history_test.py"}]} diff --git a/iguana/help/basilisk_mailbox.json b/iguana/help/basilisk_mailbox.json new file mode 100644 index 000000000..4eceaf50a --- /dev/null +++ b/iguana/help/basilisk_mailbox.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"mailbox","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_mailbox_test.py"}]} diff --git a/iguana/help/basilisk_paxfiats.json b/iguana/help/basilisk_paxfiats.json new file mode 100644 index 000000000..26a27c6cb --- /dev/null +++ b/iguana/help/basilisk_paxfiats.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"paxfiats","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_paxfiats_test.py"}]} diff --git a/iguana/help/basilisk_publish.json b/iguana/help/basilisk_publish.json new file mode 100644 index 000000000..1c0d9469c --- /dev/null +++ b/iguana/help/basilisk_publish.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"publish","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_publish_test.py"}]} diff --git a/iguana/help/basilisk_rawtx.json b/iguana/help/basilisk_rawtx.json new file mode 100644 index 000000000..73682aa14 --- /dev/null +++ b/iguana/help/basilisk_rawtx.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"rawtx","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_rawtx_test.py"}]} diff --git a/iguana/help/basilisk_refresh.json b/iguana/help/basilisk_refresh.json new file mode 100644 index 000000000..fc3ee50a8 --- /dev/null +++ b/iguana/help/basilisk_refresh.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"refresh","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_refresh_test.py"}]} diff --git a/iguana/help/basilisk_sendmessage.json b/iguana/help/basilisk_sendmessage.json new file mode 100644 index 000000000..96a8fab9e --- /dev/null +++ b/iguana/help/basilisk_sendmessage.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"sendmessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_sendmessage_test.py"}]} diff --git a/iguana/help/basilisk_subscribe.json b/iguana/help/basilisk_subscribe.json new file mode 100644 index 000000000..2369fefb9 --- /dev/null +++ b/iguana/help/basilisk_subscribe.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"subscribe","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_subscribe_test.py"}]} diff --git a/iguana/help/basilisk_utxocombine.json b/iguana/help/basilisk_utxocombine.json new file mode 100644 index 000000000..4ef0423ec --- /dev/null +++ b/iguana/help/basilisk_utxocombine.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"utxocombine","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_utxocombine_test.py"}]} diff --git a/iguana/help/basilisk_utxorawtx.json b/iguana/help/basilisk_utxorawtx.json new file mode 100644 index 000000000..f44828007 --- /dev/null +++ b/iguana/help/basilisk_utxorawtx.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"utxorawtx","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_utxorawtx_test.py"}]} diff --git a/iguana/help/basilisk_value.json b/iguana/help/basilisk_value.json new file mode 100644 index 000000000..2f3575ad8 --- /dev/null +++ b/iguana/help/basilisk_value.json @@ -0,0 +1 @@ +{"agent":"basilisk","method":"value","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_value_test.py"}]} diff --git a/iguana/help/bitcoinrpc_addmultisigaddress.json b/iguana/help/bitcoinrpc_addmultisigaddress.json new file mode 100644 index 000000000..453eedab1 --- /dev/null +++ b/iguana/help/bitcoinrpc_addmultisigaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"addmultisigaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_addmultisigaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_backupwallet.json b/iguana/help/bitcoinrpc_backupwallet.json new file mode 100644 index 000000000..49d4977f6 --- /dev/null +++ b/iguana/help/bitcoinrpc_backupwallet.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"backupwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_backupwallet_test.py"}]} diff --git a/iguana/help/bitcoinrpc_checkwallet.json b/iguana/help/bitcoinrpc_checkwallet.json new file mode 100644 index 000000000..7873ec3e3 --- /dev/null +++ b/iguana/help/bitcoinrpc_checkwallet.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"checkwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_checkwallet_test.py"}]} diff --git a/iguana/help/bitcoinrpc_createmultisig.json b/iguana/help/bitcoinrpc_createmultisig.json new file mode 100644 index 000000000..1fc0af008 --- /dev/null +++ b/iguana/help/bitcoinrpc_createmultisig.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"createmultisig","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_createmultisig_test.py"}]} diff --git a/iguana/help/bitcoinrpc_createrawtransaction.json b/iguana/help/bitcoinrpc_createrawtransaction.json new file mode 100644 index 000000000..36a955996 --- /dev/null +++ b/iguana/help/bitcoinrpc_createrawtransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"createrawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_createrawtransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_decoderawtransaction.json b/iguana/help/bitcoinrpc_decoderawtransaction.json new file mode 100644 index 000000000..772f96900 --- /dev/null +++ b/iguana/help/bitcoinrpc_decoderawtransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"decoderawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_decoderawtransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_decodescript.json b/iguana/help/bitcoinrpc_decodescript.json new file mode 100644 index 000000000..9be4a77bf --- /dev/null +++ b/iguana/help/bitcoinrpc_decodescript.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"decodescript","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_decodescript_test.py"}]} diff --git a/iguana/help/bitcoinrpc_dumpprivkey.json b/iguana/help/bitcoinrpc_dumpprivkey.json new file mode 100644 index 000000000..b28fe7185 --- /dev/null +++ b/iguana/help/bitcoinrpc_dumpprivkey.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"dumpprivkey","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_dumpprivkey_test.py"}]} diff --git a/iguana/help/bitcoinrpc_dumpwallet.json b/iguana/help/bitcoinrpc_dumpwallet.json new file mode 100644 index 000000000..d0f3ed4f1 --- /dev/null +++ b/iguana/help/bitcoinrpc_dumpwallet.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"dumpwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_dumpwallet_test.py"}]} diff --git a/iguana/help/bitcoinrpc_encryptwallet.json b/iguana/help/bitcoinrpc_encryptwallet.json new file mode 100644 index 000000000..3919c40a4 --- /dev/null +++ b/iguana/help/bitcoinrpc_encryptwallet.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"encryptwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_encryptwallet_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getaccount.json b/iguana/help/bitcoinrpc_getaccount.json new file mode 100644 index 000000000..b0ecd2a9e --- /dev/null +++ b/iguana/help/bitcoinrpc_getaccount.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getaccount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getaccount_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getaccountaddress.json b/iguana/help/bitcoinrpc_getaccountaddress.json new file mode 100644 index 000000000..cf3842825 --- /dev/null +++ b/iguana/help/bitcoinrpc_getaccountaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getaccountaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getaccountaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getaddressesbyaccount.json b/iguana/help/bitcoinrpc_getaddressesbyaccount.json new file mode 100644 index 000000000..12d42c814 --- /dev/null +++ b/iguana/help/bitcoinrpc_getaddressesbyaccount.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getaddressesbyaccount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getaddressesbyaccount_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getbalance.json b/iguana/help/bitcoinrpc_getbalance.json new file mode 100644 index 000000000..22f234744 --- /dev/null +++ b/iguana/help/bitcoinrpc_getbalance.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getbalance","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getbalance_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getbestblockhash.json b/iguana/help/bitcoinrpc_getbestblockhash.json new file mode 100644 index 000000000..e2c5fd0a7 --- /dev/null +++ b/iguana/help/bitcoinrpc_getbestblockhash.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getbestblockhash","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getbestblockhash_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getblock.json b/iguana/help/bitcoinrpc_getblock.json new file mode 100644 index 000000000..2f23841f5 --- /dev/null +++ b/iguana/help/bitcoinrpc_getblock.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getblock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getblock_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getblockcount.json b/iguana/help/bitcoinrpc_getblockcount.json new file mode 100644 index 000000000..1c1a14959 --- /dev/null +++ b/iguana/help/bitcoinrpc_getblockcount.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getblockcount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getblockcount_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getblockhash.json b/iguana/help/bitcoinrpc_getblockhash.json new file mode 100644 index 000000000..4c7877840 --- /dev/null +++ b/iguana/help/bitcoinrpc_getblockhash.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getblockhash","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getblockhash_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getdifficulty.json b/iguana/help/bitcoinrpc_getdifficulty.json new file mode 100644 index 000000000..5950fb6f5 --- /dev/null +++ b/iguana/help/bitcoinrpc_getdifficulty.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getdifficulty","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getdifficulty_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getinfo.json b/iguana/help/bitcoinrpc_getinfo.json new file mode 100644 index 000000000..22be35c69 --- /dev/null +++ b/iguana/help/bitcoinrpc_getinfo.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getinfo","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getinfo_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getnewaddress.json b/iguana/help/bitcoinrpc_getnewaddress.json new file mode 100644 index 000000000..3d6875a2a --- /dev/null +++ b/iguana/help/bitcoinrpc_getnewaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getnewaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getnewaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getrawchangeaddress.json b/iguana/help/bitcoinrpc_getrawchangeaddress.json new file mode 100644 index 000000000..3d4128a2f --- /dev/null +++ b/iguana/help/bitcoinrpc_getrawchangeaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getrawchangeaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getrawchangeaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getrawtransaction.json b/iguana/help/bitcoinrpc_getrawtransaction.json new file mode 100644 index 000000000..93c727b87 --- /dev/null +++ b/iguana/help/bitcoinrpc_getrawtransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getrawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getrawtransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getreceivedbyaccount.json b/iguana/help/bitcoinrpc_getreceivedbyaccount.json new file mode 100644 index 000000000..defd762d9 --- /dev/null +++ b/iguana/help/bitcoinrpc_getreceivedbyaccount.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getreceivedbyaccount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getreceivedbyaccount_test.py"}]} diff --git a/iguana/help/bitcoinrpc_getreceivedbyaddress.json b/iguana/help/bitcoinrpc_getreceivedbyaddress.json new file mode 100644 index 000000000..edb272cb7 --- /dev/null +++ b/iguana/help/bitcoinrpc_getreceivedbyaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"getreceivedbyaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_getreceivedbyaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_gettransaction.json b/iguana/help/bitcoinrpc_gettransaction.json new file mode 100644 index 000000000..480f1e86f --- /dev/null +++ b/iguana/help/bitcoinrpc_gettransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"gettransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_gettransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_gettxout.json b/iguana/help/bitcoinrpc_gettxout.json new file mode 100644 index 000000000..98324561b --- /dev/null +++ b/iguana/help/bitcoinrpc_gettxout.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"gettxout","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_gettxout_test.py"}]} diff --git a/iguana/help/bitcoinrpc_gettxoutsetinfo.json b/iguana/help/bitcoinrpc_gettxoutsetinfo.json new file mode 100644 index 000000000..3d1926383 --- /dev/null +++ b/iguana/help/bitcoinrpc_gettxoutsetinfo.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"gettxoutsetinfo","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_gettxoutsetinfo_test.py"}]} diff --git a/iguana/help/bitcoinrpc_importaddress.json b/iguana/help/bitcoinrpc_importaddress.json new file mode 100644 index 000000000..37e9c4a0d --- /dev/null +++ b/iguana/help/bitcoinrpc_importaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"importaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_importaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_importprivkey.json b/iguana/help/bitcoinrpc_importprivkey.json new file mode 100644 index 000000000..4efae987e --- /dev/null +++ b/iguana/help/bitcoinrpc_importprivkey.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"importprivkey","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_importprivkey_test.py"}]} diff --git a/iguana/help/bitcoinrpc_importwallet.json b/iguana/help/bitcoinrpc_importwallet.json new file mode 100644 index 000000000..8bf5ce1ae --- /dev/null +++ b/iguana/help/bitcoinrpc_importwallet.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"importwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_importwallet_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listaccounts.json b/iguana/help/bitcoinrpc_listaccounts.json new file mode 100644 index 000000000..635508cf5 --- /dev/null +++ b/iguana/help/bitcoinrpc_listaccounts.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listaccounts","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listaccounts_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listaddressgroupings.json b/iguana/help/bitcoinrpc_listaddressgroupings.json new file mode 100644 index 000000000..21f7d8b3e --- /dev/null +++ b/iguana/help/bitcoinrpc_listaddressgroupings.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listaddressgroupings","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listaddressgroupings_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listlockunspent.json b/iguana/help/bitcoinrpc_listlockunspent.json new file mode 100644 index 000000000..23ee5ccb9 --- /dev/null +++ b/iguana/help/bitcoinrpc_listlockunspent.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listlockunspent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listlockunspent_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listreceivedbyaccount.json b/iguana/help/bitcoinrpc_listreceivedbyaccount.json new file mode 100644 index 000000000..a7f59f51f --- /dev/null +++ b/iguana/help/bitcoinrpc_listreceivedbyaccount.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listreceivedbyaccount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listreceivedbyaccount_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listreceivedbyaddress.json b/iguana/help/bitcoinrpc_listreceivedbyaddress.json new file mode 100644 index 000000000..6150f1a3b --- /dev/null +++ b/iguana/help/bitcoinrpc_listreceivedbyaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listreceivedbyaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listreceivedbyaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listsinceblock.json b/iguana/help/bitcoinrpc_listsinceblock.json new file mode 100644 index 000000000..66beb661a --- /dev/null +++ b/iguana/help/bitcoinrpc_listsinceblock.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listsinceblock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listsinceblock_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listtransactions.json b/iguana/help/bitcoinrpc_listtransactions.json new file mode 100644 index 000000000..ddb55511c --- /dev/null +++ b/iguana/help/bitcoinrpc_listtransactions.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listtransactions","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listtransactions_test.py"}]} diff --git a/iguana/help/bitcoinrpc_listunspent.json b/iguana/help/bitcoinrpc_listunspent.json new file mode 100644 index 000000000..0c11033b4 --- /dev/null +++ b/iguana/help/bitcoinrpc_listunspent.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"listunspent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_listunspent_test.py"}]} diff --git a/iguana/help/bitcoinrpc_lockunspent.json b/iguana/help/bitcoinrpc_lockunspent.json new file mode 100644 index 000000000..61c9d7db8 --- /dev/null +++ b/iguana/help/bitcoinrpc_lockunspent.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"lockunspent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_lockunspent_test.py"}]} diff --git a/iguana/help/bitcoinrpc_move.json b/iguana/help/bitcoinrpc_move.json new file mode 100644 index 000000000..b96af5b84 --- /dev/null +++ b/iguana/help/bitcoinrpc_move.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"move","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_move_test.py"}]} diff --git a/iguana/help/bitcoinrpc_repairwallet.json b/iguana/help/bitcoinrpc_repairwallet.json new file mode 100644 index 000000000..4b6f7f080 --- /dev/null +++ b/iguana/help/bitcoinrpc_repairwallet.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"repairwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_repairwallet_test.py"}]} diff --git a/iguana/help/bitcoinrpc_sendfrom.json b/iguana/help/bitcoinrpc_sendfrom.json new file mode 100644 index 000000000..6cec10d79 --- /dev/null +++ b/iguana/help/bitcoinrpc_sendfrom.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"sendfrom","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_sendfrom_test.py"}]} diff --git a/iguana/help/bitcoinrpc_sendmany.json b/iguana/help/bitcoinrpc_sendmany.json new file mode 100644 index 000000000..5115347f4 --- /dev/null +++ b/iguana/help/bitcoinrpc_sendmany.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"sendmany","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_sendmany_test.py"}]} diff --git a/iguana/help/bitcoinrpc_sendrawtransaction.json b/iguana/help/bitcoinrpc_sendrawtransaction.json new file mode 100644 index 000000000..fa9c4182f --- /dev/null +++ b/iguana/help/bitcoinrpc_sendrawtransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"sendrawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_sendrawtransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_sendtoaddress.json b/iguana/help/bitcoinrpc_sendtoaddress.json new file mode 100644 index 000000000..0553170c9 --- /dev/null +++ b/iguana/help/bitcoinrpc_sendtoaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"sendtoaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_sendtoaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_setaccount.json b/iguana/help/bitcoinrpc_setaccount.json new file mode 100644 index 000000000..e73220bf2 --- /dev/null +++ b/iguana/help/bitcoinrpc_setaccount.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"setaccount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_setaccount_test.py"}]} diff --git a/iguana/help/bitcoinrpc_settxfee.json b/iguana/help/bitcoinrpc_settxfee.json new file mode 100644 index 000000000..d3cc05812 --- /dev/null +++ b/iguana/help/bitcoinrpc_settxfee.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"settxfee","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_settxfee_test.py"}]} diff --git a/iguana/help/bitcoinrpc_signmessage.json b/iguana/help/bitcoinrpc_signmessage.json new file mode 100644 index 000000000..c5e335545 --- /dev/null +++ b/iguana/help/bitcoinrpc_signmessage.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"signmessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_signmessage_test.py"}]} diff --git a/iguana/help/bitcoinrpc_signrawtransaction.json b/iguana/help/bitcoinrpc_signrawtransaction.json new file mode 100644 index 000000000..5f693247a --- /dev/null +++ b/iguana/help/bitcoinrpc_signrawtransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"signrawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_signrawtransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_submitblock.json b/iguana/help/bitcoinrpc_submitblock.json new file mode 100644 index 000000000..03e5c711e --- /dev/null +++ b/iguana/help/bitcoinrpc_submitblock.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"submitblock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_submitblock_test.py"}]} diff --git a/iguana/help/bitcoinrpc_validateaddress.json b/iguana/help/bitcoinrpc_validateaddress.json new file mode 100644 index 000000000..2226a7767 --- /dev/null +++ b/iguana/help/bitcoinrpc_validateaddress.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"validateaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_validateaddress_test.py"}]} diff --git a/iguana/help/bitcoinrpc_validatepubkey.json b/iguana/help/bitcoinrpc_validatepubkey.json new file mode 100644 index 000000000..bfd1d8c5b --- /dev/null +++ b/iguana/help/bitcoinrpc_validatepubkey.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"validatepubkey","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_validatepubkey_test.py"}]} diff --git a/iguana/help/bitcoinrpc_validaterawtransaction.json b/iguana/help/bitcoinrpc_validaterawtransaction.json new file mode 100644 index 000000000..ffcec8df8 --- /dev/null +++ b/iguana/help/bitcoinrpc_validaterawtransaction.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"validaterawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_validaterawtransaction_test.py"}]} diff --git a/iguana/help/bitcoinrpc_verifymessage.json b/iguana/help/bitcoinrpc_verifymessage.json new file mode 100644 index 000000000..9cc4a7ee7 --- /dev/null +++ b/iguana/help/bitcoinrpc_verifymessage.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"verifymessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_verifymessage_test.py"}]} diff --git a/iguana/help/bitcoinrpc_walletlock.json b/iguana/help/bitcoinrpc_walletlock.json new file mode 100644 index 000000000..d3375ba94 --- /dev/null +++ b/iguana/help/bitcoinrpc_walletlock.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"walletlock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_walletlock_test.py"}]} diff --git a/iguana/help/bitcoinrpc_walletpassphrase.json b/iguana/help/bitcoinrpc_walletpassphrase.json new file mode 100644 index 000000000..e196e4171 --- /dev/null +++ b/iguana/help/bitcoinrpc_walletpassphrase.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"walletpassphrase","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_walletpassphrase_test.py"}]} diff --git a/iguana/help/bitcoinrpc_walletpassphrasechange.json b/iguana/help/bitcoinrpc_walletpassphrasechange.json new file mode 100644 index 000000000..c18bc1a12 --- /dev/null +++ b/iguana/help/bitcoinrpc_walletpassphrasechange.json @@ -0,0 +1 @@ +{"agent":"bitcoinrpc","method":"walletpassphrasechange","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_walletpassphrasechange_test.py"}]} diff --git a/iguana/help/dex_alladdresses.json b/iguana/help/dex_alladdresses.json new file mode 100644 index 000000000..71b30968d --- /dev/null +++ b/iguana/help/dex_alladdresses.json @@ -0,0 +1 @@ +{"agent":"dex","method":"alladdresses","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_alladdresses_test.py"}]} diff --git a/iguana/help/dex_checkaddress.json b/iguana/help/dex_checkaddress.json new file mode 100644 index 000000000..c651f71f9 --- /dev/null +++ b/iguana/help/dex_checkaddress.json @@ -0,0 +1 @@ +{"agent":"dex","method":"checkaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_checkaddress_test.py"}]} diff --git a/iguana/help/dex_explorer.json b/iguana/help/dex_explorer.json new file mode 100644 index 000000000..f48b9eb44 --- /dev/null +++ b/iguana/help/dex_explorer.json @@ -0,0 +1 @@ +{"agent":"dex","method":"explorer","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_explorer_test.py"}]} diff --git a/iguana/help/dex_getbalance.json b/iguana/help/dex_getbalance.json new file mode 100644 index 000000000..39c086891 --- /dev/null +++ b/iguana/help/dex_getbalance.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getbalance","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getbalance_test.py"}]} diff --git a/iguana/help/dex_getbestblockhash.json b/iguana/help/dex_getbestblockhash.json new file mode 100644 index 000000000..ab3625a38 --- /dev/null +++ b/iguana/help/dex_getbestblockhash.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getbestblockhash","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getbestblockhash_test.py"}]} diff --git a/iguana/help/dex_getblock.json b/iguana/help/dex_getblock.json new file mode 100644 index 000000000..9f74e1ba6 --- /dev/null +++ b/iguana/help/dex_getblock.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getblock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getblock_test.py"}]} diff --git a/iguana/help/dex_getblockhash.json b/iguana/help/dex_getblockhash.json new file mode 100644 index 000000000..87fbff94d --- /dev/null +++ b/iguana/help/dex_getblockhash.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getblockhash","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getblockhash_test.py"}]} diff --git a/iguana/help/dex_getinfo.json b/iguana/help/dex_getinfo.json new file mode 100644 index 000000000..89b6f79fa --- /dev/null +++ b/iguana/help/dex_getinfo.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getinfo","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getinfo_test.py"}]} diff --git a/iguana/help/dex_getmessage.json b/iguana/help/dex_getmessage.json new file mode 100644 index 000000000..4b0aa5d4e --- /dev/null +++ b/iguana/help/dex_getmessage.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getmessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getmessage_test.py"}]} diff --git a/iguana/help/dex_getnotaries.json b/iguana/help/dex_getnotaries.json new file mode 100644 index 000000000..b3280498e --- /dev/null +++ b/iguana/help/dex_getnotaries.json @@ -0,0 +1 @@ +{"agent":"dex","method":"getnotaries","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_getnotaries_test.py"}]} diff --git a/iguana/help/dex_gettransaction.json b/iguana/help/dex_gettransaction.json new file mode 100644 index 000000000..4b3df0094 --- /dev/null +++ b/iguana/help/dex_gettransaction.json @@ -0,0 +1 @@ +{"agent":"dex","method":"gettransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_gettransaction_test.py"}]} diff --git a/iguana/help/dex_gettxin.json b/iguana/help/dex_gettxin.json new file mode 100644 index 000000000..868ffd753 --- /dev/null +++ b/iguana/help/dex_gettxin.json @@ -0,0 +1 @@ +{"agent":"dex","method":"gettxin","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_gettxin_test.py"}]} diff --git a/iguana/help/dex_gettxout.json b/iguana/help/dex_gettxout.json new file mode 100644 index 000000000..13169702d --- /dev/null +++ b/iguana/help/dex_gettxout.json @@ -0,0 +1 @@ +{"agent":"dex","method":"gettxout","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_gettxout_test.py"}]} diff --git a/iguana/help/dex_importaddress.json b/iguana/help/dex_importaddress.json new file mode 100644 index 000000000..c0961635f --- /dev/null +++ b/iguana/help/dex_importaddress.json @@ -0,0 +1 @@ +{"agent":"dex","method":"importaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_importaddress_test.py"}]} diff --git a/iguana/help/dex_kvsearch.json b/iguana/help/dex_kvsearch.json new file mode 100644 index 000000000..3b3f22ac5 --- /dev/null +++ b/iguana/help/dex_kvsearch.json @@ -0,0 +1 @@ +{"agent":"dex","method":"kvsearch","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_kvsearch_test.py"}]} diff --git a/iguana/help/dex_kvupdate.json b/iguana/help/dex_kvupdate.json new file mode 100644 index 000000000..8303eaad1 --- /dev/null +++ b/iguana/help/dex_kvupdate.json @@ -0,0 +1 @@ +{"agent":"dex","method":"kvupdate","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_kvupdate_test.py"}]} diff --git a/iguana/help/dex_listspent.json b/iguana/help/dex_listspent.json new file mode 100644 index 000000000..22767b773 --- /dev/null +++ b/iguana/help/dex_listspent.json @@ -0,0 +1 @@ +{"agent":"dex","method":"listspent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_listspent_test.py"}]} diff --git a/iguana/help/dex_listtransactions.json b/iguana/help/dex_listtransactions.json new file mode 100644 index 000000000..be95c75ff --- /dev/null +++ b/iguana/help/dex_listtransactions.json @@ -0,0 +1 @@ +{"agent":"dex","method":"listtransactions","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_listtransactions_test.py"}]} diff --git a/iguana/help/dex_listtransactions2.json b/iguana/help/dex_listtransactions2.json new file mode 100644 index 000000000..234b9b8df --- /dev/null +++ b/iguana/help/dex_listtransactions2.json @@ -0,0 +1 @@ +{"agent":"dex","method":"listtransactions2","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_listtransactions2_test.py"}]} diff --git a/iguana/help/dex_listunspent.json b/iguana/help/dex_listunspent.json new file mode 100644 index 000000000..0f50ca06e --- /dev/null +++ b/iguana/help/dex_listunspent.json @@ -0,0 +1 @@ +{"agent":"dex","method":"listunspent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_listunspent_test.py"}]} diff --git a/iguana/help/dex_listunspent2.json b/iguana/help/dex_listunspent2.json new file mode 100644 index 000000000..9ccc2a1e4 --- /dev/null +++ b/iguana/help/dex_listunspent2.json @@ -0,0 +1 @@ +{"agent":"dex","method":"listunspent2","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_listunspent2_test.py"}]} diff --git a/iguana/help/dex_psock.json b/iguana/help/dex_psock.json new file mode 100644 index 000000000..74a3a8dfa --- /dev/null +++ b/iguana/help/dex_psock.json @@ -0,0 +1 @@ +{"agent":"dex","method":"psock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_psock_test.py"}]} diff --git a/iguana/help/dex_send.json b/iguana/help/dex_send.json new file mode 100644 index 000000000..ccd3cc2bd --- /dev/null +++ b/iguana/help/dex_send.json @@ -0,0 +1 @@ +{"agent":"dex","method":"send","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_send_test.py"}]} diff --git a/iguana/help/dex_sendrawtransaction.json b/iguana/help/dex_sendrawtransaction.json new file mode 100644 index 000000000..20261d219 --- /dev/null +++ b/iguana/help/dex_sendrawtransaction.json @@ -0,0 +1 @@ +{"agent":"dex","method":"sendrawtransaction","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_sendrawtransaction_test.py"}]} diff --git a/iguana/help/dex_validateaddress.json b/iguana/help/dex_validateaddress.json new file mode 100644 index 000000000..7387dc024 --- /dev/null +++ b/iguana/help/dex_validateaddress.json @@ -0,0 +1 @@ +{"agent":"dex","method":"validateaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dex_validateaddress_test.py"}]} diff --git a/iguana/help/dpow_active.json b/iguana/help/dpow_active.json new file mode 100644 index 000000000..b639a3ada --- /dev/null +++ b/iguana/help/dpow_active.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"active","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_active_test.py"}]} diff --git a/iguana/help/dpow_bindaddr.json b/iguana/help/dpow_bindaddr.json new file mode 100644 index 000000000..65f0052f7 --- /dev/null +++ b/iguana/help/dpow_bindaddr.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"bindaddr","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_bindaddr_test.py"}]} diff --git a/iguana/help/dpow_cancelratify.json b/iguana/help/dpow_cancelratify.json new file mode 100644 index 000000000..33a872463 --- /dev/null +++ b/iguana/help/dpow_cancelratify.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"cancelratify","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_cancelratify_test.py"}]} diff --git a/iguana/help/dpow_fundnotaries.json b/iguana/help/dpow_fundnotaries.json new file mode 100644 index 000000000..4e2854714 --- /dev/null +++ b/iguana/help/dpow_fundnotaries.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"fundnotaries","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_fundnotaries_test.py"}]} diff --git a/iguana/help/dpow_notarychains.json b/iguana/help/dpow_notarychains.json new file mode 100644 index 000000000..daee37348 --- /dev/null +++ b/iguana/help/dpow_notarychains.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"notarychains","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_notarychains_test.py"}]} diff --git a/iguana/help/dpow_pending.json b/iguana/help/dpow_pending.json new file mode 100644 index 000000000..1a524af58 --- /dev/null +++ b/iguana/help/dpow_pending.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"pending","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_pending_test.py"}]} diff --git a/iguana/help/dpow_ratify.json b/iguana/help/dpow_ratify.json new file mode 100644 index 000000000..c449a8888 --- /dev/null +++ b/iguana/help/dpow_ratify.json @@ -0,0 +1 @@ +{"agent":"dpow","method":"ratify","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"dpow_ratify_test.py"}]} diff --git a/iguana/help/hash_NXT.json b/iguana/help/hash_NXT.json new file mode 100644 index 000000000..85fae7d76 --- /dev/null +++ b/iguana/help/hash_NXT.json @@ -0,0 +1 @@ +{"agent":"hash","method":"NXT","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_NXT_test.py"}]} diff --git a/iguana/help/hash_base64_decode.json b/iguana/help/hash_base64_decode.json new file mode 100644 index 000000000..eadde2571 --- /dev/null +++ b/iguana/help/hash_base64_decode.json @@ -0,0 +1 @@ +{"agent":"hash","method":"base64_decode","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_base64_decode_test.py"}]} diff --git a/iguana/help/hash_base64_encode.json b/iguana/help/hash_base64_encode.json new file mode 100644 index 000000000..171e50200 --- /dev/null +++ b/iguana/help/hash_base64_encode.json @@ -0,0 +1 @@ +{"agent":"hash","method":"base64_encode","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_base64_encode_test.py"}]} diff --git a/iguana/help/hash_crc32.json b/iguana/help/hash_crc32.json new file mode 100644 index 000000000..3891c7bdf --- /dev/null +++ b/iguana/help/hash_crc32.json @@ -0,0 +1 @@ +{"agent":"hash","method":"crc32","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_crc32_test.py"}]} diff --git a/iguana/help/hash_curve25519.json b/iguana/help/hash_curve25519.json new file mode 100644 index 000000000..c9205f92b --- /dev/null +++ b/iguana/help/hash_curve25519.json @@ -0,0 +1 @@ +{"agent":"hash","method":"curve25519","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_curve25519_test.py"}]} diff --git a/iguana/help/hash_curve25519_pair.json b/iguana/help/hash_curve25519_pair.json new file mode 100644 index 000000000..f1e183ead --- /dev/null +++ b/iguana/help/hash_curve25519_pair.json @@ -0,0 +1 @@ +{"agent":"hash","method":"curve25519_pair","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_curve25519_pair_test.py"}]} diff --git a/iguana/help/hash_hex.json b/iguana/help/hash_hex.json new file mode 100644 index 000000000..467d9579b --- /dev/null +++ b/iguana/help/hash_hex.json @@ -0,0 +1 @@ +{"agent":"hash","method":"hex","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_hex_test.py"}]} diff --git a/iguana/help/hash_md2.json b/iguana/help/hash_md2.json new file mode 100644 index 000000000..995e6bb7f --- /dev/null +++ b/iguana/help/hash_md2.json @@ -0,0 +1 @@ +{"agent":"hash","method":"md2","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_md2_test.py"}]} diff --git a/iguana/help/hash_md4.json b/iguana/help/hash_md4.json new file mode 100644 index 000000000..696b4a22b --- /dev/null +++ b/iguana/help/hash_md4.json @@ -0,0 +1 @@ +{"agent":"hash","method":"md4","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_md4_test.py"}]} diff --git a/iguana/help/hash_md5.json b/iguana/help/hash_md5.json new file mode 100644 index 000000000..cd50b763a --- /dev/null +++ b/iguana/help/hash_md5.json @@ -0,0 +1 @@ +{"agent":"hash","method":"md5","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_md5_test.py"}]} diff --git a/iguana/help/hash_rmd128.json b/iguana/help/hash_rmd128.json new file mode 100644 index 000000000..c1fe35027 --- /dev/null +++ b/iguana/help/hash_rmd128.json @@ -0,0 +1 @@ +{"agent":"hash","method":"rmd128","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_rmd128_test.py"}]} diff --git a/iguana/help/hash_rmd160.json b/iguana/help/hash_rmd160.json new file mode 100644 index 000000000..448febe13 --- /dev/null +++ b/iguana/help/hash_rmd160.json @@ -0,0 +1 @@ +{"agent":"hash","method":"rmd160","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_rmd160_test.py"}]} diff --git a/iguana/help/hash_rmd160_sha256.json b/iguana/help/hash_rmd160_sha256.json new file mode 100644 index 000000000..d20a37caa --- /dev/null +++ b/iguana/help/hash_rmd160_sha256.json @@ -0,0 +1 @@ +{"agent":"hash","method":"rmd160_sha256","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_rmd160_sha256_test.py"}]} diff --git a/iguana/help/hash_rmd256.json b/iguana/help/hash_rmd256.json new file mode 100644 index 000000000..7b5476766 --- /dev/null +++ b/iguana/help/hash_rmd256.json @@ -0,0 +1 @@ +{"agent":"hash","method":"rmd256","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_rmd256_test.py"}]} diff --git a/iguana/help/hash_rmd320.json b/iguana/help/hash_rmd320.json new file mode 100644 index 000000000..d710f49d8 --- /dev/null +++ b/iguana/help/hash_rmd320.json @@ -0,0 +1 @@ +{"agent":"hash","method":"rmd320","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_rmd320_test.py"}]} diff --git a/iguana/help/hash_sha1.json b/iguana/help/hash_sha1.json new file mode 100644 index 000000000..03a4fe9a3 --- /dev/null +++ b/iguana/help/hash_sha1.json @@ -0,0 +1 @@ +{"agent":"hash","method":"sha1","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_sha1_test.py"}]} diff --git a/iguana/help/hash_sha224.json b/iguana/help/hash_sha224.json new file mode 100644 index 000000000..a3b3f0840 --- /dev/null +++ b/iguana/help/hash_sha224.json @@ -0,0 +1 @@ +{"agent":"hash","method":"sha224","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_sha224_test.py"}]} diff --git a/iguana/help/hash_sha256.json b/iguana/help/hash_sha256.json new file mode 100644 index 000000000..f7350d129 --- /dev/null +++ b/iguana/help/hash_sha256.json @@ -0,0 +1 @@ +{"agent":"hash","method":"sha256","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_sha256_test.py"}]} diff --git a/iguana/help/hash_sha256_sha256.json b/iguana/help/hash_sha256_sha256.json new file mode 100644 index 000000000..7f750db03 --- /dev/null +++ b/iguana/help/hash_sha256_sha256.json @@ -0,0 +1 @@ +{"agent":"hash","method":"sha256_sha256","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_sha256_sha256_test.py"}]} diff --git a/iguana/help/hash_sha384.json b/iguana/help/hash_sha384.json new file mode 100644 index 000000000..9c3a29487 --- /dev/null +++ b/iguana/help/hash_sha384.json @@ -0,0 +1 @@ +{"agent":"hash","method":"sha384","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_sha384_test.py"}]} diff --git a/iguana/help/hash_sha512.json b/iguana/help/hash_sha512.json new file mode 100644 index 000000000..1b43f3a27 --- /dev/null +++ b/iguana/help/hash_sha512.json @@ -0,0 +1 @@ +{"agent":"hash","method":"sha512","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_sha512_test.py"}]} diff --git a/iguana/help/hash_tiger192_3.json b/iguana/help/hash_tiger192_3.json new file mode 100644 index 000000000..e48f284fb --- /dev/null +++ b/iguana/help/hash_tiger192_3.json @@ -0,0 +1 @@ +{"agent":"hash","method":"tiger192_3","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_tiger192_3_test.py"}]} diff --git a/iguana/help/hash_unhex.json b/iguana/help/hash_unhex.json new file mode 100644 index 000000000..860f3c3c8 --- /dev/null +++ b/iguana/help/hash_unhex.json @@ -0,0 +1 @@ +{"agent":"hash","method":"unhex","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_unhex_test.py"}]} diff --git a/iguana/help/hash_whirlpool.json b/iguana/help/hash_whirlpool.json new file mode 100644 index 000000000..6c84f55b0 --- /dev/null +++ b/iguana/help/hash_whirlpool.json @@ -0,0 +1 @@ +{"agent":"hash","method":"whirlpool","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hash_whirlpool_test.py"}]} diff --git a/iguana/help/hmac_md2.json b/iguana/help/hmac_md2.json new file mode 100644 index 000000000..3a39c448b --- /dev/null +++ b/iguana/help/hmac_md2.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"md2","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_md2_test.py"}]} diff --git a/iguana/help/hmac_md4.json b/iguana/help/hmac_md4.json new file mode 100644 index 000000000..fdb646593 --- /dev/null +++ b/iguana/help/hmac_md4.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"md4","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_md4_test.py"}]} diff --git a/iguana/help/hmac_md5.json b/iguana/help/hmac_md5.json new file mode 100644 index 000000000..cd9021def --- /dev/null +++ b/iguana/help/hmac_md5.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"md5","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_md5_test.py"}]} diff --git a/iguana/help/hmac_rmd128.json b/iguana/help/hmac_rmd128.json new file mode 100644 index 000000000..a5c10722b --- /dev/null +++ b/iguana/help/hmac_rmd128.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"rmd128","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_rmd128_test.py"}]} diff --git a/iguana/help/hmac_rmd160.json b/iguana/help/hmac_rmd160.json new file mode 100644 index 000000000..114d560d9 --- /dev/null +++ b/iguana/help/hmac_rmd160.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"rmd160","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_rmd160_test.py"}]} diff --git a/iguana/help/hmac_rmd256.json b/iguana/help/hmac_rmd256.json new file mode 100644 index 000000000..836887c38 --- /dev/null +++ b/iguana/help/hmac_rmd256.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"rmd256","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_rmd256_test.py"}]} diff --git a/iguana/help/hmac_rmd320.json b/iguana/help/hmac_rmd320.json new file mode 100644 index 000000000..a7f0a94f8 --- /dev/null +++ b/iguana/help/hmac_rmd320.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"rmd320","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_rmd320_test.py"}]} diff --git a/iguana/help/hmac_sha1.json b/iguana/help/hmac_sha1.json new file mode 100644 index 000000000..beef6ef79 --- /dev/null +++ b/iguana/help/hmac_sha1.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"sha1","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_sha1_test.py"}]} diff --git a/iguana/help/hmac_sha224.json b/iguana/help/hmac_sha224.json new file mode 100644 index 000000000..e665184e1 --- /dev/null +++ b/iguana/help/hmac_sha224.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"sha224","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_sha224_test.py"}]} diff --git a/iguana/help/hmac_sha256.json b/iguana/help/hmac_sha256.json new file mode 100644 index 000000000..ae082aa6d --- /dev/null +++ b/iguana/help/hmac_sha256.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"sha256","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_sha256_test.py"}]} diff --git a/iguana/help/hmac_sha384.json b/iguana/help/hmac_sha384.json new file mode 100644 index 000000000..cadfef49d --- /dev/null +++ b/iguana/help/hmac_sha384.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"sha384","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_sha384_test.py"}]} diff --git a/iguana/help/hmac_sha512.json b/iguana/help/hmac_sha512.json new file mode 100644 index 000000000..c2aed013b --- /dev/null +++ b/iguana/help/hmac_sha512.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"sha512","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_sha512_test.py"}]} diff --git a/iguana/help/hmac_tiger192_3.json b/iguana/help/hmac_tiger192_3.json new file mode 100644 index 000000000..c7b776d69 --- /dev/null +++ b/iguana/help/hmac_tiger192_3.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"tiger192_3","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_tiger192_3_test.py"}]} diff --git a/iguana/help/hmac_whirlpool.json b/iguana/help/hmac_whirlpool.json new file mode 100644 index 000000000..b85e3940e --- /dev/null +++ b/iguana/help/hmac_whirlpool.json @@ -0,0 +1 @@ +{"agent":"hmac","method":"whirlpool","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"hmac_whirlpool_test.py"}]} diff --git a/iguana/help/iguana_PoSweights.json b/iguana/help/iguana_PoSweights.json new file mode 100644 index 000000000..d5597f13c --- /dev/null +++ b/iguana/help/iguana_PoSweights.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"PoSweights","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_PoSweights_test.py"}]} diff --git a/iguana/help/iguana_addcoin.json b/iguana/help/iguana_addcoin.json new file mode 100644 index 000000000..0bfaaf6de --- /dev/null +++ b/iguana/help/iguana_addcoin.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"addcoin","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_addcoin_test.py"}]} diff --git a/iguana/help/iguana_addnode.json b/iguana/help/iguana_addnode.json new file mode 100644 index 000000000..1dcf66ce8 --- /dev/null +++ b/iguana/help/iguana_addnode.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"addnode","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_addnode_test.py"}]} diff --git a/iguana/help/iguana_addnotary.json b/iguana/help/iguana_addnotary.json new file mode 100644 index 000000000..c57b97435 --- /dev/null +++ b/iguana/help/iguana_addnotary.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"addnotary","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_addnotary_test.py"}]} diff --git a/iguana/help/iguana_balance.json b/iguana/help/iguana_balance.json new file mode 100644 index 000000000..b84a65f42 --- /dev/null +++ b/iguana/help/iguana_balance.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"balance","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_balance_test.py"}]} diff --git a/iguana/help/iguana_bundleaddresses.json b/iguana/help/iguana_bundleaddresses.json new file mode 100644 index 000000000..f80caee90 --- /dev/null +++ b/iguana/help/iguana_bundleaddresses.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"bundleaddresses","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_bundleaddresses_test.py"}]} diff --git a/iguana/help/iguana_bundlehashes.json b/iguana/help/iguana_bundlehashes.json new file mode 100644 index 000000000..2eddf7a38 --- /dev/null +++ b/iguana/help/iguana_bundlehashes.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"bundlehashes","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_bundlehashes_test.py"}]} diff --git a/iguana/help/iguana_dividends.json b/iguana/help/iguana_dividends.json new file mode 100644 index 000000000..222489389 --- /dev/null +++ b/iguana/help/iguana_dividends.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"dividends","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_dividends_test.py"}]} diff --git a/iguana/help/iguana_dpow.json b/iguana/help/iguana_dpow.json new file mode 100644 index 000000000..6e54c8629 --- /dev/null +++ b/iguana/help/iguana_dpow.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"dpow","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_dpow_test.py"}]} diff --git a/iguana/help/iguana_getconnectioncount.json b/iguana/help/iguana_getconnectioncount.json new file mode 100644 index 000000000..4b3ee5ad7 --- /dev/null +++ b/iguana/help/iguana_getconnectioncount.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"getconnectioncount","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_getconnectioncount_test.py"}]} diff --git a/iguana/help/iguana_initfastfind.json b/iguana/help/iguana_initfastfind.json new file mode 100644 index 000000000..1de530d85 --- /dev/null +++ b/iguana/help/iguana_initfastfind.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"initfastfind","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_initfastfind_test.py"}]} diff --git a/iguana/help/iguana_makekeypair.json b/iguana/help/iguana_makekeypair.json new file mode 100644 index 000000000..1d70e412e --- /dev/null +++ b/iguana/help/iguana_makekeypair.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"makekeypair","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_makekeypair_test.py"}]} diff --git a/iguana/help/iguana_maxpeers.json b/iguana/help/iguana_maxpeers.json new file mode 100644 index 000000000..0f67ebfe4 --- /dev/null +++ b/iguana/help/iguana_maxpeers.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"maxpeers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_maxpeers_test.py"}]} diff --git a/iguana/help/iguana_nodestatus.json b/iguana/help/iguana_nodestatus.json new file mode 100644 index 000000000..e3937827a --- /dev/null +++ b/iguana/help/iguana_nodestatus.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"nodestatus","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_nodestatus_test.py"}]} diff --git a/iguana/help/iguana_oneshot.json b/iguana/help/iguana_oneshot.json new file mode 100644 index 000000000..5157a0be7 --- /dev/null +++ b/iguana/help/iguana_oneshot.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"oneshot","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_oneshot_test.py"}]} diff --git a/iguana/help/iguana_passthru.json b/iguana/help/iguana_passthru.json new file mode 100644 index 000000000..a7203ba08 --- /dev/null +++ b/iguana/help/iguana_passthru.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"passthru","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_passthru_test.py"}]} diff --git a/iguana/help/iguana_pausecoin.json b/iguana/help/iguana_pausecoin.json new file mode 100644 index 000000000..ada16880b --- /dev/null +++ b/iguana/help/iguana_pausecoin.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"pausecoin","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_pausecoin_test.py"}]} diff --git a/iguana/help/iguana_peers.json b/iguana/help/iguana_peers.json new file mode 100644 index 000000000..75a498b7e --- /dev/null +++ b/iguana/help/iguana_peers.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"peers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_peers_test.py"}]} diff --git a/iguana/help/iguana_persistent.json b/iguana/help/iguana_persistent.json new file mode 100644 index 000000000..14953397f --- /dev/null +++ b/iguana/help/iguana_persistent.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"persistent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_persistent_test.py"}]} diff --git a/iguana/help/iguana_prices.json b/iguana/help/iguana_prices.json new file mode 100644 index 000000000..a1b02f625 --- /dev/null +++ b/iguana/help/iguana_prices.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"prices","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_prices_test.py"}]} diff --git a/iguana/help/iguana_rate.json b/iguana/help/iguana_rate.json new file mode 100644 index 000000000..94cfec4ab --- /dev/null +++ b/iguana/help/iguana_rate.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"rate","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_rate_test.py"}]} diff --git a/iguana/help/iguana_rates.json b/iguana/help/iguana_rates.json new file mode 100644 index 000000000..678f86b90 --- /dev/null +++ b/iguana/help/iguana_rates.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"rates","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_rates_test.py"}]} diff --git a/iguana/help/iguana_removecoin.json b/iguana/help/iguana_removecoin.json new file mode 100644 index 000000000..e33676b7f --- /dev/null +++ b/iguana/help/iguana_removecoin.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"removecoin","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_removecoin_test.py"}]} diff --git a/iguana/help/iguana_removenode.json b/iguana/help/iguana_removenode.json new file mode 100644 index 000000000..9af62606d --- /dev/null +++ b/iguana/help/iguana_removenode.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"removenode","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_removenode_test.py"}]} diff --git a/iguana/help/iguana_snapshot.json b/iguana/help/iguana_snapshot.json new file mode 100644 index 000000000..c5bd5c3c9 --- /dev/null +++ b/iguana/help/iguana_snapshot.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"snapshot","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_snapshot_test.py"}]} diff --git a/iguana/help/iguana_spendmsig.json b/iguana/help/iguana_spendmsig.json new file mode 100644 index 000000000..7e987d790 --- /dev/null +++ b/iguana/help/iguana_spendmsig.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"spendmsig","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_spendmsig_test.py"}]} diff --git a/iguana/help/iguana_splitfunds.json b/iguana/help/iguana_splitfunds.json new file mode 100644 index 000000000..bdea50ac5 --- /dev/null +++ b/iguana/help/iguana_splitfunds.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"splitfunds","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_splitfunds_test.py"}]} diff --git a/iguana/help/iguana_stakers.json b/iguana/help/iguana_stakers.json new file mode 100644 index 000000000..8fb613dd6 --- /dev/null +++ b/iguana/help/iguana_stakers.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"stakers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_stakers_test.py"}]} diff --git a/iguana/help/iguana_startcoin.json b/iguana/help/iguana_startcoin.json new file mode 100644 index 000000000..b0a52eaf7 --- /dev/null +++ b/iguana/help/iguana_startcoin.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"startcoin","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_startcoin_test.py"}]} diff --git a/iguana/help/iguana_stopcoin.json b/iguana/help/iguana_stopcoin.json new file mode 100644 index 000000000..802470c20 --- /dev/null +++ b/iguana/help/iguana_stopcoin.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"stopcoin","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_stopcoin_test.py"}]} diff --git a/iguana/help/iguana_validate.json b/iguana/help/iguana_validate.json new file mode 100644 index 000000000..555ed8534 --- /dev/null +++ b/iguana/help/iguana_validate.json @@ -0,0 +1 @@ +{"agent":"iguana","method":"validate","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"iguana_validate_test.py"}]} diff --git a/iguana/help/jumblr_runsilent.json b/iguana/help/jumblr_runsilent.json new file mode 100644 index 000000000..071654a08 --- /dev/null +++ b/iguana/help/jumblr_runsilent.json @@ -0,0 +1 @@ +{"agent":"jumblr","method":"runsilent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"jumblr_runsilent_test.py"}]} diff --git a/iguana/help/jumblr_setpassphrase.json b/iguana/help/jumblr_setpassphrase.json new file mode 100644 index 000000000..abb67bed0 --- /dev/null +++ b/iguana/help/jumblr_setpassphrase.json @@ -0,0 +1 @@ +{"agent":"jumblr","method":"setpassphrase","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"jumblr_setpassphrase_test.py"}]} diff --git a/iguana/help/jumblr_status.json b/iguana/help/jumblr_status.json new file mode 100644 index 000000000..a245ba5db --- /dev/null +++ b/iguana/help/jumblr_status.json @@ -0,0 +1 @@ +{"agent":"jumblr","method":"status","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"jumblr_status_test.py"}]} diff --git a/iguana/help/jumblr_totransparent.json b/iguana/help/jumblr_totransparent.json new file mode 100644 index 000000000..22d1f678d --- /dev/null +++ b/iguana/help/jumblr_totransparent.json @@ -0,0 +1 @@ +{"agent":"jumblr","method":"totransparent","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"jumblr_totransparent_test.py"}]} diff --git a/iguana/help/keyboard_key.json b/iguana/help/keyboard_key.json new file mode 100644 index 000000000..941a0517f --- /dev/null +++ b/iguana/help/keyboard_key.json @@ -0,0 +1 @@ +{"agent":"keyboard","method":"key","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"keyboard_key_test.py"}]} diff --git a/iguana/help/komodo_passthru.json b/iguana/help/komodo_passthru.json new file mode 100644 index 000000000..91e0fc86c --- /dev/null +++ b/iguana/help/komodo_passthru.json @@ -0,0 +1 @@ +{"agent":"komodo","method":"passthru","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"komodo_passthru_test.py"}]} diff --git a/iguana/help/mouse_change.json b/iguana/help/mouse_change.json new file mode 100644 index 000000000..e94100130 --- /dev/null +++ b/iguana/help/mouse_change.json @@ -0,0 +1 @@ +{"agent":"mouse","method":"change","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"mouse_change_test.py"}]} diff --git a/iguana/help/mouse_click.json b/iguana/help/mouse_click.json new file mode 100644 index 000000000..5400603ea --- /dev/null +++ b/iguana/help/mouse_click.json @@ -0,0 +1 @@ +{"agent":"mouse","method":"click","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"mouse_click_test.py"}]} diff --git a/iguana/help/mouse_close.json b/iguana/help/mouse_close.json new file mode 100644 index 000000000..465a680c4 --- /dev/null +++ b/iguana/help/mouse_close.json @@ -0,0 +1 @@ +{"agent":"mouse","method":"close","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"mouse_close_test.py"}]} diff --git a/iguana/help/mouse_image.json b/iguana/help/mouse_image.json new file mode 100644 index 000000000..0fe91b3b0 --- /dev/null +++ b/iguana/help/mouse_image.json @@ -0,0 +1 @@ +{"agent":"mouse","method":"image","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"mouse_image_test.py"}]} diff --git a/iguana/help/mouse_leave.json b/iguana/help/mouse_leave.json new file mode 100644 index 000000000..0102f7c1e --- /dev/null +++ b/iguana/help/mouse_leave.json @@ -0,0 +1 @@ +{"agent":"mouse","method":"leave","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"mouse_leave_test.py"}]} diff --git a/iguana/help/passthru_paxfiats.json b/iguana/help/passthru_paxfiats.json new file mode 100644 index 000000000..48b2d7b57 --- /dev/null +++ b/iguana/help/passthru_paxfiats.json @@ -0,0 +1 @@ +{"agent":"passthru","method":"paxfiats","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"passthru_paxfiats_test.py"}]} diff --git a/iguana/help/pax_start.json b/iguana/help/pax_start.json new file mode 100644 index 000000000..1f053e4f3 --- /dev/null +++ b/iguana/help/pax_start.json @@ -0,0 +1 @@ +{"agent":"pax","method":"start","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"pax_start_test.py"}]} diff --git a/iguana/help/tradebot_accumulate.json b/iguana/help/tradebot_accumulate.json new file mode 100644 index 000000000..e46ec03c3 --- /dev/null +++ b/iguana/help/tradebot_accumulate.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"accumulate","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_accumulate_test.py"}]} diff --git a/iguana/help/tradebot_activebots.json b/iguana/help/tradebot_activebots.json new file mode 100644 index 000000000..1eb5e73e3 --- /dev/null +++ b/iguana/help/tradebot_activebots.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"activebots","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_activebots_test.py"}]} diff --git a/iguana/help/tradebot_allbalances.json b/iguana/help/tradebot_allbalances.json new file mode 100644 index 000000000..93c51ec2b --- /dev/null +++ b/iguana/help/tradebot_allbalances.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"allbalances","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_allbalances_test.py"}]} diff --git a/iguana/help/tradebot_amlp.json b/iguana/help/tradebot_amlp.json new file mode 100644 index 000000000..35f83ec0d --- /dev/null +++ b/iguana/help/tradebot_amlp.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"amlp","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_amlp_test.py"}]} diff --git a/iguana/help/tradebot_anchor.json b/iguana/help/tradebot_anchor.json new file mode 100644 index 000000000..22a7256ae --- /dev/null +++ b/iguana/help/tradebot_anchor.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"anchor","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_anchor_test.py"}]} diff --git a/iguana/help/tradebot_aveprice.json b/iguana/help/tradebot_aveprice.json new file mode 100644 index 000000000..74f8bc1ab --- /dev/null +++ b/iguana/help/tradebot_aveprice.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"aveprice","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_aveprice_test.py"}]} diff --git a/iguana/help/tradebot_divest.json b/iguana/help/tradebot_divest.json new file mode 100644 index 000000000..013d6b795 --- /dev/null +++ b/iguana/help/tradebot_divest.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"divest","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_divest_test.py"}]} diff --git a/iguana/help/tradebot_gensvm.json b/iguana/help/tradebot_gensvm.json new file mode 100644 index 000000000..445aad5db --- /dev/null +++ b/iguana/help/tradebot_gensvm.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"gensvm","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_gensvm_test.py"}]} diff --git a/iguana/help/tradebot_goals.json b/iguana/help/tradebot_goals.json new file mode 100644 index 000000000..eadeab3f1 --- /dev/null +++ b/iguana/help/tradebot_goals.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"goals","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_goals_test.py"}]} diff --git a/iguana/help/tradebot_liquidity.json b/iguana/help/tradebot_liquidity.json new file mode 100644 index 000000000..dc1461790 --- /dev/null +++ b/iguana/help/tradebot_liquidity.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"liquidity","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_liquidity_test.py"}]} diff --git a/iguana/help/tradebot_monitor.json b/iguana/help/tradebot_monitor.json new file mode 100644 index 000000000..31df1db48 --- /dev/null +++ b/iguana/help/tradebot_monitor.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"monitor","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_monitor_test.py"}]} diff --git a/iguana/help/tradebot_monitorall.json b/iguana/help/tradebot_monitorall.json new file mode 100644 index 000000000..16ea650ae --- /dev/null +++ b/iguana/help/tradebot_monitorall.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"monitorall","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_monitorall_test.py"}]} diff --git a/iguana/help/tradebot_notlp.json b/iguana/help/tradebot_notlp.json new file mode 100644 index 000000000..ed462ecf4 --- /dev/null +++ b/iguana/help/tradebot_notlp.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"notlp","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_notlp_test.py"}]} diff --git a/iguana/help/tradebot_openliquidity.json b/iguana/help/tradebot_openliquidity.json new file mode 100644 index 000000000..961e6f424 --- /dev/null +++ b/iguana/help/tradebot_openliquidity.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"openliquidity","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_openliquidity_test.py"}]} diff --git a/iguana/help/tradebot_pause.json b/iguana/help/tradebot_pause.json new file mode 100644 index 000000000..81c641f28 --- /dev/null +++ b/iguana/help/tradebot_pause.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"pause","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_pause_test.py"}]} diff --git a/iguana/help/tradebot_portfolio.json b/iguana/help/tradebot_portfolio.json new file mode 100644 index 000000000..50b646579 --- /dev/null +++ b/iguana/help/tradebot_portfolio.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"portfolio","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_portfolio_test.py"}]} diff --git a/iguana/help/tradebot_resume.json b/iguana/help/tradebot_resume.json new file mode 100644 index 000000000..745666320 --- /dev/null +++ b/iguana/help/tradebot_resume.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"resume","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_resume_test.py"}]} diff --git a/iguana/help/tradebot_status.json b/iguana/help/tradebot_status.json new file mode 100644 index 000000000..1289541a5 --- /dev/null +++ b/iguana/help/tradebot_status.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"status","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_status_test.py"}]} diff --git a/iguana/help/tradebot_stop.json b/iguana/help/tradebot_stop.json new file mode 100644 index 000000000..d948d48c6 --- /dev/null +++ b/iguana/help/tradebot_stop.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"stop","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_stop_test.py"}]} diff --git a/iguana/help/tradebot_unmonitor.json b/iguana/help/tradebot_unmonitor.json new file mode 100644 index 000000000..992a768ef --- /dev/null +++ b/iguana/help/tradebot_unmonitor.json @@ -0,0 +1 @@ +{"agent":"tradebot","method":"unmonitor","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"tradebot_unmonitor_test.py"}]} diff --git a/iguana/help/zcash_passthru.json b/iguana/help/zcash_passthru.json new file mode 100644 index 000000000..657b16dfd --- /dev/null +++ b/iguana/help/zcash_passthru.json @@ -0,0 +1 @@ +{"agent":"zcash","method":"passthru","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"zcash_passthru_test.py"}]} From 59f86d423753bb63ef2c81c1d539b904fc57d385 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 16:31:42 +0300 Subject: [PATCH 0842/2732] Test --- iguana/exchanges/LP_remember.c | 5 +++-- iguana/exchanges/LP_transaction.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f34f92c43..275de09fa 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -264,6 +264,7 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag if ( bits256_nonz(spendtxid) != 0 ) { sentflags[utxoind] = 1; + printf("utxoind.%d Alice.(%s) Bob.(%s)\n",utxoind,aliceaddr,bobaddr); if ( aliceaddr != 0 && strcmp(destaddr,aliceaddr) == 0 ) { printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); @@ -1089,10 +1090,10 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) array = cJSON_CreateArray(); if ( origrequestid != 0 && origquoteid != 0 ) { - printf("orig req.%u q.%u\n",origrequestid,origquoteid); + //printf("orig req.%u q.%u\n",origrequestid,origquoteid); if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 ) jaddi(array,item); - printf("got.(%s)\n",jprint(item,0)); + //printf("got.(%s)\n",jprint(item,0)); } else { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 08fd99eb1..484c59a50 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -560,7 +560,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ return(complete); } -char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) +char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; if ( txfee > 0 && txfee < 10000 ) @@ -578,9 +578,9 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) { - if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n ) + if ( (vouts= jarray(&n,txobj,"vout")) != 0 && utxovout < n ) { - obj = jitem(vouts,vout); + obj = jitem(vouts,utxovout); value = LP_value_extract(obj,1); //printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0)); } From 761709fdb2ed1f314ee225325b09a22b750fda4a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 16:58:52 +0300 Subject: [PATCH 0843/2732] Test --- iguana/exchanges/LP_remember.c | 5 +++++ iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 275de09fa..c19d52129 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -705,7 +705,12 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) if ( (coin= LP_coinfind(symbol)) != 0 && (ht= LP_txheight(coin,txid)) > 0 && ht > 0 ) { if ( coin->firstrefht == 0 || ht < coin->firstrefht ) + { + if ( coin->firstscanht == 0 || ht < coin->firstscanht ) + coin->firstscanht = coin->lastscanht = ht; coin->firstrefht = ht; + printf(">>>>>>>>. 1st refht %s <- %d, scan %d %d\n",coin->symbol,ht,coin->firstscanht,coin->lastscanht); + } } if ( bits256_nonz(checktxid) == 0 ) checktxid = jbits256(sentobj,"hash"); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 484c59a50..a7b69ec80 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -587,10 +587,10 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch free_json(txobj); //if ( value != 0 ) // gettxout - } + } else printf("cant gettx\n"); if ( value == 0 ) { - printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid)); + printf("basilisk_swap_bobtxspend.%s %s utxo.(%s).v%d already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid),utxovout); return(0); } } From d0cd2f61ede1a2b8bcae07b415f9664e21d4aeb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:02:35 +0300 Subject: [PATCH 0844/2732] Test --- iguana/exchanges/LP_remember.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c19d52129..fa3c6d1a6 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -826,6 +826,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } + printf("ALICE 1st refht %s <- %d, scan %d %d\n",alice->symbol,alice->firstrefht,alice->firstscanht,alice->lastscanht); + printf("BOB 1st refht %s <- %d, scan %d %d\n",bob->symbol,bob->firstrefht,bob->firstscanht,bob->lastscanht); //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); From 505bedb910f0459efce2a90667e8c0f600af0c12 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:04:54 +0300 Subject: [PATCH 0845/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a7b69ec80..a5d66d712 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -660,7 +660,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch jaddstr(item,"userdata",hexstr); } jaddbits256(item,"txid",utxotxid); - jaddnum(item,"vout",vout); + jaddnum(item,"vout",utxovout); bitcoin_address(tmpaddr,taddr,pubtype,pubkey33,33); bitcoin_addr2rmd160(taddr,&addrtype,rmd160,tmpaddr); if ( redeemlen != 0 ) From d918b04040b47fb8d702c2ad316a3a16a0387967 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:11:46 +0300 Subject: [PATCH 0846/2732] Test --- iguana/exchanges/LP_remember.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index fa3c6d1a6..6ba98c7e3 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -622,6 +622,24 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t return(rswap->iambob); } +void LP_refht_update(char *symbol,bits256 txid) +{ + int32_t ht; struct iguana_info *coin; + if ( (coin= LP_coinfind(symbol)) != 0 ) // && coin->electrum == 0 + { + if ( (ht= LP_txheight(coin,txid)) > 0 && ht > 0 ) + { + if ( coin->firstrefht == 0 || ht < coin->firstrefht ) + { + if ( coin->firstscanht == 0 || ht < coin->firstscanht ) + coin->firstscanht = coin->lastscanht = ht; + coin->firstrefht = ht; + printf(">>>>>>>>. 1st refht %s <- %d, scan %d %d\n",coin->symbol,ht,coin->firstscanht,coin->lastscanht); + } + } + } +} + int32_t LP_swap_load(struct LP_swap_remember *rswap) { int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj; bits256 txid,checktxid; uint64_t value; @@ -694,24 +712,14 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin)); if ( rswap->finishedflag == 0 ) { + LP_refht_update(symbol,txid); if ( (sentobj= LP_gettx(symbol,txid)) == 0 ) { char str2[65]; printf("%s %s ready to broadcast\n",symbol,bits256_str(str2,txid)); } else { - struct iguana_info *coin; int32_t ht = -1; checktxid = jbits256(sentobj,"txid"); - if ( (coin= LP_coinfind(symbol)) != 0 && (ht= LP_txheight(coin,txid)) > 0 && ht > 0 ) - { - if ( coin->firstrefht == 0 || ht < coin->firstrefht ) - { - if ( coin->firstscanht == 0 || ht < coin->firstscanht ) - coin->firstscanht = coin->lastscanht = ht; - coin->firstrefht = ht; - printf(">>>>>>>>. 1st refht %s <- %d, scan %d %d\n",coin->symbol,ht,coin->firstscanht,coin->lastscanht); - } - } if ( bits256_nonz(checktxid) == 0 ) checktxid = jbits256(sentobj,"hash"); if ( bits256_cmp(checktxid,txid) == 0 ) @@ -769,6 +777,7 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi { rswap->sentflags[txi] = 1; free_json(sentobj); + LP_refht_update(symbol,rswap->txids[txi]); return(1); } } From 23a2aa6a2ddc493fed49dfd650209fbfa6eb493a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:18:32 +0300 Subject: [PATCH 0847/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 5916b14b9..960d3c0d9 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -671,9 +671,9 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) { height = jint(blockobj,"height"); - //printf("%s LP_txheight.%d\n",coin->symbol,height); + char str[65]; printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height); free_json(blockobj); - } //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); + } else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); free_json(txobj); } } From 6160dd36b8e31dee3d44a04c615ddf37378e0b5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:23:42 +0300 Subject: [PATCH 0848/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 6ba98c7e3..e1754ffb4 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -634,7 +634,7 @@ void LP_refht_update(char *symbol,bits256 txid) if ( coin->firstscanht == 0 || ht < coin->firstscanht ) coin->firstscanht = coin->lastscanht = ht; coin->firstrefht = ht; - printf(">>>>>>>>. 1st refht %s <- %d, scan %d %d\n",coin->symbol,ht,coin->firstscanht,coin->lastscanht); + char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),ht,coin->firstscanht,coin->lastscanht); } } } From fe5fb6b823195fa51fca2806eddb6561c7f76269 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:27:18 +0300 Subject: [PATCH 0849/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 960d3c0d9..d33889a7b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -673,7 +673,7 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) height = jint(blockobj,"height"); char str[65]; printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height); free_json(blockobj); - } else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); + } // else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); likely just unconfirmed free_json(txobj); } } From 5cc93e0605bcd2750e397f3276c509c2344897b6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:32:23 +0300 Subject: [PATCH 0850/2732] Test --- iguana/exchanges/LP_rpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e8d24761c..8def0e8e3 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -254,7 +254,9 @@ cJSON *LP_gettx(char *symbol,bits256 txid) if ( coin->electrum == 0 ) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); - return(bitcoin_json(coin,"getrawtransaction",buf)); + retjson = bitcoin_json(coin,"getrawtransaction",buf); + printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0)); + return(retjson); } else { From 3d25ac4764202191bf71e1c45a1d76965be84f0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:36:47 +0300 Subject: [PATCH 0851/2732] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8def0e8e3..a0f7a2151 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -255,7 +255,8 @@ cJSON *LP_gettx(char *symbol,bits256 txid) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); retjson = bitcoin_json(coin,"getrawtransaction",buf); - printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0)); + if ( jobj(retjson,"vin") == 0 ) + printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0)); return(retjson); } else From cb6ac53b2f057ded5fa94fdfc45f1ec1750a4783 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 17:46:18 +0300 Subject: [PATCH 0852/2732] Test --- iguana/exchanges/LP_remember.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index e1754ffb4..2fac6667e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -771,11 +771,12 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) { printf("[%s] txbytes.%p Apayment.%s\n",txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi])); - if ( rswap->txbytes[txi] != 0 ) + /*if ( rswap->txbytes[txi] != 0 ) rswap->sentflags[txi] = 1; - else if ( (sentobj= LP_gettx(symbol,rswap->txids[txi])) != 0 ) + else*/ if ( (sentobj= LP_gettx(symbol,rswap->txids[txi])) != 0 ) { rswap->sentflags[txi] = 1; + printf("CHECKTX.(%s)\n",jprint(sentobj,0)); free_json(sentobj); LP_refht_update(symbol,rswap->txids[txi]); return(1); From cdf13ab0721c5f79b27a869021783d998a691c85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 18:12:04 +0300 Subject: [PATCH 0853/2732] Test --- iguana/exchanges/LP_remember.c | 46 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 2fac6667e..47907d8c5 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -622,22 +622,30 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t return(rswap->iambob); } -void LP_refht_update(char *symbol,bits256 txid) +int32_t _LP_refht_update(struct iguana_info *coin,int32_t refht) { - int32_t ht; struct iguana_info *coin; + if ( refht > 0 && (coin->firstrefht == 0 || refht < coin->firstrefht) ) + { + if ( coin->firstscanht == 0 || refht < coin->firstscanht ) + coin->firstscanht = coin->lastscanht = refht; + coin->firstrefht = refht; + return(1); + } + return(0); +} + +int32_t LP_refht_update(char *symbol,bits256 txid) +{ + int32_t refht; struct iguana_info *coin; if ( (coin= LP_coinfind(symbol)) != 0 ) // && coin->electrum == 0 { - if ( (ht= LP_txheight(coin,txid)) > 0 && ht > 0 ) + if ( (refht= LP_txheight(coin,txid)) > 0 && refht > 0 ) { - if ( coin->firstrefht == 0 || ht < coin->firstrefht ) - { - if ( coin->firstscanht == 0 || ht < coin->firstscanht ) - coin->firstscanht = coin->lastscanht = ht; - coin->firstrefht = ht; - char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),ht,coin->firstscanht,coin->lastscanht); - } + char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),refht,coin->firstscanht,coin->lastscanht); + return(_LP_refht_update(coin,refht)); } } + return(0); } int32_t LP_swap_load(struct LP_swap_remember *rswap) @@ -712,7 +720,6 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin)); if ( rswap->finishedflag == 0 ) { - LP_refht_update(symbol,txid); if ( (sentobj= LP_gettx(symbol,txid)) == 0 ) { char str2[65]; printf("%s %s ready to broadcast\n",symbol,bits256_str(str2,txid)); @@ -722,6 +729,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) checktxid = jbits256(sentobj,"txid"); if ( bits256_nonz(checktxid) == 0 ) checktxid = jbits256(sentobj,"hash"); + LP_refht_update(symbol,txid); if ( bits256_cmp(checktxid,txid) == 0 ) { //printf(">>>>>> %s txid %s\n",jprint(sentobj,0),bits256_str(str,txid)); @@ -767,20 +775,16 @@ void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) { - cJSON *sentobj; char str[65]; + struct LP_transaction *tx; struct iguana_info *coin; char str[65]; if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) { - printf("[%s] txbytes.%p Apayment.%s\n",txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi])); - /*if ( rswap->txbytes[txi] != 0 ) - rswap->sentflags[txi] = 1; - else*/ if ( (sentobj= LP_gettx(symbol,rswap->txids[txi])) != 0 ) + coin = LP_coinfind(symbol); + printf("[%s] %s txbytes.%p %s\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi])); + if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 && tx->height > 0 ) { rswap->sentflags[txi] = 1; - printf("CHECKTX.(%s)\n",jprint(sentobj,0)); - free_json(sentobj); - LP_refht_update(symbol,rswap->txids[txi]); - return(1); - } + _LP_refht_update(coin,tx->height); + } else LP_refht_update(symbol,rswap->txids[txi]); } return(0); } From 92652b2da6fcdfbe086a4188392e2f63f6764467 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 18:34:57 +0300 Subject: [PATCH 0854/2732] Test --- iguana/exchanges/LP_remember.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 47907d8c5..93df5b907 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -244,7 +244,7 @@ bits256 basilisk_swap_privBn_extract(bits256 *bobrefundp,char *bobcoin,bits256 b return(privBn); } -bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr) +bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr,char *Adest,char *dest) { bits256 spendtxid,txid; char destaddr[64],str[65]; struct iguana_info *coin; cJSON *histobj; if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum != 0 ) @@ -265,14 +265,14 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag { sentflags[utxoind] = 1; printf("utxoind.%d Alice.(%s) Bob.(%s)\n",utxoind,aliceaddr,bobaddr); - if ( aliceaddr != 0 && strcmp(destaddr,aliceaddr) == 0 ) + if ( aliceaddr != 0 && (strcmp(destaddr,aliceaddr) == 0 || strcmp(Adest,destaddr) == 0) ) { printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[alicespent] = 1; sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } - else if ( bobaddr != 0 && strcmp(destaddr,bobaddr) == 0 ) + else if ( bobaddr != 0 && (strcmp(destaddr,bobaddr) == 0 || strcmp(dest,destaddr) == 0) ) { printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[bobspent] = 1; @@ -284,13 +284,13 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); if ( aliceaddr != 0 ) { - sentflags[bobspent] = 1; + sentflags[bobspent] = 0; sentflags[alicespent] = 0; txids[bobspent] = spendtxid; } else if ( bobaddr != 0 ) { - sentflags[alicespent] = 1; + sentflags[alicespent] = 0; sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } @@ -840,8 +840,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } - printf("ALICE 1st refht %s <- %d, scan %d %d\n",alice->symbol,alice->firstrefht,alice->firstscanht,alice->lastscanht); - printf("BOB 1st refht %s <- %d, scan %d %d\n",bob->symbol,bob->firstrefht,bob->firstscanht,bob->lastscanht); + printf("ALICE.(%s) 1st refht %s <- %d, scan %d %d\n",rswap.Adestaddr,alice->symbol,alice->firstrefht,alice->firstscanht,alice->lastscanht); + printf("BOB.(%s) 1st refht %s <- %d, scan %d %d\n",rswap.destaddr,bob->symbol,bob->firstrefht,bob->firstscanht,bob->lastscanht); //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); @@ -855,9 +855,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); - rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); - rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); - rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); + rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest,rswap.Adestaddr,rswap.destaddr); + rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest,rswap.Adestaddr,rswap.destaddr); + rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest,rswap.Adestaddr,rswap.destaddr); rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); if ( rswap.iambob == 0 ) { From 5b570d0f95d4ec58f7faff07b61bad8d4ac36dc4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 18:38:48 +0300 Subject: [PATCH 0855/2732] Test --- iguana/exchanges/LP_utxo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d33889a7b..85f5cd9db 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -671,7 +671,9 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) { height = jint(blockobj,"height"); - char str[65]; printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height); + char str[65]; + if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 ) + printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height); free_json(blockobj); } // else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); likely just unconfirmed free_json(txobj); From 94be3c821f346d9851de0e7e64f40c15c352e179 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 18:42:52 +0300 Subject: [PATCH 0856/2732] Test --- iguana/exchanges/LP_rpc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a0f7a2151..611085e48 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -255,8 +255,11 @@ cJSON *LP_gettx(char *symbol,bits256 txid) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); retjson = bitcoin_json(coin,"getrawtransaction",buf); - if ( jobj(retjson,"vin") == 0 ) + if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 ) + { + //if ( jobj(retjson,"vin") == 0 ) printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0)); + } return(retjson); } else From e8b82b871eae18216cfe0f3fb247849470bbaabd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 18:49:28 +0300 Subject: [PATCH 0857/2732] Test --- iguana/exchanges/LP_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 611085e48..2c0d49888 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -133,7 +133,8 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); if ( retstr != 0 && retstr[0] != 0 ) { - //printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); + if ( strcmp("KMD",coin->symbol) == 0 ) + printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); retjson = cJSON_Parse(retstr); free(retstr); } @@ -255,7 +256,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); retjson = bitcoin_json(coin,"getrawtransaction",buf); - if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 ) + if ( strcmp(symbol,"CHIPS") != 0 && strcmp(symbol,"BTC") != 0 ) { //if ( jobj(retjson,"vin") == 0 ) printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0)); From 831733604d1cdd04f7dc863d6d3ea5ebd6c64354 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 19:04:53 +0300 Subject: [PATCH 0858/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2c0d49888..08aec9037 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -131,10 +131,10 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) if ( coin->electrum == 0 ) { retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); + if ( strcmp("KMD",coin->symbol) == 0 ) + printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); if ( retstr != 0 && retstr[0] != 0 ) { - if ( strcmp("KMD",coin->symbol) == 0 ) - printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); retjson = cJSON_Parse(retstr); free(retstr); } From 6b3d37be0a785945be427fe5ef0d63ab717c4fa5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 19:08:15 +0300 Subject: [PATCH 0859/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 08aec9037..b2c7cf73c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -132,7 +132,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); if ( strcmp("KMD",coin->symbol) == 0 ) - printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr); + printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,params,retstr); if ( retstr != 0 && retstr[0] != 0 ) { retjson = cJSON_Parse(retstr); From 5cc219e5d4d05825ee2898d94caadb2e028cec45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 19:20:01 +0300 Subject: [PATCH 0860/2732] Test --- iguana/exchanges/LP_coins.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 627cbbe2a..079575fe3 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -54,9 +54,9 @@ char *parse_conf_line(char *line,char *field) return(clonestr(line)); } -void LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) +uint16_t LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) { - char *rpcuser,*rpcpassword,*str,line[8192]; + char *rpcuser,*rpcpassword,*str,line[8192]; uint16_t port = 0; rpcuser = rpcpassword = 0; username[0] = password[0] = 0; while ( fgets(line,sizeof(line),fp) != 0 ) @@ -68,6 +68,16 @@ void LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) rpcuser = parse_conf_line(str,(char *)"rpcuser"); else if ( (str= strstr(line,(char *)"rpcpassword")) != 0 ) rpcpassword = parse_conf_line(str,(char *)"rpcpassword"); + else if ( (str= strstr(line,(char *)"rpcport")) != 0 ) + { + str = parse_conf_line(str,(char *)"rpcport"); + if ( str != 0 ) + { + port = atoi(str); + printf("RPCPORT.%u\n",port); + free(str); + } + } } if ( rpcuser != 0 && rpcpassword != 0 ) { @@ -79,6 +89,7 @@ void LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) free(rpcuser); if ( rpcpassword != 0 ) free(rpcpassword); + return(port); } void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name,char *confpath) @@ -143,9 +154,9 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name strcat(fname,str); } -int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name,char *confpath) +uint16_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name,char *confpath,uint16_t origport) { - FILE *fp; char fname[512],username[512],password[512],confname[512]; + FILE *fp; char fname[512],username[512],password[512],confname[512]; uint16_t port = 0; userpass[0] = 0; sprintf(confname,"%s.conf",confroot); if ( 0 ) @@ -160,14 +171,15 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c LP_statefname(fname,symbol,assetname,confname,name,confpath); if ( (fp= fopen(fname,"rb")) != 0 ) { - LP_userpassfp(symbol,username,password,fp); + if ( (port= LP_userpassfp(symbol,username,password,fp)) == 0 ) + port = origport; sprintf(userpass,"%s:%s",username,password); fclose(fp); if ( 0 ) printf("LP_statefname.(%s) <- %s %s %s (%s) (%s)\n",fname,name,symbol,assetname,userpass,confpath); - return((int32_t)strlen(userpass)); + return(port); } else printf("cant open.(%s)\n",fname); - return(-1); + return(0); } cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) @@ -269,7 +281,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) return(coin); } -int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *confpath) +uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *confpath) { char *name2; memset(coin,0,sizeof(*coin)); @@ -296,7 +308,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); } - return(LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath)); + return(LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath,port)); } int32_t LP_isdisabled(char *base,char *rel) @@ -339,7 +351,10 @@ struct iguana_info *LP_coinfind(char *symbol) else if ( strcmp(symbol,"KMD") == 0 ) name = "komodo"; else return(0); - isinactive = LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport,0) < 0; + port = LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport,0); + if ( port == 0 ) + isinactive = 1; + else isinactive = 0; if ( (coin= LP_coinadd(&cdata)) != 0 ) { coin->inactive = isinactive * (uint32_t)time(NULL); From 01811ccbb2f0b438efd8d41e25c45671a21719c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 19:23:17 +0300 Subject: [PATCH 0861/2732] Test --- iguana/exchanges/LP_coins.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 079575fe3..7cebd164f 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -286,7 +286,6 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse char *name2; memset(coin,0,sizeof(*coin)); safecopy(coin->symbol,symbol,sizeof(coin->symbol)); - sprintf(coin->serverport,"127.0.0.1:%u",port); coin->updaterate = (uint32_t)time(NULL); coin->isPoS = isPoS; coin->taddr = taddr; @@ -308,7 +307,9 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); } - return(LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath,port)); + port = LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath,port); + sprintf(coin->serverport,"127.0.0.1:%u",port); + return(port); } int32_t LP_isdisabled(char *base,char *rel) From 45bd5e6e709ea68d23c17f5eed86a814b7aea981 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 19:27:34 +0300 Subject: [PATCH 0862/2732] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_rpc.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 7cebd164f..224e3a435 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -74,7 +74,7 @@ uint16_t LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) if ( str != 0 ) { port = atoi(str); - printf("RPCPORT.%u\n",port); + //printf("RPCPORT.%u\n",port); free(str); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b2c7cf73c..aa6296325 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -131,7 +131,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) if ( coin->electrum == 0 ) { retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); - if ( strcmp("KMD",coin->symbol) == 0 ) + if ( 0 && strcmp("KMD",coin->symbol) == 0 ) printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,params,retstr); if ( retstr != 0 && retstr[0] != 0 ) { @@ -256,11 +256,6 @@ cJSON *LP_gettx(char *symbol,bits256 txid) { sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid)); retjson = bitcoin_json(coin,"getrawtransaction",buf); - if ( strcmp(symbol,"CHIPS") != 0 && strcmp(symbol,"BTC") != 0 ) - { - //if ( jobj(retjson,"vin") == 0 ) - printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0)); - } return(retjson); } else From 7098200f6a6faed20a3ecd8ff5b48ea0d84ed26e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 19:42:38 +0300 Subject: [PATCH 0863/2732] Test --- iguana/exchanges/LP_remember.c | 12 +++++------- iguana/exchanges/LP_utxo.c | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 93df5b907..edaeb1701 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -622,10 +622,11 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t return(rswap->iambob); } -int32_t _LP_refht_update(struct iguana_info *coin,int32_t refht) +int32_t _LP_refht_update(struct iguana_info *coin,bits256 txid,int32_t refht) { if ( refht > 0 && (coin->firstrefht == 0 || refht < coin->firstrefht) ) { + char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),refht,coin->firstscanht,coin->lastscanht); if ( coin->firstscanht == 0 || refht < coin->firstscanht ) coin->firstscanht = coin->lastscanht = refht; coin->firstrefht = refht; @@ -637,13 +638,10 @@ int32_t _LP_refht_update(struct iguana_info *coin,int32_t refht) int32_t LP_refht_update(char *symbol,bits256 txid) { int32_t refht; struct iguana_info *coin; - if ( (coin= LP_coinfind(symbol)) != 0 ) // && coin->electrum == 0 + if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { if ( (refht= LP_txheight(coin,txid)) > 0 && refht > 0 ) - { - char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),refht,coin->firstscanht,coin->lastscanht); - return(_LP_refht_update(coin,refht)); - } + return(_LP_refht_update(coin,txid,refht)); } return(0); } @@ -783,7 +781,7 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 && tx->height > 0 ) { rswap->sentflags[txi] = 1; - _LP_refht_update(coin,tx->height); + _LP_refht_update(coin,rswap->txids[txi],tx->height); } else LP_refht_update(symbol,rswap->txids[txi]); } return(0); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 85f5cd9db..8fa11b1ab 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -671,9 +671,9 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) { height = jint(blockobj,"height"); - char str[65]; - if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 ) - printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height); + //char str[65]; + //if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 ) + // printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height); free_json(blockobj); } // else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); likely just unconfirmed free_json(txobj); From dd7e1e756ebba1c6fb7e91d946ba3bdb92b12a19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 20:12:27 +0300 Subject: [PATCH 0864/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 981a65e20..813d0e20f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -416,7 +416,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t needpings,height,nonz = 0; + struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t needpings,j,height,nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -511,12 +511,17 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( (coin->lastscanht % 1000) == 0 ) printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - if ( LP_blockinit(coin,coin->lastscanht) < 0 ) + for (j=0; j<100; j++) { - printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); - continue; + if ( LP_blockinit(coin,coin->lastscanht) < 0 ) + { + printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); + break; + } + coin->lastscanht++; } - coin->lastscanht++; + if ( j < 100 ) + continue; //LP_getestimatedrate(coin); break; } From 0c37a6dff7964bd36523d336ef71ffecf6d1ab1e Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 12 Oct 2017 21:15:37 +0400 Subject: [PATCH 0865/2732] add more informative logging when init and privkey updates --- iguana/exchanges/LP_utxos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9a67d2cda..35f8d2c1c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -768,8 +768,11 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) initonly = (passphrase != 0); memset(privkey.bytes,0,sizeof(privkey)); memset(pubkey.bytes,0,sizeof(pubkey)); + printf("Total coins: %d\n", HASH_COUNT(LP_coins)); + int num_iter = 0; HASH_ITER(hh,LP_coins,coin,tmp) { + printf("LP_privkey_updates [%02d / %02d]\n", num_iter++, HASH_COUNT(LP_coins)); if ( initonly != 0 ) { coin->counter = 0; From b1ea59a6bff205eeb8101f97a4169eb7fdc8d406 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 20:49:30 +0300 Subject: [PATCH 0866/2732] Skip coins without rpc access --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9a67d2cda..7dab46c3b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -742,7 +742,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan userpub = curve25519(userpass,curve25519_basepoint9()); printf("userpass.(%s)\n",bits256_str(G.USERPASS,userpub)); } - if ( coin->electrum == 0 ) + if ( coin->electrum == 0 && coin->userpass[0] != 0 ) { LP_listunspent_issue(coin->symbol,coin->smartaddr); if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) From 0e8cd85c01adcf2df1bd0b37b776fa8ddc466341 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 12 Oct 2017 21:53:09 +0400 Subject: [PATCH 0867/2732] added readme for Windows version (it will be continued) --- README_decker.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 README_decker.md diff --git a/README_decker.md b/README_decker.md new file mode 100644 index 000000000..a9cccd878 --- /dev/null +++ b/README_decker.md @@ -0,0 +1,25 @@ +## What's this? + +This is a first build of **MarketMaker** app from barterDEX for Windows (64-bit) platform. This branch includes all that you need to build marketmaker for Windows. 64-bit build uses MSVC 2015 as a default C/C++ compiler, to build - simply open *marketmaker.sln* project file via File -> Open -> Project/Solution ... next choose Release / x64 configuration and build solution. Your binaries will be placed x64\Release folder. To run marketmaker you also need following dll libraries: + +- libcurl.dll +- nanomsg.dll +- curl.exe (win64 curl binary, used is scripts) + +It already included in this branch. + +## How to use? + +Please, refer to original barterDEX documentation and Komodo Platform + SuperNET resources to learn how to work this it. Later i will add some examples and useful links here. + +Important, coins.json on Windows shouldn't contain coins which haven't running daemons. Add to coins.json only coins that you plan to use, in other case starting marketmaker will too long: about 4 seconds on each not-running coin. + +Get the latest binary release from release section and step-by-step run cmd files: + +- 1-client.cmd - this runs marketmaker with passphrase taken from a passphrase file. +- 2-getuserpass.cmd - this will save and output your userpass in userpass file for future use. +- 3-orderbook.cmd - to get an orderbook (if u downloaded binary release from release section - it's have only REVS in coins.json and orderbook will be shown at KMD/REVS coins pair). + +Other scripts will be post later ... this is just for example that it works. + + \ No newline at end of file From 70e327ac99506ddec424f52de901ffdafa3c91cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 21:20:23 +0300 Subject: [PATCH 0868/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_remember.c | 19 ++++++++++++++++--- iguana/exchanges/LP_swap.c | 11 +++++++++-- iguana/exchanges/LP_utxos.c | 2 +- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d1a85727e..5faed5c43 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -269,7 +269,7 @@ struct basilisk_swap struct basilisk_swapmessage *messages; int32_t nummessages,sentflag; char Bdeposit[64],Bpayment[64]; uint64_t otherdeck[INSTANTDEX_DECKSIZE][2],deck[INSTANTDEX_DECKSIZE][2]; - uint8_t persistent_pubkey33[33],changermd160[20],pad[15],verifybuf[100000]; + uint8_t persistent_pubkey33[33],persistent_other33[33],changermd160[20],pad[15],verifybuf[100000]; }; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index edaeb1701..c50a47853 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -152,7 +152,10 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,",\"otherfee\":\"%s\"",bits256_str(str,swap->otherfee.I.actualtxid)); if ( bits256_nonz(swap->myfee.I.actualtxid) != 0 ) fprintf(fp,",\"myfee\":\"%s\"",bits256_str(str,swap->myfee.I.actualtxid)); - fprintf(fp,",\"dest33\":\""); + fprintf(fp,",\"other33\":\""); + for (i=0; i<33; i++) + fprintf(fp,"%02x",swap->persistent_other33[i]); + fprintf(fp,"\",\"dest33\":\""); for (i=0; i<33; i++) fprintf(fp,"%02x",swap->persistent_pubkey33[i]); fprintf(fp,"\"}\n"); @@ -463,7 +466,7 @@ struct LP_swap_remember uint64_t Atxfee,Btxfee,srcamount,destamount; int64_t values[sizeof(txnames)/sizeof(*txnames)]; uint32_t requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; - uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],Predeemscript[1024],Dredeemscript[1024]; + uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; char src[64],dest[64],destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; }; @@ -508,7 +511,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t quoteid) { - char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; uint32_t r,q; int32_t i,j,n; + char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; uint32_t r,q; int32_t i,j,n; uint8_t other33[33]; memset(rswap,0,sizeof(*rswap)); rswap->requestid = requestid; rswap->quoteid = quoteid; @@ -537,6 +540,16 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t // printf("%02x",pubkey33[i]); //printf(" <- %s dest33\n",dest33); } + if ( (dest33= jstr(item,"other33")) != 0 && strlen(dest33) == 66 ) + { + decode_hex(other33,33,dest33); + for (i=0; i<33; i++) + if ( other33[i] != 0 ) + break; + if ( i < 33 ) + memcpy(rswap->other33,other33,33); + //printf(" <- %s dest33\n",dest33); + } if ( (rswap->plocktime= juint(item,"plocktime")) == 0 ) rswap->plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); if ( (rswap->dlocktime= juint(item,"dlocktime")) == 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 22bf882aa..79a495c59 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -177,6 +177,8 @@ uint32_t basilisk_requestid(struct basilisk_request *rp) int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) { int32_t i,datalen = 0; + for (i=0; i<33; i++) + data[datalen++] = swap->persistent_pubkey33[i]; for (i=0; ideck)/sizeof(swap->deck[0][0]); i++) datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->deck[i>>1][i&1]),&swap->deck[i>>1][i&1]); return(datalen); @@ -184,9 +186,14 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - int32_t i,len = 0; - if ( datalen == sizeof(swap->otherdeck) ) + int32_t i,nonz=0,len = 0; uint8_t other33[33]; + if ( datalen == sizeof(swap->otherdeck)+33 ) { + for (i=0; i<33; i++) + if ( (other33[i]= data[len++]) != 0 ) + nonz++; + if ( nonz > 8 ) + memcpy(swap->persistent_other33,other33,33); for (i=0; iotherdeck)/sizeof(swap->otherdeck[0][0]); i++) len += iguana_rwnum(0,&data[len],sizeof(swap->otherdeck[i>>1][i&1]),&swap->otherdeck[i>>1][i&1]); return(0); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7dab46c3b..fadd1b6de 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -355,7 +355,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t val2 = value2; } dispflag = 0; - if ( dispflag != 0 ) + //if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; if ( (utxo= LP_utxofinds(iambob,txid,vout,txid2,vout2)) != 0 ) From 38440265eed9f38cf27d64db9b05da6dc0822eb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 21:32:07 +0300 Subject: [PATCH 0869/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fadd1b6de..a69890fc6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -726,7 +726,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); LP_privkeyadd(privkey,G.LP_myrmd160); - if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) + if ( 1 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( G.counter++ == 0 ) { From 0057e22289cf3af7414365d17d01190987f1c1ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 21:37:07 +0300 Subject: [PATCH 0870/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a69890fc6..fadd1b6de 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -726,7 +726,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); LP_privkeyadd(privkey,G.LP_myrmd160); - if ( 1 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) + if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( G.counter++ == 0 ) { From c93cdc8f0204fb4fa27f8362511d23a355012bc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 21:45:51 +0300 Subject: [PATCH 0871/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fadd1b6de..a69890fc6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -726,7 +726,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); LP_privkeyadd(privkey,G.LP_myrmd160); - if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) + if ( 1 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( G.counter++ == 0 ) { From 56c23183544f2c785458d33c6d2d2c0bbf4bc140 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 21:46:02 +0300 Subject: [PATCH 0872/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a69890fc6..fadd1b6de 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -726,7 +726,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); LP_privkeyadd(privkey,G.LP_myrmd160); - if ( 1 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) + if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( G.counter++ == 0 ) { From 37ae216909ee6e1e78547f5e19d8a28ddbdbc90e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 22:30:15 +0300 Subject: [PATCH 0873/2732] Test --- iguana/exchanges/LP_commands.c | 11 +++++++++-- iguana/exchanges/LP_utxo.c | 2 -- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ecf6de1a7..ec5a4eda7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -372,8 +372,15 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"listunspent") == 0 ) { if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) - return(jprint(LP_address_utxos(ptr,jstr(argjson,"address"),1),1)); - else return(clonestr("{\"error\":\"cant find coind\"}")); + { + char *coinaddr; + if ( (coinaddr= jstr(argjson,"address")) != 0 ) + { + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); + return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); + } else return(clonestr("{\"error\":\"no address specified\"}")); + } else return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"balance") == 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8fa11b1ab..3572f7551 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -433,8 +433,6 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) v = jint(item,"tx_pos"); height = jint(item,"height"); val = j64bits(item,"value"); - //if ( strcmp(coin->symbol,"LBC") == 0 ) - // printf("(%s)\n",jprint(item,0)); if ( coin->electrum == 0 && (txobj= LP_gettxout(coin->symbol,coinaddr,txid,v)) != 0 ) { value = LP_value_extract(txobj,0); From 4fb9f0038c36a528aaabdb4987003a4b09ab2974 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 22:46:53 +0300 Subject: [PATCH 0874/2732] Test --- iguana/exchanges/LP_utxo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3572f7551..d9ad2b012 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -157,6 +157,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { + char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) From 6c5fac6cf66a92a436133edbed1d792f642b2f40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 22:55:15 +0300 Subject: [PATCH 0875/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fadd1b6de..7dab46c3b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -355,7 +355,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t val2 = value2; } dispflag = 0; - //if ( dispflag != 0 ) + if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; if ( (utxo= LP_utxofinds(iambob,txid,vout,txid2,vout2)) != 0 ) From 933b24d687a3c7cb014e1e0d8bca703797909de9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 22:59:36 +0300 Subject: [PATCH 0876/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 813d0e20f..694901cf4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -450,6 +450,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( peer->diduquery == 0 ) { LP_peer_pricesquery(peer); + LP_utxos_sync(peer); peer->diduquery = now; } if ( peer->needping != 0 ) From f3c6321b58cf37d94d1b72dadfe600318df9bace Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 23:10:05 +0300 Subject: [PATCH 0877/2732] Test --- iguana/exchanges/orderbook | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/orderbook b/iguana/exchanges/orderbook index 0f6e553b4..a61784991 100755 --- a/iguana/exchanges/orderbook +++ b/iguana/exchanges/orderbook @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"JUMBLR\",\"rel\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"REVS\",\"rel\":\"KMD\"}" From 4e7d7c2b4e0d025d96558678264d6e6a0963e380 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 23:15:37 +0300 Subject: [PATCH 0878/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ec5a4eda7..602c5a598 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -378,6 +378,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); + LP_listunspent_issue(coin,coinaddr); return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); } else return(clonestr("{\"error\":\"no address specified\"}")); } else return(clonestr("{\"error\":\"cant find coind\"}")); From e0476823fc02327374c9d4d77b62d6702c5fb6d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 23:23:43 +0300 Subject: [PATCH 0879/2732] Test --- iguana/exchanges/LP_prices.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b7c9e04b0..9ceb2623e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -770,7 +770,12 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { jaddi(array,LP_orderbookjson(rel,bids[i])); if ( bids[i]->numutxos == 0 )//|| relcoin->electrum == 0 ) - LP_address(relcoin,bids[i]->coinaddr), n++; + { + if ( relcoin->electrum == 0 ) + LP_listunspent_issue(rel,bids[i]->coinaddr); + else LP_address(relcoin,bids[i]->coinaddr); + n++; + } free(bids[i]); bids[i] = 0; } @@ -783,7 +788,12 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { jaddi(array,LP_orderbookjson(base,asks[i])); if ( asks[i]->numutxos == 0 )//|| basecoin->electrum == 0 ) - LP_address(basecoin,asks[i]->coinaddr), n++; + { + if ( basecoin->electrum == 0 ) + LP_listunspent_issue(base,asks[i]->coinaddr); + else LP_address(basecoin,asks[i]->coinaddr); + n++; + } free(asks[i]); asks[i] = 0; } From c58876fe8875c11ff3ab7767866082452bf5d031 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 23:44:01 +0300 Subject: [PATCH 0880/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 943a755d6..ccbe56610 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -505,6 +505,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; + printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) From c9a5374bdff1a5dc507cb6ab3a595b030af4082d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 23:55:48 +0300 Subject: [PATCH 0881/2732] Test --- iguana/exchanges/LP_ordermatch.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ccbe56610..a02bf2b84 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -500,24 +500,27 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr); } mini = -1; - if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) + if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,utxos,m,targetval)) >= 0 ) { up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); - if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) + if ( (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { - if ( up != 0 && (up2= utxos[mini]) != 0 ) + if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) + if ( up != 0 && (up2= utxos[mini]) != 0 ) { - utxo->S.satoshis = targetval; - char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); - return(utxo); + if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) + { + utxo->S.satoshis = targetval; + char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); + return(utxo); + } } - } - } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); + } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); + } else printf("failed ratio test %.8f\n",(double)utxos[mini]->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d ratio %.8f\n",dstr(targetval),mini,(double)utxos[mini]->U.value/targetval); } else printf("no utxos pass LP_address_utxo_ptrs filter\n"); From a5c27d5e7ec91ebee9b2b6595d18057071ef480a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 00:08:17 +0300 Subject: [PATCH 0882/2732] Test --- iguana/exchanges/LP_ordermatch.c | 34 ++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a02bf2b84..52b5b1639 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -451,25 +451,29 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u } for (i=0; ispendheight == 0 ) + if ( (up= utxos[i]) != 0 ) { - if ( coin->electrum != 0 ) + dist = (up->U.value - targetval); + printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); + if (up->spendheight == 0 ) { - if (up->SPV == 0 ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); - if ( up->SPV < 0 ) + if ( coin->electrum != 0 ) { - printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); - continue; + if (up->SPV == 0 ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + if ( up->SPV < 0 ) + { + printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); + continue; + } + } + if ( dist >= 0 && dist < mindist ) + { + printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); + mini = i; + mindist = dist; } - } - dist = (up->U.value - targetval); - if ( dist >= 0 && dist < mindist ) - { - printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); - mini = i; - mindist = dist; } } } From 48ad29c5b9b8f10c671e8d4b2b65d355a5bf2db8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 00:18:25 +0300 Subject: [PATCH 0883/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 52b5b1639..089d2f299 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -449,6 +449,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u if ( (backupep= ep->prev) == 0 ) backupep = ep; } + printf("LP_nearest_utxovalue %s utxos[%d]\n",coin->symbol,n); for (i=0; i Date: Fri, 13 Oct 2017 00:31:13 +0300 Subject: [PATCH 0884/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 089d2f299..e6ef44ac0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -456,7 +456,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u { dist = (up->U.value - targetval); printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); - if (up->spendheight == 0 ) + if ( up->spendheight <= 0 ) { if ( coin->electrum != 0 ) { From ca322e9e66cb39b604e28b66fa265d3e00bda95d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 00:35:20 +0300 Subject: [PATCH 0885/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e6ef44ac0..73e25c4b7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -449,13 +449,13 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u if ( (backupep= ep->prev) == 0 ) backupep = ep; } - printf("LP_nearest_utxovalue %s utxos[%d]\n",coin->symbol,n); + //printf("LP_nearest_utxovalue %s utxos[%d]\n",coin->symbol,n); for (i=0; iU.value - targetval); - printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); + //printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); if ( up->spendheight <= 0 ) { if ( coin->electrum != 0 ) @@ -478,7 +478,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u } } } - printf("return mini.%d\n",mini); + //printf("return mini.%d\n",mini); return(mini); } @@ -511,7 +511,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; - printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); + //printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); if ( (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) { if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d9ad2b012..982e45cbb 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -157,7 +157,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout); + //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) From 9d01cfda47245d663ad866f05fc05c66c1b6b769 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 01:55:39 +0300 Subject: [PATCH 0886/2732] Test --- iguana/exchanges/coins | 3 ++- iguana/exchanges/coins.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 25af22269..356346d6a 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,3 @@ -export coins="[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" diff --git a/iguana/exchanges/coins.json b/iguana/exchanges/coins.json index d97e39c22..576547207 100644 --- a/iguana/exchanges/coins.json +++ b/iguana/exchanges/coins.json @@ -1,3 +1,3 @@ -[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}] - +[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}] +#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From c922fea7ce71f90886f195000585bdd15462b75e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:06:19 +0300 Subject: [PATCH 0887/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 73e25c4b7..a99b1bafd 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -512,7 +512,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; //printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); - if ( (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 ) + if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) { @@ -526,9 +526,9 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** } } } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); - } else printf("failed ratio test %.8f\n",(double)utxos[mini]->U.value/targetval); + } else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) - printf("targetval %.8f mini.%d ratio %.8f\n",dstr(targetval),mini,(double)utxos[mini]->U.value/targetval); + printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } else printf("no utxos pass LP_address_utxo_ptrs filter\n"); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); return(0); From 03962717d20800ebd6b6ad5540f8fb01d5fea022 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:09:49 +0300 Subject: [PATCH 0888/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a99b1bafd..3cb45116e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -851,7 +851,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(&zero,0,sizeof(zero)); msg2 = clonestr(msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); + //LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); //LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(2); From be0257672fc1decdf241b986d4a7df4dc3db376e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:32:33 +0300 Subject: [PATCH 0889/2732] Test --- iguana/exchanges/LP_swap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 79a495c59..f71256d87 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -591,7 +591,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } - if ( j64bits(vout,"satoshis") >= rawtx->I.amount+txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( j64bits(vout,"satoshis") >= rawtx->I.amount && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { @@ -607,7 +607,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); } - } else printf("%s ERROR.(%s) txfees.[%.8f %.8f: %.8f] amount.%.8f -> %.8f\n",rawtx->name,jprint(txobj,0),dstr(swap->I.Atxfee),dstr(swap->I.Btxfee),dstr(txfee),dstr(rawtx->I.amount),dstr(rawtx->I.amount)-dstr(txfee)); + } else printf("%s satoshis %.8f ERROR.(%s) txfees.[%.8f %.8f: %.8f] amount.%.8f -> %.8f\n",rawtx->name,dstr(j64bits(vout,"satoshis")),jprint(txobj,0),dstr(swap->I.Atxfee),dstr(swap->I.Btxfee),dstr(txfee),dstr(rawtx->I.amount),dstr(rawtx->I.amount)-dstr(txfee)); } free_json(txobj); } @@ -1033,14 +1033,14 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin.taddr,swap->alicecoin.taddr); if ( swap->I.iambob != 0 ) { - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis),0,0,jumblrflag); - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis),0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + swap->bobcoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + swap->alicecoin.txfee,0,0,jumblrflag); bobpub33 = pubkey33; } else { - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis),0,0,jumblrflag); - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis),0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + swap->bobcoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + swap->alicecoin.txfee,0,0,jumblrflag); alicepub33 = pubkey33; } basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin.txfee,4,0,jumblrflag); From 89d66662bbe404a0adc2cbb9a296310db7f1cbc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:52:52 +0300 Subject: [PATCH 0890/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 694901cf4..9bc850539 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -308,7 +308,7 @@ void command_rpcloop(void *myipaddr) //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) - usleep(10000); + usleep(10); } } From 0725deb0ffcd16ae6053f2a37648c4f4ce3c1381 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:53:32 +0300 Subject: [PATCH 0891/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9bc850539..0d6d6ec1b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -308,7 +308,11 @@ void command_rpcloop(void *myipaddr) //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) - usleep(10); + { + if ( IAMLP != 0 ) + usleep(10); + else usleep(1000); + } } } From 2e011b6ab2762d74921223472f33f8f813390fc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:55:47 +0300 Subject: [PATCH 0892/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0d6d6ec1b..627f507ae 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -524,6 +524,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int break; } coin->lastscanht++; + if ( coin->lastscanht == coin->longestchain+1 ) + break; } if ( j < 100 ) continue; From 45cae6913d8d4890b588e895e35e9efb37e25081 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 03:03:48 +0300 Subject: [PATCH 0893/2732] Test --- iguana/exchanges/LP_swap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index f71256d87..0f839b6af 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -674,8 +674,8 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t char *retstr; cJSON *retjson=0; uint32_t divisor=8,expiration = (uint32_t)(time(NULL) + duration); printf("wait %d:%d for SWAP.(r%u/q%u) to complete\n",duration,sleeptime,requestid,quoteid); sleep(10); - if ( sleeptime < divisor*60 ) - sleeptime = divisor * 60; + //if ( sleeptime < divisor*60 ) + // sleeptime = divisor * 60; while ( time(NULL) < expiration ) { if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) @@ -690,9 +690,10 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t } free(retstr); } - sleep(sleeptime/divisor); - if ( divisor > 1 ) - divisor--; + sleep(sleeptime); + //sleep(sleeptime/divisor); + //if ( divisor > 1 ) + // divisor--; } if ( retjson != 0 ) { @@ -759,7 +760,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,300); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); } } } @@ -823,7 +824,7 @@ void LP_aliceloop(void *_swap) } if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,300); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); } } } From c654fe0b94e4e0ef98406306fc50f8f31a6d47d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 11:02:23 +0300 Subject: [PATCH 0894/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3cb45116e..ab8d00f5f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -455,7 +455,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u if ( (up= utxos[i]) != 0 ) { dist = (up->U.value - targetval); - //printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); + printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); if ( up->spendheight <= 0 ) { if ( coin->electrum != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7dab46c3b..2eb7b02de 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -345,7 +345,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t } if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid2,vout2,0)) <= 0 ) { - printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); + printf("LP_utxoadd reject2 numconfirms.%d %s %s/v%d\n",numconfirms,symbol,bits256_str(str,txid2),vout2); return(0); } } From a1d1d05cd5df9c53abaa963929f34982c4ff96f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 11:16:44 +0300 Subject: [PATCH 0895/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ab8d00f5f..747353a2e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -449,7 +449,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u if ( (backupep= ep->prev) == 0 ) backupep = ep; } - //printf("LP_nearest_utxovalue %s utxos[%d]\n",coin->symbol,n); + printf("LP_nearest_utxovalue %s utxos[%d] target %.8f\n",coin->symbol,n,dstr(targetval)); for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); + printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) From 7f6ce284140f66e0762aa1c84c78cfa32e6d2faf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 11:20:09 +0300 Subject: [PATCH 0896/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 747353a2e..5cf8094f8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -478,7 +478,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u } } } - //printf("return mini.%d\n",mini); + printf("return mini.%d\n",mini); return(mini); } @@ -511,7 +511,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** up = utxos[mini]; utxos[mini] = 0; targetval2 = (targetval / 8) * 9 + 2*txfee; - printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(utxos[mini]->U.value),dstr(targetval),dstr(targetval2),(double)utxos[mini]->U.value/targetval); + printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) From dbcbb5fd79d26cb842b5ff46b363cf494ce210d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 11:47:05 +0300 Subject: [PATCH 0897/2732] Test --- iguana/exchanges/LP_utxo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 982e45cbb..50bbfc6c8 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -698,10 +698,12 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int if ( (txobj= LP_gettxout(symbol,coinaddr,txid,vout)) != 0 ) { numconfirms = jint(txobj,"confirmations"); + printf("LP_numconfirms.%d (%s)\n",numconfirms,jprint(txobj,0)); free_json(txobj); } else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) numconfirms = 0; + else printf("LP_numconfirms cant gettxout and ignoring mempool\n"); } else { From 5d5ff5d7a2fe3da5bf7dfa3bb3e466087e4e227f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 14:30:13 +0300 Subject: [PATCH 0898/2732] Test --- iguana/exchanges/LP_utxo.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 50bbfc6c8..6baa2d858 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -333,7 +333,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0; + cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -350,11 +350,20 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum { if ( up->spendheight <= 0 && up->U.height > 0 ) { - if ( backupep != 0 && up->SPV == 0 ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - jaddi(array,LP_address_item(coin,up,electrumret)); - n++; - total += up->U.value; + if ( coin->electrum == 0 ) + { + if ( (txobj= LP_gettxout(coin->symbol,coinaddr,up->U.txid,up->U.vout)) == 0 ) + up->spendheight = 1; + else free_json(txobj); + } + if ( up->spendheight <= 0 ) + { + if ( backupep != 0 && up->SPV == 0 ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + jaddi(array,LP_address_item(coin,up,electrumret)); + n++; + total += up->U.value; + } //printf("new array %s\n",jprint(array,0)); } } @@ -698,12 +707,10 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int if ( (txobj= LP_gettxout(symbol,coinaddr,txid,vout)) != 0 ) { numconfirms = jint(txobj,"confirmations"); - printf("LP_numconfirms.%d (%s)\n",numconfirms,jprint(txobj,0)); free_json(txobj); } else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) numconfirms = 0; - else printf("LP_numconfirms cant gettxout and ignoring mempool\n"); } else { From f26a8016cedf19a733dabaa9f77a8bd4ebab41f0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 14:51:40 +0300 Subject: [PATCH 0899/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- iguana/exchanges/listunspent | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 627f507ae..b3c2375e3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -321,7 +321,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; HASH_ITER(hh,LP_coins,coin,ctmp) { - if ( coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) + if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; total = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index aa6296325..93f9e2fbb 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -425,7 +425,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); //printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); - if ( coin == 0 || coin->inactive != 0 ) + if ( coin == 0 || (IAMLP == 0 && coin->inactive != 0) ) return(cJSON_Parse("{\"error\":\"no coin\"}")); if ( coin->electrum == 0 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2eb7b02de..cd6015436 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -778,7 +778,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); } //printf("i.%d of %d\n",i,LP_numcoins); - else if ( coin->inactive == 0 ) + else if ( IAMLP == 0 || coin->inactive == 0 ) { if ( LP_privkey_init(pubsock,coin,G.LP_mypriv25519,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); diff --git a/iguana/exchanges/listunspent b/iguana/exchanges/listunspent index aa7ca4963..ddb830d7e 100755 --- a/iguana/exchanges/listunspent +++ b/iguana/exchanges/listunspent @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"BTC\",\"address\":\"1DPDsPCNNCF5SHhPPrddXcJe78rM6CBcH3\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"CHIPS\",\"address\":\"RAsvnHfueHcbQTfX69rc9oMEG65zwrk73p\"}" From 389c05b8dbfe3690cab445b4fc09e7e23e6c3155 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 14:54:28 +0300 Subject: [PATCH 0900/2732] Test --- iguana/exchanges/enable | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/enable b/iguana/exchanges/enable index d6a287b3a..75c0bc838 100755 --- a/iguana/exchanges/enable +++ b/iguana/exchanges/enable @@ -1,3 +1,4 @@ #!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"REVS\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"CHIPS\"}" From 381817fe8f48986a5cb439c11061a07e6fefe5f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 14:58:03 +0300 Subject: [PATCH 0901/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index cd6015436..62e0757bf 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -512,9 +512,9 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri { int32_t enable_utxos = 0; char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,flag=0,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; - if ( coin == 0 || coin->inactive != 0 ) + if ( coin == 0 || (IAMLP == 0 && coin->inactive != 0) ) { - printf("coin not active\n"); + //printf("coin not active\n"); return(0); } //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); From 895b22dba573c071b917ded222c6845783676aef Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:02:01 +0300 Subject: [PATCH 0902/2732] Test --- iguana/exchanges/listunspent | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/listunspent b/iguana/exchanges/listunspent index ddb830d7e..9b03640f3 100755 --- a/iguana/exchanges/listunspent +++ b/iguana/exchanges/listunspent @@ -1,3 +1,2 @@ -#!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"CHIPS\",\"address\":\"RAsvnHfueHcbQTfX69rc9oMEG65zwrk73p\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"CHIPS\",\"address\":\"RMfQwu5ey23eWJ4as2ckd8dqsQJwo836ny\"}" From ea81c79c9ec26d98930d76701f5b4449789518ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:14:29 +0300 Subject: [PATCH 0903/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_utxo.c | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 602c5a598..9137bb923 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -362,7 +362,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b3c2375e3..f3581b7f1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -362,15 +362,15 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( j == m ) { - //printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); + printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) free(retstr2); posted++; } } - if ( 0 && posted != 0 ) + if ( 1 && posted != 0 ) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - } //else printf("%s matches\n",peer->ipaddr); + } else printf("%s matches\n",peer->ipaddr); free_json(array2); } free(retstr); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6baa2d858..3c4b9213f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -189,7 +189,7 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { - struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; + struct LP_address *ap; cJSON *txobj; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( coin == 0 ) return(0); @@ -216,6 +216,16 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, } if ( flag == 0 ) { + if ( coin->electrum == 0 ) + { + if ( (txobj= LP_gettxout(coin->symbol,coinaddr,up->U.txid,up->U.vout)) == 0 ) + { + if ( up->spendheight <= 0 ) + up->spendheight = 1; + printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,up->U.txid),up->U.vout); + return(0); + } else free_json(txobj); + } up = calloc(1,sizeof(*up)); up->U.txid = txid; up->U.vout = vout; @@ -226,7 +236,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 0 && height > 0 ) + if ( 1 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From 86425b77058f6a9979ca9f62496f3d1128c4bd49 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:22:21 +0300 Subject: [PATCH 0904/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3c4b9213f..293bfa676 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -218,11 +218,11 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( coin->electrum == 0 ) { - if ( (txobj= LP_gettxout(coin->symbol,coinaddr,up->U.txid,up->U.vout)) == 0 ) + if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { if ( up->spendheight <= 0 ) up->spendheight = 1; - printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,up->U.txid),up->U.vout); + printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,txid),vout); return(0); } else free_json(txobj); } From 04f16ba501414d800d61e10321b39bcd776b4fea Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:27:15 +0300 Subject: [PATCH 0905/2732] Test --- iguana/exchanges/LP_utxo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 293bfa676..7df7bab78 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -220,8 +220,6 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - if ( up->spendheight <= 0 ) - up->spendheight = 1; printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,txid),vout); return(0); } else free_json(txobj); From 79b5376fe1f5e60ffe26d79e895cd4bdd4fe16de Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:29:59 +0300 Subject: [PATCH 0906/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7df7bab78..85b3b2ac4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -220,7 +220,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,txid),vout); + //printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,txid),vout); return(0); } else free_json(txobj); } From b6364d9a82058274b0809e47d5e26ad73aa22196 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:39:24 +0300 Subject: [PATCH 0907/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f3581b7f1..9f21e2fba 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -323,6 +323,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) { if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; + printf("UTXO sync %s -> %s\n",coin->symbol,peer->ipaddr); total = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) @@ -362,7 +363,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( j == m ) { - printf("%s missing %s\n",peer->ipaddr,jprint(item,0)); + printf("%s missing %s %s\n",peer->ipaddr,coin->symbol,jprint(item,0)); if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) free(retstr2); posted++; @@ -441,15 +442,15 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 1000) == 0) ) + if ( now > peer->lastpeers+60 || (rand() % 10000) == 0 ) { - peer->lastpeers = now; if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; LP_utxos_sync(peer); } + peer->lastpeers = now; } if ( peer->diduquery == 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 85b3b2ac4..eedac4669 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -234,7 +234,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 1 && height > 0 ) + if ( 0 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From c9a4bdefdb987b2834791249b3150f59636005e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:46:26 +0300 Subject: [PATCH 0908/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9f21e2fba..1dfb9765a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -323,9 +323,10 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) { if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; - printf("UTXO sync %s -> %s\n",coin->symbol,peer->ipaddr); + //printf("UTXO sync %s -> %s\n",coin->symbol,peer->ipaddr); total = 0; - LP_listunspent_both(coin->symbol,coin->smartaddr); + if ( LP_listunspent_both(coin->symbol,coin->smartaddr) == 0 ) + continue; if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) @@ -371,7 +372,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( 1 && posted != 0 ) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - } else printf("%s matches\n",peer->ipaddr); + } else printf("%s matches %s\n",peer->ipaddr,coin->symbol); free_json(array2); } free(retstr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5cf8094f8..b44c8c96b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -724,7 +724,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_listunspent_both(char *symbol,char *coinaddr) { int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin != 0 && coin->inactive == 0 ) + if ( coin != 0 && (IAMLP == 0 && coin->inactive == 0) ) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { From 4ffc93afdb4db8dad7e9fbd482148ab0190a2495 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:52:03 +0300 Subject: [PATCH 0909/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1dfb9765a..75ca62736 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -323,10 +323,10 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) { if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; - //printf("UTXO sync %s -> %s\n",coin->symbol,peer->ipaddr); total = 0; - if ( LP_listunspent_both(coin->symbol,coin->smartaddr) == 0 ) + if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr)) == 0 ) continue; + printf("UTXO sync.%d %s -> %s\n",j,coin->symbol,peer->ipaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b44c8c96b..0bc2e2381 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -724,7 +724,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_listunspent_both(char *symbol,char *coinaddr) { int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin != 0 && (IAMLP == 0 && coin->inactive == 0) ) + if ( coin != 0 )//&& (IAMLP != 0 || coin->inactive == 0) ) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { From 78111b1e47a4c2cc0f56758348c015ba499e2539 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 15:56:10 +0300 Subject: [PATCH 0910/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 75ca62736..95c07dfdf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -337,8 +337,10 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) total += j64bits(item,"value"); } } + printf("n.%d total %.8f\n",n,dstr(total)); if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { + printf("%s -> (%s)\n",peer->ipaddr,retstr); total2 = 0; if ( (array2= cJSON_Parse(retstr)) != 0 ) { @@ -374,9 +376,9 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); } else printf("%s matches %s\n",peer->ipaddr,coin->symbol); free_json(array2); - } + } else printf("parse error (%s)\n",retstr); free(retstr); - } + } else printf("no response from %s\n",peer->ipaddr); } if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) { From 6dfa5961de405787c42486aeafc76dc6142ece92 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 16:00:18 +0300 Subject: [PATCH 0911/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_include.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9137bb923..602c5a598 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -362,7 +362,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5faed5c43..46bdd0710 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -37,7 +37,7 @@ #define LP_GETINFO_INCR 30 #define LP_ORDERBOOK_DURATION 3600 -#define LP_HTTP_TIMEOUT 2 // 1 is too small due to edge cases of time(NULL) +#define LP_HTTP_TIMEOUT 5 // 1 is too small due to edge cases of time(NULL) #define LP_MAXPEER_ERRORS 3 #define LP_MINPEER_GOOD 20 #define LP_PEERGOOD_ERRORDECAY 0.9 From 96c3d707f008dc9a222245715fdbb73b4eac9451 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 16:03:19 +0300 Subject: [PATCH 0912/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_prices.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 95c07dfdf..4fd7dc88d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -319,6 +319,8 @@ void command_rpcloop(void *myipaddr) int32_t LP_utxos_sync(struct LP_peerinfo *peer) { int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; + if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + return(0); HASH_ITER(hh,LP_coins,coin,ctmp) { if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 9ceb2623e..0ac50c0d4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -360,6 +360,8 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) void LP_peer_pricesquery(struct LP_peerinfo *peer) { char *retstr; cJSON *array; int32_t i,n; + if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + return; peer->needping = (uint32_t)time(NULL); if ( (retstr= issue_LP_getprices(peer->ipaddr,peer->port)) != 0 ) { From e9d900969da46016dcb89296c5cc0a98512f56d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 16:09:10 +0300 Subject: [PATCH 0913/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4fd7dc88d..475ad8494 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -380,7 +380,9 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) free_json(array2); } else printf("parse error (%s)\n",retstr); free(retstr); - } else printf("no response from %s\n",peer->ipaddr); + } + else if ( n == 0 && total == 0 ) + printf("no response from %s for %s\n",peer->ipaddr,coin->symbol); } if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) { From aa666ca0363be81139ee81ba659fdceebee86249 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 16:26:56 +0300 Subject: [PATCH 0914/2732] Split out roc request packet processing --- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/stats.c | 264 +++++++++++++++++++------------------ 2 files changed, 139 insertions(+), 127 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 0f839b6af..c59d9f203 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -671,7 +671,7 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t sleeptime) { - char *retstr; cJSON *retjson=0; uint32_t divisor=8,expiration = (uint32_t)(time(NULL) + duration); + char *retstr; cJSON *retjson=0; uint32_t expiration = (uint32_t)(time(NULL) + duration); printf("wait %d:%d for SWAP.(r%u/q%u) to complete\n",duration,sleeptime,requestid,quoteid); sleep(10); //if ( sleeptime < divisor*60 ) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index c946dbc89..f4a2b473e 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -553,159 +553,171 @@ int32_t iguana_getheadersize(char *buf,int32_t recvlen) return(recvlen); } -void stats_rpcloop(void *args) +uint16_t RPC_port; + +void LP_rpc_processreq(void *_ptr) { - static char *jsonbuf; - uint16_t port; char filetype[128],content_type[128]; - int32_t recvlen,flag,bindsock,postflag=0,contentlen,sock,remains,numsent,jsonflag=0,hdrsize,len; - socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space; - struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; - if ( (port= *(uint16_t *)args) == 0 ) - port = 7779; - if ( jsonbuf == 0 ) - jsonbuf = calloc(1,IGUANA_MAXPACKETSIZE); - while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) - { - //if ( coin->MAXPEERS == 1 ) - // break; - //exit(-1); - sleep(3); - } - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); + uint64_t arg64 = *(uint64_t *)_ptr; + char filetype[128],content_type[128]; + int32_t recvlen,flag,postflag=0,contentlen,remains,sock,numsent,jsonflag=0,hdrsize,len; + char helpname[512],remoteaddr[64],*buf,*retstr,*space,*jsonbuf; + uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; + ipbits = (arg64 >> 32); + expand_ipbits(remoteaddr,ipbits); + sock = (arg64 & 0xffffffff); + recvlen = flag = 0; + retstr = 0; space = calloc(1,size); - while ( bindsock >= 0 ) + jsonbuf = calloc(1,size); + remains = size-1; + buf = jsonbuf; + while ( remains > 0 ) { - clilen = sizeof(cli_addr); - sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); - if ( sock < 0 ) - { - //printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); - continue; - } - memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); - expand_ipbits(remoteaddr,ipbits); - //printf("remote RPC request from (%s) %x\n",remoteaddr,ipbits); - - memset(jsonbuf,0,IGUANA_MAXPACKETSIZE); - remains = (int32_t)(IGUANA_MAXPACKETSIZE - 1); - buf = jsonbuf; - recvlen = flag = 0; - retstr = 0; - while ( remains > 0 ) + //printf("flag.%d remains.%d recvlen.%d\n",flag,remains,recvlen); + if ( (len= (int32_t)recv(sock,buf,remains,0)) < 0 ) { - //printf("flag.%d remains.%d recvlen.%d\n",flag,remains,recvlen); - if ( (len= (int32_t)recv(sock,buf,remains,0)) < 0 ) + if ( errno == EAGAIN ) { - if ( errno == EAGAIN ) - { - printf("EAGAIN for len %d, remains.%d\n",len,remains); - usleep(10000); - } - break; + printf("EAGAIN for len %d, remains.%d\n",len,remains); + usleep(10000); } - else + break; + } + else + { + if ( len > 0 ) { - if ( len > 0 ) + buf[len] = 0; + if ( recvlen == 0 ) { - buf[len] = 0; - if ( recvlen == 0 ) + if ( (contentlen= iguana_getcontentlen(buf,recvlen)) > 0 ) { - if ( (contentlen= iguana_getcontentlen(buf,recvlen)) > 0 ) + hdrsize = iguana_getheadersize(buf,recvlen); + if ( hdrsize > 0 ) { - hdrsize = iguana_getheadersize(buf,recvlen); - if ( hdrsize > 0 ) + if ( len < (hdrsize + contentlen) ) { - if ( len < (hdrsize + contentlen) ) - { - remains = (hdrsize + contentlen) - len; - buf = &buf[len]; - flag = 1; - //printf("got.(%s) %d remains.%d of len.%d contentlen.%d hdrsize.%d remains.%d\n",buf,recvlen,remains,len,contentlen,hdrsize,(hdrsize+contentlen)-len); - continue; - } + remains = (hdrsize + contentlen) - len; + buf = &buf[len]; + flag = 1; + //printf("got.(%s) %d remains.%d of len.%d contentlen.%d hdrsize.%d remains.%d\n",buf,recvlen,remains,len,contentlen,hdrsize,(hdrsize+contentlen)-len); + continue; } } } - recvlen += len; - remains -= len; - buf = &buf[len]; - if ( flag == 0 || remains <= 0 ) - break; - } - else - { - usleep(10000); - //printf("got.(%s) %d remains.%d of total.%d\n",jsonbuf,recvlen,remains,len); - //retstr = iguana_rpcparse(space,size,&postflag,jsonbuf); - if ( flag == 0 ) - break; } + recvlen += len; + remains -= len; + buf = &buf[len]; + if ( flag == 0 || remains <= 0 ) + break; } - } - content_type[0] = 0; - if ( recvlen > 0 ) - { - retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,port); - if ( filetype[0] != 0 ) + else { - static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; - sprintf(helpname,"%s/mime.json",GLOBAL_HELPDIR); - if ( (tmp= OS_filestr(&tmpsize,helpname)) != 0 ) - { - mimejson = cJSON_Parse(tmp); - free(tmp); - } - if ( mimejson != 0 ) - { - if ( (typestr= jstr(mimejson,filetype)) != 0 ) - sprintf(content_type,"Content-Type: %s\r\n",typestr); - } else printf("parse error.(%s)\n",tmp); - //printf("filetype.(%s) json.%p type.%p tmp.%p [%s]\n",filetype,mimejson,typestr,tmp,content_type); + usleep(10000); + //printf("got.(%s) %d remains.%d of total.%d\n",jsonbuf,recvlen,remains,len); + //retstr = iguana_rpcparse(space,size,&postflag,jsonbuf); + if ( flag == 0 ) + break; } } - if ( retstr != 0 ) + } + content_type[0] = 0; + if ( recvlen > 0 ) + { + jsonflag = postflag = 0; + retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); + if ( filetype[0] != 0 ) { - char *response,hdrs[1024]; - //printf("RETURN.(%s) jsonflag.%d postflag.%d\n",retstr,jsonflag,postflag); - if ( jsonflag != 0 || postflag != 0 ) + static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; + sprintf(helpname,"%s/mime.json",GLOBAL_HELPDIR); + if ( (tmp= OS_filestr(&tmpsize,helpname)) != 0 ) { - if ( retstr == 0 ) - retstr = clonestr("{}"); - response = malloc(strlen(retstr)+1024+1+1); - sprintf(hdrs,"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Methods: GET, POST\r\nCache-Control : no-cache, no-store, must-revalidate\r\n%sContent-Length : %8d\r\n\r\n",content_type,(int32_t)strlen(retstr)); - response[0] = '\0'; - strcat(response,hdrs); - strcat(response,retstr); - strcat(response,"\n"); - if ( retstr != space ) - free(retstr); - retstr = response; - //printf("RET.(%s)\n",retstr); + mimejson = cJSON_Parse(tmp); + free(tmp); } - remains = (int32_t)strlen(retstr); - i = 0; - while ( remains > 0 ) + if ( mimejson != 0 ) { - if ( (numsent= (int32_t)send(sock,&retstr[i],remains,MSG_NOSIGNAL)) < 0 ) - { - if ( errno != EAGAIN && errno != EWOULDBLOCK ) - { - //printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",retstr,ipaddr,numsent,remains,recvlen,errno,strerror(errno),sock); - break; - } - } - else if ( remains > 0 ) + if ( (typestr= jstr(mimejson,filetype)) != 0 ) + sprintf(content_type,"Content-Type: %s\r\n",typestr); + } else printf("parse error.(%s)\n",tmp); + //printf("filetype.(%s) json.%p type.%p tmp.%p [%s]\n",filetype,mimejson,typestr,tmp,content_type); + } + } + if ( retstr != 0 ) + { + char *response,hdrs[1024]; + //printf("RETURN.(%s) jsonflag.%d postflag.%d\n",retstr,jsonflag,postflag); + if ( jsonflag != 0 || postflag != 0 ) + { + if ( retstr == 0 ) + retstr = clonestr("{}"); + response = malloc(strlen(retstr)+1024+1+1); + sprintf(hdrs,"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Methods: GET, POST\r\nCache-Control : no-cache, no-store, must-revalidate\r\n%sContent-Length : %8d\r\n\r\n",content_type,(int32_t)strlen(retstr)); + response[0] = '\0'; + strcat(response,hdrs); + strcat(response,retstr); + strcat(response,"\n"); + if ( retstr != space ) + free(retstr); + retstr = response; + //printf("RET.(%s)\n",retstr); + } + remains = (int32_t)strlen(retstr); + i = 0; + while ( remains > 0 ) + { + if ( (numsent= (int32_t)send(sock,&retstr[i],remains,MSG_NOSIGNAL)) < 0 ) + { + if ( errno != EAGAIN && errno != EWOULDBLOCK ) { - remains -= numsent; - i += numsent; - if ( remains > 0 ) - printf("iguana sent.%d remains.%d of len.%d\n",numsent,remains,recvlen); + //printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",retstr,ipaddr,numsent,remains,recvlen,errno,strerror(errno),sock); + break; } } - if ( retstr != space) - free(retstr); + else if ( remains > 0 ) + { + remains -= numsent; + i += numsent; + if ( remains > 0 ) + printf("iguana sent.%d remains.%d of len.%d\n",numsent,remains,recvlen); + } } - closesocket(sock); + if ( retstr != space) + free(retstr); + } + free(space); + free(jsonbuf); + closesocket(sock); +} + +void stats_rpcloop(void *args) +{ + uint16_t port; int32_t sock,bindsock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; + if ( (port= *(uint16_t *)args) == 0 ) + port = 7779; + RPC_port = port; + while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + { + //if ( coin->MAXPEERS == 1 ) + // break; + //exit(-1); + sleep(3); + } + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); + while ( bindsock >= 0 ) + { + clilen = sizeof(cli_addr); + sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); + if ( sock < 0 ) + { + //printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); + continue; + } + memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); + //printf("remote RPC request from (%s) %x\n",remoteaddr,ipbits); + arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); + LP_rpc_processreq((void *)&arg64); } } From 806af4234cc7837e319c91a7a42e033a6f3b67cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 17:01:40 +0300 Subject: [PATCH 0915/2732] New thread per roc --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/stats.c | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 475ad8494..f6027076a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -257,12 +257,14 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) printf("self.(%s)\n",str); + portable_mutex_lock(&LP_commandmutex); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) free(retstr); } free_json(argjson); + portable_mutex_unlock(&LP_commandmutex); } free(str); } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index f4a2b473e..917d67d08 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -554,6 +554,7 @@ int32_t iguana_getheadersize(char *buf,int32_t recvlen) } uint16_t RPC_port; +extern portable_mutex_t LP_commandmutex; void LP_rpc_processreq(void *_ptr) { @@ -626,7 +627,9 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; + portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); + portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; @@ -693,7 +696,7 @@ void LP_rpc_processreq(void *_ptr) void stats_rpcloop(void *args) { - uint16_t port; int32_t sock,bindsock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; + uint16_t port; int32_t sock,bindsock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; void *arg64ptr; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; @@ -717,11 +720,21 @@ void stats_rpcloop(void *args) memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); //printf("remote RPC request from (%s) %x\n",remoteaddr,ipbits); arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); - LP_rpc_processreq((void *)&arg64); + arg64ptr = malloc(sizeof(arg64)); + memcpy(arg64ptr,&arg64,sizeof(arg64)); + //LP_rpc_processreq((void *)&arg64); + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) + { + printf("error launching rpc handler on port %d\n",port); + } + // yes, small leak per command } } #ifndef FROM_MARKETMAKER + +portable_mutex_t LP_commandmutex; + void stats_kvjson(FILE *logfp,int32_t height,int32_t savedheight,uint32_t timestamp,char *key,cJSON *kvjson,bits256 pubkey,bits256 sigprev) { struct tai T; int32_t seconds,datenum,n; From f908bb0c8cf03fa91ed704202dfabb455c809b29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 17:05:56 +0300 Subject: [PATCH 0916/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_rpc.c | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f6027076a..10f936fe9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -344,7 +344,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) printf("n.%d total %.8f\n",n,dstr(total)); if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { - printf("%s -> (%s)\n",peer->ipaddr,retstr); total2 = 0; if ( (array2= cJSON_Parse(retstr)) != 0 ) { @@ -383,7 +382,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } else printf("parse error (%s)\n",retstr); free(retstr); } - else if ( n == 0 && total == 0 ) + else if ( n != 0 && total != 0 ) printf("no response from %s for %s\n",peer->ipaddr,coin->symbol); } if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 93f9e2fbb..80ac137c7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -94,10 +94,11 @@ char *issue_LP_getprices(char *destip,uint16_t destport) char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) { - char url[512]; + char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); - //printf("listunspent.(%s)\n",url); - return(LP_issue_curl("listunspent",destip,destport,url)); + retstr = LP_issue_curl("listunspent",destip,destport,url); + printf("listunspent.(%s) -> (%s)\n",url,retstr); + return(retstr); } char *LP_apicall(struct iguana_info *coin,char *method,char *params) From ca98fe9b0315b7233d4508dd942a1ae01f15bcb6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 17:16:44 +0300 Subject: [PATCH 0917/2732] Test --- iguana/exchanges/LP_commands.c | 9 ++++++--- iguana/exchanges/LP_nativeDEX.c | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 602c5a598..817a74988 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -376,9 +376,12 @@ dividends(coin, height, )\n\ char *coinaddr; if ( (coinaddr= jstr(argjson,"address")) != 0 ) { - if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) - LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); - LP_listunspent_issue(coin,coinaddr); + if ( coinaddr[0] != 0 ) + { + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); + LP_listunspent_issue(coin,coinaddr); + } return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); } else return(clonestr("{\"error\":\"no address specified\"}")); } else return(clonestr("{\"error\":\"cant find coind\"}")); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 10f936fe9..274d7f6d2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -327,6 +327,8 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) { if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; + if ( coin->smartaddr[0] == 0 ) + continue; total = 0; if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr)) == 0 ) continue; @@ -396,7 +398,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) item = jitem(array2,j); if ( (coinaddr= jfieldname(item)) != 0 ) { - metric = j64bits(item,"coinaddr"); + metric = j64bits(item,coinaddr); //printf("(%s) -> %.8f n.%d\n",coinaddr,dstr(metric>>16),(uint16_t)metric); if ( (ap= LP_addressfind(coin,coinaddr)) == 0 || _LP_unspents_metric(ap->total,ap->n) != metric ) { From 590361d86e25c1e185d77cf1fb5c34b600621a47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 17:22:41 +0300 Subject: [PATCH 0918/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 274d7f6d2..923f18977 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -332,7 +332,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) total = 0; if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr)) == 0 ) continue; - printf("UTXO sync.%d %s -> %s\n",j,coin->symbol,peer->ipaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) @@ -343,9 +342,9 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) total += j64bits(item,"value"); } } - printf("n.%d total %.8f\n",n,dstr(total)); if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { + printf("UTXO sync.%d %s n.%d total %.8f -> %s\n",j,coin->symbol,n,dstr(total),peer->ipaddr); total2 = 0; if ( (array2= cJSON_Parse(retstr)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 80ac137c7..be270d8c5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -97,7 +97,7 @@ char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coi char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); retstr = LP_issue_curl("listunspent",destip,destport,url); - printf("listunspent.(%s) -> (%s)\n",url,retstr); + //printf("listunspent.(%s) -> (%s)\n",url,retstr); return(retstr); } From 47366177ac07ff44abe17f492217752d12a148d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 17:38:06 +0300 Subject: [PATCH 0919/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 46bdd0710..0808149cc 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -37,7 +37,7 @@ #define LP_GETINFO_INCR 30 #define LP_ORDERBOOK_DURATION 3600 -#define LP_HTTP_TIMEOUT 5 // 1 is too small due to edge cases of time(NULL) +#define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_MAXPEER_ERRORS 3 #define LP_MINPEER_GOOD 20 #define LP_PEERGOOD_ERRORDECAY 0.9 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 923f18977..de434d70e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -318,6 +318,31 @@ void command_rpcloop(void *myipaddr) } } +void LP_smartutxos_push(struct iguana_info *coin) +{ + struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item; + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) + free(retstr); + } + } + } + free_json(array); + } +} + int32_t LP_utxos_sync(struct LP_peerinfo *peer) { int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; @@ -463,6 +488,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->diduquery == 0 ) { + needpings++; LP_peer_pricesquery(peer); LP_utxos_sync(peer); peer->diduquery = now; @@ -479,6 +505,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); + HASH_ITER(hh,LP_coins,coin,ctmp) + { + LP_smartutxos_push(coin); + } } if ( (counter % 6000) == 10 ) { From a404823f4e97d6e8f181346ea9a8d1b685f9072a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 17:40:50 +0300 Subject: [PATCH 0920/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index de434d70e..c0b202599 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -321,10 +321,13 @@ void command_rpcloop(void *myipaddr) void LP_smartutxos_push(struct iguana_info *coin) { struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item; + if ( coin->smartaddr[0] == 0 ) + return; if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) { + printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); for (i=0; i Date: Fri, 13 Oct 2017 17:58:40 +0300 Subject: [PATCH 0921/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c0b202599..24a612c22 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -483,6 +483,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { + nonz++; LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; LP_utxos_sync(peer); @@ -491,6 +492,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->diduquery == 0 ) { + nonz++; needpings++; LP_peer_pricesquery(peer); LP_utxos_sync(peer); @@ -498,6 +500,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->needping != 0 ) { + nonz++; needpings++; if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); @@ -506,15 +509,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( needpings != 0 || (counter % 6000) == 5 ) { - //printf("needpings.%d send notify\n",needpings); + nonz++; + printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); - HASH_ITER(hh,LP_coins,coin,ctmp) - { - LP_smartutxos_push(coin); - } } if ( (counter % 6000) == 10 ) { + nonz++; LP_privkey_updates(ctx,pubsock,0); } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht @@ -522,12 +523,18 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; + if ( (counter % 6000) == 100 ) + { + LP_smartutxos_push(coin); + nonz++; + } if ( coin->electrum != 0 ) continue; //if ( coin->obooktime == 0 ) // continue; if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { + nonz++; if ( (height= LP_getheight(coin)) > coin->longestchain ) { coin->longestchain = height; @@ -572,6 +579,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( j < 100 ) continue; + nonz++; //LP_getestimatedrate(coin); break; } @@ -580,6 +588,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (retstr= basilisk_swapentry(0,0)) != 0 ) { //printf("SWAPS.(%s)\n",retstr); + nonz++; free(retstr); } } @@ -816,8 +825,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) - usleep(50000); - else usleep(5000); + usleep(1000); + else if ( IAMLP == 0 ) + usleep(10000); } } From d08f6215e655bf9485dcca538bed6fec3dc92ac3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 18:44:29 +0300 Subject: [PATCH 0922/2732] Test --- iguana/exchanges/stats.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 917d67d08..507aafb22 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -627,6 +627,7 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; + printf("RPC.(%s)\n",jsonbuf); portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); portable_mutex_unlock(&LP_commandmutex); From cf342a210f7ec78458ca8c406f7204c27c685e19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 18:50:43 +0300 Subject: [PATCH 0923/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 507aafb22..27dda90ba 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -627,9 +627,9 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; - printf("RPC.(%s)\n",jsonbuf); portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); + printf("RPC.(%s)%s\n",jsonbuf,retstr); portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { From 4dabdc066c43f7907415d349e3118f471f403902 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 18:55:57 +0300 Subject: [PATCH 0924/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 27dda90ba..ab1e5cc2b 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -629,7 +629,7 @@ void LP_rpc_processreq(void *_ptr) jsonflag = postflag = 0; portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); - printf("RPC.(%s)%s\n",jsonbuf,retstr); + //printf("RPC.(%s)%s\n",jsonbuf,retstr); portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { From 4eec1c9c3d4318bda4abeda4bb0d0068c189194f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 19:22:53 +0300 Subject: [PATCH 0925/2732] Test --- iguana/exchanges/stats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index ab1e5cc2b..eeee71816 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -629,7 +629,8 @@ void LP_rpc_processreq(void *_ptr) jsonflag = postflag = 0; portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); - //printf("RPC.(%s)%s\n",jsonbuf,retstr); + if ( strcmp("5.9.253.195",remoteaddr) == 0 ) + printf("RPC.(%s)%s\n",jsonbuf,retstr); portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { From 9e0a743ad8c76e276b79237eec9c1e37249d08dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 19:52:12 +0300 Subject: [PATCH 0926/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 15 +++++++++++++-- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 24a612c22..0856747b8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -372,7 +372,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { - printf("UTXO sync.%d %s n.%d total %.8f -> %s\n",j,coin->symbol,n,dstr(total),peer->ipaddr); + printf("UTXO sync.%d %s n.%d total %.8f -> %s (%s)\n",j,coin->symbol,n,dstr(total),peer->ipaddr,retstr); total2 = 0; if ( (array2= cJSON_Parse(retstr)) != 0 ) { @@ -412,7 +412,18 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) free(retstr); } else if ( n != 0 && total != 0 ) - printf("no response from %s for %s\n",peer->ipaddr,coin->symbol); + { + printf("no response from %s for %s %s\n",peer->ipaddr,coin->symbol,coin->smartaddr); + for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) + free(retstr2); + } + } + free_json(array); } if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index be270d8c5..80ac137c7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -97,7 +97,7 @@ char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coi char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); retstr = LP_issue_curl("listunspent",destip,destport,url); - //printf("listunspent.(%s) -> (%s)\n",url,retstr); + printf("listunspent.(%s) -> (%s)\n",url,retstr); return(retstr); } From b363add7b7e12413e6cdd66a46d70be770bd215a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 19:54:38 +0300 Subject: [PATCH 0927/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0856747b8..f533064e5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -372,7 +372,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) { - printf("UTXO sync.%d %s n.%d total %.8f -> %s (%s)\n",j,coin->symbol,n,dstr(total),peer->ipaddr,retstr); + //printf("UTXO sync.%d %s n.%d total %.8f -> %s (%s)\n",j,coin->symbol,n,dstr(total),peer->ipaddr,retstr); total2 = 0; if ( (array2= cJSON_Parse(retstr)) != 0 ) { @@ -398,13 +398,13 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( j == m ) { - printf("%s missing %s %s\n",peer->ipaddr,coin->symbol,jprint(item,0)); + //printf("%s missing %s %s\n",peer->ipaddr,coin->symbol,jprint(item,0)); if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) free(retstr2); posted++; } } - if ( 1 && posted != 0 ) + if ( 0 && posted != 0 ) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); } else printf("%s matches %s\n",peer->ipaddr,coin->symbol); free_json(array2); @@ -413,7 +413,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } else if ( n != 0 && total != 0 ) { - printf("no response from %s for %s %s\n",peer->ipaddr,coin->symbol,coin->smartaddr); + //printf("no response from %s for %s %s\n",peer->ipaddr,coin->symbol,coin->smartaddr); for (i=0; iinactive != 0 ) continue; - if ( (counter % 6000) == 100 ) + /*if ( (counter % 6000) == 100 ) { LP_smartutxos_push(coin); nonz++; - } + }*/ if ( coin->electrum != 0 ) continue; //if ( coin->obooktime == 0 ) From b385cc2e735671632a0c4e700375ee3d3c95021a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 19:57:04 +0300 Subject: [PATCH 0928/2732] Test --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index eeee71816..e3e0060cd 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -629,8 +629,8 @@ void LP_rpc_processreq(void *_ptr) jsonflag = postflag = 0; portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); - if ( strcmp("5.9.253.195",remoteaddr) == 0 ) - printf("RPC.(%s)%s\n",jsonbuf,retstr); + //if ( strcmp("5.9.253.195",remoteaddr) == 0 ) + // printf("RPC.(%s)%s\n",jsonbuf,retstr); portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { From 41df4117937bb5adebcfcaa2557c46a4c63dd3d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 19:57:28 +0300 Subject: [PATCH 0929/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 80ac137c7..be270d8c5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -97,7 +97,7 @@ char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coi char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); retstr = LP_issue_curl("listunspent",destip,destport,url); - printf("listunspent.(%s) -> (%s)\n",url,retstr); + //printf("listunspent.(%s) -> (%s)\n",url,retstr); return(retstr); } From 62b3b5d714b10b1818121cd65e39d4441589ce9a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:04:42 +0300 Subject: [PATCH 0930/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 817a74988..535b46cff 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -311,6 +311,7 @@ dividends(coin, height, )\n\ jaddnum(retjson,"timestamp",time(NULL)); jadd(retjson,"alice",LP_inventory(coin)); //jadd(retjson,"bob",LP_inventory(coin,1)); + LP_smartutxos_push(ptr); return(jprint(retjson,1)); } } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0808149cc..bb24eccd2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -312,6 +312,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); +void LP_smartutxos_push(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f533064e5..570272669 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -406,7 +406,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } if ( 0 && posted != 0 ) printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - } else printf("%s matches %s\n",peer->ipaddr,coin->symbol); + } //else printf("%s matches %s\n",peer->ipaddr,coin->symbol); free_json(array2); } else printf("parse error (%s)\n",retstr); free(retstr); @@ -521,7 +521,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( needpings != 0 || (counter % 6000) == 5 ) { nonz++; - printf("needpings.%d send notify\n",needpings); + //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) From 7c9e6e6b505fedd00307ac65d015b77e391fa36c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:08:05 +0300 Subject: [PATCH 0931/2732] Test --- iguana/exchanges/LP_commands.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 535b46cff..4f9860119 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -379,9 +379,12 @@ dividends(coin, height, )\n\ { if ( coinaddr[0] != 0 ) { + LP_listunspent_issue(coin,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + { LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); - LP_listunspent_issue(coin,coinaddr); + LP_smartutxos_push(ptr); + } } return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); } else return(clonestr("{\"error\":\"no address specified\"}")); From e906dd4c4ca40d5c9c244935923fa3372c670a1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:08:32 +0300 Subject: [PATCH 0932/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 62e0757bf..499d2af9d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -472,7 +472,7 @@ cJSON *LP_inventory(char *symbol) // LP_utxo_clientpublish(utxo); jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } - else if ( LP_ismine(utxo) > 0 && strcmp(symbol,utxo->coin) == 0 ) + else if ( 0 && LP_ismine(utxo) > 0 && strcmp(symbol,utxo->coin) == 0 ) printf("skip %s %s %d %d %d %d\n",utxo->coin,bits256_str(str,utxo->payment.txid),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); } return(array); From a7fb628f715c65044d60e256a7510a26b23e5e28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:14:51 +0300 Subject: [PATCH 0933/2732] Test --- iguana/exchanges/stats.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index e3e0060cd..8e5099814 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -724,8 +724,12 @@ void stats_rpcloop(void *args) arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); memcpy(arg64ptr,&arg64,sizeof(arg64)); - //LP_rpc_processreq((void *)&arg64); - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) + if ( 1 ) + { + LP_rpc_processreq((void *)&arg64); + free(arg64ptr); + } + else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { printf("error launching rpc handler on port %d\n",port); } From 786c5ca7241e12d64ca164f1ddc7f6555e885a39 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:18:32 +0300 Subject: [PATCH 0934/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_include.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4f9860119..c1de78f0a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -379,7 +379,7 @@ dividends(coin, height, )\n\ { if ( coinaddr[0] != 0 ) { - LP_listunspent_issue(coin,coinaddr); + //LP_listunspent_issue(coin,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index bb24eccd2..450f3e67a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -37,7 +37,7 @@ #define LP_GETINFO_INCR 30 #define LP_ORDERBOOK_DURATION 3600 -#define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) +#define LP_HTTP_TIMEOUT 2 // 1 is too small due to edge cases of time(NULL) #define LP_MAXPEER_ERRORS 3 #define LP_MINPEER_GOOD 20 #define LP_PEERGOOD_ERRORDECAY 0.9 From 0fffd2bf91ea70dddf5e7cf8a1be4a2917fce0b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:35:46 +0300 Subject: [PATCH 0935/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 570272669..61c71ea8b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -312,8 +312,8 @@ void command_rpcloop(void *myipaddr) if ( nonz == 0 ) { if ( IAMLP != 0 ) - usleep(10); - else usleep(1000); + usleep(1000); + else usleep(10000); } } } From 27b856ecf2ed9fe6050f11f076c6c215d716ae31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 20:36:30 +0300 Subject: [PATCH 0936/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 61c71ea8b..f7d48da5c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -836,9 +836,10 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) - usleep(1000); - else if ( IAMLP == 0 ) usleep(10000); + else if ( IAMLP != 0 ) + usleep(1000); + else usleep(10000); } } From 0707f72fbdc050a3c16c4d894443803fc0dcfaf4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:03:33 +0300 Subject: [PATCH 0937/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0bc2e2381..0af0c6001 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -247,7 +247,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) char *LP_postedprice(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); From bebb405ca895c19351a2b241fbcb47085fbd7dc7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:15:29 +0300 Subject: [PATCH 0938/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0af0c6001..0bc2e2381 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -247,7 +247,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) char *LP_postedprice(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0ac50c0d4..0f9604dc7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -773,9 +773,9 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) jaddi(array,LP_orderbookjson(rel,bids[i])); if ( bids[i]->numutxos == 0 )//|| relcoin->electrum == 0 ) { + LP_address(relcoin,bids[i]->coinaddr); if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr); - else LP_address(relcoin,bids[i]->coinaddr); n++; } free(bids[i]); @@ -791,9 +791,9 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) jaddi(array,LP_orderbookjson(base,asks[i])); if ( asks[i]->numutxos == 0 )//|| basecoin->electrum == 0 ) { + LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr); - else LP_address(basecoin,asks[i]->coinaddr); n++; } free(asks[i]); From 81cadf7ff876610f2876c56ad87d123f93496329 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:23:13 +0300 Subject: [PATCH 0939/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c1de78f0a..4f9860119 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -379,7 +379,7 @@ dividends(coin, height, )\n\ { if ( coinaddr[0] != 0 ) { - //LP_listunspent_issue(coin,coinaddr); + LP_listunspent_issue(coin,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); From 03ac17d5182c98650b2b8b653cb558b681b1b40f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:23:27 +0300 Subject: [PATCH 0940/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4f9860119..c27d4c3cc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -383,7 +383,7 @@ dividends(coin, height, )\n\ if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); - LP_smartutxos_push(ptr); + //LP_smartutxos_push(ptr); } } return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); From 6c0021d007599eee2e77281fb143de7f7633668e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:29:08 +0300 Subject: [PATCH 0941/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++++ iguana/exchanges/LP_rpc.c | 1 + 2 files changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c27d4c3cc..103950e88 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -385,6 +385,10 @@ dividends(coin, height, )\n\ LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); //LP_smartutxos_push(ptr); } + else + { + + } } return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); } else return(clonestr("{\"error\":\"no address specified\"}")); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index be270d8c5..759b55e64 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -463,6 +463,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) else if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); + printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); retjson = cJSON_Parse(retstr); } else printf("LP_listunspent_issue couldnt get a random peer?\n"); if ( retjson != 0 ) From 520e5bbf8342cf94d9b095a197e3df038d2a101c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:53:35 +0300 Subject: [PATCH 0942/2732] Test --- iguana/exchanges/LP_commands.c | 43 +++++++++++++++++++++++++++++++- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_ordermatch.c | 11 ++++++++ iguana/exchanges/LP_prices.c | 2 ++ 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 103950e88..71eb62250 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -363,7 +363,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); @@ -416,6 +416,47 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"checktxid") == 0 ) retstr = LP_spentcheck(argjson); + else if ( strcmp(method,"addr_unspents") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + { + char *coinaddr; cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; + if ( (coinaddr= jstr(argjson,"address")) != 0 ) + { + if ( coinaddr[0] != 0 ) + { + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + { + printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + if ( (array= LP_address_utxos(ptr,coinaddr,1)) != 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; icoinaddr); if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr); + LP_listunspent_query(rel,bids[i]->coinaddr); n++; } free(bids[i]); @@ -794,6 +795,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr); + LP_listunspent_query(base,asks[i]->coinaddr); n++; } free(asks[i]); From eedbc8de2a8bed43f135f3be24fde46b02c084d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 21:54:34 +0300 Subject: [PATCH 0943/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f7d48da5c..2b7d1a6fe 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -425,7 +425,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } free_json(array); } - if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) + if ( 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) { if ( (array2= cJSON_Parse(retstr)) != 0 ) { From 786d194ab7c874243005babbe92547d083798d6f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 22:01:03 +0300 Subject: [PATCH 0944/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_rpc.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 71eb62250..acdf5783a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -418,6 +418,7 @@ dividends(coin, height, )\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { + printf("GOT ADDR_UNSPENTS\n"); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { char *coinaddr; cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6124c5c04..088d05f94 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -252,6 +252,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"address",coinaddr); msg = jprint(reqjson,1); + printf("BROADCAST.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,"","",zero,msg); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 759b55e64..d4a9c1912 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -460,12 +460,12 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) retjson = LP_listunspent(symbol,coinaddr); //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } - else if ( (destport= LP_randpeer(destip)) > 0 ) + /*else if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); retjson = cJSON_Parse(retstr); - } else printf("LP_listunspent_issue couldnt get a random peer?\n"); + } else printf("LP_listunspent_issue couldnt get a random peer?\n");*/ if ( retjson != 0 ) { n = cJSON_GetArraySize(retjson); From bda40839538e67391c1ce6826f42e62af5ddf902 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 22:04:31 +0300 Subject: [PATCH 0945/2732] Test --- iguana/exchanges/LP_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index acdf5783a..8f0062b3d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -448,7 +448,8 @@ dividends(coin, height, )\n\ jaddnum(req,"vout",vout); jaddnum(req,"ht",height); jadd64bits(req,"value",value); - LP_broadcast_message(pubsock,"","",zero,jprint(reqjson,1)); + //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_broadcast_message(pubsock,"","",zero,jprint(req,1)); } } free_json(array); @@ -457,6 +458,7 @@ dividends(coin, height, )\n\ } } } + retstr = clonestr("{\"result\":\"success\"}"); } else if ( strcmp(method,"getcoins") == 0 ) return(jprint(LP_coinsjson(0),1)); From 0d496c50839f05b9efec77541a56ea54a4f0fd44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 22:07:34 +0300 Subject: [PATCH 0946/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8f0062b3d..61d680375 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -443,6 +443,7 @@ dividends(coin, height, )\n\ value = j64bits(item,"value"); req = cJSON_CreateObject(); jaddstr(req,"method","uitem"); + jaddstr(req,"coin",ptr->symbol); jaddstr(req,"coinaddr",coinaddr); jaddbits256(req,"txid",txid); jaddnum(req,"vout",vout); From 247112cf388aa0c3267b66d1598066c63e2d6730 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 22:10:24 +0300 Subject: [PATCH 0947/2732] Test --- iguana/exchanges/LP_commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 61d680375..d857c9f5a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -418,7 +418,7 @@ dividends(coin, height, )\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { - printf("GOT ADDR_UNSPENTS\n"); + //printf("GOT ADDR_UNSPENTS\n"); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { char *coinaddr; cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; @@ -428,7 +428,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { - printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + //printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); if ( (array= LP_address_utxos(ptr,coinaddr,1)) != 0 ) { memset(zero.bytes,0,sizeof(zero)); @@ -437,8 +437,8 @@ dividends(coin, height, )\n\ for (i=0; i Date: Fri, 13 Oct 2017 22:15:38 +0300 Subject: [PATCH 0948/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 088d05f94..247281d52 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -990,9 +990,10 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + LP_listunspent_query(base,coinaddr); n = LP_listunspent_both(base,coinaddr); //printf("unspent.(%s) n.%d\n",coinaddr,n); - if ( n > 1 ) + //if ( n > 1 ) { basesatoshis = LP_basesatoshis(dstr(autxo->S.satoshis),price,txfee,desttxfee); if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) @@ -1005,7 +1006,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } - } else printf("no unspents %s %s %s\n",base,coinaddr,bits256_str(str,pubkey)); + } //else printf("no unspents %s %s %s\n",base,coinaddr,bits256_str(str,pubkey)); } else printf("self trading or blacklisted peer\n"); } else From bec2ed0757c4fe47a81fb2a49c9a540ff9c54c44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 22:20:12 +0300 Subject: [PATCH 0949/2732] Test --- iguana/exchanges/LP_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d857c9f5a..a74d55e22 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -418,7 +418,7 @@ dividends(coin, height, )\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { - //printf("GOT ADDR_UNSPENTS\n"); + printf("GOT ADDR_UNSPENTS\n"); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { char *coinaddr; cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; @@ -428,7 +428,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { - //printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); if ( (array= LP_address_utxos(ptr,coinaddr,1)) != 0 ) { memset(zero.bytes,0,sizeof(zero)); @@ -449,7 +449,7 @@ dividends(coin, height, )\n\ jaddnum(req,"vout",vout); jaddnum(req,"ht",height); jadd64bits(req,"value",value); - //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); LP_broadcast_message(pubsock,"","",zero,jprint(req,1)); } } From 0d21044ac2721fc859ed2db0191eef19fd10521c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 22:33:29 +0300 Subject: [PATCH 0950/2732] Test --- iguana/exchanges/LP_commands.c | 29 ++--------------------------- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 30 ++++++++++++++++++++++++------ iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 5 files changed, 29 insertions(+), 36 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a74d55e22..583b1096d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -421,7 +421,7 @@ dividends(coin, height, )\n\ printf("GOT ADDR_UNSPENTS\n"); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { - char *coinaddr; cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; + char *coinaddr; //cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; if ( (coinaddr= jstr(argjson,"address")) != 0 ) { if ( coinaddr[0] != 0 ) @@ -429,32 +429,7 @@ dividends(coin, height, )\n\ if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); - if ( (array= LP_address_utxos(ptr,coinaddr,1)) != 0 ) - { - memset(zero.bytes,0,sizeof(zero)); - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; isymbol); - jaddstr(req,"coinaddr",coinaddr); - jaddbits256(req,"txid",txid); - jaddnum(req,"vout",vout); - jaddnum(req,"ht",height); - jadd64bits(req,"value",value); - printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_broadcast_message(pubsock,"","",zero,jprint(req,1)); - } - } - free_json(array); - } + ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3cc60f12f..c3ee027af 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -183,7 +183,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; + uint32_t addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2b7d1a6fe..4d294fc9c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -320,11 +320,12 @@ void command_rpcloop(void *myipaddr) void LP_smartutxos_push(struct iguana_info *coin) { - struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item; + struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; if ( coin->smartaddr[0] == 0 ) return; if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { + memset(zero.bytes,0,sizeof(zero)); if ( (n= cJSON_GetArraySize(array)) > 0 ) { printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); @@ -335,11 +336,27 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); + if ( 0 ) + { HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) free(retstr); } + } + else + { + req = cJSON_CreateObject(); + jaddstr(req,"method","uitem"); + jaddstr(req,"coin",coin->symbol); + jaddstr(req,"coinaddr",coin->smartaddr); + jaddbits256(req,"txid",txid); + jaddnum(req,"vout",vout); + jaddnum(req,"ht",height); + jadd64bits(req,"value",value); + printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_broadcast_message(LP_mypubsock,"","",zero,jprint(req,1)); + } } } free_json(array); @@ -532,13 +549,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { memset(&zero,0,sizeof(zero)); - if ( coin->inactive != 0 ) - continue; - /*if ( (counter % 6000) == 100 ) + if ( coin->addr_listunspent_requested != 0 ) { + printf("addr_listunspent_requested %u\n",coin->addr_listunspent_requested); LP_smartutxos_push(coin); - nonz++; - }*/ + coin->addr_listunspent_requested = 0; + } + if ( coin->inactive != 0 ) + continue; if ( coin->electrum != 0 ) continue; //if ( coin->obooktime == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 247281d52..d5fef89a5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -957,7 +957,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { - bits256 pubkey; char *obookstr,coinaddr[64],str[65]; cJSON *orderbook,*asks,*item; int32_t i,j,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,j,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d4a9c1912..5e6dc9105 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -440,7 +440,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { - struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; + struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0;// uint16_t destport; if ( symbol == 0 || symbol[0] == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) From f24a6af2183d6ba1b0652527b4221638dd46f092 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 12:10:39 +0300 Subject: [PATCH 0951/2732] Add prefix field for secret addresses --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 40 +++++++++++++++++++++----------- iguana/exchanges/LP_utxos.c | 6 +++-- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 583b1096d..e3ab3c825 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -120,7 +120,7 @@ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ -secretaddresses(passphrase, num=10, pubtype=60, taddr=0)\n\ +secretaddresses(prefix='secretaddress', passphrase, num=10, pubtype=60, taddr=0)\n\ electrum(coin, ipaddr, port)\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ @@ -186,7 +186,7 @@ dividends(coin, height, )\n\ uint8_t taddr,pubtype; pubtype = (jobj(argjson,"pubtype") == 0) ? 60 : juint(argjson,"pubtype"); taddr = (jobj(argjson,"taddr") == 0) ? 0 : juint(argjson,"taddr"); - return(LP_secretaddresses(ctx,jstr(argjson,"passphrase"),juint(argjson,"num"),taddr,pubtype)); + return(LP_secretaddresses(ctx,jstr(argjson,"prefix"),jstr(argjson,"passphrase"),juint(argjson,"num"),taddr,pubtype)); } if ( base != 0 && rel != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d5fef89a5..b3c2844bf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -955,9 +955,26 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } +int32_t LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct iguana_info *basecoin,char *coinaddr,uint64_t asatoshis,double price,uint64_t txfee,uint64_t desttxfee,bits256 pubkey,char *gui) +{ + uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; + basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); + if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) + { + bestutxo->pubkey = pubkey; + safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); + *bestsatoshisp = basesatoshis; + *ordermatchpricep = price; + *bestdestsatoshisp = asatoshis; + return(0); + } + return(-1); +} + struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t i,j,n,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; struct iguana_info *basecoin; uint64_t basesatoshis; struct LP_utxoinfo *bestutxo = 0; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; + maxiters = 10; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -991,22 +1008,19 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); LP_listunspent_query(base,coinaddr); - n = LP_listunspent_both(base,coinaddr); - //printf("unspent.(%s) n.%d\n",coinaddr,n); - //if ( n > 1 ) + LP_listunspent_both(base,coinaddr); + asatoshis = autxo->S.satoshis; + for (j=0; jS.satoshis),price,txfee,desttxfee); - if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) + if ( LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui) == 0 ) { - bestutxo->pubkey = pubp->pubkey; - safecopy(bestutxo->gui,gui,sizeof(bestutxo->gui)); - *bestsatoshisp = basesatoshis; - *ordermatchpricep = price; - *bestdestsatoshisp = autxo->S.satoshis; - printf("ordermatch %.8f %.8f %.8f txfees (%.8f %.8f)\n",price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); + printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } - } //else printf("no unspents %s %s %s\n",base,coinaddr,bits256_str(str,pubkey)); + asatoshis = (asatoshis / 64) * 63; + } + if ( j < maxiters ) + break; } else printf("self trading or blacklisted peer\n"); } else diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 499d2af9d..499f6bff1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -654,10 +654,12 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri return(flag); } -char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) +char *LP_secretaddresses(void *ctx,char *prefix,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char output[777*45],str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; retjson = cJSON_CreateObject(); + if ( prefix == 0 || prefix[0] == 0 ) + prefix = "secretaddress"; if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; if ( n <= 0 ) @@ -670,7 +672,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint sprintf(output,"\"addresses\":["); for (i=0; i Date: Sat, 14 Oct 2017 12:19:20 +0300 Subject: [PATCH 0952/2732] Test --- iguana/exchanges/LP_remember.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c50a47853..671a3d15b 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1075,25 +1075,28 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("depositspent.(%s) alice.%d bob.%d %s %.8f\n",bits256_str(str,rswap.depositspent),rswap.sentflags[BASILISK_ALICECLAIM],rswap.sentflags[BASILISK_BOBREFUND],rswap.bobcoin,dstr(rswap.values[BASILISK_BOBDEPOSIT])); } LP_totals_update(rswap.iambob,rswap.alicecoin,rswap.bobcoin,KMDtotals,BTCtotals,rswap.sentflags,rswap.values); + int32_t numspent = 0; if ( bits256_nonz(rswap.paymentspent) == 0 ) { if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; else rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; - } + } else numspent++; if ( bits256_nonz(rswap.depositspent) == 0 ) { if ( bits256_nonz(rswap.txids[BASILISK_BOBREFUND]) != 0 ) rswap.depositspent = rswap.txids[BASILISK_BOBREFUND]; else rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; - } + } else numspent++; if ( bits256_nonz(rswap.Apaymentspent) == 0 ) { if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; else rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; - } - rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); + } else numspent++; + if ( numspent == 3 ) + rswap.finishedflag = 1; + else rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); item = LP_swap_json(&rswap); if ( rswap.origfinishedflag == 0 && rswap.finishedflag != 0 ) { From c4f20d41eb997202c1a0334ddeaee40a08ed29f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 12:20:53 +0300 Subject: [PATCH 0953/2732] Test --- iguana/exchanges/LP_commands.c | 6 +++--- iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e3ab3c825..bb2fb1c4c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -363,7 +363,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); @@ -418,7 +418,7 @@ dividends(coin, height, )\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { - printf("GOT ADDR_UNSPENTS\n"); + //printf("GOT ADDR_UNSPENTS\n"); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { char *coinaddr; //cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; @@ -428,7 +428,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { - printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + //printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b3c2844bf..738a77066 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -252,7 +252,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"address",coinaddr); msg = jprint(reqjson,1); - printf("BROADCAST.(%s)\n",msg); + //printf("BROADCAST.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,"","",zero,msg); } From 76fa6b69ba83addd602775ebf2372bd7eb05d220 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:11:09 +0300 Subject: [PATCH 0954/2732] Test --- iguana/exchanges/LP_remember.c | 8 ++++---- iguana/exchanges/LP_transaction.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 671a3d15b..6979c9afe 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -346,7 +346,7 @@ int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflag n++; if ( n == 0 ) { - printf("if nothing sent, it is finished\n"); + //printf("if nothing sent, it is finished\n"); return(1); } if ( iambob != 0 ) @@ -851,13 +851,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } - printf("ALICE.(%s) 1st refht %s <- %d, scan %d %d\n",rswap.Adestaddr,alice->symbol,alice->firstrefht,alice->firstscanht,alice->lastscanht); - printf("BOB.(%s) 1st refht %s <- %d, scan %d %d\n",rswap.destaddr,bob->symbol,bob->firstrefht,bob->firstscanht,bob->lastscanht); //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); if ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 ) { + //printf("ALICE.(%s) 1st refht %s <- %d, scan %d %d\n",rswap.Adestaddr,alice->symbol,alice->firstrefht,alice->firstscanht,alice->lastscanht); + //printf("BOB.(%s) 1st refht %s <- %d, scan %d %d\n",rswap.destaddr,bob->symbol,bob->firstrefht,bob->firstscanht,bob->lastscanht); if ( alice->inactive != 0 || bob->inactive != 0 ) { printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",rswap.alicecoin,alice->inactive,rswap.bobcoin,bob->inactive); @@ -1101,7 +1101,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( rswap.origfinishedflag == 0 && rswap.finishedflag != 0 ) { char fname[1024],*itemstr; FILE *fp; - //printf("SWAP %u-%u finished!\n",requestid,quoteid); + printf("SWAP %u-%u finished!\n",requestid,quoteid); sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap.requestid,rswap.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a5d66d712..18537ce9b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -935,13 +935,22 @@ bits256 _LP_swap_spendtxid(char *symbol,char *destaddr,char *coinaddr,bits256 ut bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t vout) { - bits256 spendtxid; int32_t spendvin; char coinaddr[64],str[65]; + bits256 spendtxid; int32_t spendvin; char coinaddr[64],str[65]; cJSON *retjson; struct iguana_info *coin; // listtransactions or listspents destaddr[0] = 0; coinaddr[0] = 0; memset(&spendtxid,0,sizeof(spendtxid)); if ( LP_spendsearch(&spendtxid,&spendvin,symbol,utxotxid,vout) > 0 ) printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); + else if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) + { + if ( (retjson= LP_gettxout(symbol,coinaddr,utxotxid,vout)) != 0 ) + { + free_json(retjson); + decode_hex(spendtxid.bytes,32,"deadbeefdeadbeefdeadbeefdeadbeef"); + printf("couldnt find spend of %s/v%d, but no gettxout\n",bits256_str(str,utxotxid),vout); + } + } return(spendtxid); //char str[65]; printf("swap %s spendtxid.(%s)\n",symbol,bits256_str(str,utxotxid)); } From 6e552395a7fec598f6df874bcf25bd4ae8348816 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:13:24 +0300 Subject: [PATCH 0955/2732] Test --- iguana/exchanges/LP_transaction.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 18537ce9b..a8ddd2a0e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -944,12 +944,11 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t v printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); else if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { - if ( (retjson= LP_gettxout(symbol,coinaddr,utxotxid,vout)) != 0 ) + if ( (retjson= LP_gettxout(symbol,coinaddr,utxotxid,vout)) == 0 ) { - free_json(retjson); decode_hex(spendtxid.bytes,32,"deadbeefdeadbeefdeadbeefdeadbeef"); printf("couldnt find spend of %s/v%d, but no gettxout\n",bits256_str(str,utxotxid),vout); - } + } else free_json(retjson); } return(spendtxid); //char str[65]; printf("swap %s spendtxid.(%s)\n",symbol,bits256_str(str,utxotxid)); From 31c75fa109c51251c80b5096817c7ca3ad2dfaed Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:14:49 +0300 Subject: [PATCH 0956/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a8ddd2a0e..869b17d59 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -946,7 +946,7 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t v { if ( (retjson= LP_gettxout(symbol,coinaddr,utxotxid,vout)) == 0 ) { - decode_hex(spendtxid.bytes,32,"deadbeefdeadbeefdeadbeefdeadbeef"); + decode_hex(spendtxid.bytes,32,"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); printf("couldnt find spend of %s/v%d, but no gettxout\n",bits256_str(str,utxotxid),vout); } else free_json(retjson); } From 285e46235f10e260e5642ae93a29f8e4624c4cca Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:22:40 +0300 Subject: [PATCH 0957/2732] Test --- iguana/exchanges/LP_remember.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 6979c9afe..4486bd685 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -661,7 +661,7 @@ int32_t LP_refht_update(char *symbol,bits256 txid) int32_t LP_swap_load(struct LP_swap_remember *rswap) { - int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj; bits256 txid,checktxid; uint64_t value; + int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj,*fileobj; bits256 txid,checktxid; uint64_t value; rswap->iambob = -1; for (i=0; isrc,rswap->bobcoin); if ( rswap->dest[0] == 0 ) strcpy(rswap->dest,rswap->alicecoin); + sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap->requestid,rswap->quoteid), OS_compatible_path(fname); + if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) + { + if ( (fileobj= cJSON_Parse(fstr)) != 0 ) + { + rswap->finishedflag = 1; + free_json(fileobj); + } + free(fstr); + } return(rswap->finishedflag); } From b4abc136ccbc2f32113d9fa523f4d8c683a16e91 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:25:42 +0300 Subject: [PATCH 0958/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 4486bd685..8fe16bacc 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -748,7 +748,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) } free_json(sentobj); } - if ( rswap->finishedflag == 0 ) + if ( 0 && rswap->finishedflag == 0 ) printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); } } @@ -770,7 +770,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) { if ( (fileobj= cJSON_Parse(fstr)) != 0 ) { - rswap->finishedflag = 1; + rswap->origfinishedflag = rswap->finishedflag = 1; free_json(fileobj); } free(fstr); From cbf1699ee6c4a19bbe05002adb79c16da766d6ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:28:58 +0300 Subject: [PATCH 0959/2732] Test --- iguana/exchanges/LP_remember.c | 23 +++++++++++------------ iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/mm.c | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 8fe16bacc..fca22ef2a 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -663,6 +663,16 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) { int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj,*fileobj; bits256 txid,checktxid; uint64_t value; rswap->iambob = -1; + sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap->requestid,rswap->quoteid), OS_compatible_path(fname); + if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) + { + if ( (fileobj= cJSON_Parse(fstr)) != 0 ) + { + rswap->origfinishedflag = rswap->finishedflag = 1; + free_json(fileobj); + } + free(fstr); + } for (i=0; ifinishedflag == 0 ) - printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); + printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); } } } //else printf("no symbol\n"); @@ -765,16 +774,6 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) strcpy(rswap->src,rswap->bobcoin); if ( rswap->dest[0] == 0 ) strcpy(rswap->dest,rswap->alicecoin); - sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap->requestid,rswap->quoteid), OS_compatible_path(fname); - if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) - { - if ( (fileobj= cJSON_Parse(fstr)) != 0 ) - { - rswap->origfinishedflag = rswap->finishedflag = 1; - free_json(fileobj); - } - free(fstr); - } return(rswap->finishedflag); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a56737148..f4b7fe22c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -909,7 +909,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) } else { - printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); + printf("launched electrum.(%s:%u)\n",ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); ep->prev = coin->electrum; coin->electrum = ep; diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 618b9d494..e262972b3 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -880,7 +880,7 @@ int main(int argc, const char * argv[]) { printf("error launching LP_main (%s)\n",jprint(retjson,0)); exit(-1); - } else printf("(%s) launched.(%s)\n",argv[1],passphrase); + } //else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; while ( (1) ) sleep(1); From d3f0616c3c0bd3218b21d31b9416cf6806a9bdbd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:34:37 +0300 Subject: [PATCH 0960/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5e6dc9105..f6a66ead1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -460,6 +460,8 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) retjson = LP_listunspent(symbol,coinaddr); //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } + else if ( IAMLP == 0 ) + LP_listunspent_query(coin->symbol,coin->smartaddr); /*else if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); From 41cce6e61eb276b4719c016ae716bbfa20955e14 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:39:35 +0300 Subject: [PATCH 0961/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4d294fc9c..655cdb012 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -354,7 +354,7 @@ void LP_smartutxos_push(struct iguana_info *coin) jaddnum(req,"vout",vout); jaddnum(req,"ht",height); jadd64bits(req,"value",value); - printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); LP_broadcast_message(LP_mypubsock,"","",zero,jprint(req,1)); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 738a77066..696452ebb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -974,7 +974,7 @@ int32_t LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *or struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; - maxiters = 10; + maxiters = 100; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); From 6497b4e2a916e445b0c5e3f9ea2081ad413d2d40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:43:13 +0300 Subject: [PATCH 0962/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 696452ebb..cd28e6ac9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -955,7 +955,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(jprint(bestitem,0)); } -int32_t LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct iguana_info *basecoin,char *coinaddr,uint64_t asatoshis,double price,uint64_t txfee,uint64_t desttxfee,bits256 pubkey,char *gui) +struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct iguana_info *basecoin,char *coinaddr,uint64_t asatoshis,double price,uint64_t txfee,uint64_t desttxfee,bits256 pubkey,char *gui) { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); @@ -966,9 +966,9 @@ int32_t LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *or *bestsatoshisp = basesatoshis; *ordermatchpricep = price; *bestdestsatoshisp = asatoshis; - return(0); + return(bestutxo); } - return(-1); + return(0); } struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) @@ -1012,7 +1012,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i asatoshis = autxo->S.satoshis; for (j=0; jpubkey,gui) == 0 ) + if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) { printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; From 8272f7ecd83aa8dcfde3f1377d89f31000cb60fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:46:36 +0300 Subject: [PATCH 0963/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cd28e6ac9..f9bb6b3e9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -252,7 +252,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"address",coinaddr); msg = jprint(reqjson,1); - //printf("BROADCAST.(%s)\n",msg); + printf("BROADCAST.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,"","",zero,msg); } From 625ebe1383414a8341dae057ef35fda7377873cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:49:22 +0300 Subject: [PATCH 0964/2732] Test --- iguana/exchanges/LP_rpc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f6a66ead1..fcca1d487 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -440,7 +440,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { - struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0;// uint16_t destport; + struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; if ( symbol == 0 || symbol[0] == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) @@ -461,13 +461,15 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } else if ( IAMLP == 0 ) - LP_listunspent_query(coin->symbol,coin->smartaddr); - /*else if ( (destport= LP_randpeer(destip)) > 0 ) { - retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); - printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); - retjson = cJSON_Parse(retstr); - } else printf("LP_listunspent_issue couldnt get a random peer?\n");*/ + LP_listunspent_query(coin->symbol,coin->smartaddr); + if ( (destport= LP_randpeer(destip)) > 0 ) + { + retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); + printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); + retjson = cJSON_Parse(retstr); + } else printf("LP_listunspent_issue couldnt get a random peer?\n"); + } if ( retjson != 0 ) { n = cJSON_GetArraySize(retjson); From c92909932dac9c19ed2fe642a72a39e3822d7592 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:54:04 +0300 Subject: [PATCH 0965/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_rpc.c | 8 ++++---- iguana/exchanges/LP_socket.c | 12 ++++++------ iguana/exchanges/LP_utxo.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 9bf11f909..3eba63939 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -771,7 +771,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 )//|| relcoin->electrum == 0 ) + if ( n < 10 && bids[i]->numutxos == 0 )//|| relcoin->electrum == 0 ) { LP_address(relcoin,bids[i]->coinaddr); if ( relcoin->electrum == 0 ) @@ -790,7 +790,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 )//|| basecoin->electrum == 0 ) + if ( n < 10 && asks[i]->numutxos == 0 )//|| basecoin->electrum == 0 ) { LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index fcca1d487..c79e0fde8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -326,7 +326,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) return(0); return(LP_gettxout_json(txid,vout,up->U.height,coinaddr,up->U.value)); } - if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 ) + if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr,1)) != 0 ) { //printf("array.(%s)\n",jprint(array,0)); if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 ) @@ -435,7 +435,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } else return(LP_address_utxos(coin,coinaddr,0)); - } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)); + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); } int32_t LP_listunspent_issue(char *symbol,char *coinaddr) @@ -447,7 +447,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { if ( coin->electrum != 0 ) { - if ( (retjson= electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + if ( (retjson= electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)) != 0 ) { n = cJSON_GetArraySize(retjson); //printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); @@ -473,7 +473,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) if ( retjson != 0 ) { n = cJSON_GetArraySize(retjson); - if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 ) + if ( electrum_process_array(coin,0,coinaddr,retjson,1) != 0 ) { //LP_postutxos(symbol,coinaddr); // might be good to not saturate } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f4b7fe22c..1c49e20ac 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -295,7 +295,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) return(ep); } -int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep,char *coinaddr,cJSON *array) +int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep,char *coinaddr,cJSON *array,int32_t electrumflag) { int32_t i,v,n,ht,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*retjson,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) @@ -304,7 +304,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep for (i=0; ielectrum == 0 ) + if ( electrumflag == 0 ) { txid = jbits256(item,"txid"); v = jint(item,"vout"); @@ -493,11 +493,11 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_mempool",addr,ELECTRUM_TIMEOUT); //printf("MEMPOOL.(%s)\n",jprint(retjson,0)); - electrum_process_array(coin,ep,addr,retjson); + electrum_process_array(coin,ep,addr,retjson,1); return(retjson); } -cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) +cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr,int32_t electrumflag) { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); @@ -506,7 +506,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); - if ( electrum_process_array(coin,ep,addr,retjson) != 0 ) + if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); @@ -654,7 +654,7 @@ void electrum_test() printf("electrum_address_getmempool %s\n",jprint(retjson,1)); if ( (retjson= electrum_address_getbalance(symbol,ep,0,addr)) != 0 ) printf("electrum_address_getbalance %s\n",jprint(retjson,1)); - if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr)) != 0 ) + if ( (retjson= electrum_address_listunspent(symbol,ep,0,addr,1)) != 0 ) printf("electrum_address_listunspent %s\n",jprint(retjson,1)); if ( (retjson= electrum_addpeer(symbol,ep,0,"electrum.be:50001")) != 0 ) printf("electrum_addpeer %s\n",jprint(retjson,1)); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index eedac4669..17e260145 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -489,7 +489,7 @@ char *LP_postedutxos(cJSON *argjson) if ( (array= jarray(&n,argjson,"utxos")) != 0 ) LP_unspents_array(coin,coinaddr,array); } - else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr)) != 0 ) + else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) free_json(array); } return(clonestr("{\"result\":\"success\"}")); From ee721e5a1b031bd56fdf6c465aa9c842038c31f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 13:59:14 +0300 Subject: [PATCH 0966/2732] Test --- iguana/exchanges/LP_ordermatch.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f9bb6b3e9..e6e89bc05 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -461,13 +461,13 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u if ( (backupep= ep->prev) == 0 ) backupep = ep; } - printf("LP_nearest_utxovalue %s utxos[%d] target %.8f\n",coin->symbol,n,dstr(targetval)); + //printf("LP_nearest_utxovalue %s utxos[%d] target %.8f\n",coin->symbol,n,dstr(targetval)); for (i=0; iU.value - targetval); - printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); + //printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); if ( up->spendheight <= 0 ) { if ( coin->electrum != 0 ) @@ -483,20 +483,20 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u } if ( dist >= 0 && dist < mindist ) { - printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); + //printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); mini = i; mindist = dist; } } } } - printf("return mini.%d\n",mini); + //printf("return mini.%d\n",mini); return(mini); } uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { - printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); + //printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); if ( relvolume > dstr(desttxfee) && price > SMALLVAL ) return(SATOSHIDEN * (relvolume / price) + 2*txfee); else return(0); @@ -510,7 +510,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + //printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) @@ -537,7 +537,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** return(utxo); } } - } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); + } //else printf("cant find targetval2 %.8f\n",dstr(targetval2)); } else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); @@ -863,7 +863,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(&zero,0,sizeof(zero)); msg2 = clonestr(msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); - //LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); + sleep(1); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); //LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(2); @@ -984,7 +985,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(0); utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); - printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); + //printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) @@ -996,7 +997,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i item = jitem(asks,i); price = jdouble(item,"price"); pubkey = jbits256(item,"pubkey"); - printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); + //printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { for (j=0; j Date: Sat, 14 Oct 2017 14:07:37 +0300 Subject: [PATCH 0967/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 10 +++++----- iguana/exchanges/LP_prices.c | 6 +++--- iguana/exchanges/LP_rpc.c | 15 +++++++++------ iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 6 +++--- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index bb2fb1c4c..8acc60b7c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -379,7 +379,7 @@ dividends(coin, height, )\n\ { if ( coinaddr[0] != 0 ) { - LP_listunspent_issue(coin,coinaddr); + LP_listunspent_issue(coin,coinaddr,1); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c3ee027af..cda18e7f7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -316,7 +316,7 @@ void LP_smartutxos_push(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); -int32_t LP_listunspent_both(char *symbol,char *coinaddr); +int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag); uint16_t LP_randpeer(char *destip); cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys); //int32_t LP_butxo_findeither(bits256 txid,int32_t vout); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 655cdb012..e5686e5a3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -375,7 +375,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( coin->smartaddr[0] == 0 ) continue; total = 0; - if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr)) == 0 ) + if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr,0)) == 0 ) continue; if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e6e89bc05..d12d66312 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -252,7 +252,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"address",coinaddr); msg = jprint(reqjson,1); - printf("BROADCAST.(%s)\n",msg); + //printf("BROADCAST.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,"","",zero,msg); } @@ -733,7 +733,7 @@ char *LP_connectedalice(cJSON *argjson) // alice } } -int32_t LP_listunspent_both(char *symbol,char *coinaddr) +int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) { int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); if ( coin != 0 )//&& (IAMLP != 0 || coin->inactive == 0) ) @@ -743,7 +743,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) //printf("issue path electrum.%p\n",coin->electrum); //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) // free_json(array); - n = LP_listunspent_issue(symbol,coinaddr); + n = LP_listunspent_issue(symbol,coinaddr,fullflag); } else { @@ -799,7 +799,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); - LP_listunspent_both(Q.srccoin,Q.coinaddr); + LP_listunspent_both(Q.srccoin,Q.coinaddr,0); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { Q.txid = butxo->payment.txid; @@ -1009,7 +1009,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); LP_listunspent_query(base,coinaddr); - LP_listunspent_both(base,coinaddr); + LP_listunspent_both(base,coinaddr,1); asatoshis = autxo->S.satoshis; for (j=0; jsymbol,coinaddr); + LP_listunspent_both(coin->symbol,coinaddr,0); if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { total = 0; @@ -775,7 +775,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { LP_address(relcoin,bids[i]->coinaddr); if ( relcoin->electrum == 0 ) - LP_listunspent_issue(rel,bids[i]->coinaddr); + LP_listunspent_issue(rel,bids[i]->coinaddr,0); LP_listunspent_query(rel,bids[i]->coinaddr); n++; } @@ -794,7 +794,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) - LP_listunspent_issue(base,asks[i]->coinaddr); + LP_listunspent_issue(base,asks[i]->coinaddr,0); LP_listunspent_query(base,asks[i]->coinaddr); n++; } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c79e0fde8..1ebceefeb 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -438,7 +438,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); } -int32_t LP_listunspent_issue(char *symbol,char *coinaddr) +int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) { struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; if ( symbol == 0 || symbol[0] == 0 ) @@ -463,12 +463,15 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) else if ( IAMLP == 0 ) { LP_listunspent_query(coin->symbol,coin->smartaddr); - if ( (destport= LP_randpeer(destip)) > 0 ) + if ( fullflag != 0 ) { - retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); - printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); - retjson = cJSON_Parse(retstr); - } else printf("LP_listunspent_issue couldnt get a random peer?\n"); + if ( (destport= LP_randpeer(destip)) > 0 ) + { + retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); + printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); + retjson = cJSON_Parse(retstr); + } else printf("LP_listunspent_issue couldnt get a random peer?\n"); + } } if ( retjson != 0 ) { diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 23e76098e..eb721e2ee 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -481,7 +481,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } free(array); } - LP_listunspent_issue(coin->symbol,coinaddr); + LP_listunspent_issue(coin->symbol,coinaddr,1); struct LP_address_utxo *up; if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 17e260145..d15ae08b1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -722,7 +722,7 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } else { - LP_listunspent_issue(symbol,coinaddr); + LP_listunspent_issue(symbol,coinaddr,1); if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) numconfirms = (LP_getheight(coin) - ht + 1); else if ( mempool != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 499f6bff1..376158308 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -452,7 +452,7 @@ cJSON *LP_inventory(char *symbol) if ( (coin= LP_coinfind(symbol)) != 0 ) { coin->unspenttime = (uint32_t)time(NULL) - 777; - LP_listunspent_both(symbol,coin->smartaddr); + LP_listunspent_both(symbol,coin->smartaddr,0); } HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { @@ -519,7 +519,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) - LP_listunspent_issue(coin->symbol,coin->smartaddr); + LP_listunspent_issue(coin->symbol,coin->smartaddr,0); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0); @@ -746,7 +746,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan } if ( coin->electrum == 0 && coin->userpass[0] != 0 ) { - LP_listunspent_issue(coin->symbol,coin->smartaddr); + LP_listunspent_issue(coin->symbol,coin->smartaddr,0); if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) { if ( jobj(retjson,"error") != 0 ) From fc7a9e3e4d8d66d17ed642b8734b0311b62b75e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 14:24:48 +0300 Subject: [PATCH 0968/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 19 +++++++++++++++---- iguana/exchanges/LP_ordermatch.c | 17 +++++++---------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e5686e5a3..ef38ff29f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,7 +21,6 @@ // // SPV at tx level and limit SPV proofing -// coins file // stats, fix pricearray // sign packets // dPoW security @@ -33,9 +32,10 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex; int32_t LP_canbind; -char *Broadcaststr; +char *Broadcaststr,*Reserved_msgs[1000]; +int32_t num_Reserved_msgs; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; @@ -689,7 +689,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint 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; long filesize,n; int32_t 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; bits256 zero; long filesize,n; int32_t 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(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { @@ -747,6 +747,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_messagemutex); portable_mutex_init(&LP_portfoliomutex); portable_mutex_init(&LP_butxomutex); + portable_mutex_init(&LP_reservedmutex); #ifndef _WIN32 if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) { @@ -853,6 +854,16 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; + memset(zero.bytes,0,sizeof(zero)); + portable_mutex_lock(&LP_reservedmutex); + while ( num_Reserved_msgs > 0 ) + { + num_Reserved_msgs--; + printf("BROADCASTING RESERVED.(%s)\n",Reserved_msgs[num_Reserved_msgs]); + LP_broadcast_message(pubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); + Reserved_msgs[num_Reserved_msgs] = 0; + } + portable_mutex_unlock(&LP_reservedmutex); if ( nonz == 0 ) usleep(10000); else if ( IAMLP != 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d12d66312..ab79fdb7a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -474,12 +474,11 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u { if (up->SPV == 0 ) up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); if ( up->SPV < 0 ) { printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); continue; - } + } else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } if ( dist >= 0 && dist < mindist ) { @@ -859,14 +858,12 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { - bits256 zero; char *msg2; - memset(&zero,0,sizeof(zero)); - msg2 = clonestr(msg); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg); - sleep(1); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); - //LP_butxo_swapfields_set(butxo); - printf("return after RESERVED\n"); + portable_mutex_lock(&LP_reservedmutex); + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) + Reserved_msgs[num_Reserved_msgs++] = msg; + else LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + portable_mutex_unlock(&LP_reservedmutex); + printf("return after queued RESERVED\n"); return(2); } } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); From 22bf05fd51d7a12a3339bcb89bb612a30739ca22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 14:26:04 +0300 Subject: [PATCH 0969/2732] Test --- crypto777/bitcoind_RPC.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 0ef7dfab0..559ea4d02 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -55,6 +55,7 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * long i,j,len; char *retstr = 0; cJSON *json,*result,*error; + usleep(1000); //printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,rpcstr); if ( command == 0 || rpcstr == 0 || rpcstr[0] == 0 ) { From 6024c12d6328c2c75b3ee924c7e0d5c7626ff844 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 14:34:20 +0300 Subject: [PATCH 0970/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 31 +++++++++++++++++++------------ iguana/exchanges/LP_network.c | 3 ++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index cda18e7f7..8dadf593a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -295,6 +295,7 @@ int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsoc uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); +int32_t LP_reserved_msgs(); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ef38ff29f..cb75ec172 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -551,7 +551,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->addr_listunspent_requested != 0 ) { - printf("addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + //printf("addr_listunspent_requested %u\n",coin->addr_listunspent_requested); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } @@ -687,9 +687,26 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } } +int32_t LP_reserved_msgs() +{ + bits256 zero; int32_t n = 0; + memset(zero.bytes,0,sizeof(zero)); + portable_mutex_lock(&LP_reservedmutex); + while ( num_Reserved_msgs > 0 ) + { + num_Reserved_msgs--; + printf("BROADCASTING RESERVED.(%s)\n",Reserved_msgs[num_Reserved_msgs]); + LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); + Reserved_msgs[num_Reserved_msgs] = 0; + n++; + } + portable_mutex_unlock(&LP_reservedmutex); + return(n); +} + 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; bits256 zero; long filesize,n; int32_t 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; long filesize,n; int32_t 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(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { @@ -854,16 +871,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; - memset(zero.bytes,0,sizeof(zero)); - portable_mutex_lock(&LP_reservedmutex); - while ( num_Reserved_msgs > 0 ) - { - num_Reserved_msgs--; - printf("BROADCASTING RESERVED.(%s)\n",Reserved_msgs[num_Reserved_msgs]); - LP_broadcast_message(pubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); - Reserved_msgs[num_Reserved_msgs] = 0; - } - portable_mutex_unlock(&LP_reservedmutex); if ( nonz == 0 ) usleep(10000); else if ( IAMLP != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 582c1f37a..961f36ef3 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -144,6 +144,7 @@ void queue_loop(void *ignore) struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; while ( 1 ) { + LP_reserved_msgs(); nonz = 0; //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); n = 0; @@ -199,7 +200,7 @@ void queue_loop(void *ignore) //if ( n != 0 ) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) - usleep(50000); + usleep(5000); } } From c25a6936236181a5fe0827a6e24812027b749a6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:01:44 +0300 Subject: [PATCH 0971/2732] Test --- iguana/exchanges/LP_commands.c | 4 +-- iguana/exchanges/LP_include.h | 3 +- iguana/exchanges/LP_nativeDEX.c | 24 ++++++++++++++-- iguana/exchanges/LP_ordermatch.c | 47 ++++++++++++++------------------ iguana/exchanges/LP_peers.c | 5 ++-- iguana/exchanges/LP_utxo.c | 5 ++-- 6 files changed, 48 insertions(+), 40 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8acc60b7c..a61fe617c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -521,11 +521,9 @@ dividends(coin, height, )\n\ } else { - char *msg; memset(zero.bytes,0,sizeof(zero)); - msg = jprint(reqjson,0); //printf("broadcast.(%s)\n",msg); - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,msg); + LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8dadf593a..34f16721a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -43,7 +43,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 60 +#define LP_AUTOTRADE_TIMEOUT 10 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 @@ -296,6 +296,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_reserved_msgs(); +int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cb75ec172..be9c2519f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,7 +20,7 @@ // marketmaker // -// SPV at tx level and limit SPV proofing +// -SPV at tx level and limit SPV proofing // stats, fix pricearray // sign packets // dPoW security @@ -35,7 +35,7 @@ portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex; int32_t LP_canbind; char *Broadcaststr,*Reserved_msgs[1000]; -int32_t num_Reserved_msgs; +int32_t num_Reserved_msgs,max_Reserved_msgs; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; @@ -355,7 +355,7 @@ void LP_smartutxos_push(struct iguana_info *coin) jaddnum(req,"ht",height); jadd64bits(req,"value",value); //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_broadcast_message(LP_mypubsock,"","",zero,jprint(req,1)); + LP_reserved_msg("","",zero,jprint(req,1)); } } } @@ -704,6 +704,24 @@ int32_t LP_reserved_msgs() return(n); } +int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) +{ + int32_t n = 0; + portable_mutex_lock(&LP_reservedmutex); + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) + { + Reserved_msgs[num_Reserved_msgs++] = msg; + n = num_Reserved_msgs; + } else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); + portable_mutex_unlock(&LP_reservedmutex); + if ( num_Reserved_msgs > max_Reserved_msgs ) + { + max_Reserved_msgs = num_Reserved_msgs; + printf("New max_Reserved_msgs.%d\n",max_Reserved_msgs); + } + return(n); +} + 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; long filesize,n; int32_t 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(); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ab79fdb7a..9779c1c55 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -219,41 +219,37 @@ char *LP_quotereceived(cJSON *argjson) char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { - bits256 zero; char *msg; cJSON *reqjson = cJSON_CreateObject(); + bits256 zero; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); jaddbits256(reqjson,"pubkey",G.LP_mypub25519); jaddstr(reqjson,"base",base); jaddstr(reqjson,"rel",rel); jaddnum(reqjson,"price",price); jaddstr(reqjson,"method","postprice"); - msg = jprint(reqjson,1); - LP_broadcast_message(pubsock,base,rel,zero,msg); + LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); return(clonestr("{\"result\":\"success\"}")); } void LP_notify_pubkeys(void *ctx,int32_t pubsock) { - bits256 zero; char *msg,secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); + bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); jaddstr(reqjson,"method","notify"); jaddstr(reqjson,"rmd160",G.LP_myrmd160str); jaddbits256(reqjson,"pub",G.LP_mypub25519); init_hexbytes_noT(secpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",secpstr); - msg = jprint(reqjson,1); - LP_broadcast_message(pubsock,"","",zero,msg); + LP_reserved_msg("","",zero,jprint(reqjson,1)); } void LP_listunspent_query(char *symbol,char *coinaddr) { - bits256 zero; char *msg; cJSON *reqjson = cJSON_CreateObject(); + bits256 zero; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); jaddstr(reqjson,"method","addr_unspents"); jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"address",coinaddr); - msg = jprint(reqjson,1); - //printf("BROADCAST.(%s)\n",msg); - LP_broadcast_message(LP_mypubsock,"","",zero,msg); + LP_reserved_msg("","",zero,jprint(reqjson,1)); } char *LP_postedprice(cJSON *argjson) @@ -401,11 +397,16 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L msg = jprint(reqjson,1); printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); - if ( 1 && strcmp(method,"request") == 0 ) + portable_mutex_lock(&LP_reservedmutex); + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) + Reserved_msgs[num_Reserved_msgs++] = msg; + else { - sleep(3); - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); - } else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); + if ( 1 && strcmp(method,"request") == 0 ) + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); + else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); + } + portable_mutex_unlock(&LP_reservedmutex); for (i=0; i<20; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) @@ -581,7 +582,7 @@ void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *base,char *rel,double price,struct LP_quoteinfo *qp) { - char pairstr[512],*msg; cJSON *retjson; bits256 privkey; int32_t pair=-1,retval = -1,DEXselector = 0; struct basilisk_swap *swap; struct iguana_info *coin; + char pairstr[512]; cJSON *retjson; bits256 privkey; int32_t pair=-1,retval = -1,DEXselector = 0; struct basilisk_swap *swap; struct iguana_info *coin; printf("LP_connectstartbob.(%s) with.(%s) %s\n",LP_myipaddr,jprint(argjson,0),LP_myipaddr); qp->quotetime = (uint32_t)time(NULL); if ( (coin= LP_coinfind(utxo->coin)) == 0 ) @@ -609,8 +610,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jaddnum(retjson,"requestid",qp->R.requestid); jaddnum(retjson,"quoteid",qp->R.quoteid); char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); - msg = jprint(retjson,1); - LP_broadcast_message(pubsock,base,rel,utxo->S.otherpubkey,msg); + LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,1)); retval = 0; } else printf("error launching swaploop\n"); } else printf("couldnt bind to any port %s\n",pairstr); @@ -856,16 +856,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddstr(retjson,"method","reserved"); msg = jprint(retjson,1); butxo->T.lasttime = (uint32_t)time(NULL); - printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); - { - portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) - Reserved_msgs[num_Reserved_msgs++] = msg; - else LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); - portable_mutex_unlock(&LP_reservedmutex); - printf("return after queued RESERVED\n"); - return(2); - } + printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); + LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + return(2); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } else if ( strcmp(method,"connect") == 0 ) // bob diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 5c7efb7e7..a7ffdf846 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -128,11 +128,10 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char portable_mutex_unlock(&LP_peermutex); if ( IAMLP != 0 && mypubsock >= 0 ) { - struct iguana_info *coin,*ctmp; bits256 zero; char *msg,busaddr[64]; - msg = jprint(LP_peerjson(peer),1); + struct iguana_info *coin,*ctmp; bits256 zero; char busaddr[64]; memset(zero.bytes,0,sizeof(zero)); //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); - LP_broadcast_message(mypubsock,"","",zero,msg); + LP_reserved_msg("","",zero,jprint(LP_peerjson(peer),1)); if ( 0 ) { HASH_ITER(hh,LP_coins,coin,ctmp) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d15ae08b1..214bef80b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -417,7 +417,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr void LP_postutxos(char *symbol,char *coinaddr) { - bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); + bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); @@ -430,9 +430,8 @@ void LP_postutxos(char *symbol,char *coinaddr) jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"coinaddr",coinaddr); jadd(reqjson,"utxos",array); - msg = jprint(reqjson,1); //printf("post (%s) -> %d\n",msg,LP_mypubsock); - LP_broadcast_message(LP_mypubsock,symbol,symbol,zero,msg); + LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); } } } From 2b085290d1b0ae03c0640a1a87b11ce35569f008 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:05:30 +0300 Subject: [PATCH 0972/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index be9c2519f..92a8de55d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -695,7 +695,7 @@ int32_t LP_reserved_msgs() while ( num_Reserved_msgs > 0 ) { num_Reserved_msgs--; - printf("BROADCASTING RESERVED.(%s)\n",Reserved_msgs[num_Reserved_msgs]); + //printf("BROADCASTING RESERVED.(%s)\n",Reserved_msgs[num_Reserved_msgs]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; n++; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9779c1c55..825f45e31 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -596,9 +596,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-2*qp->txfee,rel,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); - printf("call swapinit\n"); swap = LP_swapinit(1,0,privkey,&qp->R,qp); - printf("swapinit.%p\n",swap); swap->N.pair = pair; utxo->S.swap = swap; swap->utxo = utxo; From e78962ae7c14f6a55b27a3dcbfd4b1905e94bedb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:15:09 +0300 Subject: [PATCH 0973/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a61fe617c..3c7b70358 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -406,7 +406,7 @@ dividends(coin, height, )\n\ retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"reserved") == 0 ) { - //printf("RESERVED.(%s)\n",jprint(argjson,0)); + printf("received RESERVED.(%s)\n",jprint(argjson,0)); retstr = LP_quotereceived(argjson); } else if ( strcmp(method,"connected") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 92a8de55d..3594d76e5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -282,6 +282,7 @@ void command_rpcloop(void *myipaddr) origipaddr = "127.0.0.1"; while ( 1 ) { + fprintf(stderr,"."); nonz = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 825f45e31..4d8fb64ee 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -402,9 +402,9 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L Reserved_msgs[num_Reserved_msgs++] = msg; else { - if ( 1 && strcmp(method,"request") == 0 ) + //if ( 1 && strcmp(method,"request") == 0 ) LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); - else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); + //else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); } portable_mutex_unlock(&LP_reservedmutex); for (i=0; i<20; i++) @@ -772,7 +772,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char *method,*msg; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { - printf("LP_tradecommand: check received %s\n",method); + printf("LP_tradecommand: check received method %s\n",method); retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) { From 2458905607b2963a21934a3cd2c945cef11ed5c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:22:55 +0300 Subject: [PATCH 0974/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 65 ++++++++++++++++++-------------- iguana/exchanges/LP_ordermatch.c | 3 ++ 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 34f16721a..8f1698718 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -295,6 +295,7 @@ int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsoc uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); +int32_t LP_nanomsg_recvs(void *ctx); int32_t LP_reserved_msgs(); int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3594d76e5..652aab67e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -32,7 +32,7 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex; int32_t LP_canbind; char *Broadcaststr,*Reserved_msgs[1000]; int32_t num_Reserved_msgs,max_Reserved_msgs; @@ -274,40 +274,48 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int return(nonz); } -void command_rpcloop(void *myipaddr) +int32_t LP_nanomsg_recvs(void *ctx) { - int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; void *ctx; - ctx = bitcoin_ctx(); - if ( (origipaddr= myipaddr) == 0 ) + int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; + if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; - while ( 1 ) + fprintf(stderr,"."); + portable_mutex_lock(&LP_nanorecvsmutex); + HASH_ITER(hh,LP_peerinfos,peer,tmp) { - fprintf(stderr,"."); - nonz = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) + if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( peer->errors >= LP_MAXPEER_ERRORS ) + if ( (rand() % 10000) == 0 ) + peer->errors--; + else { - if ( (rand() % 10000) == 0 ) - peer->errors--; - else - { - //printf("skip %s\n",peer->ipaddr); - continue; - } + //printf("skip %s\n",peer->ipaddr); + continue; } - //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); - nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr); } - /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht - { - if ( coin->inactive != 0 ) - continue; - if ( coin->bussock >= 0 ) - nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); - }*/ - if ( LP_mypullsock >= 0 ) - nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); + //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); + nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr); + } + /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht + { + if ( coin->inactive != 0 ) + continue; + if ( coin->bussock >= 0 ) + nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); + }*/ + if ( LP_mypullsock >= 0 ) + nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); + portable_mutex_unlock(&LP_nanorecvsmutex); + return(nonz); +} + +void command_rpcloop(void *myipaddr) +{ + int32_t nonz = 0; void *ctx; + ctx = bitcoin_ctx(); + while ( 1 ) + { + nonz = LP_nanomsg_recvs(ctx); //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) @@ -784,6 +792,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_portfoliomutex); portable_mutex_init(&LP_butxomutex); portable_mutex_init(&LP_reservedmutex); + portable_mutex_init(&LP_nanorecvsmutex); #ifndef _WIN32 if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4d8fb64ee..adb37bddf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -417,6 +417,9 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L break; } } + while ( 1 ) + if ( LP_nanomsg_recvs(ctx) <= 0 ) + break; sleep(1); } return(price); From d616e9d50ac04e1c609585f2170b811d67a29c9d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:25:41 +0300 Subject: [PATCH 0975/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 652aab67e..9556a9eb9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -280,7 +280,7 @@ int32_t LP_nanomsg_recvs(void *ctx) if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; fprintf(stderr,"."); - portable_mutex_lock(&LP_nanorecvsmutex); + //portable_mutex_lock(&LP_nanorecvsmutex); HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors >= LP_MAXPEER_ERRORS ) @@ -305,7 +305,7 @@ int32_t LP_nanomsg_recvs(void *ctx) }*/ if ( LP_mypullsock >= 0 ) nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); - portable_mutex_unlock(&LP_nanorecvsmutex); + //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz); } From fc3162c5aeecdc553b3404b8af1671d948cefb17 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:39:52 +0300 Subject: [PATCH 0976/2732] Test --- iguana/exchanges/LP_commands.c | 10 ------ iguana/exchanges/LP_nativeDEX.c | 4 +-- iguana/exchanges/LP_ordermatch.c | 55 +++++++++++++++++++------------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3c7b70358..bd7f000c9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -404,16 +404,6 @@ dividends(coin, height, )\n\ return(clonestr("{\"result\":\"at least one of coins disabled\"}")); else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) retstr = clonestr("{\"result\":\"coin is disabled\"}"); - else if ( strcmp(method,"reserved") == 0 ) - { - printf("received RESERVED.(%s)\n",jprint(argjson,0)); - retstr = LP_quotereceived(argjson); - } - else if ( strcmp(method,"connected") == 0 ) - { - //printf("CONNECTED.(%s)\n",jprint(argjson,0)); - retstr = LP_connectedalice(argjson); - } else if ( strcmp(method,"checktxid") == 0 ) retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9556a9eb9..c34b6c997 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -257,14 +257,14 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) printf("self.(%s)\n",str); - portable_mutex_lock(&LP_commandmutex); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { + portable_mutex_lock(&LP_commandmutex); if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) free(retstr); + portable_mutex_unlock(&LP_commandmutex); } free_json(argjson); - portable_mutex_unlock(&LP_commandmutex); } free(str); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index adb37bddf..1c462ce17 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -376,9 +376,9 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) return(-1); } -double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) +void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -386,7 +386,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L else { printf("couldnt find my txid to make request\n"); - return(0.); + return; } } reqjson = LP_quotejson(qp); @@ -407,22 +407,6 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L //else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); } portable_mutex_unlock(&LP_reservedmutex); - for (i=0; i<20; i++) - { - if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) - { - if ( flag == 0 || bits256_nonz(qp->desthash) != 0 ) - { - printf("break out of loop.%d price %.8f %s/%s\n",i,price,qp->srccoin,qp->destcoin); - break; - } - } - while ( 1 ) - if ( LP_nanomsg_recvs(ctx) <= 0 ) - break; - sleep(1); - } - return(price); } int32_t LP_nanobind(void *ctx,char *pairstr) @@ -772,11 +756,25 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received method %s\n",method); retval = 1; + if ( strcmp(method,"reserved") == 0 ) + { + printf("alice received RESERVED.(%s)\n",jprint(argjson,0)); + if ( (retstr= LP_quotereceived(argjson)) != 0 ) + free(retstr); + return(1); + } + else if ( strcmp(method,"connected") == 0 ) + { + printf("alice received CONNECTED.(%s)\n",jprint(argjson,0)); + if ( (retstr= LP_connectedalice(argjson)) != 0 ) + free(retstr); + return(1); + } if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) { if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) @@ -898,15 +896,26 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(clonestr("{\"error\":\"cant find alice utxopair\"}")); } - price = LP_query(ctx,myipaddr,mypubsock,"request",qp); + expiration = (uint32_t)time(NULL) + timeout; + price = 0.; + LP_query(ctx,myipaddr,mypubsock,"request",qp); + while ( time(NULL) < expiration ) + { + if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) + { + printf("break out of price %.8f %s/%s\n",price,qp->srccoin,qp->destcoin); + break; + } + sleep(1); + } bestitem = LP_quotejson(qp); if ( LP_pricevalid(price) > 0 ) { if ( price <= maxprice ) { - price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); + LP_query(ctx,myipaddr,mypubsock,"connect",qp); + //price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-2*qp->txfee,qp->destcoin,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); - expiration = (uint32_t)time(NULL) + timeout; while ( time(NULL) < expiration ) { if ( aliceutxo->S.swap != 0 ) From f6c0ad1e19a5e7e734eb7812892e9f3faa6130f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:42:46 +0300 Subject: [PATCH 0977/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1c462ce17..acddaf616 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -757,7 +757,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { char *method,*msg,*retstr; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); - if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) + if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { printf("LP_tradecommand: check received method %s\n",method); retval = 1; From 0b3a51b0a37447e2579ac9c99453d7010061255f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 15:46:13 +0300 Subject: [PATCH 0978/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c34b6c997..24ac8410b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -276,10 +276,14 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t LP_nanomsg_recvs(void *ctx) { - int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; + static double lastmilli; + int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; - fprintf(stderr,"."); + milli = OS_milliseconds(); + if ( milli > lastmilli+100 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f\n",milli-lastmilli); + lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); HASH_ITER(hh,LP_peerinfos,peer,tmp) { From cbb95b4aaa756331140ff8ed5f35acc8405c4c0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 16:15:36 +0300 Subject: [PATCH 0979/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 151 +++++++++++++---------------- iguana/exchanges/LP_statemachine.c | 58 +++++++++++ 3 files changed, 124 insertions(+), 87 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 24ac8410b..8792b7abb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -282,7 +282,7 @@ int32_t LP_nanomsg_recvs(void *ctx) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); if ( milli > lastmilli+100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f\n",milli-lastmilli); + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",milli-lastmilli); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); HASH_ITER(hh,LP_peerinfos,peer,tmp) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index acddaf616..5987e084d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -754,28 +754,85 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) return(n); } +char *LP_bestfit(char *rel,double relvolume) +{ + struct LP_utxoinfo *autxo; + if ( relvolume <= 0. || LP_priceinfofind(rel) == 0 ) + return(clonestr("{\"error\":\"invalid parameter\"}")); + if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) + return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + return(jprint(LP_utxojson(autxo),1)); +} + +struct LP_quoteinfo LP_Alicequery; +double LP_Alicemaxprice; +char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) +{ + struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; + if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) + { + char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); + return(clonestr("{\"error\":\"cant find alice utxopair\"}")); + } + price = 0.; + LP_query(ctx,myipaddr,mypubsock,"request",qp); + LP_Alicequery = *qp, LP_Alicemaxprice = maxprice; + return(clonestr("{\"result\":\"success\"}")); +} + +int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) +{ + if ( bits256_cmp(qp->srchash,qp2->srchash) == 0 && bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) + return(0); + else return(-1); +} + +void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) +{ + double price,maxprice = LP_Alicemaxprice; + if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) + { + price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); + if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) + { + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + LP_Alicemaxprice = 0.; + LP_query(ctx,myipaddr,mypubsock,"connect",qp); + } + } +} + int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*retstr; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { + LP_quoteparse(&Q,argjson); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); printf("LP_tradecommand: check received method %s\n",method); retval = 1; if ( strcmp(method,"reserved") == 0 ) { - printf("alice received RESERVED.(%s)\n",jprint(argjson,0)); - if ( (retstr= LP_quotereceived(argjson)) != 0 ) - free(retstr); + if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) + { + printf("alice received RESERVED.(%s)\n",jprint(argjson,0)); + if ( (retstr= LP_quotereceived(argjson)) != 0 ) + free(retstr); + LP_reserved(ctx,myipaddr,pubsock,&Q); + } return(1); } else if ( strcmp(method,"connected") == 0 ) { - printf("alice received CONNECTED.(%s)\n",jprint(argjson,0)); - if ( (retstr= LP_connectedalice(argjson)) != 0 ) - free(retstr); + if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) + { + printf("alice received CONNECTED.(%s)\n",jprint(argjson,0)); + if ( (retstr= LP_connectedalice(argjson)) != 0 ) + free(retstr); + } return(1); } - if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) + if ( bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) { if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { @@ -878,84 +935,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } -char *LP_bestfit(char *rel,double relvolume) -{ - struct LP_utxoinfo *autxo; - if ( relvolume <= 0. || LP_priceinfofind(rel) == 0 ) - return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) - return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - return(jprint(LP_utxojson(autxo),1)); -} - -char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) -{ - struct LP_utxoinfo *aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; - if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) - { - char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); - return(clonestr("{\"error\":\"cant find alice utxopair\"}")); - } - expiration = (uint32_t)time(NULL) + timeout; - price = 0.; - LP_query(ctx,myipaddr,mypubsock,"request",qp); - while ( time(NULL) < expiration ) - { - if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) - { - printf("break out of price %.8f %s/%s\n",price,qp->srccoin,qp->destcoin); - break; - } - sleep(1); - } - bestitem = LP_quotejson(qp); - if ( LP_pricevalid(price) > 0 ) - { - if ( price <= maxprice ) - { - LP_query(ctx,myipaddr,mypubsock,"connect",qp); - //price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); - LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-2*qp->txfee,qp->destcoin,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); - while ( time(NULL) < expiration ) - { - if ( aliceutxo->S.swap != 0 ) - break; - sleep(3); - } - jaddnum(bestitem,"quotedprice",price); - jaddnum(bestitem,"maxprice",maxprice); - if ( (swap= aliceutxo->S.swap) == 0 ) - { - if ( (pubp= LP_pubkeyadd(qp->srchash)) != 0 ) - pubp->numerrors++; - jaddstr(bestitem,"status","couldnt establish connection"); - } - else - { - jaddstr(bestitem,"status","connected"); - jaddnum(bestitem,"requestid",swap->I.req.requestid); - jaddnum(bestitem,"quoteid",swap->I.req.quoteid); - printf("Alice r.%u qp->%u\n",swap->I.req.requestid,swap->I.req.quoteid); - } - } - else - { - jaddnum(bestitem,"quotedprice",price); - jaddnum(bestitem,"maxprice",maxprice); - jaddstr(bestitem,"status","too expensive"); - } - } - else - { - printf("invalid price %.8f\n",price); - jaddnum(bestitem,"maxprice",maxprice); - jaddstr(bestitem,"status","no response to request"); - } - if ( aliceutxo->S.swap == 0 ) - LP_availableset(aliceutxo); - return(jprint(bestitem,0)); -} - struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct iguana_info *basecoin,char *coinaddr,uint64_t asatoshis,double price,uint64_t txfee,uint64_t desttxfee,bits256 pubkey,char *gui) { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index b32dbc83a..7eafd0392 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1871,6 +1871,64 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu } //else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos); return(n); } +bestitem = LP_quotejson(qp); +if ( LP_pricevalid(price) > 0 ) +{ + if ( price <= maxprice ) + { + LP_query(ctx,myipaddr,mypubsock,"connect",qp); + //price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-2*qp->txfee,qp->destcoin,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + while ( time(NULL) < expiration ) + { + if ( aliceutxo->S.swap != 0 ) + break; + sleep(3); + } + jaddnum(bestitem,"quotedprice",price); + jaddnum(bestitem,"maxprice",maxprice); + if ( (swap= aliceutxo->S.swap) == 0 ) + { + if ( (pubp= LP_pubkeyadd(qp->srchash)) != 0 ) + pubp->numerrors++; + jaddstr(bestitem,"status","couldnt establish connection"); + } + else + { + jaddstr(bestitem,"status","connected"); + jaddnum(bestitem,"requestid",swap->I.req.requestid); + jaddnum(bestitem,"quoteid",swap->I.req.quoteid); + printf("Alice r.%u qp->%u\n",swap->I.req.requestid,swap->I.req.quoteid); + } + } + else + { + jaddnum(bestitem,"quotedprice",price); + jaddnum(bestitem,"maxprice",maxprice); + jaddstr(bestitem,"status","too expensive"); + } +} +else +{ + printf("invalid price %.8f\n",price); + jaddnum(bestitem,"maxprice",maxprice); + jaddstr(bestitem,"status","no response to request"); +} +/*while ( time(NULL) < expiration ) + { + if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) + { + printf("break out of price %.8f %s/%s\n",price,qp->srccoin,qp->destcoin); + break; + } + sleep(1); + }*/ + +if ( aliceutxo->S.swap == 0 ) +LP_availableset(aliceutxo); +return(jprint(bestitem,0)); +} + /*if ( time(NULL) > coin->lastmonitor+60 ) { //portable_mutex_lock(&coin->addrmutex); From b5ca59087c72e4f7856501b46e4c28503d184ab1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 16:32:22 +0300 Subject: [PATCH 0980/2732] Test --- iguana/exchanges/LP_swap.c | 10 ++++++---- iguana/exchanges/LP_transaction.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index c59d9f203..fd2cd3ec7 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -419,10 +419,10 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) > 0 ) { - printf("start wait\n"); + //printf("start wait\n"); if ( (datalen= nn_recv(pairsock,&data,NN_MSG,0)) >= 0 ) { - printf("wait for got.%d\n",datalen); + //printf("wait for got.%d\n",datalen); retval = (*verify)(swap,data,datalen); nn_freemsg(data); //printf("retval.%d\n",retval); @@ -754,6 +754,8 @@ void LP_bobloop(void *_swap) } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) printf("error sending bobpayment\n"); + //if ( LP_waitfor(swap->N.pair,swap,10,LP_verify_alicespend) < 0 ) + // printf("error waiting for alicespend\n"); swap->sentflag = 1; swap->bobreclaim.utxovout = 0; swap->bobreclaim.utxotxid = swap->bobpayment.I.signedtxid; @@ -815,13 +817,13 @@ void LP_aliceloop(void *_swap) char str[65];printf("%d waiting for bobpayment %s to be confirmed.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); } - if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) + /*if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) { char str[65];printf("%d waiting for alicespend %s to be confirmed.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); - } + }*/ if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 869b17d59..c49486171 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1329,6 +1329,20 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data return(-1); } +int32_t LP_verify_alicespend(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) +{ + if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->alicespend,0,data,datalen,0) == 0 ) + { + printf("alicespend amount %.8f -> %s vs %s\n",dstr(swap->alicespend.I.amount),swap->alicespend.p2shaddr,swap->alicespend.I.destaddr); + if ( strcmp(swap->alicespend.I.destaddr,swap->alicespend.p2shaddr) == 0 ) + { + printf("alicespend verified\n"); + return(0); + } + } + return(-1); +} + /* Bob deposit: OP_IF OP_CLTV OP_DROP OP_CHECKSIG From 72c1886ee38dafc61697224f49520e105b97dec1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 16:40:33 +0300 Subject: [PATCH 0981/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index c49486171..a1a00ef5b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -942,7 +942,7 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t v memset(&spendtxid,0,sizeof(spendtxid)); if ( LP_spendsearch(&spendtxid,&spendvin,symbol,utxotxid,vout) > 0 ) printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); - else if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) + else if ( 0 && (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { if ( (retjson= LP_gettxout(symbol,coinaddr,utxotxid,vout)) == 0 ) { From b01f14849820ecb62336faa94a80da09a4ce905b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 16:58:17 +0300 Subject: [PATCH 0982/2732] Test --- iguana/exchanges/LP_remember.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index fca22ef2a..dcfecc5b2 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -548,7 +548,7 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t break; if ( i < 33 ) memcpy(rswap->other33,other33,33); - //printf(" <- %s dest33\n",dest33); + printf(" <- %s other33\n",dest33); } if ( (rswap->plocktime= juint(item,"plocktime")) == 0 ) rswap->plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); @@ -860,6 +860,11 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } + if ( rswap.iambob != 0 && rswap.Adestaddr[0] == 0 ) + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.other33,33); + if ( rswap.iambob == 0 && rswap.destaddr[0] == 0 ) + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.other33,33); + //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); From 20782429041d555b2fd1b6ade2d67a49be2b2577 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:04:52 +0300 Subject: [PATCH 0983/2732] Test --- iguana/exchanges/LP_remember.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index dcfecc5b2..3724b0394 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -511,7 +511,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t quoteid) { - char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; uint32_t r,q; int32_t i,j,n; uint8_t other33[33]; + char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; struct iguana_info *coin; uint32_t r,q; int32_t i,j,n; uint8_t other33[33]; memset(rswap,0,sizeof(*rswap)); rswap->requestid = requestid; rswap->quoteid = quoteid; @@ -548,7 +548,11 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t break; if ( i < 33 ) memcpy(rswap->other33,other33,33); - printf(" <- %s other33\n",dest33); + if ( rswap->iambob != 0 && (coin= LP_coinfind(rswap->dest)) != 0 ) + bitcoin_address(rswap->Adestaddr,coin->taddr,coin->pubtype,rswap->other33,33); + else if ( (coin= LP_coinfind(rswap->src)) != 0 ) + bitcoin_address(rswap->destaddr,coin->taddr,coin->pubtype,rswap->other33,33); + printf("(%s %s) <- %s other33\n",rswap->destaddr,rswap->Adestaddr,dest33); } if ( (rswap->plocktime= juint(item,"plocktime")) == 0 ) rswap->plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); @@ -860,10 +864,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } - if ( rswap.iambob != 0 && rswap.Adestaddr[0] == 0 ) - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.other33,33); - if ( rswap.iambob == 0 && rswap.destaddr[0] == 0 ) - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.other33,33); //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); From 3b6d6231801f7412984db1ab5544226a5caab6de Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:10:00 +0300 Subject: [PATCH 0984/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5987e084d..a26e487d3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -954,7 +954,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; - maxiters = 100; + maxiters = 50; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 640512d18..d6244d1e0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -666,8 +666,8 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); - jaddnum(item,"minvolume",dstr(op->minsatoshis)); - jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); + jaddnum(item,"minvolume",dstr(op->minsatoshis)*0.8); + jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8); jaddbits256(item,"pubkey",op->pubkey); jaddnum(item,"age",time(NULL)-op->timestamp); } From 9edbaf27bce0ba67cbf26fa5b257fa321ac9ae78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:14:59 +0300 Subject: [PATCH 0985/2732] Test --- iguana/exchanges/LP_remember.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 3724b0394..fee76ad9a 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -536,6 +536,10 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t if ( (dest33= jstr(item,"dest33")) != 0 && strlen(dest33) == 66 ) { decode_hex(rswap->pubkey33,33,dest33); + if ( rswap->iambob != 0 && (coin= LP_coinfind(rswap->src)) != 0 ) + bitcoin_address(rswap->destaddr,coin->taddr,coin->pubtype,rswap->pubkey33,33); + else if ( rswap->iambob == 0 && (coin= LP_coinfind(rswap->dest)) != 0 ) + bitcoin_address(rswap->Adestaddr,coin->taddr,coin->pubtype,rswap->pubkey33,33); //for (i=0; i<33; i++) // printf("%02x",pubkey33[i]); //printf(" <- %s dest33\n",dest33); @@ -550,9 +554,9 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t memcpy(rswap->other33,other33,33); if ( rswap->iambob != 0 && (coin= LP_coinfind(rswap->dest)) != 0 ) bitcoin_address(rswap->Adestaddr,coin->taddr,coin->pubtype,rswap->other33,33); - else if ( (coin= LP_coinfind(rswap->src)) != 0 ) + else if ( rswap->iambob == 0 && (coin= LP_coinfind(rswap->src)) != 0 ) bitcoin_address(rswap->destaddr,coin->taddr,coin->pubtype,rswap->other33,33); - printf("(%s %s) <- %s other33\n",rswap->destaddr,rswap->Adestaddr,dest33); + printf("(%s, %s) <- %s other33\n",rswap->destaddr,rswap->Adestaddr,dest33); } if ( (rswap->plocktime= juint(item,"plocktime")) == 0 ) rswap->plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); @@ -842,7 +846,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.other33,33); Adest = rswap.destaddr; } } @@ -855,7 +859,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.other33,33); ABdest = rswap.Adestaddr; } } From bb12899d57879ad86a4e39f098220c5eb27d054a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:19:06 +0300 Subject: [PATCH 0986/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index fee76ad9a..7db2324eb 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -267,7 +267,7 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag if ( bits256_nonz(spendtxid) != 0 ) { sentflags[utxoind] = 1; - printf("utxoind.%d Alice.(%s) Bob.(%s)\n",utxoind,aliceaddr,bobaddr); + printf("utxoind.%d Alice.(%s %s) Bob.(%s %s) vs destaddr.(%s)\n",utxoind,aliceaddr,Adest,bobaddr,dest,destaddr); if ( aliceaddr != 0 && (strcmp(destaddr,aliceaddr) == 0 || strcmp(Adest,destaddr) == 0) ) { printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); From 337c73429097485a4bb4f7b78d5cfce0e791c1e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:26:00 +0300 Subject: [PATCH 0987/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 7db2324eb..3548c0b96 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -846,7 +846,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.other33,33); + bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); Adest = rswap.destaddr; } } @@ -859,7 +859,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.other33,33); + bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); ABdest = rswap.Adestaddr; } } From 6ff716c84d51af96db766d5cac45216f1afc0af0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:30:59 +0300 Subject: [PATCH 0988/2732] Test --- iguana/exchanges/LP_remember.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 3548c0b96..780e8a812 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -467,7 +467,7 @@ struct LP_swap_remember uint32_t requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; - char src[64],dest[64],destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; + char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; }; cJSON *LP_swap_json(struct LP_swap_remember *rswap) @@ -841,26 +841,26 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( alice != 0 ) { - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + //bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); AAdest = rswap.Adestaddr; } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); - Adest = rswap.destaddr; + bitcoin_address(rswap.Sdestaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + ABdest = rswap.Sdestaddr; } } else { if ( bob != 0 ) { - bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); + //bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); Bdest = rswap.destaddr; } if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { - bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - ABdest = rswap.Adestaddr; + bitcoin_address(rswap.Sdestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); + ABdest = rswap.Sdestaddr; } } if ( bob == 0 || alice == 0 ) From 56337413036c7cd946ca3fa4d527e0af57765e97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:37:08 +0300 Subject: [PATCH 0989/2732] Test --- iguana/exchanges/LP_remember.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 780e8a812..08604a1ab 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -842,13 +842,14 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( alice != 0 ) { //bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - AAdest = rswap.Adestaddr; + AAdest = Adest = rswap.Adestaddr; } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { bitcoin_address(rswap.Sdestaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); ABdest = rswap.Sdestaddr; } + Bdest = rswap.destaddr; } else { @@ -860,8 +861,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { bitcoin_address(rswap.Sdestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - ABdest = rswap.Sdestaddr; + AAdest = ABdest = rswap.Sdestaddr; } + Adest = rswap.Adestaddr; } if ( bob == 0 || alice == 0 ) { From addbb66d521dbfcd8f8ce72ce1a14e65a869d0ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:40:51 +0300 Subject: [PATCH 0990/2732] Test --- iguana/exchanges/LP_remember.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 08604a1ab..51e4692d0 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -842,14 +842,14 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( alice != 0 ) { //bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - AAdest = Adest = rswap.Adestaddr; + Adest = rswap.Adestaddr; } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { bitcoin_address(rswap.Sdestaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); - ABdest = rswap.Sdestaddr; + AAdest = rswap.Sdestaddr; } - Bdest = rswap.destaddr; + ABdest = Bdest = rswap.destaddr; } else { @@ -861,9 +861,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { bitcoin_address(rswap.Sdestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - AAdest = ABdest = rswap.Sdestaddr; + ABdest = rswap.Sdestaddr; } - Adest = rswap.Adestaddr; + AAdest = Adest = rswap.Adestaddr; } if ( bob == 0 || alice == 0 ) { From 93a3a93c71df96c0efbc7054be75536ffaf7a91b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:51:41 +0300 Subject: [PATCH 0991/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_scan.c | 9 +++++---- iguana/exchanges/LP_transaction.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8f1698718..f274f45e4 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -288,6 +288,7 @@ int32_t LP_ismine(struct LP_utxoinfo *utxo); int32_t LP_isavailable(struct LP_utxoinfo *utxo); struct LP_peerinfo *LP_peerfind(uint32_t ipbits,uint16_t port); uint64_t LP_value_extract(cJSON *obj,int32_t addinterest); +int32_t LP_swap_getcoinaddr(char *symbol,char *coinaddr,bits256 txid,int32_t vout); char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index eb721e2ee..6b71d89e9 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -391,7 +391,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) return(clonestr("{\"error\":\"symbol not found\"}")); } -int32_t LP_spendsearch(bits256 *spendtxidp,int32_t *indp,char *symbol,bits256 searchtxid,int32_t searchvout) +int32_t LP_spendsearch(char *coinaddr,bits256 *spendtxidp,int32_t *indp,char *symbol,bits256 searchtxid,int32_t searchvout) { struct LP_transaction *tx; struct iguana_info *coin; *indp = -1; @@ -402,6 +402,7 @@ int32_t LP_spendsearch(bits256 *spendtxidp,int32_t *indp,char *symbol,bits256 se { if ( searchvout < tx->numvouts && tx->outpoints[searchvout].spendvini >= 0 ) { + LP_swap_getcoinaddr(symbol,coinaddr,*spendtxidp,*indp); *spendtxidp = tx->outpoints[searchvout].spendtxid; *indp = tx->outpoints[searchvout].spendvini; return(tx->outpoints[searchvout].spendheight); @@ -504,7 +505,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int int32_t LP_mempool_vinscan(bits256 *spendtxidp,int32_t *spendvinp,char *symbol,char *coinaddr,bits256 searchtxid,int32_t searchvout,bits256 searchtxid2,int32_t searchvout2) { - struct iguana_info *coin; int32_t selector; cJSON *array; + struct iguana_info *coin; int32_t selector; cJSON *array; char addr[64]; if ( symbol == 0 || symbol[0] == 0 || bits256_nonz(searchtxid) == 0 || bits256_nonz(searchtxid2) == 0 ) return(-1); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) @@ -517,9 +518,9 @@ int32_t LP_mempool_vinscan(bits256 *spendtxidp,int32_t *spendvinp,char *symbol,c coin->lastmempool = (uint32_t)time(NULL); } } - if ( (selector= LP_spendsearch(spendtxidp,spendvinp,symbol,searchtxid,searchvout)) >= 0 ) + if ( (selector= LP_spendsearch(addr,spendtxidp,spendvinp,symbol,searchtxid,searchvout)) >= 0 ) return(selector); - else if ( (selector= LP_spendsearch(spendtxidp,spendvinp,symbol,searchtxid2,searchvout2)) >= 0 ) + else if ( (selector= LP_spendsearch(addr,spendtxidp,spendvinp,symbol,searchtxid2,searchvout2)) >= 0 ) return(selector); return(-1); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a1a00ef5b..320e6c745 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -940,7 +940,7 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t v destaddr[0] = 0; coinaddr[0] = 0; memset(&spendtxid,0,sizeof(spendtxid)); - if ( LP_spendsearch(&spendtxid,&spendvin,symbol,utxotxid,vout) > 0 ) + if ( LP_spendsearch(destaddr,&spendtxid,&spendvin,symbol,utxotxid,vout) > 0 ) printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); else if ( 0 && (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { From 3db8022cf3f65dfe9bdebd83923121d7f5ac8fb2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 17:58:46 +0300 Subject: [PATCH 0992/2732] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 6b71d89e9..193ee7e92 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -402,9 +402,9 @@ int32_t LP_spendsearch(char *coinaddr,bits256 *spendtxidp,int32_t *indp,char *sy { if ( searchvout < tx->numvouts && tx->outpoints[searchvout].spendvini >= 0 ) { - LP_swap_getcoinaddr(symbol,coinaddr,*spendtxidp,*indp); *spendtxidp = tx->outpoints[searchvout].spendtxid; *indp = tx->outpoints[searchvout].spendvini; + LP_swap_getcoinaddr(symbol,coinaddr,*spendtxidp,*indp); return(tx->outpoints[searchvout].spendheight); } } From d7e9262583d143129be686674236b6e5501136f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 18:09:50 +0300 Subject: [PATCH 0993/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a26e487d3..a08ef9d75 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -954,7 +954,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; - maxiters = 50; + maxiters = 100; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; basecoin = LP_coinfind(base); @@ -964,7 +964,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(0); utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); - //printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); + printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) From 9531dc745ba4f2510afd8463e4bf92d7b81b041c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 18:15:54 +0300 Subject: [PATCH 0994/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8792b7abb..a496f6094 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -281,7 +281,7 @@ int32_t LP_nanomsg_recvs(void *ctx) if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); - if ( milli > lastmilli+100 ) + if ( lastmilli > 0. && milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",milli-lastmilli); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); From 2b962fd334c68a8a5d7b9cb750fab42dc35096a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 18:48:19 +0300 Subject: [PATCH 0995/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a08ef9d75..706b4e13a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -679,7 +679,7 @@ char *LP_connectedalice(cJSON *argjson) // alice return(clonestr("{\"error\":\"cant get alicecoin\"}")); } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); - if ( bits256_nonz(Q.privkey) != 0 && Q.quotetime >= Q.timestamp-3 ) + if ( bits256_nonz(Q.privkey) != 0 )//&& Q.quotetime >= Q.timestamp-3 ) { retjson = cJSON_CreateObject(); if ( (pairstr= jstr(argjson,"pair")) == 0 || (pairsock= nn_socket(AF_SP,NN_PAIR)) < 0 ) @@ -712,7 +712,7 @@ char *LP_connectedalice(cJSON *argjson) // alice else { LP_availableset(autxo); - printf("no privkey found\n"); + printf("no privkey found coin.%s %s taddr.%u\n",Q.destcoin,Q.destaddr,coin->taddr); return(clonestr("{\"error\",\"no privkey\"}")); } } From 3ad4c4efb2abcf2e2b4315910a55da31c14d503d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 19:36:29 +0300 Subject: [PATCH 0996/2732] Fix state machine --- iguana/exchanges/LP_remember.c | 4 ++-- iguana/exchanges/LP_transaction.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 51e4692d0..ebb6cf3d3 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1052,9 +1052,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { - if ( bits256_nonz(rswap.paymentspent) != 0 || time(NULL) > rswap.expiration ) + if ( bits256_nonz(rswap.Apaymentspent) != 0 || time(NULL) > rswap.expiration ) { - printf("do the refund!\n"); + printf("do the refund! paymentspent.%s now.%u vs expiration.%u\n",bits256_str(str,rswap.paymentspent),(uint32_t)time(NULL),rswap.expiration); //if ( txbytes[BASILISK_BOBREFUND] == 0 ) { revcalc_rmd160_sha256(rswap.secretBn,rswap.privBn); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 320e6c745..95ce5fcb0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1077,16 +1077,16 @@ int32_t basilisk_swapuserdata(uint8_t *userdata,bits256 privkey,int32_t ifpath,b int32_t basilisk_bobpayment_reclaim(struct basilisk_swap *swap,int32_t delay) { - uint8_t userdata[512]; int32_t retval,len = 0; static bits256 zero; + uint8_t userdata[512]; int32_t retval,i,len = 0; static bits256 zero; //printf("basilisk_bobpayment_reclaim\n"); len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); memcpy(swap->I.userdata_bobreclaim,userdata,len); swap->I.userdata_bobreclaimlen = len; if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr)) == 0 ) { - //for (i=0; ibobreclaim.I.datalen; i++) - // printf("%02x",swap->bobreclaim.txbytes[i]); - //printf(" <- bobreclaim\n"); + for (i=0; ibobreclaim.I.datalen; i++) + printf("%02x",swap->bobreclaim.txbytes[i]); + printf(" <- bobreclaim\n"); //basilisk_txlog(swap,&swap->bobreclaim,delay); return(retval); } From 64759d4b8006931f8e9badd4c9cf26db1eb0147f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 19:45:21 +0300 Subject: [PATCH 0997/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index ebb6cf3d3..8c8f22050 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -556,7 +556,7 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t bitcoin_address(rswap->Adestaddr,coin->taddr,coin->pubtype,rswap->other33,33); else if ( rswap->iambob == 0 && (coin= LP_coinfind(rswap->src)) != 0 ) bitcoin_address(rswap->destaddr,coin->taddr,coin->pubtype,rswap->other33,33); - printf("(%s, %s) <- %s other33\n",rswap->destaddr,rswap->Adestaddr,dest33); + //printf("(%s, %s) <- %s other33\n",rswap->destaddr,rswap->Adestaddr,dest33); } if ( (rswap->plocktime= juint(item,"plocktime")) == 0 ) rswap->plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); From 1d7a72a64a6c1068f2722476a50e26ef4b45ce31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 19:49:54 +0300 Subject: [PATCH 0998/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 706b4e13a..939d9301e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -804,7 +804,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*retstr; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { LP_quoteparse(&Q,argjson); @@ -815,7 +815,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { - printf("alice received RESERVED.(%s)\n",jprint(argjson,0)); + printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) free(retstr); LP_reserved(ctx,myipaddr,pubsock,&Q); @@ -826,7 +826,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { - printf("alice received CONNECTED.(%s)\n",jprint(argjson,0)); + printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_connectedalice(argjson)) != 0 ) free(retstr); } From 5dfecd6f7a8f3d7c0c176c7d520be7bbe300e2d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 20:25:07 +0300 Subject: [PATCH 0999/2732] Reasonably stable --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a496f6094..416aea3d4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,11 +21,11 @@ // // -SPV at tx level and limit SPV proofing +// withdraw // stats, fix pricearray // sign packets -// dPoW security // electrum peers -// withdraw +// dPoW security and zeroconf // verify portfolio // bittrex balancing From f8d8268a4f4f52c3140c18425573f84296a46a19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 21:18:10 +0300 Subject: [PATCH 1000/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 8c8f22050..1785676a6 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -358,7 +358,7 @@ int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflag if ( bits256_nonz(depositspent) != 0 ) return(1); } - else if ( bits256_nonz(paymentspent) != 0 ) + else if ( bits256_nonz(Apaymentspent) != 0 ) return(1); } else From fa8a1412f1f4118be8fd569ef2c28395da3745ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 21:47:56 +0300 Subject: [PATCH 1001/2732] Test --- iguana/exchanges/LP_remember.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 1785676a6..fc3c7598c 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -645,7 +645,8 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t int32_t _LP_refht_update(struct iguana_info *coin,bits256 txid,int32_t refht) { - if ( refht > 0 && (coin->firstrefht == 0 || refht < coin->firstrefht) ) + refht -= 9; + if ( refht > 10 && (coin->firstrefht == 0 || refht < coin->firstrefht) ) { char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),refht,coin->firstscanht,coin->lastscanht); if ( coin->firstscanht == 0 || refht < coin->firstscanht ) From f05e427e23e738b28d055e500e28c2e35bc1a528 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 22:10:42 +0300 Subject: [PATCH 1002/2732] Test --- iguana/exchanges/LP_coins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 224e3a435..54450c061 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -84,7 +84,7 @@ uint16_t LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) strcpy(username,rpcuser); strcpy(password,rpcpassword); } - //printf("%s rpcuser.(%s) rpcpassword.(%s)\n",symbol,rpcuser,rpcpassword); + printf("%s rpcuser.(%s) rpcpassword.(%s)\n",symbol,rpcuser,rpcpassword); if ( rpcuser != 0 ) free(rpcuser); if ( rpcpassword != 0 ) From ee12b77aa4012ad3e59206adf04a5ff2a9e52525 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 22:12:09 +0300 Subject: [PATCH 1003/2732] Test --- iguana/exchanges/LP_coins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 54450c061..224e3a435 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -84,7 +84,7 @@ uint16_t LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) strcpy(username,rpcuser); strcpy(password,rpcpassword); } - printf("%s rpcuser.(%s) rpcpassword.(%s)\n",symbol,rpcuser,rpcpassword); + //printf("%s rpcuser.(%s) rpcpassword.(%s)\n",symbol,rpcuser,rpcpassword); if ( rpcuser != 0 ) free(rpcuser); if ( rpcpassword != 0 ) From f74d3fa4d145f7f9c3bee5bfbb6f8125ce4baafd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 22:15:47 +0300 Subject: [PATCH 1004/2732] Test --- crypto777/bitcoind_RPC.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 559ea4d02..803c0cb40 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -60,13 +60,13 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * if ( command == 0 || rpcstr == 0 || rpcstr[0] == 0 ) { if ( strcmp(command,"signrawtransaction") != 0 && strcmp(command,"getrawtransaction") != 0 ) - printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,rpcstr); + printf("<<<<<<<<<<< A bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,params); return(rpcstr); } json = cJSON_Parse(rpcstr); if ( json == 0 ) { - printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s can't parse.(%s) params.(%s)\n",debugstr,command,rpcstr,params); + printf("<<<<<<<<<<< B bitcoind_RPC: %s post_process_bitcoind_RPC.%s can't parse.(%s) params.(%s)\n",debugstr,command,rpcstr,params); free(rpcstr); return(0); } From 7ea562fc5e7f26400c0ffe7f7d9ef3c743f01657 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 22:18:42 +0300 Subject: [PATCH 1005/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 803c0cb40..6a465fd91 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -55,7 +55,7 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * long i,j,len; char *retstr = 0; cJSON *json,*result,*error; - usleep(1000); + usleep(2500); //printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,rpcstr); if ( command == 0 || rpcstr == 0 || rpcstr[0] == 0 ) { From 2176e55fd79630bc42c209fa98553bca000877b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Oct 2017 23:49:05 +0300 Subject: [PATCH 1006/2732] Update spent taxis twice --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_remember.c | 49 +++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 416aea3d4..7d97b203d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,7 +20,7 @@ // marketmaker // -// -SPV at tx level and limit SPV proofing +// -verify SPV checking is working // withdraw // stats, fix pricearray // sign packets diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index fc3c7598c..bbfc387b6 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -818,10 +818,34 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi return(0); } +int32_t LP_spends_set(struct LP_swap_remember *rswap) +{ + int32_t numspent = 0; + if ( bits256_nonz(rswap->paymentspent) == 0 ) + { + if ( bits256_nonz(rswap->txids[BASILISK_ALICESPEND]) != 0 ) + rswap->paymentspent = rswap->txids[BASILISK_ALICESPEND]; + else rswap->paymentspent = rswap->txids[BASILISK_BOBRECLAIM]; + } else numspent++; + if ( bits256_nonz(rswap->depositspent) == 0 ) + { + if ( bits256_nonz(rswap->txids[BASILISK_BOBREFUND]) != 0 ) + rswap->depositspent = rswap->txids[BASILISK_BOBREFUND]; + else rswap->depositspent = rswap->txids[BASILISK_ALICECLAIM]; + } else numspent++; + if ( bits256_nonz(rswap->Apaymentspent) == 0 ) + { + if ( bits256_nonz(rswap->txids[BASILISK_BOBSPEND]) != 0 ) + rswap->Apaymentspent = rswap->txids[BASILISK_BOBSPEND]; + else rswap->Apaymentspent = rswap->txids[BASILISK_ALICERECLAIM]; + } else numspent++; + return(numspent); +} + cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,len,secretstart,redeemlen; char str[65],*Adest,*Bdest,*AAdest,*ABdest; cJSON *item; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + struct LP_swap_remember rswap; int32_t i,j,numspent,len,secretstart,redeemlen; char str[65],*Adest,*Bdest,*AAdest,*ABdest; cJSON *item; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) @@ -891,6 +915,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest,rswap.Adestaddr,rswap.destaddr); rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest,rswap.Adestaddr,rswap.destaddr); rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); + LP_spends_set(&rswap); if ( rswap.iambob == 0 ) { if ( rswap.sentflags[BASILISK_ALICESPEND] == 0 ) @@ -1003,6 +1028,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( bits256_nonz(rswap.privAm) == 0 ) { rswap.privAm = basilisk_swap_privbob_extract(rswap.bobcoin,rswap.txids[BASILISK_ALICESPEND],0,1); + printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); } if ( bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) { @@ -1096,26 +1122,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("depositspent.(%s) alice.%d bob.%d %s %.8f\n",bits256_str(str,rswap.depositspent),rswap.sentflags[BASILISK_ALICECLAIM],rswap.sentflags[BASILISK_BOBREFUND],rswap.bobcoin,dstr(rswap.values[BASILISK_BOBDEPOSIT])); } LP_totals_update(rswap.iambob,rswap.alicecoin,rswap.bobcoin,KMDtotals,BTCtotals,rswap.sentflags,rswap.values); - int32_t numspent = 0; - if ( bits256_nonz(rswap.paymentspent) == 0 ) - { - if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) - rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; - else rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; - } else numspent++; - if ( bits256_nonz(rswap.depositspent) == 0 ) - { - if ( bits256_nonz(rswap.txids[BASILISK_BOBREFUND]) != 0 ) - rswap.depositspent = rswap.txids[BASILISK_BOBREFUND]; - else rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; - } else numspent++; - if ( bits256_nonz(rswap.Apaymentspent) == 0 ) - { - if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) - rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; - else rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; - } else numspent++; - if ( numspent == 3 ) + if ( (numspent= LP_spends_set(&rswap)) == 3 ) rswap.finishedflag = 1; else rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); item = LP_swap_json(&rswap); From ea7976fd2d51d9467991945a57f608280adf5a7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 00:36:32 +0300 Subject: [PATCH 1007/2732] Test --- iguana/exchanges/LP_remember.c | 89 ++++++++-------------------------- 1 file changed, 19 insertions(+), 70 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index bbfc387b6..7ffbb8980 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -287,13 +287,13 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); if ( aliceaddr != 0 ) { - sentflags[bobspent] = 0; + sentflags[bobspent] = 1; sentflags[alicespent] = 0; txids[bobspent] = spendtxid; } else if ( bobaddr != 0 ) { - sentflags[alicespent] = 0; + sentflags[alicespent] = 1; sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } @@ -845,14 +845,15 @@ int32_t LP_spends_set(struct LP_swap_remember *rswap) cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,numspent,len,secretstart,redeemlen; char str[65],*Adest,*Bdest,*AAdest,*ABdest; cJSON *item; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + struct LP_swap_remember rswap; int32_t i,j,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64]; cJSON *item; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) return(cJSON_Parse("{\"error\":\"couldnt initialize rswap, are all coins active?\"}")); LP_swap_load(&rswap); memset(zero.bytes,0,sizeof(zero)); - Adest = Bdest = AAdest = ABdest = 0; + otheraddr[0] = 0; + srcAdest = srcBdest = destAdest = destBdest = 0; if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) { printf("BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); @@ -866,36 +867,38 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( alice != 0 ) { - //bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - Adest = rswap.Adestaddr; + bitcoin_address(otheraddr,alice->taddr,alice->pubtype,rswap.other33,33); + destBdest = otheraddr; + destAdest = rswap.Adestaddr; } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { bitcoin_address(rswap.Sdestaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); - AAdest = rswap.Sdestaddr; + srcAdest = rswap.Sdestaddr; } - ABdest = Bdest = rswap.destaddr; + srcBdest = rswap.destaddr; } else { if ( bob != 0 ) { - //bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33); - Bdest = rswap.destaddr; + bitcoin_address(otheraddr,bob->taddr,bob->pubtype,rswap.other33,33); + srcAdest = otheraddr; + srcBdest = rswap.destaddr; } if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) { bitcoin_address(rswap.Sdestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33); - ABdest = rswap.Sdestaddr; + destBdest = rswap.Sdestaddr; } - AAdest = Adest = rswap.Adestaddr; + destAdest = rswap.Adestaddr; } if ( bob == 0 || alice == 0 ) { printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } - + printf("src.(Adest %s, Bdest %s), dest.(Adest %s, Bdest %s)\n",srcAdest,srcBdest,destAdest,destBdest); //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); @@ -911,9 +914,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); - rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest,rswap.Adestaddr,rswap.destaddr); - rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest,rswap.Adestaddr,rswap.destaddr); - rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest,rswap.Adestaddr,rswap.destaddr); + rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); + rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,destAdest,destBdest,rswap.Adestaddr,rswap.destaddr); + rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); LP_spends_set(&rswap); if ( rswap.iambob == 0 ) @@ -949,15 +952,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); - /*if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 ) - { - rswap.txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],zero); - if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) // tested - { - rswap.sentflags[BASILISK_ALICESPEND] = 1; - rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND]; - } - }*/ } } if ( rswap.sentflags[BASILISK_ALICECLAIM] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) @@ -982,15 +976,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],&rswap.txids[BASILISK_ALICECLAIM],&rswap.depositspent,&rswap.sentflags[BASILISK_ALICECLAIM]); - /*if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 ) - { - rswap.txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],zero); - if ( bits256_nonz(rswap.txids[BASILISK_ALICECLAIM]) != 0 ) // tested - { - rswap.sentflags[BASILISK_ALICECLAIM] = 1; - rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM]; - } - }*/ } else printf("now %u before expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } if ( rswap.sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(rswap.Apaymentspent) == 0 && rswap.sentflags[BASILISK_ALICECLAIM] == 0 ) @@ -1005,15 +990,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],&rswap.txids[BASILISK_ALICERECLAIM],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_ALICERECLAIM]); - /*if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 ) - { - rswap.txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],zero); - if ( bits256_nonz(rswap.txids[BASILISK_ALICERECLAIM]) != 0 ) // tested - { - rswap.sentflags[BASILISK_ALICERECLAIM] = 1; - rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM]; - } - }*/ } } else if ( rswap.iambob == 1 ) @@ -1037,15 +1013,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],&rswap.txids[BASILISK_BOBSPEND],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_BOBSPEND]); - /*if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 ) - { - rswap.txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],zero); - if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) // tested - { - rswap.sentflags[BASILISK_BOBSPEND] = 1; - rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND]; - } - }*/ } } if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > rswap.expiration && bits256_nonz(rswap.paymentspent) == 0 ) @@ -1067,15 +1034,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]); - /*if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 ) - { - rswap.txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],zero); - if ( bits256_nonz(rswap.txids[BASILISK_BOBRECLAIM]) != 0 ) // tested - { - rswap.sentflags[BASILISK_BOBRECLAIM] = 1; - rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM]; - } - }*/ } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { @@ -1092,15 +1050,6 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]); - /*if ( rswap.txbytes[BASILISK_BOBREFUND] != 0 ) - { - rswap.txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],zero); - if ( bits256_nonz(rswap.txids[BASILISK_BOBREFUND]) != 0 ) // tested - { - rswap.sentflags[BASILISK_BOBREFUND] = 1; - rswap.depositspent = rswap.txids[BASILISK_BOBREFUND]; - } - }*/ } else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } } From be68af67121ad11aa1a360b65e4f12b51d5d6a1e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 01:54:01 +0300 Subject: [PATCH 1008/2732] __WIN32 --- crypto777/iguana_OS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 9b218f130..1d31c269e 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -30,7 +30,7 @@ char *OS_mvstr() { -#ifdef __WIN32 +#ifdef _WIN32 return("rename"); #else return("mv"); From f9c262c757cf39a60250df6dd31ef787d3735dde Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 02:18:01 +0300 Subject: [PATCH 1009/2732] Print mark error --- crypto777/OS_portable.h | 2 +- crypto777/iguana_OS.c | 2 +- crypto777/jpeg/unix/jmemname.c | 2 +- iguana/exchanges/LP_coins.c | 6 +++--- iguana/exchanges/LP_nativeDEX.c | 4 +--- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxo.c | 6 ++++-- iguana/exchanges/stats.c | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 9ce9d368b..77e6ec5bc 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -40,7 +40,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #define sleep(x) Sleep(1000*(x)) #include "../OSlibs/win/mingw.h" #include "../OSlibs/win/mman.h" diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 1d31c269e..c8a7c888f 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -659,7 +659,7 @@ int64_t OS_copyfile(char *src,char *dest,int32_t cmpflag) { if ( (destfp= fopen(OS_compatible_path(dest),"wb")) != 0 ) { -#ifdef WIN32 +#ifdef _WIN32 allocsize = 1024 * 1024 * 8L; #else allocsize = 1024 * 1024 * 128L; diff --git a/crypto777/jpeg/unix/jmemname.c b/crypto777/jpeg/unix/jmemname.c index 9db4408eb..fd09935aa 100755 --- a/crypto777/jpeg/unix/jmemname.c +++ b/crypto777/jpeg/unix/jmemname.c @@ -11,7 +11,7 @@ * Also, the problem of determining the amount of memory available * is shoved onto the user. */ -#ifndef WIN32 +#ifndef _WIN32 #include #endif diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 224e3a435..dc6f3634c 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -100,7 +100,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name return; } sprintf(fname,"%s",LP_getdatadir()); -#ifdef WIN32 +#ifdef _WIN32 strcat(fname,"\\"); #else strcat(fname,"/"); @@ -138,7 +138,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name #endif if ( strcmp(symbol,"KMD") != 0 ) { -#ifdef WIN32 +#ifdef _WIN32 strcat(fname,"\\"); #else strcat(fname,"/"); @@ -146,7 +146,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name strcat(fname,assetname); } } -#ifdef WIN32 +#ifdef _WIN32 strcat(fname,"\\"); #else strcat(fname,"/"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7d97b203d..b696d3a53 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,14 +19,12 @@ // LP_nativeDEX.c // marketmaker // - -// -verify SPV checking is working // withdraw +// verify portfolio // stats, fix pricearray // sign packets // electrum peers // dPoW security and zeroconf -// verify portfolio // bittrex balancing diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 72df16330..5a716959c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -460,7 +460,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u { if ( coin->electrum != 0 ) { - if (up->SPV == 0 ) + if (up->SPV <= 0 ) up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); if ( up->SPV < 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1c49e20ac..99d707ad4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -86,7 +86,7 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) #endif saddr.sin_family = AF_INET; saddr.sin_port = htons(port); - //#ifdef WIN32 + //#ifdef _WIN32 // saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); //#else @@ -111,7 +111,7 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) opt = 1; slen = sizeof(opt); //printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen)); -#ifndef WIN32 +#ifndef _WIN32 if ( 1 )//&& bindflag != 0 ) { opt = 0; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 214bef80b..b5553ef00 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -332,8 +332,10 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); free_json(hdrobj); - } + } else printf("couldnt get header for ht.%d\n",height); } + if ( SPV < 0 ) + printf("MERKLE DIDNT VERIFY.(%s)\n",jprint(merkobj,0)); free_json(merkobj); } return(SPV); @@ -366,7 +368,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } if ( up->spendheight <= 0 ) { - if ( backupep != 0 && up->SPV == 0 ) + if ( backupep != 0 && up->SPV <= 0 ) up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); jaddi(array,LP_address_item(coin,up,electrumret)); n++; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 8e5099814..6ac6d9a84 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -28,7 +28,7 @@ #include "DEXstats.h" char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port); -#ifndef WIN32 +#ifndef _WIN32 #ifndef MSG_NOSIGNAL #define MSG_NOSIGNAL 0x4000 // Do not generate SIGPIPE #endif @@ -115,7 +115,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) #endif saddr.sin_family = AF_INET; saddr.sin_port = htons(port); - //#ifdef WIN32 + //#ifdef _WIN32 // saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); //#else @@ -140,7 +140,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) opt = 1; slen = sizeof(opt); //printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen)); -#ifndef WIN32 +#ifndef _WIN32 if ( 1 )//&& bindflag != 0 ) { opt = 0; From 2f74c36783d6b4248354bd8ec083bb2a281bd8cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 02:27:53 +0300 Subject: [PATCH 1010/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++--- iguana/exchanges/LP_utxo.c | 15 +++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b696d3a53..fdac06dd6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,13 +19,12 @@ // LP_nativeDEX.c // marketmaker // +// sign packets // withdraw // verify portfolio // stats, fix pricearray -// sign packets -// electrum peers // dPoW security and zeroconf -// bittrex balancing +// electrum peers #include diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b5553ef00..b1641292f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -324,13 +324,16 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 roothash = validate_merkle(jint(merkobj,"pos"),txid,merkles,m); if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 ) { - merkleroot = jbits256(hdrobj,"merkle_root"); - if ( bits256_cmp(merkleroot,roothash) == 0 ) + if ( jobj(hdrobj,"merkle_root") != 0 ) { - SPV = height; - //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); - } - else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + merkleroot = jbits256(hdrobj,"merkle_root"); + if ( bits256_cmp(merkleroot,roothash) == 0 ) + { + SPV = height; + //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + } + else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s (%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot),jprint(hdrobj,0)); + } else SPV = 0; free_json(hdrobj); } else printf("couldnt get header for ht.%d\n",height); } From 327481dc3705e41e713c79e62247cfbe2949a62f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 15:46:11 +0300 Subject: [PATCH 1011/2732] Test --- iguana/exchanges/LP_commands.c | 32 ---------------------- iguana/exchanges/LP_ordermatch.c | 47 ++++++++++++++++++-------------- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/install | 2 +- iguana/exchanges/listunspent | 1 + iguana/exchanges/utxos | 3 -- 6 files changed, 30 insertions(+), 57 deletions(-) delete mode 100755 iguana/exchanges/utxos diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index bd7f000c9..30523ba69 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -428,38 +428,10 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"getcoins") == 0 ) return(jprint(LP_coinsjson(0),1)); - else if ( strcmp(method,"numutxos") == 0 ) - { - printf("deprecated numutxos received\n"); - retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); - //return(LP_numutxos()); - } else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); - else if ( strcmp(method,"registerall") == 0 ) - return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - else if ( strcmp(method,"forward") == 0 ) - return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - else if ( strcmp(method,"keepalive") == 0 ) - return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); else if ( strcmp(method,"getpeers") == 0 ) return(LP_peers()); - else if ( strcmp(method,"getutxos") == 0 ) - { - printf("deprecated getutxos received\n"); - retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); - //return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); - } - else if ( strcmp(method,"utxo") == 0 ) - { - static uint32_t counter; - if ( counter++ < 3 ) - printf("deprecated utxo received\n"); - //if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) - // retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); - //else - retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); - } else { if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) @@ -490,10 +462,6 @@ dividends(coin, height, )\n\ } if ( IAMLP != 0 ) { - if ( strcmp(method,"register") == 0 ) - return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - else if ( strcmp(method,"lookup") == 0 ) - return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); if ( strcmp(method,"broadcast") == 0 ) { bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5a716959c..53fe24fdf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -821,7 +821,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, free(retstr); LP_reserved(ctx,myipaddr,pubsock,&Q); } - return(1); + return(retval); } else if ( strcmp(method,"connected") == 0 ) { @@ -831,14 +831,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( (retstr= LP_connectedalice(argjson)) != 0 ) free(retstr); } - return(1); + return(retval); } if ( bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) { if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); - return(-3); + return(retval); } price = ask; autxo = &A; @@ -884,17 +884,17 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f -> %.8f\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,dstr(Q.satoshis),dstr(Q.destsatoshis)); - return(1); + return(retval); } if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); - return(-4); + return(-3); } if ( qprice < (price - 0.00000001) * 0.9999 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); - return(-5); + return(-4); } if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) butxo->T.swappending = 0; @@ -915,7 +915,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); - return(2); + return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } else if ( strcmp(method,"connect") == 0 ) // bob @@ -926,7 +926,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, // validate SPV alice LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); //LP_butxo_swapfields_set(butxo); - return(3); + return(retval); } else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } @@ -1026,7 +1026,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) { - uint64_t desttxfee,txfee; int32_t numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + uint64_t desttxfee,txfee; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; printf("LP_autobuy %s/%s price %.8f vol %.8f\n",base,rel,maxprice,relvolume); if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; @@ -1044,23 +1044,30 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis; - while ( 1 ) + if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { - if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); + return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + } + pubkeys[numpubs++] = bestutxo->pubkey; + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + maxiters = 25; + for (i=0; ipubkey; - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - if ( (qprice= LP_quote_validate(autxo,0,&Q,0)) <= SMALLVAL ) + if ( qprice/ordermatchprice < 1.+SMALLVAL ) { - printf("continue searching, quote validate error %.0f\n",qprice); + printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); continue; } + Q.satoshis *= 0.999; break; } //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 7ffbb8980..5953151ff 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -898,7 +898,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("Bob.%p is null or Alice.%p is null\n",bob,alice); return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}")); } - printf("src.(Adest %s, Bdest %s), dest.(Adest %s, Bdest %s)\n",srcAdest,srcBdest,destAdest,destBdest); + //printf("src.(Adest %s, Bdest %s), dest.(Adest %s, Bdest %s)\n",srcAdest,srcBdest,destAdest,destBdest); //printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest); diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 4695b8e3a..db8330603 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status utxos ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/listunspent b/iguana/exchanges/listunspent index 9b03640f3..127397d9c 100755 --- a/iguana/exchanges/listunspent +++ b/iguana/exchanges/listunspent @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listunspent\",\"coin\":\"CHIPS\",\"address\":\"RMfQwu5ey23eWJ4as2ckd8dqsQJwo836ny\"}" diff --git a/iguana/exchanges/utxos b/iguana/exchanges/utxos deleted file mode 100755 index 4782c9a0a..000000000 --- a/iguana/exchanges/utxos +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getutxos\",\"coin\":\"REVS\"}" From a823190e35e47fb7fe41bd30bfce6ca4ff782084 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 15:53:03 +0300 Subject: [PATCH 1012/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 53fe24fdf..9356a7b9d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -287,7 +287,7 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo, double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp,int32_t iambob) { double qprice=0.; uint64_t txfee,desttxfee,srcvalue=0,srcvalue2=0,destvalue=0,destvalue2=0; - printf("quote %s %.8f -> %s %.8f\n",qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); + printf(">>>>>>> quote satoshis.(%.8f %.8f) %s %.8f -> %s %.8f\n",dstr(qp->satoshis),dstr(qp->destsatoshis),qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); if ( butxo != 0 ) { if (LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) From 7503b94b79025f4303af118b39bff124ec621ef1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 15:59:25 +0300 Subject: [PATCH 1013/2732] Test --- iguana/exchanges/LP_ordermatch.c | 50 ++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9356a7b9d..254cb4680 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1034,9 +1034,9 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel timeout = LP_AUTOTRADE_TIMEOUT; if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); - if ( strcmp("BTC",rel) == 0 ) - maxprice *= 1.01; - else maxprice *= 1.001; + //if ( strcmp("BTC",rel) == 0 ) + // maxprice *= 1.01; + //else maxprice *= 1.001; memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; @@ -1044,30 +1044,38 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis; - if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + while ( 1 ) { - printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); - return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - } - pubkeys[numpubs++] = bestutxo->pubkey; - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - maxiters = 25; - for (i=0; ipubkey; + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + maxiters = 25; + qprice = 1. / SMALLVAL; + for (i=0; i maxprice ) { - printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); + printf("i.%d maxiters.%d qprice %.8f vs maxprice %.8f, no acceptable quote for this pubkey\n",i,maxiters,dstr(qprice),dstr(maxprice)); continue; } - Q.satoshis *= 0.999; break; } //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); From b4cdc2b35886b20dbe80e78191c346aa9aeccb5f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 16:39:55 +0300 Subject: [PATCH 1014/2732] Tweak numconfirms --- iguana/exchanges/LP_include.h | 4 +-- iguana/exchanges/LP_ordermatch.c | 4 +-- iguana/exchanges/LP_swap.c | 48 +++++++++++++++++++++++--------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f274f45e4..99f4551a0 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -71,7 +71,7 @@ #define LP_RESERVETIME 60 #define LP_AVETXSIZE 256 #define LP_CACHEDURATION 60 -#define BASILISK_DEFAULT_NUMCONFIRMS 1 +#define BASILISK_DEFAULT_NUMCONFIRMS 3 #define DEX_SLEEP 3 #define BASILISK_KEYSIZE ((int32_t)(2*sizeof(bits256)+sizeof(uint32_t)*2)) @@ -151,7 +151,7 @@ struct basilisk_swapinfo char bobstr[64],alicestr[64]; bits256 myhash,otherhash,orderhash; uint32_t statebits,otherstatebits,started,expiration,finished,dead,reftime,putduration,callduration; - int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad; + int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad,aliceistrusted,bobistrusted,otheristrusted,otherstrust; uint64_t alicesatoshis,bobsatoshis,bobinsurance,aliceinsurance,Atxfee,Btxfee; bits256 myprivs[2],mypubs[2],otherpubs[2],pubA0,pubA1,pubB0,pubB1,privAm,pubAm,privBn,pubBn; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 254cb4680..5ff3cf7e4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1056,7 +1056,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - maxiters = 25; + maxiters = 100; qprice = 1. / SMALLVAL; for (i=0; i maxprice ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index fd2cd3ec7..6c3848772 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -177,6 +177,9 @@ uint32_t basilisk_requestid(struct basilisk_request *rp) int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) { int32_t i,datalen = 0; + data[datalen++] = swap->I.aliceconfirms; + data[datalen++] = swap->I.bobconfirms; + data[datalen++] = swap->I.otheristrusted; for (i=0; i<33; i++) data[datalen++] = swap->persistent_pubkey33[i]; for (i=0; ideck)/sizeof(swap->deck[0][0]); i++) @@ -186,9 +189,28 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - int32_t i,nonz=0,len = 0; uint8_t other33[33]; - if ( datalen == sizeof(swap->otherdeck)+33 ) + int32_t i,nonz=0,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; + if ( datalen == sizeof(swap->otherdeck)+34 ) { + aliceconfirms = data[len++]; + bobconfirms = data[len++]; + if ( aliceconfirms != swap->I.aliceconfirms || bobconfirms != swap->I.bobconfirms ) + { + printf("MISMATCHED required confirms me.(%d %d) vs (%d %d)\n",swap->I.aliceconfirms,swap->I.bobconfirms,aliceconfirms,bobconfirms); + if ( swap->I.aliceconfirms < aliceconfirms ) + swap->I.aliceconfirms = aliceconfirms; + if ( swap->I.bobconfirms < bobconfirms ) + swap->I.bobconfirms = bobconfirms; + } + if ( (swap->I.otherstrust= data[len++]) != 0 ) + { + if ( swap->I.otheristrusted != 0 ) + { + swap->I.aliceconfirms = swap->I.bobconfirms = 0; + printf("Otherside trusts us, adjust required confirms to: alice.%d bob.%d\n",swap->I.aliceconfirms,swap->I.bobconfirms); + } + } + printf("NUMCONFIRMS for SWAP alice.%d bob.%d, otheristrusted.%d othertrusts.%d\n",swap->I.aliceconfirms,swap->I.bobconfirms,swap->I.otheristrusted,swap->I.otherstrust); for (i=0; i<33; i++) if ( (other33[i]= data[len++]) != 0 ) nonz++; @@ -746,7 +768,7 @@ void LP_bobloop(void *_swap) { if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) m = 0; - else m = 1; + else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); @@ -801,7 +823,7 @@ void LP_aliceloop(void *_swap) { if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) m = 0; - else m = 1; + else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); @@ -957,7 +979,7 @@ void basilisk_rawtx_setparms(char *name,uint32_t quoteid,struct basilisk_rawtx * struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 pubkey25519,struct basilisk_swap *swap,int32_t optionduration,uint32_t statebits,struct LP_quoteinfo *qp) { //FILE *fp; char fname[512]; - uint8_t *alicepub33=0,*bobpub33=0; int32_t bobistrusted,aliceistrusted,jumblrflag=-2,x = -1; struct iguana_info *coin; + uint8_t *alicepub33=0,*bobpub33=0; int32_t jumblrflag=-2,x = -1; struct iguana_info *coin; swap->I.Atxfee = qp->desttxfee; swap->I.Btxfee = qp->txfee; swap->I.putduration = swap->I.callduration = INSTANTDEX_LOCKTIME; @@ -985,15 +1007,15 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 { swap->I.iambob = 0; swap->I.otherhash = swap->I.req.desthash; - aliceistrusted = 1; - bobistrusted = LP_pubkey_istrusted(swap->I.req.desthash); + swap->I.aliceistrusted = 1; + swap->I.otheristrusted = swap->I.bobistrusted = LP_pubkey_istrusted(swap->I.req.desthash); } else { swap->I.iambob = 1; swap->I.otherhash = swap->I.req.srchash; - bobistrusted = 1; - aliceistrusted = LP_pubkey_istrusted(swap->I.req.desthash); + swap->I.bobistrusted = 1; + swap->I.otheristrusted = swap->I.aliceistrusted = LP_pubkey_istrusted(swap->I.req.desthash); } if ( bits256_nonz(privkey) == 0 || (x= instantdex_pubkeyargs(swap,2 + INSTANTDEX_DECKSIZE,privkey,swap->I.orderhash,0x02+swap->I.iambob)) != 2 + INSTANTDEX_DECKSIZE ) { @@ -1019,20 +1041,20 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 if ( strcmp("BTC",swap->bobcoin.symbol) == 0 ) { swap->I.bobconfirms = (1 + sqrt(dstr(swap->I.bobsatoshis) * .1)); - swap->I.aliceconfirms = MIN(BASILISK_DEFAULT_NUMCONFIRMS,swap->I.bobconfirms); + swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } else if ( strcmp("BTC",swap->alicecoin.symbol) == 0 ) { swap->I.aliceconfirms = (1 + sqrt(dstr(swap->I.alicesatoshis) * .1)); - swap->I.bobconfirms = MIN(BASILISK_DEFAULT_NUMCONFIRMS,swap->I.aliceconfirms); + swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } else { swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } - swap->I.bobconfirms *= !bobistrusted; - swap->I.aliceconfirms *= !aliceistrusted; + swap->I.bobconfirms *= !swap->I.bobistrusted; + swap->I.aliceconfirms *= !swap->I.aliceistrusted; printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin.taddr,swap->alicecoin.taddr); if ( swap->I.iambob != 0 ) { From 54baa1abbb929d1ae4f6538283a7792f779b5ef4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 16:41:00 +0300 Subject: [PATCH 1015/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 6a465fd91..bc87b61f2 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -228,7 +228,7 @@ try_again: { count++; elapsedsum += (OS_milliseconds() - starttime); - if ( (count % 10000) == 0) + if ( (count % 100000) == 0) printf("%d: ave %9.6f | elapsed %.3f millis | bitcoind_RPC.(%s) url.(%s)\n",count,elapsedsum/count,(OS_milliseconds() - starttime),command,url); if ( retstrp != 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fdac06dd6..78ba51f67 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -278,7 +278,7 @@ int32_t LP_nanomsg_recvs(void *ctx) if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); - if ( lastmilli > 0. && milli > lastmilli+100 ) + if ( lastmilli > 0. && milli > lastmilli+1000 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",milli-lastmilli); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); From 75d04c43001d8f98c4a72709ce1dceef42c6deb2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 16:51:34 +0300 Subject: [PATCH 1016/2732] Test --- iguana/exchanges/LP_swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 6c3848772..c6a16119e 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -190,7 +190,7 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { int32_t i,nonz=0,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; - if ( datalen == sizeof(swap->otherdeck)+34 ) + if ( datalen == sizeof(swap->otherdeck)+36 ) { aliceconfirms = data[len++]; bobconfirms = data[len++]; @@ -220,7 +220,7 @@ int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datal len += iguana_rwnum(0,&data[len],sizeof(swap->otherdeck[i>>1][i&1]),&swap->otherdeck[i>>1][i&1]); return(0); } - printf("pubkeys verify size mismatch %d != %d\n",datalen,(int32_t)sizeof(swap->otherdeck)); + printf("pubkeys verify size mismatch %d != %d\n",datalen,(int32_t)sizeof(swap->otherdeck)+36); return(-1); } From b25f229bba7d53028f683483f08c6dac1ff063c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 17:36:11 +0300 Subject: [PATCH 1017/2732] Test --- iguana/exchanges/LP_coins.c | 5 +++++ iguana/exchanges/LP_commands.c | 18 +++++++++++++++ iguana/exchanges/LP_include.h | 5 +++-- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_swap.c | 39 ++++++++++++++++++++++++++++----- iguana/exchanges/setconfirms | 3 +++ iguana/exchanges/trust | 4 ++++ 7 files changed, 68 insertions(+), 8 deletions(-) create mode 100755 iguana/exchanges/setconfirms create mode 100755 iguana/exchanges/trust diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index dc6f3634c..af0681662 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -299,6 +299,11 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->inactive = (uint32_t)time(NULL); coin->bussock = LP_coinbus(busport); coin->ctx = bitcoin_ctx(); + if ( assetname != 0 && strcmp(name,assetname) == 0 ) + { + printf("%s is assetchain\n",symbol); + coin->isassetchain = 1; + } if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 30523ba69..5a76fc503 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -114,6 +114,8 @@ portfolio()\n\ getpeers()\n\ passphrase(passphrase, gui)\n\ listunspent(coin, address)\n\ +setconfirms(coin, numconfirms, maxconfirms=6)\n\ +trust(pubkey, trust)\n\ balance(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ @@ -275,6 +277,22 @@ dividends(coin, height, )\n\ return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); } else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"setconfirms") == 0 ) + { + int32_t n; + n = jint(argjson,"numconfirms"); + if ( n < 0 ) + return(clonestr("{\"error\":\"illegal numconfirms\"}")); + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + ptr->userconfirms = n; + if ( (n= jint(argjson,"maxconfirms")) > 0 ) + ptr->maxconfirms = n; + if ( ptr->maxconfirms > 0 && ptr->userconfirms > ptr->maxconfirms ) + ptr->userconfirms = ptr->maxconfirms; + return(clonestr("{\"result\":\"success\"}")); + } else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( strcmp(method,"snapshot") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 99f4551a0..3eebf220a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -72,6 +72,7 @@ #define LP_AVETXSIZE 256 #define LP_CACHEDURATION 60 #define BASILISK_DEFAULT_NUMCONFIRMS 3 +#define BASILISK_DEFAULT_MAXCONFIRMS 6 #define DEX_SLEEP 3 #define BASILISK_KEYSIZE ((int32_t)(2*sizeof(bits256)+sizeof(uint32_t)*2)) @@ -151,7 +152,7 @@ struct basilisk_swapinfo char bobstr[64],alicestr[64]; bits256 myhash,otherhash,orderhash; uint32_t statebits,otherstatebits,started,expiration,finished,dead,reftime,putduration,callduration; - int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad,aliceistrusted,bobistrusted,otheristrusted,otherstrust; + int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad,aliceistrusted,bobistrusted,otheristrusted,otherstrust,alicemaxconfirms,bobmaxconfirms; uint64_t alicesatoshis,bobsatoshis,bobinsurance,aliceinsurance,Atxfee,Btxfee; bits256 myprivs[2],mypubs[2],otherpubs[2],pubA0,pubA1,pubB0,pubB1,privAm,pubAm,privBn,pubBn; @@ -184,7 +185,7 @@ struct iguana_info uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; uint32_t addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; - uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; + uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 78ba51f67..fabe55958 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -338,7 +338,7 @@ void LP_smartutxos_push(struct iguana_info *coin) memset(zero.bytes,0,sizeof(zero)); if ( (n= cJSON_GetArraySize(array)) > 0 ) { - printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); + //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); for (i=0; iI.aliceconfirms; data[datalen++] = swap->I.bobconfirms; + data[datalen++] = swap->I.alicemaxconfirms; + data[datalen++] = swap->I.bobmaxconfirms; data[datalen++] = swap->I.otheristrusted; for (i=0; i<33; i++) data[datalen++] = swap->persistent_pubkey33[i]; @@ -189,18 +191,29 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - int32_t i,nonz=0,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; - if ( datalen == sizeof(swap->otherdeck)+36 ) + int32_t i,nonz=0,alicemaxconfirms,bobmaxconfirms,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; + if ( datalen == sizeof(swap->otherdeck)+38 ) { aliceconfirms = data[len++]; bobconfirms = data[len++]; + alicemaxconfirms = data[len++]; + bobmaxconfirms = data[len++]; if ( aliceconfirms != swap->I.aliceconfirms || bobconfirms != swap->I.bobconfirms ) { - printf("MISMATCHED required confirms me.(%d %d) vs (%d %d)\n",swap->I.aliceconfirms,swap->I.bobconfirms,aliceconfirms,bobconfirms); + printf("MISMATCHED required confirms me.(%d %d) vs (%d %d) max.(%d %d) othermax.(%d %d)\n",swap->I.aliceconfirms,swap->I.bobconfirms,aliceconfirms,bobconfirms,swap->I.alicemaxconfirms,swap->I.bobmaxconfirms,alicemaxconfirms,bobmaxconfirms); + if ( alicemaxconfirms > swap->I.alicemaxconfirms ) + alicemaxconfirms = swap->I.alicemaxconfirms; + if ( bobmaxconfirms > swap->I.bobmaxconfirms ) + bobmaxconfirms = swap->I.bobmaxconfirms; if ( swap->I.aliceconfirms < aliceconfirms ) swap->I.aliceconfirms = aliceconfirms; if ( swap->I.bobconfirms < bobconfirms ) swap->I.bobconfirms = bobconfirms; + if ( swap->I.aliceconfirms > swap->I.alicemaxconfirms || swap->I.bobconfirms > swap->I.bobmaxconfirms ) + { + printf("numconfirms (%d %d) exceeds max (%d %d)\n",swap->I.aliceconfirms,swap->I.bobconfirms,swap->I.alicemaxconfirms,swap->I.bobmaxconfirms); + return(-1); + } } if ( (swap->I.otherstrust= data[len++]) != 0 ) { @@ -771,7 +784,7 @@ void LP_bobloop(void *_swap) else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { - char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) @@ -826,7 +839,7 @@ void LP_aliceloop(void *_swap) else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { - char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } swap->sentflag = 1; @@ -1053,6 +1066,22 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } + if ( swap->bobcoin.isassetchain != 0 ) + swap->I.bobconfirms = 1; + if ( swap->alicecoin.isassetchain != 0 ) + swap->I.aliceconfirms = 1; + if ( swap->bobcoin.userconfirms > 0 ) + swap->I.bobconfirms = swap->bobcoin.userconfirms; + if ( swap->alicecoin.userconfirms > 0 ) + swap->I.aliceconfirms = swap->alicecoin.userconfirms; + if ( (swap->I.bobmaxconfirms= swap->bobcoin.maxconfirms) == 0 ) + swap->I.bobmaxconfirms = BASILISK_DEFAULT_MAXCONFIRMS; + if ( (swap->I.alicemaxconfirms= swap->alicecoin.maxconfirms) == 0 ) + swap->I.alicemaxconfirms = BASILISK_DEFAULT_MAXCONFIRMS; + if ( swap->I.bobconfirms > swap->I.bobmaxconfirms ) + swap->I.bobconfirms = swap->I.bobmaxconfirms; + if ( swap->I.aliceconfirms > swap->I.alicemaxconfirms ) + swap->I.aliceconfirms = swap->I.alicemaxconfirms; swap->I.bobconfirms *= !swap->I.bobistrusted; swap->I.aliceconfirms *= !swap->I.aliceistrusted; printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin.taddr,swap->alicecoin.taddr); diff --git a/iguana/exchanges/setconfirms b/iguana/exchanges/setconfirms new file mode 100755 index 000000000..78905f158 --- /dev/null +++ b/iguana/exchanges/setconfirms @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setconfirms\",\"coin\":\"REVS\",\"numconfirms\":1}" diff --git a/iguana/exchanges/trust b/iguana/exchanges/trust new file mode 100755 index 000000000..6461f04c7 --- /dev/null +++ b/iguana/exchanges/trust @@ -0,0 +1,4 @@ +#!/bin/bash +echo "usage: ./trust " +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"trust\",\"trust\":1}" From e24f80f45be10d1e4b4fd6012cd159bcfa866282 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 17:36:35 +0300 Subject: [PATCH 1018/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fabe55958..205b98f67 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -160,7 +160,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( duplicate != 0 ) dup++; else uniq++; - if ( (rand() % 1000) == 0 ) + if ( (rand() % 10000) == 0 ) printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); if ( duplicate == 0 ) { From 4fc0c3f18b78eec8a4b315a8165ed2346b19b0b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 18:00:34 +0300 Subject: [PATCH 1019/2732] Test --- iguana/exchanges/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index db8330603..08c054a29 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status utxos ../dexscripts +cp setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status utxos ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From 46326bf42bf50047770098c076ff28e4cffacc08 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 18:18:19 +0300 Subject: [PATCH 1020/2732] Nonce --- iguana/exchanges/LP_commands.c | 7 ++++--- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 12 +++++++++--- iguana/exchanges/LP_portfolio.c | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5a76fc503..157294820 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -104,7 +104,8 @@ enable(coin)\n\ disable(coin)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ -buy(base, rel, price, relvolume, timeout=10, duration=3600)\n\ +buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ +sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ @@ -233,14 +234,14 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"))); } else return(clonestr("{\"error\":\"no price set\"}")); } else if ( strcmp(method,"sell") == 0 ) { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 205b98f67..75e020d50 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -47,6 +47,7 @@ char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.25 //uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; +uint32_t LP_lastnonce; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5ff3cf7e4..20d927bff 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1024,10 +1024,16 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(bestutxo); } -char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui) +char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce) { - uint64_t desttxfee,txfee; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; - printf("LP_autobuy %s/%s price %.8f vol %.8f\n",base,rel,maxprice,relvolume); + uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + printf("LP_autobuy %s/%s price %.8f vol %.8f nonce %u\n",base,rel,maxprice,relvolume,nonce); + if ( (lastnonce= LP_lastnonce) != 0 && nonce <= lastnonce ) + { + printf("nonce.%u not bigger than lastnonce.%u\n",nonce,lastnonce); + return(clonestr("{\"error\":\"invalid nonce\"}")); + } + LP_lastnonce = nonce; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 80ce16c7b..75e8fd330 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -441,7 +441,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str break; if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) { - if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui)) != 0 ) + if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { From df78d5e3f3aee04310c79222fd74887f1edb139b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 18:45:17 +0300 Subject: [PATCH 1021/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++++ iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/install | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 157294820..fb7d6d0cb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -277,6 +277,10 @@ dividends(coin, height, )\n\ ptr->inactive = 0; return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); } else return(clonestr("{\"error\":\"cant find coind\"}")); + } + else if ( strcmp(method,"withdraw") == 0 ) + { + } else if ( strcmp(method,"setconfirms") == 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 75e020d50..da2bed08e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,7 +23,7 @@ // withdraw // verify portfolio // stats, fix pricearray -// dPoW security and zeroconf +// dPoW security -> 2: KMD notarized, 3: BTC notarized // electrum peers diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 08c054a29..2aace6b1d 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status utxos ../dexscripts +cp setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From 03375ac2f29c59ee896bbe11d548489126e5b1f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 19:39:49 +0300 Subject: [PATCH 1022/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++++++- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 7 +++---- iguana/exchanges/LP_ordermatch.c | 12 +++++++----- iguana/exchanges/LP_remember.c | 6 +++--- iguana/exchanges/LP_transaction.c | 30 +++++++++++++++++++++++++++--- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 4 ++-- 8 files changed, 51 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index fb7d6d0cb..39199cc42 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -106,6 +106,7 @@ inventory(coin)\n\ bestfit(rel, relvolume)\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ +withdraw(coin, outputs[])\n\ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ @@ -280,7 +281,12 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"withdraw") == 0 ) { - + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + if ( jobj(argjson,"outputs") == 0 ) + return(clonestr("{\"error\":\"withdraw needs to have outputs\"}")); + else return(LP_withdraw(ptr,argjson)); + } else return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"setconfirms") == 0 ) { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3eebf220a..2cf2e8fc0 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -303,7 +303,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); -uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee); +uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index da2bed08e..fc8885984 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,12 +19,11 @@ // LP_nativeDEX.c // marketmaker // -// sign packets // withdraw -// verify portfolio -// stats, fix pricearray +// stats +// sign critical api calls // dPoW security -> 2: KMD notarized, 3: BTC notarized -// electrum peers +// verify portfolio and pricearray #include diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 20d927bff..c7cffdaa3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -19,18 +19,20 @@ // marketmaker // -uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) +uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen) { if ( coin != 0 ) { if ( strcmp(coin->symbol,"BTC") == 0 ) { + if ( txlen == 0 ) + txlen = LP_AVETXSIZE; coin->rate = LP_getestimatedrate(coin); - if ( (txfee= SATOSHIDEN * coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) + if ( (txfee= SATOSHIDEN * coin->rate * txlen) <= LP_MIN_TXFEE ) { coin->rate = -1.; coin->rate = _LP_getestimatedrate(coin); - if ( (txfee= SATOSHIDEN * coin->rate * LP_AVETXSIZE) <= LP_MIN_TXFEE ) + if ( (txfee= SATOSHIDEN * coin->rate * txlen) <= LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } } else txfee = coin->txfee; @@ -42,8 +44,8 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee) void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) { - *txfeep = LP_txfeecalc(LP_coinfind(base),0); - *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0); + *txfeep = LP_txfeecalc(LP_coinfind(base),0,0); + *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0,0); printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); } diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 5953151ff..01f7bb20a 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -856,13 +856,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti srcAdest = srcBdest = destAdest = destBdest = 0; if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) { - printf("BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); + printf("legacy DB SWAPS files BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); return(cJSON_Parse("{\"error\":\"mismatched bob/alice vs src/dest coins??\"}")); } alice = LP_coinfind(rswap.alicecoin); bob = LP_coinfind(rswap.bobcoin); - rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee); - rswap.Btxfee = LP_txfeecalc(bob,rswap.Btxfee); + rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee,0); + rswap.Btxfee = LP_txfeecalc(bob,rswap.Btxfee,0); if ( rswap.iambob == 0 ) { if ( alice != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 95ce5fcb0..5213c3897 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -724,9 +724,34 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch return(signedtx); } +/*char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) +{ + int32_t iter,i,datalen; char changeaddr[64],*signedtx=0; cJSON *retjson; bits256 signedtxid; uint64_t txfee,newtxfee=10000; + txfee = coin->txfee; + if ( txfee > 0 && txfee < 10000 ) + txfee = 10000; + retjson = cJSON_CreateObject(); + safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); + for (iter=0; iter<2; iter++) + { + if ( (signedtx= basilisk_swap_bobtxspend(&signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys)) != 0 ) + { + datalen = (int32_t)strlen(signedtx) / 2; + if ( strcmp(coin->symbol,"BTC") == 0 ) + { + newtxfee = LP_txfeecalc(coin,0,datalen); + printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); + } else break; + } else break; + if ( strcmp(str,"myfee") == 0 ) + break; + } + return(jprint(retjson,1)); +}*/ + int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pubkey33,int32_t iambob,int32_t lockinputs,struct basilisk_rawtx *rawtx,uint32_t locktime,uint8_t *script,int32_t scriptlen,int64_t txfee,int32_t minconf,int32_t delay,bits256 privkey,uint8_t *changermd160,char *vinaddr) { - int32_t retval=-1,len,iter; char *signedtx,*changeaddr = 0,_changeaddr[64]; struct iguana_info *coin; int64_t newtxfee=0,destamount; + int32_t retval=-1,iter; char *signedtx,*changeaddr = 0,_changeaddr[64]; struct iguana_info *coin; int64_t newtxfee=0,destamount; char str2[65]; printf("%s rawtxgen.(%s/v%d)\n",rawtx->name,bits256_str(str2,rawtx->utxotxid),rawtx->utxovout); if ( (coin= rawtx->coin) == 0 ) return(-1); @@ -753,8 +778,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub free(signedtx); if ( strcmp(coin->symbol,"BTC") != 0 ) return(retval); - len = rawtx->I.datalen; - newtxfee = LP_txfeecalc(coin,0); + newtxfee = LP_txfeecalc(coin,0,rawtx->I.datalen); printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; if ( strcmp(str,"myfee") == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b1641292f..cdbf09bec 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -828,7 +828,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol return(-2); if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) return(-3); - txfee = LP_txfeecalc(LP_coinfind(symbol),0); + txfee = LP_txfeecalc(LP_coinfind(symbol),0,0); if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : (LP_DEXFEE(satoshis) + txfee); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e98e1f878..b0da0da76 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -312,7 +312,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t //printf("LP_utxoadd reject inactive %s\n",symbol); return(0); } - txfee = LP_txfeecalc(coin,0); + txfee = LP_txfeecalc(coin,0,0); if ( iambob != 0 && value2 < 9 * (value >> 3) + 2*txfee ) // big txfee padding { if ( value2 > 2*txfee ) @@ -522,7 +522,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri LP_listunspent_issue(coin->symbol,coin->smartaddr,0); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { - txfee = LP_txfeecalc(coin,0); + txfee = LP_txfeecalc(coin,0,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { //printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); From 6be7bbffc1f6afb860df09fdc39e521f3e639bbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 19:40:40 +0300 Subject: [PATCH 1023/2732] Test --- iguana/exchanges/LP_commands.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 39199cc42..239ab6e6b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -285,8 +285,9 @@ dividends(coin, height, )\n\ { if ( jobj(argjson,"outputs") == 0 ) return(clonestr("{\"error\":\"withdraw needs to have outputs\"}")); - else return(LP_withdraw(ptr,argjson)); - } else return(clonestr("{\"error\":\"cant find coind\"}")); + //else return(LP_withdraw(ptr,argjson)); + } + return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"setconfirms") == 0 ) { From 009ea85c3f277e4e7cb9a055e7d359e999652081 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:05:47 +0300 Subject: [PATCH 1024/2732] Withdraw --- iguana/exchanges/LP_commands.c | 15 +- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 22 ++- iguana/exchanges/LP_transaction.c | 247 +++++++++++++++++++++++++++++- iguana/exchanges/install | 2 +- iguana/exchanges/register | 3 - iguana/exchanges/registerall | 4 - iguana/exchanges/withdraw | 3 + 10 files changed, 281 insertions(+), 20 deletions(-) delete mode 100755 iguana/exchanges/register delete mode 100755 iguana/exchanges/registerall create mode 100755 iguana/exchanges/withdraw diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 239ab6e6b..3c8ae9cf8 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -104,9 +104,11 @@ enable(coin)\n\ disable(coin)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ +lastnonce()\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ withdraw(coin, outputs[])\n\ +sendrawtransaction(coin, signedtx)\n\ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ @@ -279,13 +281,17 @@ dividends(coin, height, )\n\ return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); } else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"sendrawtransaction") == 0 ) + { + return(LP_sendrawtransaction(coin,jstr(argjson,"signedtx"))); + } else if ( strcmp(method,"withdraw") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) { if ( jobj(argjson,"outputs") == 0 ) return(clonestr("{\"error\":\"withdraw needs to have outputs\"}")); - //else return(LP_withdraw(ptr,argjson)); + else return(LP_withdraw(ptr,argjson)); } return(clonestr("{\"error\":\"cant find coind\"}")); } @@ -359,6 +365,13 @@ dividends(coin, height, )\n\ return(basilisk_swapentry(requestid,quoteid)); else return(basilisk_swaplist(0,0)); } + else if ( strcmp(method,"lastnonce") == 0 ) + { + cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddnum(retjson,"lastnonce",LP_lastnonce); + return(jprint(retjson,1)); + } else if ( strcmp(method,"myprices") == 0 ) return(LP_myprices()); else if ( strcmp(method,"trust") == 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2cf2e8fc0..b816be396 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -332,5 +332,6 @@ struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout); struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid,int32_t vout); void LP_listunspent_query(char *symbol,char *coinaddr); +int32_t bitcoin_priv2wif(uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8_t addrtype); #endif diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 961f36ef3..080400f5d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -171,7 +171,7 @@ void queue_loop(void *ignore) if ( duplicate > 0 ) { LP_Qfound++; - if ( (LP_Qfound % 10) == 0 ) + if ( (LP_Qfound % 100) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c7cffdaa3..7c2bc6f69 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -904,7 +904,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { if ( LP_isavailable(butxo) > 0 ) { - butxo->T.swappending = Q.timestamp + LP_RESERVETIME; + autxo->T.swappending = butxo->T.swappending = Q.timestamp + LP_RESERVETIME; retjson = LP_quotejson(&Q); butxo->S.otherpubkey = jbits256(argjson,"desthash"); LP_unavailableset(butxo,butxo->S.otherpubkey); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1ebceefeb..ed1f832cd 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -419,6 +419,24 @@ int32_t LP_address_ismine(char *symbol,char *address) return(doneflag); } +int32_t LP_address_isvalid(char *symbol,char *address) +{ + int32_t isvalid = 0; cJSON *retjson; + if ( symbol == 0 || symbol[0] == 0 ) + return(0); + if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) + { + if ( jobj(retjson,"isvalid") != 0 && is_cJSON_True(jobj(retjson,"isvalid")) != 0 ) + { + isvalid = 1; + //printf("%s ismine (%s)\n",address,jprint(retjson,0)); + } + //printf("%s\n",jprint(retjson,0)); + free_json(retjson); + } + return(isvalid); +} + cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; cJSON *retjson; struct iguana_info *coin; @@ -612,9 +630,9 @@ double LP_getestimatedrate(struct iguana_info *coin) char *LP_sendrawtransaction(char *symbol,char *signedtx) { cJSON *array,*errobj; char *paramstr,*tmpstr,*retstr=0; int32_t n,alreadyflag = 0; cJSON *retjson; struct iguana_info *coin; - if ( symbol == 0 || symbol[0] == 0 ) + if ( symbol == 0 || symbol[0] == 0 || signedtx == 0 || signedtx[0] == 0 ) { - printf("LP_sendrawtransaction null symbol\n"); + printf("LP_sendrawtransaction null symbol %p or signedtx.%p\n",symbol,signedtx); return(0); } coin = LP_coinfind(symbol); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 5213c3897..f7b7ead7f 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -724,18 +724,244 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch return(signedtx); } -/*char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) +int32_t LP_vin_select(int32_t *aboveip,int64_t *abovep,int32_t *belowip,int64_t *belowp,struct LP_address_utxo **utxos,int32_t numunspents,uint64_t value,int32_t maxmode) { - int32_t iter,i,datalen; char changeaddr[64],*signedtx=0; cJSON *retjson; bits256 signedtxid; uint64_t txfee,newtxfee=10000; + int32_t i,abovei,belowi; int64_t above,below,gap,atx_value; + abovei = belowi = -1; + for (above=below=i=0; iU.value) <= 0 ) + { + //printf("illegal value.%d\n",i); + continue; + } + if ( atx_value == value ) + { + *aboveip = *belowip = i; + *abovep = *belowp = 0; + return(i); + } + else if ( atx_value > value ) + { + gap = (atx_value - value); + if ( above == 0 || gap < above ) + { + above = gap; + abovei = i; + } + } else gap = (value - atx_value); + if ( below == 0 || gap < below ) + { + below = gap; + belowi = i; + } + } + *aboveip = abovei; + *abovep = above; + *belowip = belowi; + *belowp = below; + //printf("above.%d below.%d\n",abovei,belowi); + return(abovei >= 0 && above < (below>>1) ? abovei : belowi); +} + +cJSON *LP_inputjson(bits256 txid,int32_t vout,char *spendscriptstr) +{ + cJSON *sobj,*item = cJSON_CreateObject(); + jaddbits256(item,"txid",txid); + jaddnum(item,"vout",vout); + sobj = cJSON_CreateObject(); + jaddstr(sobj,"hex",spendscriptstr); + jadd(item,"scriptPubKey",sobj); + return(item); +} + +int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen) +{ + char wifstr[128],spendscriptstr[128]; int32_t i,n,ind,abovei,belowi,maxmode=0; struct vin_info *vp; struct LP_address_utxo *up; int64_t above,below,remains = amount,total = 0; + *totalp = 0; + init_hexbytes_noT(spendscriptstr,script,scriptlen); + bitcoin_priv2wif(coin->wiftaddr,wifstr,privkey,coin->wiftype); + for (i=n=0; i= 0 ) + ind = abovei; + else ind = belowi; + if ( ind < 0 ) + { + printf("error finding unspent i.%d of %d, %.8f vs %.8f, abovei.%d belowi.%d ind.%d\n",i,numunspents,dstr(remains),dstr(amount),abovei,belowi,ind); + return(0); + } + up = utxos[ind]; + utxos[ind] = utxos[--numunspents]; + utxos[numunspents] = 0; + total += up->U.value; + remains -= up->U.value; + if ( remains <= 0 ) + break; + if ( numunspents == 0 ) + { + printf("total %.8f not enough for amount %.8f\n",dstr(total),dstr(amount)); + return(0); + } + vp = &V[n++]; + vp->N = vp->M = 1; + vp->signers[0].privkey = privkey; + jaddistr(privkeys,wifstr); + bitcoin_pubkey33(ctx,vp->signers[0].pubkey,privkey); + vp->suppress_pubkeys = suppress_pubkeys; + vp->ignore_cltverr = ignore_cltverr; + jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); + //printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains)); + } + *totalp = total; + return(n); +} + +char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys) +{ + static void *ctx; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp,locktime; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + *numvinsp = 0; + if ( sizeof(utxos)/sizeof(*utxos) != max ) + { + printf("LP_createrawtransaction: internal error %ld != max.%d\n",sizeof(utxos)/sizeof(*utxos),max); + return(0); + } + if ( coin == 0 || outputs == 0 || (numvouts= cJSON_GetArraySize(outputs)) <= 0 ) + { + printf("LP_createrawtransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); + return(0); + } + for (i=0; isymbol,coinaddr) <= 0 ) + { + printf("LP_createrawtransaction %s i.%d of %d is invalid\n",coinaddr,i,numvouts); + return(0); + } + if ( (value= j64bits(item,coinaddr)) <= 0 ) + { + printf("cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); + return(0); + } + amount += value; + } + else + { + printf("cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + return(0); + } + } + LP_listunspent_issue(coin->symbol,coin->smartaddr,1); + if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) + { + printf("LP_createrawtransaction: cant find address data\n"); + return(0); + } + memset(utxos,0,sizeof(utxos)); + if ( (numutxos= LP_address_utxo_ptrs(0,utxos,max,ap)) <= 0 ) + { + printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); + return(0); + } + ignore_cltverr = 0; + suppress_pubkeys = 1; + scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); + numvins = LP_vins_select(ctx,coin,&total,amount,V,utxos,numutxos,suppress_pubkeys,ignore_cltverr,privkey,privkeys,vins,script,scriptlen); + change = (total - amount); + timestamp = (uint32_t)time(NULL); + if ( strcmp("KMD",coin->symbol) == 0 ) + locktime = timestamp - 777; + else locktime = 0; + txobj = bitcoin_txcreate(coin->symbol,coin->isPoS,locktime,1,timestamp); + jdelete(txobj,"vin"); + jadd(txobj,"vin",vins); + if ( change < 6000 ) + { + adjust = change / numvouts; + change = 0; + } + for (i=0; itaddr,&addrtype,rmd160,coinaddr); + spendlen = bitcoin_standardspend(spendscript,0,rmd160); + txobj = bitcoin_txoutput(txobj,spendscript,spendlen,value + adjust); + } + else + { + printf("cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + return(0); + } + } + if ( change != 0 ) + txobj = bitcoin_txoutput(txobj,script,scriptlen,change); + if ( (rawtxbytes= bitcoin_json2hex(coin->isPoS,&txid,txobj,V)) != 0 ) + { + } else printf("error making rawtx suppress.%d\n",suppress_pubkeys); + free_json(privkeys); + free_json(txobj); + return(rawtxbytes); +} + +char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) +{ + static void *ctx; + int32_t iter,completed=0,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info V[256]; cJSON *retjson,*outputs,*vins,*privkeys; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; + if ( (outputs= jarray(&numvouts,argjson,"outputs")) == 0 ) + { + printf("no outputs in argjson (%s)\n",jprint(argjson,0)); + return(clonestr("{\"error\":\"no outputs specified\"}")); + } txfee = coin->txfee; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); if ( txfee > 0 && txfee < 10000 ) txfee = 10000; - retjson = cJSON_CreateObject(); + suppress_pubkeys = 0; + memset(signedtxid.bytes,0,sizeof(signedtxid)); safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); + safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); + privkey = LP_privkey(vinaddr,coin->taddr); for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(&signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys)) != 0 ) + privkeys = cJSON_CreateArray(); + vins = cJSON_CreateArray(); + memset(V,0,sizeof(V)); + if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,(int32_t)(sizeof(V)/sizeof(*V)),privkey,outputs,vins,privkeys)) != 0 ) { + completed = 0; + memset(&msgtx,0,sizeof(msgtx)); + memset(signedtxid.bytes,0,sizeof(signedtxid)); + if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,V,numvins,rawtx,vins,privkeys)) < 0 ) + printf("couldnt sign withdraw %s\n",bits256_str(str,signedtxid)); + else if ( completed == 0 ) + { + printf("incomplete signing withdraw (%s)\n",jprint(vins,0)); + if ( signedtx != 0 ) + free(signedtx), signedtx = 0; + } else printf("LP_withdraw %s -> %s\n",jprint(argjson,0),bits256_str(str,signedtxid)); datalen = (int32_t)strlen(signedtx) / 2; if ( strcmp(coin->symbol,"BTC") == 0 ) { @@ -743,11 +969,18 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; } else break; - if ( strcmp(str,"myfee") == 0 ) - break; + free(rawtx); + rawtx = 0; } + retjson = cJSON_CreateObject(); + if ( rawtx != 0 ) + jaddstr(retjson,"rawtx",rawtx); + if ( signedtx != 0 ) + jaddstr(retjson,"hex",signedtx); + jaddbits256(retjson,"txid",signedtxid); + jadd(retjson,"complete",completed!=0?jtrue():jfalse()); return(jprint(retjson,1)); -}*/ +} int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pubkey33,int32_t iambob,int32_t lockinputs,struct basilisk_rawtx *rawtx,uint32_t locktime,uint8_t *script,int32_t scriptlen,int64_t txfee,int32_t minconf,int32_t delay,bits256 privkey,uint8_t *changermd160,char *vinaddr) { diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 2aace6b1d..c624028e4 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/register b/iguana/exchanges/register deleted file mode 100755 index d00160beb..000000000 --- a/iguana/exchanges/register +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source userpass -curl --url "http://5.9.253.195:7783" --data "{\"userpass\":\"9bb4846d24136fc7c33515e45bccbab5c8fb7b57b411aa20057b371da9358255\",\"agent\":\"stats\",\"method\":\"register\",\"client\":\"6d3332be4904feafd326609bd76b66528dc7b2e2d75a7bd110c6bf8d19c4cf58\",\"pushaddr\":\"5.9.253.195\",\"pushport\":\"10000\"}" diff --git a/iguana/exchanges/registerall b/iguana/exchanges/registerall deleted file mode 100755 index 927f0b2f9..000000000 --- a/iguana/exchanges/registerall +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"registerall\",\"numnodes\":10}" diff --git a/iguana/exchanges/withdraw b/iguana/exchanges/withdraw new file mode 100755 index 000000000..1de924634 --- /dev/null +++ b/iguana/exchanges/withdraw @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"KMD\",\"outputs\":[\"iRUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.001, \"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.002]}" From 5fbff6abdd4ca4e5c28f8ec2abfaf3144b24e243 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:09:47 +0300 Subject: [PATCH 1025/2732] Test --- iguana/exchanges/LP_transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index f7b7ead7f..33b8d167d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -826,7 +826,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(n); } -char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys) +char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee) { static void *ctx; cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp,locktime; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; @@ -843,6 +843,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct printf("LP_createrawtransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); return(0); } + amount = txfee; for (i=0; ismartaddr,sizeof(changeaddr)); safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); privkey = LP_privkey(vinaddr,coin->taddr); + printf("LP_withdraw txfee %.8f\n",dstr(txfee)); for (iter=0; iter<2; iter++) { privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); memset(V,0,sizeof(V)); - if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,(int32_t)(sizeof(V)/sizeof(*V)),privkey,outputs,vins,privkeys)) != 0 ) + if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,(int32_t)(sizeof(V)/sizeof(*V)),privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) { completed = 0; memset(&msgtx,0,sizeof(msgtx)); From f32efb44b909439efdf5d6583d704b1201e3ed77 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:33:49 +0300 Subject: [PATCH 1026/2732] Test --- iguana/exchanges/withdraw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/withdraw b/iguana/exchanges/withdraw index 1de924634..39d8dbfd7 100755 --- a/iguana/exchanges/withdraw +++ b/iguana/exchanges/withdraw @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"KMD\",\"outputs\":[\"iRUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.001, \"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.002]}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"KMD\",\"outputs\":[{\"iRUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.001}, {\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.002}]}" From 6127a49fd4743fe428f3445053403acf4f4a973c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:35:56 +0300 Subject: [PATCH 1027/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 33b8d167d..3ca7b9bf2 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -847,6 +847,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct for (i=0; isymbol,coinaddr) <= 0 ) From a148d8d7750dd8eb94ff8e8071c691ab5440d43b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:40:18 +0300 Subject: [PATCH 1028/2732] Test --- iguana/exchanges/LP_transaction.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3ca7b9bf2..cd1bbd31c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -930,7 +930,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t iter,completed=0,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info V[256]; cJSON *retjson,*outputs,*vins,*privkeys; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; + int32_t iter,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; cJSON *retjson,*outputs,*vins,*privkeys; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; if ( (outputs= jarray(&numvouts,argjson,"outputs")) == 0 ) { printf("no outputs in argjson (%s)\n",jprint(argjson,0)); @@ -946,13 +946,15 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); privkey = LP_privkey(vinaddr,coin->taddr); - printf("LP_withdraw txfee %.8f\n",dstr(txfee)); + maxV = 256; + V = malloc(maxV * sizeof(*V)); + printf("LP_withdraw txfee %.8f sizeof V %ld\n",dstr(txfee),sizeof(*V)*maxV); for (iter=0; iter<2; iter++) { privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); - memset(V,0,sizeof(V)); - if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,(int32_t)(sizeof(V)/sizeof(*V)),privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) + memset(V,0,sizeof(*V)*maxV); + if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) { completed = 0; memset(&msgtx,0,sizeof(msgtx)); @@ -975,6 +977,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) free(rawtx); rawtx = 0; } + free(V); retjson = cJSON_CreateObject(); if ( rawtx != 0 ) jaddstr(retjson,"rawtx",rawtx); From efb8cf377486f863dc2521f640ab94dc8e3f06b1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:43:15 +0300 Subject: [PATCH 1029/2732] Test --- iguana/exchanges/LP_transaction.c | 4 ++-- iguana/exchanges/withdraw | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index cd1bbd31c..9f3e7319f 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -855,7 +855,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct printf("LP_createrawtransaction %s i.%d of %d is invalid\n",coinaddr,i,numvouts); return(0); } - if ( (value= j64bits(item,coinaddr)) <= 0 ) + if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) { printf("cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); return(0); @@ -902,7 +902,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct item = jitem(outputs,i); if ( (coinaddr= jfieldname(item)) != 0 ) { - if ( (value= j64bits(item,coinaddr)) <= 0 ) + if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) { printf("cant get value i.%d of %d %s\n",i,numvouts,jprint(outputs,0)); return(0); diff --git a/iguana/exchanges/withdraw b/iguana/exchanges/withdraw index 39d8dbfd7..8a78fa5a1 100755 --- a/iguana/exchanges/withdraw +++ b/iguana/exchanges/withdraw @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"KMD\",\"outputs\":[{\"iRUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.001}, {\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.002}]}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"KMD\",\"outputs\":[{\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.001}, {\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.002}]}" From 1a2af79b0c79f53e5f23e4589a6bf3c172013d79 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:47:29 +0300 Subject: [PATCH 1030/2732] Test --- iguana/exchanges/LP_transaction.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 9f3e7319f..1051de01c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -897,6 +897,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct adjust = change / numvouts; change = 0; } + printf("vins.(%s) privkeys.(%s)\n",jprint(vins,0),jprint(privkeys,0)); for (i=0; iisPoS,&txid,txobj,V)) != 0 ) { } else printf("error making rawtx suppress.%d\n",suppress_pubkeys); @@ -967,6 +969,8 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) if ( signedtx != 0 ) free(signedtx), signedtx = 0; } else printf("LP_withdraw %s -> %s\n",jprint(argjson,0),bits256_str(str,signedtxid)); + if ( signedtx == 0 ) + break; datalen = (int32_t)strlen(signedtx) / 2; if ( strcmp(coin->symbol,"BTC") == 0 ) { From 0803f39e7cca545c7c273984de9e2c967bbf6fe1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 23:50:29 +0300 Subject: [PATCH 1031/2732] Test --- iguana/exchanges/LP_transaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 1051de01c..4fc3489b3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -785,6 +785,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ bitcoin_priv2wif(coin->wiftaddr,wifstr,privkey,coin->wiftype); for (i=n=0; isuppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); + printf("i.%d privkeys.%s vins.%s\n",i,jprint(privkeys,0),jprint(vins,0)); //printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains)); } *totalp = total; @@ -897,7 +899,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct adjust = change / numvouts; change = 0; } - printf("vins.(%s) privkeys.(%s)\n",jprint(vins,0),jprint(privkeys,0)); + printf("numvins.%d vins.(%s) privkeys.(%s)\n",numvins,jprint(vins,0),jprint(privkeys,0)); for (i=0; i Date: Sun, 15 Oct 2017 23:53:24 +0300 Subject: [PATCH 1032/2732] Test --- iguana/exchanges/LP_transaction.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 4fc3489b3..3bc5e317d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -774,6 +774,7 @@ cJSON *LP_inputjson(bits256 txid,int32_t vout,char *spendscriptstr) sobj = cJSON_CreateObject(); jaddstr(sobj,"hex",spendscriptstr); jadd(item,"scriptPubKey",sobj); + printf("vin.%s\n",jprint(item,0)); return(item); } @@ -821,7 +822,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ vp->suppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); - printf("i.%d privkeys.%s vins.%s\n",i,jprint(privkeys,0),jprint(vins,0)); + printf("wif.%s i.%d privkeys.%s vins.%s %p %p\n",wifstr,i,jprint(privkeys,0),jprint(vins,0),privkeys,vins); //printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains)); } *totalp = total; @@ -899,7 +900,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct adjust = change / numvouts; change = 0; } - printf("numvins.%d vins.(%s) privkeys.(%s)\n",numvins,jprint(vins,0),jprint(privkeys,0)); + printf("numvins.%d vins.(%s) privkeys.(%s) %p %p\n",numvins,jprint(vins,0),jprint(privkeys,0),vins,privkeys); for (i=0; i Date: Sun, 15 Oct 2017 23:57:39 +0300 Subject: [PATCH 1033/2732] Test --- iguana/exchanges/LP_transaction.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3bc5e317d..3c1ef3472 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -807,13 +807,6 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ utxos[numunspents] = 0; total += up->U.value; remains -= up->U.value; - if ( remains <= 0 ) - break; - if ( numunspents == 0 ) - { - printf("total %.8f not enough for amount %.8f\n",dstr(total),dstr(amount)); - return(0); - } vp = &V[n++]; vp->N = vp->M = 1; vp->signers[0].privkey = privkey; @@ -824,6 +817,13 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); printf("wif.%s i.%d privkeys.%s vins.%s %p %p\n",wifstr,i,jprint(privkeys,0),jprint(vins,0),privkeys,vins); //printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains)); + if ( remains <= 0 ) + break; + if ( numunspents == 0 ) + { + printf("total %.8f not enough for amount %.8f\n",dstr(total),dstr(amount)); + return(0); + } } *totalp = total; return(n); From e150f5d81125a3582cb6f5609312146e69979529 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:04:59 +0300 Subject: [PATCH 1034/2732] Test --- iguana/exchanges/LP_transaction.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3c1ef3472..6ec336111 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -774,7 +774,7 @@ cJSON *LP_inputjson(bits256 txid,int32_t vout,char *spendscriptstr) sobj = cJSON_CreateObject(); jaddstr(sobj,"hex",spendscriptstr); jadd(item,"scriptPubKey",sobj); - printf("vin.%s\n",jprint(item,0)); + //printf("vin.%s\n",jprint(item,0)); return(item); } @@ -786,7 +786,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ bitcoin_priv2wif(coin->wiftaddr,wifstr,privkey,coin->wiftype); for (i=n=0; isuppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); - printf("wif.%s i.%d privkeys.%s vins.%s %p %p\n",wifstr,i,jprint(privkeys,0),jprint(vins,0),privkeys,vins); + //printf("wif.%s i.%d privkeys.%s vins.%s %p %p\n",wifstr,i,jprint(privkeys,0),jprint(vins,0),privkeys,vins); //printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains)); if ( remains <= 0 ) break; @@ -850,7 +850,6 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct for (i=0; isymbol,coinaddr) <= 0 ) @@ -900,7 +899,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct adjust = change / numvouts; change = 0; } - printf("numvins.%d vins.(%s) privkeys.(%s) %p %p\n",numvins,jprint(vins,0),jprint(privkeys,0),vins,privkeys); + printf("numvins.%d vins.(%s) privkeys.(%s)\n",numvins,jprint(vins,0),jprint(privkeys,0)); for (i=0; iisPoS,&txid,txobj,V)) != 0 ) { } else printf("error making rawtx suppress.%d\n",suppress_pubkeys); - free_json(privkeys); free_json(txobj); return(rawtxbytes); } @@ -953,12 +951,11 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) privkey = LP_privkey(vinaddr,coin->taddr); maxV = 256; V = malloc(maxV * sizeof(*V)); - printf("LP_withdraw txfee %.8f sizeof V %ld\n",dstr(txfee),sizeof(*V)*maxV); for (iter=0; iter<2; iter++) { privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); - memset(V,0,sizeof(*V)*maxV); + memset(V,0,sizeof(*V) * maxV); if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) { completed = 0; @@ -981,10 +978,13 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; } else break; - free(rawtx); - rawtx = 0; + free_json(privkeys), privkeys = 0; + if ( rawtx != 0 ) + free(rawtx), rawtx = 0; } free(V); + if ( privkeys != 0 ) + free_json(privkeys); retjson = cJSON_CreateObject(); if ( rawtx != 0 ) jaddstr(retjson,"rawtx",rawtx); From e35ac080847aff51d798f16eda4e83300e6956b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:13:12 +0300 Subject: [PATCH 1035/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6ec336111..947e9e5dc 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -451,7 +451,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) { - //printf("numinputs.%d msgtx.%d\n",numinputs,msgtx->tx_in); + printf("numinputs.%d msgtx.%d\n",numinputs,msgtx->tx_in); memset(msgtx,0,sizeof(*msgtx)); if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) { From dd7eff3175cd529920ead2382fec428438c03878 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:20:40 +0300 Subject: [PATCH 1036/2732] Test --- iguana/exchanges/LP_bitcoin.c | 18 +++++++++--------- iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 20cc5858f..4f983ae67 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3345,11 +3345,11 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is sigser = calloc(1,maxsize*2); //printf("json.%p array.%p sigser.%p\n",json,vinarray,sigser); } - //printf("version.%d\n",msg->version); +printf("version.%d\n",msg->version); if ( isPoS != 0 ) { len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->timestamp),&msg->timestamp); - //char str[65]; printf("version.%d timestamp.%08x %u %s\n",msg->version,msg->timestamp,msg->timestamp,utc_str(str,msg->timestamp)); +char str[65]; printf("version.%d timestamp.%08x %u %s\n",msg->version,msg->timestamp,msg->timestamp,utc_str(str,msg->timestamp)); if ( json != 0 ) jaddnum(json,"timestamp",msg->timestamp); } @@ -3370,7 +3370,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } for (i=0; itx_in; i++) { - //printf("vin.%d starts offset.%d\n",i,len); +printf("vin.%d starts offset.%d\n",i,len); if ( vins != 0 && jitem(vins,i) != 0 ) iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); if ( (n= iguana_vinparse(rwflag,&serialized[len],&msg->vins[i])) < 0 ) @@ -3378,7 +3378,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is //printf("serialized vin.[%02x %02x %02x]\n",serialized[len],serialized[len+1],serialized[len+2]); if ( msg->vins[i].spendscript == spendscript ) msg->vins[i].spendscript = 0; - //printf("vin.%d n.%d len.%d\n",i,n,len); +printf("vin.%d n.%d len.%d\n",i,n,len); len += n; if ( len > maxsize ) { @@ -3386,9 +3386,9 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is return(-1); } } - //for (i=-3; i<7; i++) - // printf("%02x",serialized[len+i]); - //printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); + for (i=-3; i<7; i++) + printf("%02x",serialized[len+i]); + printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_out); if ( rwflag == 0 ) { @@ -3408,7 +3408,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } for (i=0; itx_out; i++) { - //printf("rwflag.%d vout.%d starts %d\n",rwflag,i,len); +printf("rwflag.%d vout.%d starts %d\n",rwflag,i,len); if ( (n= iguana_voutparse(rwflag,&serialized[len],&msg->vouts[i])) < 0 ) return(-1); len += n; @@ -3421,7 +3421,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is jaddi(voutarray,iguana_voutjson(taddr,pubtype,p2shtype,&msg->vouts[i],i,*txidp)); } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); - //printf("lock_time.%08x len.%d\n",msg->lock_time,len); +printf("lock_time.%08x len.%d\n",msg->lock_time,len); /*if ( strcmp(coin->symbol,"VPN") == 0 ) { uint16_t ddosflag = 0; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 947e9e5dc..5861b2d33 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -451,7 +451,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) { - printf("numinputs.%d msgtx.%d\n",numinputs,msgtx->tx_in); + printf("numinputs.%d (%s) msgtx.%d\n",numinputs,jprint(vins,0),msgtx->tx_in); memset(msgtx,0,sizeof(*msgtx)); if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) { @@ -933,7 +933,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t iter,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; cJSON *retjson,*outputs,*vins,*privkeys; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; + int32_t iter,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; cJSON *retjson,*outputs,*vins=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; if ( (outputs= jarray(&numvouts,argjson,"outputs")) == 0 ) { printf("no outputs in argjson (%s)\n",jprint(argjson,0)); From 90e09db8794f91273804aa51e735dbe1a6a4a209 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:28:06 +0300 Subject: [PATCH 1037/2732] Trusted --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_prices.c | 11 +++++++++++ iguana/exchanges/trusted | 3 +++ 3 files changed, 16 insertions(+) create mode 100755 iguana/exchanges/trusted diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3c8ae9cf8..9d9a5febd 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -376,6 +376,8 @@ dividends(coin, height, )\n\ return(LP_myprices()); else if ( strcmp(method,"trust") == 0 ) return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); + else if ( strcmp(method,"trusted") == 0 ) + return(LP_pubkey_trusted()); } if ( IAMLP == 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1fc8c64b6..c742decd2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -221,6 +221,17 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) return(clonestr("{\"error\":\"pubkey not found\"}")); } +char *LP_pubkey_trusted() +{ + struct LP_pubkeyinfo *pubp,*tmp; cJSON *array = cJSON_CreateArray(); + HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) + { + if ( pubp->istrusted != 0 ) + jaddibits256(array,pubp->pubkey); + } + return(jprint(array,1)); +} + uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) { cJSON *array,*item; int32_t i,n; uint64_t metric=0,total; diff --git a/iguana/exchanges/trusted b/iguana/exchanges/trusted new file mode 100755 index 000000000..fe96516e2 --- /dev/null +++ b/iguana/exchanges/trusted @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"trusted\"}" From 453821bb8a99d15a0ed9c639d62bd81d8a8bcba1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:34:30 +0300 Subject: [PATCH 1038/2732] Test --- iguana/exchanges/LP_transaction.c | 3 ++- iguana/exchanges/install | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 5861b2d33..013b5d377 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -444,11 +444,12 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ extraspace = malloc(extralen); memset(msgtx,0,sizeof(*msgtx)); decode_hex(serialized,len,rawtx); - // printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); + printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys)) != 0 ) { //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); + printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) { printf("numinputs.%d (%s) msgtx.%d\n",numinputs,jprint(vins,0),msgtx->tx_in); diff --git a/iguana/exchanges/install b/iguana/exchanges/install index c624028e4..561a3063e 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From d1dbe8001859a24836c35edffe8c7b6b580664b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:36:28 +0300 Subject: [PATCH 1039/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 013b5d377..a06e0517c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -444,6 +444,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ extraspace = malloc(extralen); memset(msgtx,0,sizeof(*msgtx)); decode_hex(serialized,len,rawtx); + printf("vins.%p privkeys.%p\n",vins,privkeysjson); printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys)) != 0 ) { From b02a0d14101ac1295339025b5b1d041d66bcdaa1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:42:08 +0300 Subject: [PATCH 1040/2732] Test --- iguana/exchanges/LP_transaction.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a06e0517c..19e37b547 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -433,6 +433,8 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) { uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; + printf("vins.%p privkeys.%p\n",vins,privkeysjson); + printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); maxsize = 1000000; memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) @@ -444,8 +446,6 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ extraspace = malloc(extralen); memset(msgtx,0,sizeof(*msgtx)); decode_hex(serialized,len,rawtx); - printf("vins.%p privkeys.%p\n",vins,privkeysjson); - printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys)) != 0 ) { //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); @@ -895,7 +895,7 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct else locktime = 0; txobj = bitcoin_txcreate(coin->symbol,coin->isPoS,locktime,1,timestamp); jdelete(txobj,"vin"); - jadd(txobj,"vin",vins); + jadd(txobj,"vin",jduplicate(vins)); if ( change < 6000 ) { adjust = change / numvouts; @@ -963,6 +963,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) completed = 0; memset(&msgtx,0,sizeof(msgtx)); memset(signedtxid.bytes,0,sizeof(signedtxid)); + printf("%p %p vins.(%s) privkeys.(%s)\n",vins,privkeys,jprint(vins,0),jprint(privkeys,0)); if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,V,numvins,rawtx,vins,privkeys)) < 0 ) printf("couldnt sign withdraw %s\n",bits256_str(str,signedtxid)); else if ( completed == 0 ) From 21ef9c284e7bd47f6d856e611ea524ea736296df Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:44:59 +0300 Subject: [PATCH 1041/2732] Test --- iguana/exchanges/LP_bitcoin.c | 18 +++++++++--------- iguana/exchanges/LP_transaction.c | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 4f983ae67..20cc5858f 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3345,11 +3345,11 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is sigser = calloc(1,maxsize*2); //printf("json.%p array.%p sigser.%p\n",json,vinarray,sigser); } -printf("version.%d\n",msg->version); + //printf("version.%d\n",msg->version); if ( isPoS != 0 ) { len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->timestamp),&msg->timestamp); -char str[65]; printf("version.%d timestamp.%08x %u %s\n",msg->version,msg->timestamp,msg->timestamp,utc_str(str,msg->timestamp)); + //char str[65]; printf("version.%d timestamp.%08x %u %s\n",msg->version,msg->timestamp,msg->timestamp,utc_str(str,msg->timestamp)); if ( json != 0 ) jaddnum(json,"timestamp",msg->timestamp); } @@ -3370,7 +3370,7 @@ char str[65]; printf("version.%d timestamp.%08x %u %s\n",msg->version,msg->times } for (i=0; itx_in; i++) { -printf("vin.%d starts offset.%d\n",i,len); + //printf("vin.%d starts offset.%d\n",i,len); if ( vins != 0 && jitem(vins,i) != 0 ) iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); if ( (n= iguana_vinparse(rwflag,&serialized[len],&msg->vins[i])) < 0 ) @@ -3378,7 +3378,7 @@ printf("vin.%d starts offset.%d\n",i,len); //printf("serialized vin.[%02x %02x %02x]\n",serialized[len],serialized[len+1],serialized[len+2]); if ( msg->vins[i].spendscript == spendscript ) msg->vins[i].spendscript = 0; -printf("vin.%d n.%d len.%d\n",i,n,len); + //printf("vin.%d n.%d len.%d\n",i,n,len); len += n; if ( len > maxsize ) { @@ -3386,9 +3386,9 @@ printf("vin.%d n.%d len.%d\n",i,n,len); return(-1); } } - for (i=-3; i<7; i++) - printf("%02x",serialized[len+i]); - printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); + //for (i=-3; i<7; i++) + // printf("%02x",serialized[len+i]); + //printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_out); if ( rwflag == 0 ) { @@ -3408,7 +3408,7 @@ printf("vin.%d n.%d len.%d\n",i,n,len); } for (i=0; itx_out; i++) { -printf("rwflag.%d vout.%d starts %d\n",rwflag,i,len); + //printf("rwflag.%d vout.%d starts %d\n",rwflag,i,len); if ( (n= iguana_voutparse(rwflag,&serialized[len],&msg->vouts[i])) < 0 ) return(-1); len += n; @@ -3421,7 +3421,7 @@ printf("rwflag.%d vout.%d starts %d\n",rwflag,i,len); jaddi(voutarray,iguana_voutjson(taddr,pubtype,p2shtype,&msg->vouts[i],i,*txidp)); } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); -printf("lock_time.%08x len.%d\n",msg->lock_time,len); + //printf("lock_time.%08x len.%d\n",msg->lock_time,len); /*if ( strcmp(coin->symbol,"VPN") == 0 ) { uint16_t ddosflag = 0; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 19e37b547..e51209add 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -901,7 +901,6 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct adjust = change / numvouts; change = 0; } - printf("numvins.%d vins.(%s) privkeys.(%s)\n",numvins,jprint(vins,0),jprint(privkeys,0)); for (i=0; iisPoS,&txid,txobj,V)) != 0 ) { } else printf("error making rawtx suppress.%d\n",suppress_pubkeys); @@ -963,7 +961,6 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) completed = 0; memset(&msgtx,0,sizeof(msgtx)); memset(signedtxid.bytes,0,sizeof(signedtxid)); - printf("%p %p vins.(%s) privkeys.(%s)\n",vins,privkeys,jprint(vins,0),jprint(privkeys,0)); if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,V,numvins,rawtx,vins,privkeys)) < 0 ) printf("couldnt sign withdraw %s\n",bits256_str(str,signedtxid)); else if ( completed == 0 ) @@ -981,11 +978,14 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; } else break; + free_json(vins), vins = 0; free_json(privkeys), privkeys = 0; if ( rawtx != 0 ) free(rawtx), rawtx = 0; } free(V); + if ( vins != 0 ) + free_json(vins); if ( privkeys != 0 ) free_json(privkeys); retjson = cJSON_CreateObject(); From 36d3284a961c813117a9927db486a80731675d3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:46:14 +0300 Subject: [PATCH 1042/2732] Test --- iguana/exchanges/sendrawtransaction | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 iguana/exchanges/sendrawtransaction diff --git a/iguana/exchanges/sendrawtransaction b/iguana/exchanges/sendrawtransaction new file mode 100755 index 000000000..c3c2b09a0 --- /dev/null +++ b/iguana/exchanges/sendrawtransaction @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sendrawtransaction\",\"coin\":\"KMD\",\"signedtx\":\"$1\"}" From 496d4887ac2f8088344e1fd93360cdcef9a8a550 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:47:02 +0300 Subject: [PATCH 1043/2732] Test --- iguana/exchanges/LP_transaction.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index e51209add..b9e9a9ee1 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -433,8 +433,6 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) { uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; - printf("vins.%p privkeys.%p\n",vins,privkeysjson); - printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); maxsize = 1000000; memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) @@ -450,10 +448,10 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ { //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); - printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); + //printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) { - printf("numinputs.%d (%s) msgtx.%d\n",numinputs,jprint(vins,0),msgtx->tx_in); + //printf("numinputs.%d (%s) msgtx.%d\n",numinputs,jprint(vins,0),msgtx->tx_in); memset(msgtx,0,sizeof(*msgtx)); if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) { From f071beca9e65d7f63433236a76d5b58f00bb66d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 00:52:40 +0300 Subject: [PATCH 1044/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_transaction.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fc8885984..be8c462a3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,6 @@ // LP_nativeDEX.c // marketmaker // -// withdraw // stats // sign critical api calls // dPoW security -> 2: KMD notarized, 3: BTC notarized diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b9e9a9ee1..9e94a1b88 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -829,13 +829,14 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(n); } -char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee) +char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee) { static void *ctx; cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp,locktime; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; + *txobjp = 0; if ( sizeof(utxos)/sizeof(*utxos) != max ) { printf("LP_createrawtransaction: internal error %ld != max.%d\n",sizeof(utxos)/sizeof(*utxos),max); @@ -924,14 +925,14 @@ char *LP_createrawtransaction(int32_t *numvinsp,struct iguana_info *coin,struct if ( (rawtxbytes= bitcoin_json2hex(coin->isPoS,&txid,txobj,V)) != 0 ) { } else printf("error making rawtx suppress.%d\n",suppress_pubkeys); - free_json(txobj); + *txobjp = txobj; return(rawtxbytes); } char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t iter,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; cJSON *retjson,*outputs,*vins=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; + int32_t iter,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; cJSON *retjson,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 signedtxid; uint64_t txfee,newtxfee=10000; if ( (outputs= jarray(&numvouts,argjson,"outputs")) == 0 ) { printf("no outputs in argjson (%s)\n",jprint(argjson,0)); @@ -954,7 +955,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); memset(V,0,sizeof(*V) * maxV); - if ( (rawtx= LP_createrawtransaction(&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) + if ( (rawtx= LP_createrawtransaction(&txobj,&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) { completed = 0; memset(&msgtx,0,sizeof(msgtx)); @@ -977,6 +978,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) } else break; } else break; free_json(vins), vins = 0; + free_json(txobj), txobj = 0; free_json(privkeys), privkeys = 0; if ( rawtx != 0 ) free(rawtx), rawtx = 0; @@ -991,6 +993,8 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) jaddstr(retjson,"rawtx",rawtx); if ( signedtx != 0 ) jaddstr(retjson,"hex",signedtx); + if ( txobj != 0 ) + jadd(retjson,"tx",txobj); jaddbits256(retjson,"txid",signedtxid); jadd(retjson,"complete",completed!=0?jtrue():jfalse()); return(jprint(retjson,1)); From 318c5fc075e13684da2a246d100205ab56892fa9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 10:42:37 +0300 Subject: [PATCH 1045/2732] Add MNZ --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/coins | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index be8c462a3..002260f2c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,7 +13,6 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ -//alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN // // LP_nativeDEX.c @@ -22,7 +21,8 @@ // stats // sign critical api calls // dPoW security -> 2: KMD notarized, 3: BTC notarized -// verify portfolio and pricearray +// verify portfolio, pricearray, withdraw +//alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN #include diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 356346d6a..f5c3a21d4 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,3 +1,3 @@ -export coins="[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 3046871492604965f14a4fd1149275a5572111ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 15:15:49 +0300 Subject: [PATCH 1046/2732] Test --- iguana/exchanges/LP_commands.c | 56 +++++++++++++++++++++++---------- iguana/exchanges/LP_nativeDEX.c | 5 +-- iguana/exchanges/LP_swap.c | 2 +- 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9d9a5febd..19871c0c4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -94,23 +94,23 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r // return(clonestr("{\"result\":\"success\"}")); else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ -available localhost RPC commands:\n \ +available localhost RPC commands: * means it needs to be a signed request\n \ pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ -setprice(base, rel, price)\n\ -autoprice(base, rel, price, margin, type)\n\ -goal(coin=*, val=)\n\ +setprice(base, rel, price)*\n\ +autoprice(base, rel, price, margin, type)*\n\ +goal(coin=*, val=)*\n\ myprice(base, rel)\n\ -enable(coin)\n\ -disable(coin)\n\ +enable(coin)*\n\ +disable(coin)*\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ -buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ -sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ -withdraw(coin, outputs[])\n\ +buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)*\n\ +sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)*\n\ +withdraw(coin, outputs[])*\n\ sendrawtransaction(coin, signedtx)\n\ -swapstatus()\n\ -swapstatus(requestid, quoteid)\n\ +swapstatus()*\n\ +swapstatus(requestid, quoteid)*\n\ public API:\n \ getcoins()\n\ getcoin(coin)\n\ @@ -118,16 +118,16 @@ portfolio()\n\ getpeers()\n\ passphrase(passphrase, gui)\n\ listunspent(coin, address)\n\ -setconfirms(coin, numconfirms, maxconfirms=6)\n\ -trust(pubkey, trust)\n\ +setconfirms(coin, numconfirms, maxconfirms=6)*\n\ +trust(pubkey, trust)*\n\ balance(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ -sendmessage(base=coin, rel="", pubkey=zero, )\n\ -getmessages(firsti=0, num=100)\n\ -clearmessages(firsti=0, num=100)\n\ +sendmessage(base=coin, rel="", pubkey=zero, )*\n\ +getmessages(firsti=0, num=100)*\n\ +deletemessages(firsti=0, num=100)*\n\ secretaddresses(prefix='secretaddress', passphrase, num=10, pubtype=60, taddr=0)\n\ -electrum(coin, ipaddr, port)\n\ +electrum(coin, ipaddr, port)*\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ @@ -153,6 +153,7 @@ dividends(coin, height, )\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) { + //* if ( jobj(argjson,"method2") == 0 ) { printf("broadcast message\n"); @@ -162,12 +163,14 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"getmessages") == 0 ) { + //* if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) return(jprint(retjson,1)); else return(clonestr("{\"error\":\"null messages\"}")); } else if ( strcmp(method,"deletemessages") == 0 ) { + //* LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); return(clonestr("{\"result\":\"success\"}")); } @@ -202,6 +205,7 @@ dividends(coin, height, )\n\ price = jdouble(argjson,"price"); if ( strcmp(method,"setprice") == 0 ) { + //* if ( price > SMALLVAL ) { if ( LP_mypriceset(&changed,base,rel,price) < 0 ) @@ -213,6 +217,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"autoprice") == 0 ) { + //* if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin"),jstr(argjson,"type")) < 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); @@ -235,6 +240,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"buy") == 0 ) { + //* if ( price > SMALLVAL ) { return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"))); @@ -242,6 +248,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"sell") == 0 ) { + //* if ( price > SMALLVAL ) { return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"))); @@ -259,6 +266,7 @@ dividends(coin, height, )\n\ { if ( strcmp(method,"enable") == 0 ) { + //* if ( (ptr= LP_coinsearch(coin)) != 0 ) { if ( LP_conflicts_find(ptr) == 0 ) @@ -269,12 +277,14 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"disable") == 0 ) { + //* if ( (ptr= LP_coinsearch(coin)) != 0 ) ptr->inactive = (uint32_t)time(NULL); return(jprint(LP_coinsjson(0),1)); } else if ( strcmp(method,"electrum") == 0 ) { + //* if ( (ptr= LP_coinsearch(coin)) != 0 ) { ptr->inactive = 0; @@ -287,6 +297,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"withdraw") == 0 ) { + ///* if ( (ptr= LP_coinsearch(coin)) != 0 ) { if ( jobj(argjson,"outputs") == 0 ) @@ -298,6 +309,7 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"setconfirms") == 0 ) { int32_t n; + //* n = jint(argjson,"numconfirms"); if ( n < 0 ) return(clonestr("{\"error\":\"illegal numconfirms\"}")); @@ -352,15 +364,22 @@ dividends(coin, height, )\n\ } } else if ( strcmp(method,"goal") == 0 ) + { + //* return(LP_portfolio_goal(coin,jdouble(argjson,"val"))); + } else if ( strcmp(method,"getcoin") == 0 ) return(LP_getcoin(coin)); } else if ( strcmp(method,"goal") == 0 ) + { + //* return(LP_portfolio_goal("*",100.)); + } else if ( strcmp(method,"swapstatus") == 0 ) { uint32_t requestid,quoteid; + //* if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) return(basilisk_swapentry(requestid,quoteid)); else return(basilisk_swaplist(0,0)); @@ -375,7 +394,10 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"myprices") == 0 ) return(LP_myprices()); else if ( strcmp(method,"trust") == 0 ) + { + //* return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); + } else if ( strcmp(method,"trusted") == 0 ) return(LP_pubkey_trusted()); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 002260f2c..1c266716e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,11 +18,12 @@ // LP_nativeDEX.c // marketmaker // -// stats // sign critical api calls +// stats // dPoW security -> 2: KMD notarized, 3: BTC notarized +// add interest to KMD withdraw // verify portfolio, pricearray, withdraw -//alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN +// alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN #include diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index a6a9e0bf2..c7f4cd457 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1021,7 +1021,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.iambob = 0; swap->I.otherhash = swap->I.req.desthash; swap->I.aliceistrusted = 1; - swap->I.otheristrusted = swap->I.bobistrusted = LP_pubkey_istrusted(swap->I.req.desthash); + swap->I.otheristrusted = swap->I.bobistrusted = LP_pubkey_istrusted(swap->I.req.srchash); } else { From 31628da270b8c71b1711bb52f74335b0f59a0a98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 15:58:42 +0300 Subject: [PATCH 1047/2732] Remove GETTXOUT print --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index ed1f832cd..5da878bbd 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -283,7 +283,7 @@ cJSON *LP_gettxout_json(bits256 txid,int32_t vout,int32_t height,char *coinaddr, jaddstr(sobj,"type","pubkey"); jadd(sobj,"addresses",addresses); jadd(retjson,"scriptPubKey",sobj); - printf("GETTXOUT.(%s)\n",jprint(retjson,0)); + //printf("GETTXOUT.(%s)\n",jprint(retjson,0)); return(retjson); } From b5b0b7e8d8c5ff60a21629acf10a4d090373c18a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 16:37:44 +0300 Subject: [PATCH 1048/2732] Test --- iguana/exchanges/LP_commands.c | 3 +-- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_rpc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 19871c0c4..d74b34501 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -153,10 +153,9 @@ dividends(coin, height, )\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) { - //* if ( jobj(argjson,"method2") == 0 ) { - printf("broadcast message\n"); + //LP_signature_add(argjson,jstr(argjson,"message"),jbits256(argjson,"pubkey")); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); } return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b816be396..a292f1be1 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -35,7 +35,7 @@ #define MIN_PSOCK_PORT 10000 #define LP_MEMPOOL_TIMEINCR 10 #define LP_GETINFO_INCR 30 -#define LP_ORDERBOOK_DURATION 3600 +#define LP_ORDERBOOK_DURATION 120 #define LP_HTTP_TIMEOUT 2 // 1 is too small due to edge cases of time(NULL) #define LP_MAXPEER_ERRORS 3 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1c266716e..b59cf9123 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // sign critical api calls +// SPV height errors, autodetect and fix // stats // dPoW security -> 2: KMD notarized, 3: BTC notarized // add interest to KMD withdraw diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5da878bbd..083159723 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -486,7 +486,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) if ( (destport= LP_randpeer(destip)) > 0 ) { retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); - printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); + //printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); retjson = cJSON_Parse(retstr); } else printf("LP_listunspent_issue couldnt get a random peer?\n"); } From 10723a3c198282d1f296e3373ff51e8937eefbed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 16:41:18 +0300 Subject: [PATCH 1049/2732] Test --- iguana/exchanges/LP_prices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c742decd2..f91916e73 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -719,6 +719,8 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * //printf("skip pubp since no rmd160\n"); continue; } + if ( pubp->timestamp < oldest ) + continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); minsatoshis = maxsatoshis = n = 0; ap = 0; From e8aa77d7356df4e39009e12d4905f77a744a1eea Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 17:24:39 +0300 Subject: [PATCH 1050/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 23 ++++++++++++++++------- iguana/exchanges/LP_socket.c | 15 ++++++++++++++- iguana/exchanges/LP_utxo.c | 27 +++++++++++++++++++++------ 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b59cf9123..890d65174 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,6 +21,7 @@ // sign critical api calls // SPV height errors, autodetect and fix // stats +// deal with offline pubkeys, reputations, etc. // dPoW security -> 2: KMD notarized, 3: BTC notarized // add interest to KMD withdraw // verify portfolio, pricearray, withdraw diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7c2bc6f69..414e7cf51 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -443,9 +443,9 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) +int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { - int32_t i,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; char str[65]; int64_t dist; uint64_t mindist = (1LL << 60); + int32_t i,oldht,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; char str[65]; int64_t dist; uint64_t mindist = (1LL << 60); if ( (ep= coin->electrum) != 0 ) { if ( (backupep= ep->prev) == 0 ) @@ -462,15 +462,24 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u { if ( coin->electrum != 0 ) { - if (up->SPV <= 0 ) + if ( up->SPV == 0 || up->SPV == -1 ) up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV < 0 ) + if ( up->SPV == 0 || up->SPV == -1 ) { printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); + if ( up->SPV == -1 ) + { + oldht = up->U.height; + LP_txheight_check(coin,coinaddr,up); + if ( oldht != up->U.height ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV == -1 ) + up->SPV = -2; + } continue; } else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } - if ( dist >= 0 && dist < mindist ) + if ( up->SPV > 0 && dist >= 0 && dist < mindist ) { //printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); mini = i; @@ -507,7 +516,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr); } mini = -1; - if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,utxos,m,targetval)) >= 0 ) + if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,targetval)) >= 0 ) { up = utxos[mini]; utxos[mini] = 0; @@ -516,7 +525,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { - if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,targetval2 * 1.01)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 99d707ad4..afca7e887 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -457,7 +457,7 @@ cJSON *electrum_address_subscribe(char *symbol,struct electrum_info *ep,cJSON ** cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { - struct LP_transaction *tx; cJSON *retjson,*txobj,*item; int32_t i,n,height; bits256 txid; struct iguana_info *coin = LP_coinfind(symbol); + char str[65]; struct LP_transaction *tx; cJSON *retjson,*txobj,*item; int32_t i,n,height; bits256 txid; struct iguana_info *coin = LP_coinfind(symbol); retjson = electrum_strarg(symbol,ep,retjsonp,"blockchain.address.get_history",addr,ELECTRUM_TIMEOUT); //printf("history.(%s)\n",jprint(retjson,0)); if ( retjson != 0 && (n= cJSON_GetArraySize(retjson)) > 0 ) @@ -478,6 +478,8 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * { if ( (tx= LP_transactionfind(coin,txid)) != 0 ) { + if ( tx->height > 0 && tx->height != height ) + printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; LP_address_utxoadd(coin,addr,txid,0,0,height,-1); } @@ -488,6 +490,17 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * return(retjson); } +int32_t LP_txheight_check(struct iguana_info *coin,char *coinaddr,struct LP_address_utxo *up) +{ + cJSON *retjson; + if ( coin->electrum != 0 ) + { + if ( (retjson= electrum_address_gethistory(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + free_json(retjson); + } + return(0); +} + cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr) { cJSON *retjson; struct iguana_info *coin = LP_coinfind(symbol); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index cdbf09bec..0a0727038 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -204,8 +204,12 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) { flag = 1; - if ( up->U.height <= 0 && height > 0 && up->U.height != height ) + if ( height > 0 && up->U.height != height ) + { + if ( up->U.height > 0 ) + printf("update %s/v%d up->U.height %d <- %d\n",bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); up->U.height = height, flag |= 2; + } if ( spendheight > 0 && up->spendheight != spendheight ) up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) @@ -346,7 +350,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; struct electrum_info *ep,*backupep=0; + cJSON *array,*item; int32_t oldht,n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -371,11 +375,22 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } if ( up->spendheight <= 0 ) { - if ( backupep != 0 && up->SPV <= 0 ) + if ( backupep != 0 && (up->SPV == 0 || up->SPV == -1) ) + { up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - jaddi(array,LP_address_item(coin,up,electrumret)); - n++; - total += up->U.value; + oldht = up->U.height; + LP_txheight_check(coin,coinaddr,up); + if ( oldht != up->U.height ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV == -1 ) + up->SPV = -2; + } + if ( up->SPV > 0 ) + { + jaddi(array,LP_address_item(coin,up,electrumret)); + n++; + total += up->U.value; + } } //printf("new array %s\n",jprint(array,0)); } From 820e8429c9e724ed88ae5fd126e5d1094c15492a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 17:47:29 +0300 Subject: [PATCH 1051/2732] Test --- iguana/exchanges/LP_commands.c | 13 +++++-------- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d74b34501..1c4d76600 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -123,9 +123,9 @@ trust(pubkey, trust)*\n\ balance(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ -sendmessage(base=coin, rel="", pubkey=zero, )*\n\ -getmessages(firsti=0, num=100)*\n\ -deletemessages(firsti=0, num=100)*\n\ +sendmessage(base=coin, rel="", pubkey=zero, )\n\ +getmessages(firsti=0, num=100)\n\ +deletemessages(firsti=0, num=100)\n\ secretaddresses(prefix='secretaddress', passphrase, num=10, pubtype=60, taddr=0)\n\ electrum(coin, ipaddr, port)*\n\ snapshot(coin, height)\n\ @@ -155,21 +155,18 @@ dividends(coin, height, )\n\ { if ( jobj(argjson,"method2") == 0 ) { - //LP_signature_add(argjson,jstr(argjson,"message"),jbits256(argjson,"pubkey")); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); } return(clonestr("{\"result\":\"success\"}")); } else if ( strcmp(method,"getmessages") == 0 ) { - //* if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) return(jprint(retjson,1)); else return(clonestr("{\"error\":\"null messages\"}")); } else if ( strcmp(method,"deletemessages") == 0 ) { - //* LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); return(clonestr("{\"result\":\"success\"}")); } @@ -204,9 +201,9 @@ dividends(coin, height, )\n\ price = jdouble(argjson,"price"); if ( strcmp(method,"setprice") == 0 ) { - //* if ( price > SMALLVAL ) { + //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); if ( LP_mypriceset(&changed,base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); //else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) @@ -216,7 +213,7 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"autoprice") == 0 ) { - //* + //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin"),jstr(argjson,"type")) < 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 890d65174..87431732a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,7 @@ // marketmaker // // sign critical api calls -// SPV height errors, autodetect and fix +// -SPV height errors, autodetect and fix // stats // deal with offline pubkeys, reputations, etc. // dPoW security -> 2: KMD notarized, 3: BTC notarized diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 414e7cf51..ed9e8e8e2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -473,7 +473,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a LP_txheight_check(coin,coinaddr,up); if ( oldht != up->U.height ) up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV == -1 ) + if ( up->SPV < 0 ) up->SPV = -2; } continue; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0a0727038..e6085fc75 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -382,7 +382,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum LP_txheight_check(coin,coinaddr,up); if ( oldht != up->U.height ) up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV == -1 ) + if ( up->SPV < 0 ) up->SPV = -2; } if ( up->SPV > 0 ) From 0e70c76fedb35fca3bdad2e3a2a4d614de247036 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 17:57:39 +0300 Subject: [PATCH 1052/2732] Test --- iguana/exchanges/LP_utxo.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e6085fc75..65dc31791 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -350,7 +350,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item; int32_t oldht,n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; struct electrum_info *ep,*backupep=0; + cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; struct electrum_info *ep,*backupep=0; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { @@ -375,17 +375,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } if ( up->spendheight <= 0 ) { - if ( backupep != 0 && (up->SPV == 0 || up->SPV == -1) ) - { - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - oldht = up->U.height; - LP_txheight_check(coin,coinaddr,up); - if ( oldht != up->U.height ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV < 0 ) - up->SPV = -2; - } - if ( up->SPV > 0 ) + if ( up->SPV >= 0 ) { jaddi(array,LP_address_item(coin,up,electrumret)); n++; From d36241af909936e959df52dab721e29396f1de48 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 17:59:49 +0300 Subject: [PATCH 1053/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ed9e8e8e2..b151fec64 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -477,7 +477,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a up->SPV = -2; } continue; - } else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } //else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } if ( up->SPV > 0 && dist >= 0 && dist < mindist ) { From 02f03df62f252244c83f098d1e51f59b84bde624 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 18:01:20 +0300 Subject: [PATCH 1054/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 65dc31791..239170f56 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -207,7 +207,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, if ( height > 0 && up->U.height != height ) { if ( up->U.height > 0 ) - printf("update %s/v%d up->U.height %d <- %d\n",bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); + printf("SPV.%d update %s/v%d up->U.height %d <- %d\n",up->SPV,bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); up->U.height = height, flag |= 2; } if ( spendheight > 0 && up->spendheight != spendheight ) From 75e0bff25a1fd751ac166933c0b54810229674c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 18:12:18 +0300 Subject: [PATCH 1055/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 239170f56..b37b9f01e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -207,7 +207,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, if ( height > 0 && up->U.height != height ) { if ( up->U.height > 0 ) - printf("SPV.%d update %s/v%d up->U.height %d <- %d\n",up->SPV,bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); + printf("%s SPV.%d update %s/v%d up->U.height %d <- %d\n",coin->symbol,up->SPV,bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); up->U.height = height, flag |= 2; } if ( spendheight > 0 && up->spendheight != spendheight ) From 0fb43b5b7d56129a29ca5c4e29c31b172f32742b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 18:14:36 +0300 Subject: [PATCH 1056/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b37b9f01e..bede356f6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -253,7 +253,7 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 { jaddbits256(item,"txid",up->U.txid); jaddnum(item,"vout",up->U.vout); - jaddnum(item,"confirmations",LP_getheight(coin) - up->U.height); + jaddnum(item,"confirmations",LP_getheight(coin) - up->U.height + 1); jaddnum(item,"amount",dstr(up->U.value)); jaddstr(item,"scriptPubKey",""); } @@ -469,7 +469,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) errs++; } if ( coin->height != 0 ) - ht = LP_getheight(coin) - jint(txobj,"confirmations"); + ht = LP_getheight(coin) - jint(txobj,"confirmations") + 1; else ht = 0; /*if ( ht != 0 && ht < height-2 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b0da0da76..206e4e66a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -540,7 +540,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txid = jbits256(item,"txid"); vout = juint(item,"vout"); value = LP_value_extract(item,0); - height = LP_getheight(coin) - jint(item,"confirmations"); + height = LP_getheight(coin) - jint(item,"confirmations") + 1; } else { From e96fec7b71b2ce849a63221570cb6260540593af Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 18:32:19 +0300 Subject: [PATCH 1057/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b151fec64..aecd24f16 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1085,7 +1085,9 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( qprice/ordermatchprice < 1.+SMALLVAL ) { printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); - Q.satoshis *= 0.9999; + if ( strcmp("BTC",Q.destcoin) == 0 ) + Q.satoshis *= 0.999; + else Q.satoshis *= 0.9999; } else break; } if ( i == maxiters || qprice > maxprice ) From 16996bb7bf38e198953ebb0cfbbb931fb83a08b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 18:50:51 +0300 Subject: [PATCH 1058/2732] Test --- iguana/exchanges/LP_utxo.c | 7 ++++--- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bede356f6..2ce7c4c16 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -468,9 +468,10 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) char str[65]; printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",coin->symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(txobj,0)); errs++; } - if ( coin->height != 0 ) - ht = LP_getheight(coin) - jint(txobj,"confirmations") + 1; - else ht = 0; + ht = LP_txheight(coin,txid); + //if ( coin->height != 0 ) + // ht = LP_getheight(coin) - jint(txobj,"confirmations") + 1; + //else ht = 0; /*if ( ht != 0 && ht < height-2 ) { printf("REJECT %s %s/v%d ht.%d vs %d confs.%d (%s)\n",symbol,bits256_str(str,txid),v,ht,height,jint(txobj,"confirmations"),jprint(item,0)); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 206e4e66a..de147122b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -540,7 +540,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txid = jbits256(item,"txid"); vout = juint(item,"vout"); value = LP_value_extract(item,0); - height = LP_getheight(coin) - jint(item,"confirmations") + 1; + height = LP_txheight(coin,txid);//LP_getheight(coin) - jint(item,"confirmations") + 1; } else { From 7cba004841c174cd3529fc52f8e180e1ab73d266 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 19:09:25 +0300 Subject: [PATCH 1059/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index aecd24f16..a35f504fc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1086,7 +1086,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel { printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); if ( strcmp("BTC",Q.destcoin) == 0 ) - Q.satoshis *= 0.999; + Q.satoshis *= 0.995; else Q.satoshis *= 0.9999; } else break; } From d2f998692ee86d62466def2028ad32fa6d34d078 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 19:11:34 +0300 Subject: [PATCH 1060/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a35f504fc..be9815aa6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1086,7 +1086,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel { printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); if ( strcmp("BTC",Q.destcoin) == 0 ) - Q.satoshis *= 0.995; + Q.satoshis *= 0.99; else Q.satoshis *= 0.9999; } else break; } From c2385dfcbc7e9a13f1bf0135920c2f00e88569c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 19:15:00 +0300 Subject: [PATCH 1061/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index be9815aa6..9e583a33e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1086,7 +1086,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel { printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); if ( strcmp("BTC",Q.destcoin) == 0 ) - Q.satoshis *= 0.99; + Q.satoshis *= 0.98; else Q.satoshis *= 0.9999; } else break; } From 6ebb90669cff6f95d0f5106932e800ad2a3946cb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Oct 2017 19:18:03 +0300 Subject: [PATCH 1062/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9e583a33e..d32e089e0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1073,7 +1073,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); - maxiters = 100; + maxiters = 200; qprice = 1. / SMALLVAL; for (i=0; i Date: Mon, 16 Oct 2017 19:28:07 +0300 Subject: [PATCH 1063/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d32e089e0..b0f06dcb3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -348,10 +348,9 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-14); if ( butxo != 0 ) { - //qprice 2259.01692494 <- 10.34279604/0.00457845 txfees.(0.00042631 0.00010000) vs (0.00042791 0.00010000) if ( qp->satoshis < (srcvalue / LP_MINVOL) || srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT ) { - printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee)); + printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f [%d %d]\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee),qp->satoshis < (srcvalue / LP_MINVOL),srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT); return(-12); } } @@ -1086,7 +1085,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel { printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); if ( strcmp("BTC",Q.destcoin) == 0 || strcmp("BTC",Q.srccoin) == 0 ) - Q.satoshis *= 0.99; + Q.satoshis *= 0.999; else Q.satoshis *= 0.9999; } else break; } From 73325c713f66bed28d350e2a6173a89dd3d9fe57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 13:45:36 +0300 Subject: [PATCH 1064/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_remember.c | 5 ++++- iguana/exchanges/LP_utxo.c | 12 +++++++++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 87431732a..0cba5ea50 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,13 +18,14 @@ // LP_nativeDEX.c // marketmaker // -// sign critical api calls -// -SPV height errors, autodetect and fix -// stats +// autoprice based on formula +// sign critical api calls (pubkey reg, listunspent, orders?) +// stats using KV opreturn // deal with offline pubkeys, reputations, etc. // dPoW security -> 2: KMD notarized, 3: BTC notarized // add interest to KMD withdraw // verify portfolio, pricearray, withdraw +// dICO allocation // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b0f06dcb3..32bc86b1b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -820,6 +820,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + LP_tradecommand_log(argjson); printf("LP_tradecommand: check received method %s\n",method); retval = 1; if ( strcmp(method,"reserved") == 0 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 01f7bb20a..119b35f94 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1201,5 +1201,8 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) return(retstr); } - +void LP_tradecommand_log(cJSON *argjson) +{ + +} diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2ce7c4c16..df8f11d27 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -204,7 +204,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) { flag = 1; - if ( height > 0 && up->U.height != height ) + if ( height > 0 && up->U.height != height && up->SPV <= 0 ) { if ( up->U.height > 0 ) printf("%s SPV.%d update %s/v%d up->U.height %d <- %d\n",coin->symbol,up->SPV,bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); @@ -818,7 +818,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { //struct LP_utxoinfo *utxo; - struct LP_address_utxo *up; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); + struct LP_address_utxo *up; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64],str[65]; struct iguana_info *coin = LP_coinfind(symbol); if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) { printf("null txid not eligible\n"); @@ -831,9 +831,15 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) + { + printf("%s/v%d spent %d\n",bits256_str(str,txid),vout,up->spendheight); return(-2); + } if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) + { + printf("%s/v%d spent %d\n",bits256_str(str,txid2),vout2,up->spendheight); return(-3); + } txfee = LP_txfeecalc(LP_coinfind(symbol),0,0); if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { @@ -855,7 +861,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - char str[65],str2[65]; + char str2[65]; if ( val != 0 && val2 != 0 ) printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); if ( val == 0 ) From cafd5fac40e26d4383376d76cb68da32894ab246 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 14:31:41 +0300 Subject: [PATCH 1065/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 1c4d76600..b13d720b7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -265,6 +265,8 @@ dividends(coin, height, )\n\ //* if ( (ptr= LP_coinsearch(coin)) != 0 ) { + if ( ptr->userpass[0] == 0 ) + return(clonestr("{\"error\":\"no rpc credentials to enable\"}")); if ( LP_conflicts_find(ptr) == 0 ) ptr->inactive = 0; else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); From 68ba6242a1b0c0f83c05f02dabb10ec555dd9629 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 14:36:06 +0300 Subject: [PATCH 1066/2732] Test --- iguana/exchanges/LP_commands.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b13d720b7..af9387558 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -268,17 +268,24 @@ dividends(coin, height, )\n\ if ( ptr->userpass[0] == 0 ) return(clonestr("{\"error\":\"no rpc credentials to enable\"}")); if ( LP_conflicts_find(ptr) == 0 ) + { ptr->inactive = 0; - else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); - } - return(jprint(LP_coinsjson(0),1)); + cJSON *array = cJSON_CreateArray(); + jaddi(array,LP_coinjson(ptr,0)); + return(jprint(array,1)); + } else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); + } else return(clonestr("{\"error\":\"couldnt find coin\"}")); } else if ( strcmp(method,"disable") == 0 ) { //* if ( (ptr= LP_coinsearch(coin)) != 0 ) + { ptr->inactive = (uint32_t)time(NULL); - return(jprint(LP_coinsjson(0),1)); + cJSON *array = cJSON_CreateArray(); + jaddi(array,LP_coinjson(ptr,0)); + return(jprint(array,1)); + } else return(clonestr("{\"error\":\"couldnt find coin\"}")); } else if ( strcmp(method,"electrum") == 0 ) { From ca8852a7677492053dfe6e144bd87ae17eb97d4d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:07:32 +0300 Subject: [PATCH 1067/2732] Test --- iguana/exchanges/LP_ordermatch.c | 15 +++++++++++---- iguana/exchanges/LP_utxo.c | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 32bc86b1b..df830ca12 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -776,7 +776,7 @@ char *LP_bestfit(char *rel,double relvolume) } struct LP_quoteinfo LP_Alicequery; -double LP_Alicemaxprice; +double LP_Alicemaxprice; int32_t Alice_timeout; char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; @@ -787,7 +787,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } price = 0.; LP_query(ctx,myipaddr,mypubsock,"request",qp); - LP_Alicequery = *qp, LP_Alicemaxprice = maxprice; + LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_timeout = timeout; return(clonestr("{\"result\":\"success\"}")); } @@ -801,7 +801,14 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) { double price,maxprice = LP_Alicemaxprice; - if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) + if ( time(NULL) > qp->timestamp+Alice_timeout ) + { + printf("time expired for Alice_request\n"); + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + LP_Alicemaxprice = 0.; + Alice_timeout = 0; + } + else if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) @@ -1058,7 +1065,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) - return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis; while ( 1 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index df8f11d27..ba5fdad3b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -157,7 +157,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout); + char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) @@ -832,12 +832,12 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol else val = LP_txvalue(destaddr,symbol,txid,vout); if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) { - printf("%s/v%d spent %d\n",bits256_str(str,txid),vout,up->spendheight); + //printf("%s/v%d spent %d\n",bits256_str(str,txid),vout,up->spendheight); return(-2); } if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) { - printf("%s/v%d spent %d\n",bits256_str(str,txid2),vout2,up->spendheight); + //printf("%s/v%d spent %d\n",bits256_str(str,txid2),vout2,up->spendheight); return(-3); } txfee = LP_txfeecalc(LP_coinfind(symbol),0,0); From ffa5b37a26f6b8eff32d8ae329c34249a1154fc5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:07:50 +0300 Subject: [PATCH 1068/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ba5fdad3b..1886e6ada 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -238,7 +238,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 0 && height > 0 ) + if ( 1 && height > 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From 2957c83e3f7df09a2047fec5a31f4d083051ae1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:37:35 +0300 Subject: [PATCH 1069/2732] Test --- iguana/exchanges/LP_commands.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index af9387558..04289473d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -472,10 +472,6 @@ dividends(coin, height, )\n\ return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); else return(clonestr("{\"error\":\"cant find coind\"}")); } - else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) - return(clonestr("{\"result\":\"at least one of coins disabled\"}")); - else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) - retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"checktxid") == 0 ) retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) @@ -498,6 +494,10 @@ dividends(coin, height, )\n\ } retstr = clonestr("{\"result\":\"success\"}"); } + //else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) + // return(clonestr("{\"result\":\"at least one of coins disabled\"}")); + //else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) + // retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"getcoins") == 0 ) return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"encrypted") == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1886e6ada..f9ff13b2b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -154,6 +154,7 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) { struct LP_address_utxo *up,*tmp; int32_t n = 0; + printf("LP_address_utxo_ptrs for (%s)\n",ap->coinaddr); portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { From 25ea4fe4906b6d2c6e2f0a15812f9cd48cd67d43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:40:05 +0300 Subject: [PATCH 1070/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f9ff13b2b..b74c79fa6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -239,7 +239,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 1 && height > 0 ) + if ( 1 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From 83fc3846dcea613534ebb8dc1776fd7dc56799e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:42:24 +0300 Subject: [PATCH 1071/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/LP_utxo.c | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index df830ca12..120ee3899 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -504,7 +504,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { - if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap)) > 1 ) + if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); if ( 0 ) @@ -539,7 +539,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** } else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); - } else printf("no utxos pass LP_address_utxo_ptrs filter\n"); + } else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); return(0); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 9e94a1b88..48c03efa1 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -878,7 +878,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } memset(utxos,0,sizeof(utxos)); - if ( (numutxos= LP_address_utxo_ptrs(0,utxos,max,ap)) <= 0 ) + if ( (numutxos= LP_address_utxo_ptrs(0,utxos,max,ap,coin->smartaddr)) <= 0 ) { printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); return(0); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b74c79fa6..c9d10c4ad 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -151,10 +151,12 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) return(0); } -int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) +int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) { struct LP_address_utxo *up,*tmp; int32_t n = 0; - printf("LP_address_utxo_ptrs for (%s)\n",ap->coinaddr); + printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); + if ( strcmp(ap->coinaddr,coinaddr) != 0 ) + printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { From 14e77c725dffdb7b7a7d75a5f20ae0860c4bb622 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:49:30 +0300 Subject: [PATCH 1072/2732] Test --- iguana/exchanges/LP_commands.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 04289473d..d8dea68ee 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -265,8 +265,6 @@ dividends(coin, height, )\n\ //* if ( (ptr= LP_coinsearch(coin)) != 0 ) { - if ( ptr->userpass[0] == 0 ) - return(clonestr("{\"error\":\"no rpc credentials to enable\"}")); if ( LP_conflicts_find(ptr) == 0 ) { ptr->inactive = 0; From 6f0461ae8a3da3df2143d79213c15d8925b16145 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 15:58:07 +0300 Subject: [PATCH 1073/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_rpc.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0cba5ea50..7b8c5a05f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -708,7 +708,7 @@ int32_t LP_reserved_msgs() while ( num_Reserved_msgs > 0 ) { num_Reserved_msgs--; - //printf("BROADCASTING RESERVED.(%s)\n",Reserved_msgs[num_Reserved_msgs]); + printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; n++; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 083159723..26f23986f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -476,10 +476,11 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) if ( strcmp(coin->smartaddr,coinaddr) == 0 ) { retjson = LP_listunspent(symbol,coinaddr); - //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); + printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } else if ( IAMLP == 0 ) { + printf("LP_listunspent_query.(%s %s)\n",symbol,coinaddr); LP_listunspent_query(coin->symbol,coin->smartaddr); if ( fullflag != 0 ) { From 9c49451d878e4bf6b554a2210166b39685241010 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:03:18 +0300 Subject: [PATCH 1074/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 37 +++++++++++++++------------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d8dea68ee..9c3419f72 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -484,7 +484,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { - //printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7b8c5a05f..30500c2d0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -349,27 +349,24 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); - if ( 0 ) + if ( IAMLP == 0 ) { - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) - free(retstr); - } - } - else - { - req = cJSON_CreateObject(); - jaddstr(req,"method","uitem"); - jaddstr(req,"coin",coin->symbol); - jaddstr(req,"coinaddr",coin->smartaddr); - jaddbits256(req,"txid",txid); - jaddnum(req,"vout",vout); - jaddnum(req,"ht",height); - jadd64bits(req,"value",value); - //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_reserved_msg("","",zero,jprint(req,1)); + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) + free(retstr); + } } + req = cJSON_CreateObject(); + jaddstr(req,"method","uitem"); + jaddstr(req,"coin",coin->symbol); + jaddstr(req,"coinaddr",coin->smartaddr); + jaddbits256(req,"txid",txid); + jaddnum(req,"vout",vout); + jaddnum(req,"ht",height); + jadd64bits(req,"value",value); + printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_reserved_msg("","",zero,jprint(req,1)); } } free_json(array); @@ -564,7 +561,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->addr_listunspent_requested != 0 ) { - //printf("addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } From 50020d581e633f5be9f6d6c25eec72b4145cf923 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:09:29 +0300 Subject: [PATCH 1075/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++++- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 30500c2d0..2874b4679 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -699,11 +699,16 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t LP_reserved_msgs() { - bits256 zero; int32_t n = 0; + bits256 zero; struct nn_pollfd pfd; int32_t n = 0; memset(zero.bytes,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); while ( num_Reserved_msgs > 0 ) { + memset(&pfd,0,sizeof(pfd)); + pfd.fd = LP_mypubsock; + pfd.events = NN_POLLOUT; + if ( nn_poll(&pfd,1,1) != 1 ) + break; num_Reserved_msgs--; printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 26f23986f..c6cc3e298 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -476,7 +476,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) if ( strcmp(coin->smartaddr,coinaddr) == 0 ) { retjson = LP_listunspent(symbol,coinaddr); - printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); + //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } else if ( IAMLP == 0 ) { From 75239f966792c7a1cd4bc3d166926d267c952b09 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:18:35 +0300 Subject: [PATCH 1076/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2874b4679..0be040be1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -699,21 +699,24 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t LP_reserved_msgs() { - bits256 zero; struct nn_pollfd pfd; int32_t n = 0; + bits256 zero; int32_t n = 0; //struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); - while ( num_Reserved_msgs > 0 ) + if ( num_Reserved_msgs > 0 ) { - memset(&pfd,0,sizeof(pfd)); + /*memset(&pfd,0,sizeof(pfd)); pfd.fd = LP_mypubsock; pfd.events = NN_POLLOUT; if ( nn_poll(&pfd,1,1) != 1 ) - break; + break;*/ num_Reserved_msgs--; printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; n++; +#ifdef __APPLE__ + usleep(5000); +#endif } portable_mutex_unlock(&LP_reservedmutex); return(n); From 4bc2805917f09fac3e6a4077863346a0d615bde5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:27:22 +0300 Subject: [PATCH 1077/2732] Test --- iguana/exchanges/LP_network.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 080400f5d..b85f044f4 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -158,7 +158,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - //else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); +else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -206,16 +206,16 @@ void queue_loop(void *ignore) void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) { - int32_t sentbytes,peerind = 0; + int32_t peerind = 0; //sentbytes, if ( sock0 >= 0 || sock1 >= 0 ) { - if ( sock0 >= 0 && LP_sockcheck(sock0) > 0 ) +/* if ( sock0 >= 0 && LP_sockcheck(sock0) > 0 ) { if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - //printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); +printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); sock0 = -1; } } @@ -223,10 +223,14 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 { if ( (sentbytes= nn_send(sock1,msg,msglen,0)) != msglen ) printf("_LP_queuesend1 sent %d instead of %d\n",sentbytes,msglen); - else sock1 = -1; + else + { +printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); + sock1 = -1; + } } if ( sock0 < 0 && sock1 < 0 ) - return; + return;*/ } else { From e64a537d8d590407f36ceb4602f991b9cc8bfbfc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:32:54 +0300 Subject: [PATCH 1078/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_network.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9c3419f72..08f5c888e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -474,7 +474,7 @@ dividends(coin, height, )\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { - //printf("GOT ADDR_UNSPENTS\n"); + printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { char *coinaddr; //cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; @@ -550,7 +550,7 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); - //printf("broadcast.(%s)\n",msg); +printf("broadcast.(%s)\n",Broadcaststr); LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0be040be1..28381fcb9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -710,7 +710,9 @@ int32_t LP_reserved_msgs() if ( nn_poll(&pfd,1,1) != 1 ) break;*/ num_Reserved_msgs--; +#ifdef __APPLE__ printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); +#endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; n++; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index b85f044f4..1806052b4 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -158,7 +158,9 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); +#ifdef __APPLE__ else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); +#endif ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); From 4be753cae6ee28d4f6906d9434eabfbbc9e08039 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:33:41 +0300 Subject: [PATCH 1079/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 08f5c888e..b2e3aca50 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -551,7 +551,7 @@ dividends(coin, height, )\n\ { memset(zero.bytes,0,sizeof(zero)); printf("broadcast.(%s)\n",Broadcaststr); - LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + //LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); From e30cb837003987f790a701e29aeaf9370ecc9914 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:34:58 +0300 Subject: [PATCH 1080/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b2e3aca50..08f5c888e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -551,7 +551,7 @@ dividends(coin, height, )\n\ { memset(zero.bytes,0,sizeof(zero)); printf("broadcast.(%s)\n",Broadcaststr); - //LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); From b40718b3f2a0256488163c9ac8a9e314908adce5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:42:07 +0300 Subject: [PATCH 1081/2732] Test --- iguana/exchanges/LP_network.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1806052b4..34ed24c0f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -208,7 +208,7 @@ else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->m void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) { - int32_t peerind = 0; //sentbytes, + int32_t maxind,peerind = 0; //sentbytes, if ( sock0 >= 0 || sock1 >= 0 ) { /* if ( sock0 >= 0 && LP_sockcheck(sock0) > 0 ) @@ -236,7 +236,9 @@ printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); } else { - peerind = 1; + if ( (maxind= LP_numpeers()) > 0 ) + peerind = (rand() % maxind); + else peerind = 0; sock0 = LP_peerindsock(&peerind); } if ( sock0 >= 0 ) From 93f815c15cb14df11f1f34ceeaab7df110eb3041 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:43:02 +0300 Subject: [PATCH 1082/2732] Test --- iguana/exchanges/LP_include.h | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a292f1be1..c18048077 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -316,6 +316,7 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); +int32_t LP_numpeers(); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); void LP_smartutxos_push(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); From 1e78dc5b062287ff1a1c20f86469cc76e0216da6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:50:29 +0300 Subject: [PATCH 1083/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 28381fcb9..31e006822 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -244,7 +244,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { -//printf("RECV.(%s)\n",(char *)ptr); +printf("%s RECV.(%s)\n",typestr,(char *)ptr); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -349,7 +349,7 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); - if ( IAMLP == 0 ) + if ( 0 && IAMLP == 0 ) { HASH_ITER(hh,LP_peerinfos,peer,tmp) { @@ -711,7 +711,7 @@ int32_t LP_reserved_msgs() break;*/ num_Reserved_msgs--; #ifdef __APPLE__ - printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); +// printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; From edb5b4648bef9c06e9be500022d4e0827053358f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:55:02 +0300 Subject: [PATCH 1084/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 31e006822..01f7fe5ce 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -244,7 +244,18 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { -printf("%s RECV.(%s)\n",typestr,(char *)ptr); + { + cJSON *recvjson; char *mstr,*cstr; + if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) + { + if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && + (mstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) + { + printf("%s RECV.(%s)\n",typestr,(char *)ptr); + } + free_json(recvjson); + } + } nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); From 0c27e303c9b560ed7b012c946143add821159e20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:58:55 +0300 Subject: [PATCH 1085/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 01f7fe5ce..a0cdf8e84 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -249,7 +249,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && - (mstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) + (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { printf("%s RECV.(%s)\n",typestr,(char *)ptr); } From 9907d83c5d5d5754ee6ae9af18a54288eb894a3e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:01:18 +0300 Subject: [PATCH 1086/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 34ed24c0f..a85336b6b 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[8192]; static unsigned long dup,total; + static uint32_t crcs[8]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) From febb54665275ad6eba7210a6bd8faa3e8f7c2335 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:05:18 +0300 Subject: [PATCH 1087/2732] Test --- iguana/exchanges/LP_network.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a85336b6b..83feb7d32 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -280,6 +280,9 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON free(msg); jdelete(argjson,"method"); jaddstr(argjson,"method","broadcast"); + if ( jobj(argjson,"timestamp") == 0 ) + jaddnum(argjson,"timestamp",(uint32_t)time(NULL)); + // add signature here msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; LP_queuesend(crc32,-1,base,rel,msg,msglen); From 936dde1436627498a3358bc683fc72cacc1ed81b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:07:47 +0300 Subject: [PATCH 1088/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 08f5c888e..742bc954e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -433,7 +433,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); From c4d021584c9ee4dfef317a855624d8b2f399726d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:14:43 +0300 Subject: [PATCH 1089/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_utxo.c | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a0cdf8e84..2a4dfd88c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -244,6 +244,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { + if ( 0 ) { cJSON *recvjson; char *mstr,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 83feb7d32..d5ef33335 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[8]; static unsigned long dup,total; + static uint32_t crcs[8192]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c9d10c4ad..5b3d39678 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -193,7 +193,7 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; - //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); +printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about @@ -217,7 +217,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; - //printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); +printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } @@ -227,7 +227,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - //printf("prevent utxoadd since gettxout %s/v%d missing\n",bits256_str(str,txid),vout); + printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); return(0); } else free_json(txobj); } From 55ce2b639456547db01ab046e2a6d75d55583b28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:19:35 +0300 Subject: [PATCH 1090/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 742bc954e..024b22b71 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -265,6 +265,8 @@ dividends(coin, height, )\n\ //* if ( (ptr= LP_coinsearch(coin)) != 0 ) { + if ( ptr->userpass[0] == 0 ) + return(clonestr("{\"error\":\"couldnt find coin locally installed\"}")); if ( LP_conflicts_find(ptr) == 0 ) { ptr->inactive = 0; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d5ef33335..f997427d2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -177,7 +177,7 @@ else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->m printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } - else + else if ( 0 ) // too much beyond duplicate filter when network is busy { printf("couldnt find.%u peerind.%d Q.%d err.%d match.%d\n",ptr->crc32,ptr->peerind,LP_Qenqueued,LP_Qerrors,LP_Qfound); ptr->peerind++; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 5b3d39678..e83007e48 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -193,12 +193,12 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; -printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about ap = LP_addressfind(coin,coinaddr); else ap = LP_address(coin,coinaddr); + printf("%s add addr.%s ht.%d ap.%p\n",coin->symbol,coinaddr,height,ap); if ( ap != 0 ) { flag = 0; From d6123ab68a2d1f1cdb4a59f0151942ee2cf77702 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:23:22 +0300 Subject: [PATCH 1091/2732] Test --- iguana/exchanges/LP_commands.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 024b22b71..93bb74152 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -435,7 +435,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); @@ -476,7 +476,7 @@ dividends(coin, height, )\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { - printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); + //printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { char *coinaddr; //cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; @@ -486,7 +486,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { - printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); + //printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } @@ -552,7 +552,7 @@ dividends(coin, height, )\n\ else { memset(zero.bytes,0,sizeof(zero)); -printf("broadcast.(%s)\n",Broadcaststr); +//printf("broadcast.(%s)\n",Broadcaststr); LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e83007e48..a846975c6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -198,7 +198,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about ap = LP_addressfind(coin,coinaddr); else ap = LP_address(coin,coinaddr); - printf("%s add addr.%s ht.%d ap.%p\n",coin->symbol,coinaddr,height,ap); + //printf("%s add addr.%s ht.%d ap.%p\n",coin->symbol,coinaddr,height,ap); if ( ap != 0 ) { flag = 0; @@ -217,7 +217,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; -printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); +//printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } From ce49af85d639a2d6a4f6577f480e0fe8d3db2c41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:25:16 +0300 Subject: [PATCH 1092/2732] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f997427d2..0036a4e86 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -159,7 +159,7 @@ void queue_loop(void *ignore) if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); #ifdef __APPLE__ -else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); +//else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); #endif ptr->sock = -1; if ( ptr->peerind > 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a846975c6..1a88b000c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -154,13 +154,13 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) { struct LP_address_utxo *up,*tmp; int32_t n = 0; - printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); + //printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight); + //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) From e7e3d5df43a2793586f5070be98a9a6cdbe172b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:26:53 +0300 Subject: [PATCH 1093/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/assetchains.old | 89 ++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/assetchains.old diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2a4dfd88c..670f77bdb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -573,7 +573,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->addr_listunspent_requested != 0 ) { - printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } diff --git a/iguana/exchanges/assetchains.old b/iguana/exchanges/assetchains.old new file mode 100755 index 000000000..e7584afcd --- /dev/null +++ b/iguana/exchanges/assetchains.old @@ -0,0 +1,89 @@ +#!/bin/bash +set -x +delay=60 +source pubkey.txt +echo $pubkey + +./komodod -pubkey=$pubkey -ac_name=REVS -ac_supply=1300000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=PANGEA -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=JUMBLR -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=BET -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=SHARK -ac_supply=1401 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 & +#./komodod -pubkey=$pubkey -ac_name=MVP -ac_supply=1000000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=COQUI -ac_supply=72000000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=WLC -ac_supply=210000000 -addnode=148.251.190.89 $1 & +./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000007 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=MNZ -ac_supply=257142858 -addnode=51.15.138.138 $1 & +sleep $delay + +./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=GBP -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=AUD -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=CAD -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=CHF -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=NZD -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=CNY -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=RUB -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=MXN -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=BRL -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=INR -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=HKD -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=TRY -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=ZAR -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=PLN -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=NOK -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=SEK -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=DKK -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=CZK -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=HUF -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=ILS -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=KRW -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=MYR -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=PHP -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=RON -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=SGD -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=THB -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 & +sleep $delay +./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 & From 350c25538d8d7c31a6cce680de4d1e2ca897bf89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:27:54 +0300 Subject: [PATCH 1094/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1a88b000c..b144a95c4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -242,7 +242,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, portable_mutex_unlock(&coin->addrmutex); retval = 1; if ( 1 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) - printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); From bfb02173da98d96063021758644635f180291e9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:38:26 +0300 Subject: [PATCH 1095/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++++ iguana/exchanges/LP_utxo.c | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f91916e73..b49cbcd17 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -167,7 +167,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) ap->pubkey = pubp->pubkey; memcpy(ap->pubsecp,pubp->pubsecp,sizeof(ap->pubsecp)); } - //printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); + printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); return(ap); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index afca7e887..2c3eb1e6e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -350,7 +350,10 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep } } if ( value != 0 || tx->height > 0 ) + { + printf("from electrum_process_array\n"); flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); + } //printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } //else printf("cant find tx\n"); } @@ -481,6 +484,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * if ( tx->height > 0 && tx->height != height ) printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; + printf("from history\n"); LP_address_utxoadd(coin,addr,txid,0,0,height,-1); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b144a95c4..4eb2a4f65 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -178,7 +178,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; - //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + printf("LP_address_utxofind %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -227,7 +227,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); + //printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); return(0); } else free_json(txobj); } @@ -484,6 +484,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) } if ( errs == 0 ) { + printf("from LP_unspents_array\n"); LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); count++; } @@ -631,6 +632,8 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; + if ( coin->inactive != 0 ) + return(0); if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { if ( coin->electrum == 0 ) From 38ed48ded8e5de429c6e10a4e9dafd9ea27aff74 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:40:59 +0300 Subject: [PATCH 1096/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxo.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 670f77bdb..7f6055f7a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -377,7 +377,7 @@ void LP_smartutxos_push(struct iguana_info *coin) jaddnum(req,"vout",vout); jaddnum(req,"ht",height); jadd64bits(req,"value",value); - printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); LP_reserved_msg("","",zero,jprint(req,1)); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4eb2a4f65..9c624010c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -178,7 +178,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; - printf("LP_address_utxofind %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + printf("LP_address_utxofind %s add addr.%s\n",coin->symbol,coinaddr); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -651,6 +651,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); + printf("from transaction init\n"); LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); From 2e6fba307f94e6b25a6ea44691bbff38c71dad4f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:50:19 +0300 Subject: [PATCH 1097/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 93bb74152..519546882 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -451,6 +451,7 @@ dividends(coin, height, )\n\ { if ( coinaddr[0] != 0 ) { + LP_address(ptr,coinaddr); LP_listunspent_issue(coin,coinaddr,1); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { @@ -484,6 +485,7 @@ dividends(coin, height, )\n\ { if ( coinaddr[0] != 0 ) { + LP_address(ptr,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { //printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2c3eb1e6e..cb697972a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -351,7 +351,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep } if ( value != 0 || tx->height > 0 ) { - printf("from electrum_process_array\n"); + //printf("from electrum_process_array\n"); flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); } //printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); @@ -484,7 +484,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * if ( tx->height > 0 && tx->height != height ) printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; - printf("from history\n"); + //printf("from history\n"); LP_address_utxoadd(coin,addr,txid,0,0,height,-1); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9c624010c..fe2ccfcad 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -241,7 +241,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 1 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) + if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); @@ -484,7 +484,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) } if ( errs == 0 ) { - printf("from LP_unspents_array\n"); + //printf("from LP_unspents_array\n"); LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); count++; } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index de147122b..b467bf294 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -520,6 +520,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); + LP_address(coin,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0,0); From 5f9a8c3f20eb0b99d2096b719a54d48ad88dfb05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:51:00 +0300 Subject: [PATCH 1098/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fe2ccfcad..62fae25ae 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -651,8 +651,8 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); - printf("from transaction init\n"); - LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); + //printf("from transaction init\n"); + //LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b467bf294..5e258fbd0 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -520,7 +520,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); - LP_address(coin,coin->smartaddr); + LP_address(coin,coin->smart`addr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0,0); From 99d27240095d2d79bc6996b0ad820e2817b6a25d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:51:56 +0300 Subject: [PATCH 1099/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5e258fbd0..b467bf294 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -520,7 +520,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); - LP_address(coin,coin->smart`addr); + LP_address(coin,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { txfee = LP_txfeecalc(coin,0,0); From f261c7176d5bf79ae888b9cd868362e55f7c18c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:53:15 +0300 Subject: [PATCH 1100/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 62fae25ae..9244889b8 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -178,7 +178,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; - printf("LP_address_utxofind %s add addr.%s\n",coin->symbol,coinaddr); + //printf("LP_address_utxofind %s add addr.%s\n",coin->symbol,coinaddr); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) From 814e1a3cc93363c59117d165a64f1977960a58d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 18:17:11 +0300 Subject: [PATCH 1101/2732] New auto price --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/autoprice | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7f6055f7a..5c159e440 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -361,7 +361,7 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); - if ( 0 && IAMLP == 0 ) + if ( (rand() % 100) == 0 && IAMLP == 0 ) { HASH_ITER(hh,LP_peerinfos,peer,tmp) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cb697972a..53d800a1d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -547,9 +547,9 @@ cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp, cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) { uint8_t *extraspace; cJSON *txobj; char str[65],str2[65]; struct iguana_msgtx msgtx; bits256 checktxid; - extraspace = calloc(1,1000000); + extraspace = calloc(1,4000000); memset(&msgtx,0,sizeof(msgtx)); - txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,1000000,serialized,len,0,0); + txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,4000000,serialized,len,0,0); //printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); free(extraspace); if ( bits256_cmp(txid,checktxid) != 0 ) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index a95a3f5e3..5cb422e84 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -8,3 +8,4 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" From 8623e767c9f9f9d078c809a660cd9f48c2ec8d7d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:23:38 +0300 Subject: [PATCH 1102/2732] New autoprice --- iguana/exchanges/LP_commands.c | 4 +- iguana/exchanges/LP_portfolio.c | 75 +++++++++++++++++++++++++++------ iguana/exchanges/LP_prices.c | 3 ++ 3 files changed, 68 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 519546882..31679e2eb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -97,7 +97,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r available localhost RPC commands: * means it needs to be a signed request\n \ pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ setprice(base, rel, price)*\n\ -autoprice(base, rel, price, margin, type)*\n\ +autoprice(base, rel, minprice, margin, refbase, refrel, factor, offset)*\n\ goal(coin=*, val=)*\n\ myprice(base, rel)\n\ enable(coin)*\n\ @@ -214,7 +214,7 @@ dividends(coin, height, )\n\ else if ( strcmp(method,"autoprice") == 0 ) { //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); - if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin"),jstr(argjson,"type")) < 0 ) + if ( LP_autoprice(base,rel,argjson) < 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 75e8fd330..e6cbf31db 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -198,7 +198,12 @@ char *LP_portfolio_goal(char *symbol,double goal) } else return(clonestr("{\"error\":\"cant set goal for inactive coin\"}")); } -int32_t LP_autoprices; +int32_t LP_autoprices,num_LP_autorefs; + +struct LP_autoprice_ref +{ + char refbase[16],refrel[16],base[16],rel[16]; +} LP_autorefs[100]; /*int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) { @@ -213,26 +218,65 @@ int32_t LP_autoprices; return(-1); }*/ -int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *type) +int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { - struct LP_priceinfo *basepp,*relpp; + //curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" + struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor; if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { + if ( jobj(argjson,"minprice") != 0 ) + minprice = jdouble(argjson,"minprice"); + else minprice = 0.; + margin = jdouble(argjson,"margin"); + offset = jdouble(argjson,"offset"); + factor = jdouble(argjson,"factor"); basepp->minprices[relpp->ind] = minprice; basepp->margins[relpp->ind] = margin; + basepp->offsets[relpp->ind] = offset; + basepp->factors[relpp->ind] = factor; + if ( (refbase= jstr(argjson,"refbase")) != 0 && (refrel= jstr(argjson,"refrel")) != 0 ) + { + for (i=0; imargins[relpp->ind]; oppomargin = relpp->margins[basepp->ind]; if ( margin != 0. || oppomargin != 0. ) { + if ( fabs(price) < SMALLVAL && refbase != 0 && refrel != 0 ) + { + price = LP_myprice(&bid,&ask,refbase,refrel); + printf("USE ref %s/%s %.8f\n",refbase,refrel,price); + } + offset = basepp->offsets[relpp->ind]; + if ( (factor= basepp->factors[relpp->ind]) > SMALLVAL ) + price = (price * factor) + offset; if ( margin == 0. ) margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); @@ -325,8 +369,8 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; } - LP_autopriceset(ctx,1,refpp,coinpp,price); - LP_autopriceset(ctx,-1,coinpp,refpp,price); + LP_autopriceset(ctx,1,refpp,coinpp,price,0,0); + LP_autopriceset(ctx,-1,coinpp,refpp,price,0,0); } } } @@ -358,7 +402,7 @@ static char *assetids[][3] = void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { - char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *kmdpp,*fiatpp,*nxtpp; + char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *kmdpp,*fiatpp,*nxtpp,*basepp,*relpp; if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) { printf("trex error getting marketsummaries\n"); @@ -385,8 +429,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,kmdpp,fiatpp,price); - LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); + LP_autopriceset(ctx,1,kmdpp,fiatpp,price,0,0); + LP_autopriceset(ctx,-1,fiatpp,kmdpp,price,0,0); free_json(retjson); } } @@ -409,14 +453,21 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) if ( bidsatoshis != 0 && asksatoshis != 0 ) price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } - LP_autopriceset(ctx,1,kmdpp,nxtpp,price); - LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); + LP_autopriceset(ctx,1,kmdpp,nxtpp,price,0,0); + LP_autopriceset(ctx,-1,nxtpp,kmdpp,price,0,0); //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } } } } + for (i=0; i 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { + if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) *changedp = 1; basepp->myprices[relpp->ind] = price; // ask From 722815c4ad605cfd32c3a5cc9b6d26889b04de54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:26:10 +0300 Subject: [PATCH 1103/2732] Test --- iguana/exchanges/enable | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/enable b/iguana/exchanges/enable index 75c0bc838..90b006dfe 100755 --- a/iguana/exchanges/enable +++ b/iguana/exchanges/enable @@ -2,3 +2,4 @@ source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"REVS\"}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"CHIPS\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"MNZ\"}" From b58933919d4ac282ac4313452513474f17fc74b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:30:35 +0300 Subject: [PATCH 1104/2732] Test --- iguana/exchanges/autoprice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 5cb422e84..ab4e2e6b7 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -8,4 +8,4 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" From 6e89d6c560bf19bb8d130f776c01e610a8a9182a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:32:06 +0300 Subject: [PATCH 1105/2732] Test --- iguana/exchanges/LP_portfolio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index e6cbf31db..07f177806 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -222,6 +222,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { //curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor; + printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { if ( jobj(argjson,"minprice") != 0 ) From 2ab48b722d22af7dea2f2169f2f4676b32777627 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:47:05 +0300 Subject: [PATCH 1106/2732] Test --- iguana/exchanges/LP_portfolio.c | 12 ++++++++---- iguana/exchanges/autoprice | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 07f177806..7f719356f 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -222,7 +222,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { //curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor; - printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); + //printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { if ( jobj(argjson,"minprice") != 0 ) @@ -270,14 +270,18 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ oppomargin = relpp->margins[basepp->ind]; if ( margin != 0. || oppomargin != 0. ) { + offset = basepp->offsets[relpp->ind]; + factor = basepp->factors[relpp->ind]; if ( fabs(price) < SMALLVAL && refbase != 0 && refrel != 0 ) { price = LP_myprice(&bid,&ask,refbase,refrel); - printf("USE ref %s/%s %.8f\n",refbase,refrel,price); + printf("USE ref %s/%s %.8f factor %.8f offset %.8f\n",refbase,refrel,price,factor,offset); } - offset = basepp->offsets[relpp->ind]; - if ( (factor= basepp->factors[relpp->ind]) > SMALLVAL ) + if ( factor > SMALLVAL ) + { + printf("price %.8f -> %.8f\n",price,(price * factor) + offset); price = (price * factor) + offset; + } if ( margin == 0. ) margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index ab4e2e6b7..9ec3ce3f1 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -8,4 +8,4 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":0.01}" From 771fe9b3d0dc6fd82efc7326d343d423cda8fdad Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:54:12 +0300 Subject: [PATCH 1107/2732] Test --- iguana/exchanges/LP_portfolio.c | 39 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 7f719356f..0c58e6713 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -243,7 +243,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { safecopy(LP_autorefs[i].refbase,refbase,sizeof(LP_autorefs[i].refbase)); safecopy(LP_autorefs[i].refrel,refrel,sizeof(LP_autorefs[i].refrel)); - printf("%d Update ref %s/%s for %s/%s\n",i,refbase,refrel,base,rel); + printf("%d Update ref %s/%s for %s/%s factor %.8f offset %.8f\n",i,refbase,refrel,base,rel,factor,offset); break; } } @@ -253,7 +253,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) safecopy(LP_autorefs[num_LP_autorefs].refrel,refrel,sizeof(LP_autorefs[num_LP_autorefs].refrel)); safecopy(LP_autorefs[num_LP_autorefs].base,base,sizeof(LP_autorefs[num_LP_autorefs].base)); safecopy(LP_autorefs[num_LP_autorefs].rel,rel,sizeof(LP_autorefs[num_LP_autorefs].rel)); - printf("%d Using ref %s/%s for %s/%s\n",num_LP_autorefs,refbase,refrel,base,rel); + printf("%d Using ref %s/%s for %s/%s %.8f %.8f\n",num_LP_autorefs,refbase,refrel,base,rel,factor,offset); num_LP_autorefs++; } } @@ -277,23 +277,26 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ price = LP_myprice(&bid,&ask,refbase,refrel); printf("USE ref %s/%s %.8f factor %.8f offset %.8f\n",refbase,refrel,price,factor,offset); } - if ( factor > SMALLVAL ) + if ( LP_pricevalid(price) > 0 ) { - printf("price %.8f -> %.8f\n",price,(price * factor) + offset); - price = (price * factor) + offset; - } - if ( margin == 0. ) - margin = oppomargin; - //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); - if ( dir > 0 ) - price = 1. / (price * (1. - margin)); - else price = (price * (1. + margin)); - if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) - { - LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); - //printf("changed.%d\n",changed); - if ( changed != 0 ) - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + if ( factor > SMALLVAL ) + { + printf("price %.8f -> %.8f\n",price,(price * factor) + offset); + price = (price * factor) + offset; + } + if ( margin == 0. ) + margin = oppomargin; + //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); + if ( dir > 0 ) + price = 1. / (price * (1. - margin)); + else price = (price * (1. + margin)); + if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) + { + LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); + //printf("changed.%d\n",changed); + if ( changed != 0 ) + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } } } } From 8eb68b61a025714fffb1d106befa9260813690c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:56:08 +0300 Subject: [PATCH 1108/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 0c58e6713..2f5b9d217 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -281,7 +281,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ { if ( factor > SMALLVAL ) { - printf("price %.8f -> %.8f\n",price,(price * factor) + offset); + printf("price %.8f -> %.8f factor %.8f offset %.8f\n",price,(price * factor) + offset,factor,offset); price = (price * factor) + offset; } if ( margin == 0. ) From 8c1207b462e10939fba83c67f54ceadd85da097a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:57:47 +0300 Subject: [PATCH 1109/2732] Test --- iguana/exchanges/LP_portfolio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2f5b9d217..ef7be2955 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -377,8 +377,8 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; } - LP_autopriceset(ctx,1,refpp,coinpp,price,0,0); - LP_autopriceset(ctx,-1,coinpp,refpp,price,0,0); + LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); + LP_autopriceset(ctx,-1,refpp,coinpp,price,0,0); } } } @@ -437,8 +437,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,kmdpp,fiatpp,price,0,0); - LP_autopriceset(ctx,-1,fiatpp,kmdpp,price,0,0); + LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); + LP_autopriceset(ctx,-1,kmdpp,fiatpp,price,0,0); free_json(retjson); } } @@ -461,8 +461,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) if ( bidsatoshis != 0 && asksatoshis != 0 ) price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } - LP_autopriceset(ctx,1,kmdpp,nxtpp,price,0,0); - LP_autopriceset(ctx,-1,nxtpp,kmdpp,price,0,0); + LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); + LP_autopriceset(ctx,-1,kmdpp,nxtpp,price,0,0); //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } From e583382a8c6b9a500c6c365971f5acea22ac6fb2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 19:58:07 +0300 Subject: [PATCH 1110/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index ef7be2955..89dc5d24a 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -263,7 +263,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) return(-1); } -void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price,char *refbase,char *refrel) +void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP_priceinfo *relpp,double price,char *refbase,char *refrel) { double margin,minprice,oppomargin,factor,offset; double bid,ask; int32_t changed; margin = basepp->margins[relpp->ind]; From 471795aed5e19089546a10a97533d899fe8f5d04 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:05:19 +0300 Subject: [PATCH 1111/2732] Test --- iguana/exchanges/LP_portfolio.c | 3 ++- iguana/exchanges/autoprice | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 89dc5d24a..e563e9371 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -281,7 +281,8 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP { if ( factor > SMALLVAL ) { - printf("price %.8f -> %.8f factor %.8f offset %.8f\n",price,(price * factor) + offset,factor,offset); + double tmp = (price * factor) + offset; + printf("price %.8f -> %.8f factor %.8f offset %.8f [%.8f %.8f]\n",price,tmp,factor,offset,(tmp * (1. + margin)),1./(tmp * (1. + margin))); price = (price * factor) + offset; } if ( margin == 0. ) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 9ec3ce3f1..ecdcecc84 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -5,7 +5,8 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"USD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":0.01}" +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" From 2acc7df4dcad27068b591022b8ceaca0ec229439 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:10:00 +0300 Subject: [PATCH 1112/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index e563e9371..3f1ff3e51 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -275,14 +275,14 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( fabs(price) < SMALLVAL && refbase != 0 && refrel != 0 ) { price = LP_myprice(&bid,&ask,refbase,refrel); - printf("USE ref %s/%s %.8f factor %.8f offset %.8f\n",refbase,refrel,price,factor,offset); + printf("USE ref %s/%s %.8f factor %.8f offset %.8f margin %.8f\n",refbase,refrel,price,factor,offset,margin); } if ( LP_pricevalid(price) > 0 ) { if ( factor > SMALLVAL ) { double tmp = (price * factor) + offset; - printf("price %.8f -> %.8f factor %.8f offset %.8f [%.8f %.8f]\n",price,tmp,factor,offset,(tmp * (1. + margin)),1./(tmp * (1. + margin))); + printf("price %.8f -> %.8f factor %.8f offset %.8f margin %.8f [%.8f %.8f] [%.8f %.8f]\n",price,tmp,factor,offset,margin,(tmp * (1. + margin)),1./(tmp * (1. - margin)),(tmp * (1. - margin)),1./(tmp * (1. + margin))); price = (price * factor) + offset; } if ( margin == 0. ) From 1eee23d32e2c3dcdf616fd62516314b7d801760a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:12:22 +0300 Subject: [PATCH 1113/2732] Test --- iguana/exchanges/autoprice | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index ecdcecc84..5944209dd 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -8,5 +8,5 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ #curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" #curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" -#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":-0.2}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":-0.2}" From 6b0c69c873a90184231fd56dd5eefb6b9eabcdaf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:19:58 +0300 Subject: [PATCH 1114/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 3f1ff3e51..5b2ea43e4 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -290,7 +290,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) price = 1. / (price * (1. - margin)); - else price = (price * (1. + margin)); + else price = (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); From 082eb218bf0df0a6500710da100dc2337bb3ef58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:21:10 +0300 Subject: [PATCH 1115/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 5b2ea43e4..b2ec8ff2a 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -275,7 +275,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( fabs(price) < SMALLVAL && refbase != 0 && refrel != 0 ) { price = LP_myprice(&bid,&ask,refbase,refrel); - printf("USE ref %s/%s %.8f factor %.8f offset %.8f margin %.8f\n",refbase,refrel,price,factor,offset,margin); + printf("%s/%s USE ref %s/%s %.8f factor %.8f offset %.8f margin %.8f\n",basepp->symbol,relpp->symbol,refbase,refrel,price,factor,offset,margin); } if ( LP_pricevalid(price) > 0 ) { From 1f7d117738c2f1fdd51beeade13a49c4417be543 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:40:37 +0300 Subject: [PATCH 1116/2732] Test --- iguana/exchanges/LP_portfolio.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index b2ec8ff2a..3e56b9fbb 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -265,7 +265,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP_priceinfo *relpp,double price,char *refbase,char *refrel) { - double margin,minprice,oppomargin,factor,offset; double bid,ask; int32_t changed; + double margin,minprice,newprice,oppomargin,factor,offset; double bid,ask; int32_t changed; margin = basepp->margins[relpp->ind]; oppomargin = relpp->margins[basepp->ind]; if ( margin != 0. || oppomargin != 0. ) @@ -288,15 +288,17 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( margin == 0. ) margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); - if ( dir > 0 ) - price = 1. / (price * (1. - margin)); - else price = (price * (1. - margin)); + //if ( dir > 0 ) + // price = 1. / (price * (1. - margin)); + //else price = (price * (1. - margin)); + + newprice = (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { - LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); - //printf("changed.%d\n",changed); + LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); + printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,newprice); if ( changed != 0 ) - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,newprice); } } } @@ -378,7 +380,7 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; } - LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); + //LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); LP_autopriceset(ctx,-1,refpp,coinpp,price,0,0); } } @@ -438,7 +440,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); + //LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); LP_autopriceset(ctx,-1,kmdpp,fiatpp,price,0,0); free_json(retjson); } @@ -462,7 +464,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) if ( bidsatoshis != 0 && asksatoshis != 0 ) price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } - LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); + //LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); LP_autopriceset(ctx,-1,kmdpp,nxtpp,price,0,0); //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); @@ -475,7 +477,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) basepp = LP_priceinfofind(LP_autorefs[i].base); relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) - LP_autopriceset(ctx,1,basepp,relpp,0,LP_autorefs[i].refbase,LP_autorefs[i].refrel); + LP_autopriceset(ctx,-1,basepp,relpp,0,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } From 181f4f68762fb54a5eccd2ffe2b5c49854461e1d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:47:02 +0300 Subject: [PATCH 1117/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 3e56b9fbb..5d7927574 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -292,11 +292,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP // price = 1. / (price * (1. - margin)); //else price = (price * (1. - margin)); - newprice = (price * (1. - margin)); + newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); - printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,newprice); + printf("changed.%d %s/%s <- %.8f\n",changed,relpp->symbol,basepp->symbol,newprice); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,newprice); } From 490b995f18f6db7ab6a942786db27f7e96d29248 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:49:32 +0300 Subject: [PATCH 1118/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 5d7927574..81aca5097 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -292,7 +292,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP // price = 1. / (price * (1. - margin)); //else price = (price * (1. - margin)); - newprice = 1. / (price * (1. - margin)); + newprice = (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); From 4fa8066558812c7e627063f8e99c1f93bad1e3c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:50:10 +0300 Subject: [PATCH 1119/2732] Test --- iguana/exchanges/autoprice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 5944209dd..50210de86 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -9,4 +9,4 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ #curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":-0.2}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":-0.2}" +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":-0.2}" From f212e74674eaa2072b853b961a8bd3695eee3072 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 20:54:42 +0300 Subject: [PATCH 1120/2732] Test --- iguana/exchanges/autoprice | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 50210de86..539c6f9f1 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -8,5 +8,5 @@ curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\ #curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" #curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":-0.2}" -#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":-0.2}" +#curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.0,\"refbase\":\"BTC\",\"refrel\":\"KMD\",\"factor\":0.00006667,\"margin\":-0.2}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"MNZ\",\"offset\":0.0,\"refbase\":\"KMD\",\"refrel\":\"BTC\",\"factor\":15000,\"margin\":-0.2}" From e0d818f0c8ae6d5cdae2ed28496ecf8a8cb4847f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:00:07 +0300 Subject: [PATCH 1121/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_portfolio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 120ee3899..32b5914ec 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -801,7 +801,7 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) { double price,maxprice = LP_Alicemaxprice; - if ( time(NULL) > qp->timestamp+Alice_timeout ) + if ( 0 && time(NULL) > qp->timestamp+Alice_timeout ) { printf("time expired for Alice_request\n"); memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 81aca5097..2a72bb438 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -292,11 +292,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP // price = 1. / (price * (1. - margin)); //else price = (price * (1. - margin)); - newprice = (price * (1. - margin)); + newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); - printf("changed.%d %s/%s <- %.8f\n",changed,relpp->symbol,basepp->symbol,newprice); + printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,newprice); } From b9332019efc6e6b8c3c0345dd113ea62c234bff2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:02:02 +0300 Subject: [PATCH 1122/2732] Test --- iguana/exchanges/LP_portfolio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2a72bb438..23919cd69 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -288,11 +288,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( margin == 0. ) margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); - //if ( dir > 0 ) - // price = 1. / (price * (1. - margin)); - //else price = (price * (1. - margin)); + if ( dir > 0 ) + newprice = 1. / (price * (1. - margin)); + else newprice = (price * (1. - margin)); - newprice = 1. / (price * (1. - margin)); + //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); @@ -380,7 +380,7 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; } - //LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); + LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); LP_autopriceset(ctx,-1,refpp,coinpp,price,0,0); } } @@ -440,7 +440,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); - //LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); + LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); LP_autopriceset(ctx,-1,kmdpp,fiatpp,price,0,0); free_json(retjson); } @@ -464,7 +464,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) if ( bidsatoshis != 0 && asksatoshis != 0 ) price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } - //LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); + LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); LP_autopriceset(ctx,-1,kmdpp,nxtpp,price,0,0); //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); @@ -477,7 +477,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) basepp = LP_priceinfofind(LP_autorefs[i].base); relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) - LP_autopriceset(ctx,-1,basepp,relpp,0,LP_autorefs[i].refbase,LP_autorefs[i].refrel); + LP_autopriceset(ctx,1,basepp,relpp,0,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } From a53ffd5e852acb3465f3e3b5baefedf04508c86b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:10:04 +0300 Subject: [PATCH 1123/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 23919cd69..48e022d68 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -289,8 +289,8 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) - newprice = 1. / (price * (1. - margin)); - else newprice = (price * (1. - margin)); + newprice = 1. / (price * (1. + margin)); + else newprice = (price * (1. + margin)); //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) From feab8be8227e85ab775d0114cbe819f5b8bf30c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:13:54 +0300 Subject: [PATCH 1124/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- iguana/exchanges/autoprice | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 48e022d68..23919cd69 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -289,8 +289,8 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) - newprice = 1. / (price * (1. + margin)); - else newprice = (price * (1. + margin)); + newprice = 1. / (price * (1. - margin)); + else newprice = (price * (1. - margin)); //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 539c6f9f1..21369b468 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,7 +1,7 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.03}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.03}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"USD\",\"margin\":0.01}" From 26dd7b91847b88eabf2bc3b3307ad2607279144e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:19:30 +0300 Subject: [PATCH 1125/2732] Test --- iguana/exchanges/LP_portfolio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 23919cd69..7401e2ba5 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -253,7 +253,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) safecopy(LP_autorefs[num_LP_autorefs].refrel,refrel,sizeof(LP_autorefs[num_LP_autorefs].refrel)); safecopy(LP_autorefs[num_LP_autorefs].base,base,sizeof(LP_autorefs[num_LP_autorefs].base)); safecopy(LP_autorefs[num_LP_autorefs].rel,rel,sizeof(LP_autorefs[num_LP_autorefs].rel)); - printf("%d Using ref %s/%s for %s/%s %.8f %.8f\n",num_LP_autorefs,refbase,refrel,base,rel,factor,offset); + printf("%d Using ref %s/%s for %s/%s factor %.8f, offset %.8f, margin %.8f\n",num_LP_autorefs,refbase,refrel,base,rel,factor,offset,margin); num_LP_autorefs++; } } @@ -275,28 +275,28 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( fabs(price) < SMALLVAL && refbase != 0 && refrel != 0 ) { price = LP_myprice(&bid,&ask,refbase,refrel); - printf("%s/%s USE ref %s/%s %.8f factor %.8f offset %.8f margin %.8f\n",basepp->symbol,relpp->symbol,refbase,refrel,price,factor,offset,margin); + //printf("%s/%s USE ref %s/%s %.8f factor %.8f offset %.8f margin %.8f\n",basepp->symbol,relpp->symbol,refbase,refrel,price,factor,offset,margin); } if ( LP_pricevalid(price) > 0 ) { if ( factor > SMALLVAL ) { - double tmp = (price * factor) + offset; - printf("price %.8f -> %.8f factor %.8f offset %.8f margin %.8f [%.8f %.8f] [%.8f %.8f]\n",price,tmp,factor,offset,margin,(tmp * (1. + margin)),1./(tmp * (1. - margin)),(tmp * (1. - margin)),1./(tmp * (1. + margin))); + //double tmp = (price * factor) + offset; + //printf("price %.8f -> %.8f factor %.8f offset %.8f margin %.8f [%.8f %.8f] [%.8f %.8f]\n",price,tmp,factor,offset,margin,(tmp * (1. + margin)),1./(tmp * (1. - margin)),(tmp * (1. - margin)),1./(tmp * (1. + margin))); price = (price * factor) + offset; } if ( margin == 0. ) margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) - newprice = 1. / (price * (1. - margin)); + newprice = 1. / (price * (1. + margin)); else newprice = (price * (1. - margin)); //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); - printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); + //printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,newprice); } From 4052426cfc3af042148697e0c10576de085d1ea6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:22:51 +0300 Subject: [PATCH 1126/2732] Test --- iguana/exchanges/LP_portfolio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 7401e2ba5..bf7d37b33 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -289,8 +289,8 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) - newprice = 1. / (price * (1. + margin)); - else newprice = (price * (1. - margin)); + newprice = 1. / (price * (1. - margin)); + else newprice = (price * (1. + margin)); //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) @@ -380,8 +380,8 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; } - LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); - LP_autopriceset(ctx,-1,refpp,coinpp,price,0,0); + LP_autopriceset(ctx,-1,coinpp,refpp,price,0,0); + LP_autopriceset(ctx,1,refpp,coinpp,price,0,0); } } } @@ -440,8 +440,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); - LP_autopriceset(ctx,-1,kmdpp,fiatpp,price,0,0); + LP_autopriceset(ctx,-1,fiatpp,kmdpp,price,0,0); + LP_autopriceset(ctx,1,kmdpp,fiatpp,price,0,0); free_json(retjson); } } @@ -464,8 +464,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) if ( bidsatoshis != 0 && asksatoshis != 0 ) price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } - LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); - LP_autopriceset(ctx,-1,kmdpp,nxtpp,price,0,0); + LP_autopriceset(ctx,-1,nxtpp,kmdpp,price,0,0); + LP_autopriceset(ctx,1,kmdpp,nxtpp,price,0,0); //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } From 51e042bca9373f2d3fd3b34362e55b2bde9d2ce8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:26:05 +0300 Subject: [PATCH 1127/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++--- iguana/exchanges/LP_portfolio.c | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5c159e440..d50f4893a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,13 +18,12 @@ // LP_nativeDEX.c // marketmaker // -// autoprice based on formula // sign critical api calls (pubkey reg, listunspent, orders?) -// stats using KV opreturn +// stats using local files // deal with offline pubkeys, reputations, etc. // dPoW security -> 2: KMD notarized, 3: BTC notarized // add interest to KMD withdraw -// verify portfolio, pricearray, withdraw +// verify portfolio, pricearray // dICO allocation // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index bf7d37b33..43e3ab4ae 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -290,7 +290,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) newprice = 1. / (price * (1. - margin)); - else newprice = (price * (1. + margin)); + else newprice = (price * (1. - margin)); //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) @@ -380,8 +380,8 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; } - LP_autopriceset(ctx,-1,coinpp,refpp,price,0,0); - LP_autopriceset(ctx,1,refpp,coinpp,price,0,0); + LP_autopriceset(ctx,1,coinpp,refpp,price,0,0); + LP_autopriceset(ctx,-1,refpp,coinpp,price,0,0); } } } @@ -440,8 +440,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); - LP_autopriceset(ctx,-1,fiatpp,kmdpp,price,0,0); - LP_autopriceset(ctx,1,kmdpp,fiatpp,price,0,0); + LP_autopriceset(ctx,1,fiatpp,kmdpp,price,0,0); + LP_autopriceset(ctx,-1,kmdpp,fiatpp,price,0,0); free_json(retjson); } } @@ -464,8 +464,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) if ( bidsatoshis != 0 && asksatoshis != 0 ) price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } - LP_autopriceset(ctx,-1,nxtpp,kmdpp,price,0,0); - LP_autopriceset(ctx,1,kmdpp,nxtpp,price,0,0); + LP_autopriceset(ctx,1,nxtpp,kmdpp,price,0,0); + LP_autopriceset(ctx,-1,kmdpp,nxtpp,price,0,0); //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } From 9a6b09a06ac069dace210804f155fb2b437b2313 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:28:58 +0300 Subject: [PATCH 1128/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 43e3ab4ae..482327f49 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -289,8 +289,8 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP margin = oppomargin; //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) - newprice = 1. / (price * (1. - margin)); - else newprice = (price * (1. - margin)); + newprice = (1. / price) * (1. + margin); + else newprice = (price * (1. + margin)); //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) From 1a4caa5ce71246eda348cc38b8774d944acf8c76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 21:36:40 +0300 Subject: [PATCH 1129/2732] Test --- iguana/exchanges/LP_prices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 217514983..d23dbbb68 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -789,6 +789,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) jaddi(array,LP_orderbookjson(rel,bids[i])); if ( n < 10 && bids[i]->numutxos == 0 )//|| relcoin->electrum == 0 ) { + printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr,0); @@ -808,6 +809,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) jaddi(array,LP_orderbookjson(base,asks[i])); if ( n < 10 && asks[i]->numutxos == 0 )//|| basecoin->electrum == 0 ) { + printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr,0); From 767727694ea0f1d0aceb4b0ba25a791875d38fae Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 23:38:48 +0300 Subject: [PATCH 1130/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_remember.c | 12 ++++++------ iguana/exchanges/LP_utxo.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d23dbbb68..531a2fdb0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -789,7 +789,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) jaddi(array,LP_orderbookjson(rel,bids[i])); if ( n < 10 && bids[i]->numutxos == 0 )//|| relcoin->electrum == 0 ) { - printf("bid ping %s %s\n",rel,bids[i]->coinaddr); + //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr,0); @@ -809,7 +809,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) jaddi(array,LP_orderbookjson(base,asks[i])); if ( n < 10 && asks[i]->numutxos == 0 )//|| basecoin->electrum == 0 ) { - printf("ask ping %s %s\n",base,asks[i]->coinaddr); + //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr,0); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 119b35f94..752c63956 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -247,7 +247,7 @@ bits256 basilisk_swap_privBn_extract(bits256 *bobrefundp,char *bobcoin,bits256 b return(privBn); } -bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr,char *Adest,char *dest) +bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr,char *Adest,char *dest) { bits256 spendtxid,txid; char destaddr[64],str[65]; struct iguana_info *coin; cJSON *histobj; if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum != 0 ) @@ -285,13 +285,13 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag else { printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); - if ( aliceaddr != 0 ) + if ( iambob == 0 ) { sentflags[bobspent] = 1; sentflags[alicespent] = 0; txids[bobspent] = spendtxid; } - else if ( bobaddr != 0 ) + else { sentflags[alicespent] = 1; sentflags[bobspent] = 0; @@ -914,9 +914,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); - rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); - rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,destAdest,destBdest,rswap.Adestaddr,rswap.destaddr); - rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); + rswap.paymentspent = basilisk_swap_spendupdate(rswap.iambob,rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); + rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.iambob,rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,destAdest,destBdest,rswap.Adestaddr,rswap.destaddr); + rswap.depositspent = basilisk_swap_spendupdate(rswap.iambob,rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); LP_spends_set(&rswap); if ( rswap.iambob == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9244889b8..b60b3b7f5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -160,7 +160,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight); + char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) @@ -241,7 +241,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) + if ( 1 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From 634ad6778a05cacac1025f0a3da729fa21ae42d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 23:43:06 +0300 Subject: [PATCH 1131/2732] Test --- iguana/exchanges/LP_utxo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b60b3b7f5..c330ef305 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -160,7 +160,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight); + char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) @@ -172,6 +172,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 } } portable_mutex_unlock(&LP_utxomutex); + printf("return n.%d\n",n); return(n); } From 8d084c7021708d7d56c993ae096e9120da66fae4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 23:56:05 +0300 Subject: [PATCH 1132/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 32b5914ec..6c3cdcf62 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -507,7 +507,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c330ef305..4be11c04e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -160,7 +160,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); + //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 ) { if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) @@ -172,7 +172,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 } } portable_mutex_unlock(&LP_utxomutex); - printf("return n.%d\n",n); + //printf("return n.%d\n",n); return(n); } From e67c08d1952981bb3456cea3faad7dfa90541ab2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 23:59:08 +0300 Subject: [PATCH 1133/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6c3cdcf62..cbf060638 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -478,7 +478,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a continue; } //else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } - if ( up->SPV > 0 && dist >= 0 && dist < mindist ) + if ( (coin->electrum == 0 || up->SPV > 0) && dist >= 0 && dist < mindist ) { //printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); mini = i; @@ -507,7 +507,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + //printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4be11c04e..26d0c6300 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -242,7 +242,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 1 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) + if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From 7fac9e7387e1176ae30cc13c2da90eb4e6e42107 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:08:49 +0300 Subject: [PATCH 1134/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++++ iguana/exchanges/LP_network.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d50f4893a..cb75b35e8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -339,6 +339,8 @@ void command_rpcloop(void *myipaddr) usleep(1000); else usleep(10000); } + else if ( IAMLP == 0 ) + usleep(1000); } } @@ -729,6 +731,8 @@ int32_t LP_reserved_msgs() n++; #ifdef __APPLE__ usleep(5000); +#else + usleep(100); #endif } portable_mutex_unlock(&LP_reservedmutex); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0036a4e86..14f452dbe 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -203,6 +203,8 @@ void queue_loop(void *ignore) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(5000); + else if ( IAMLP == 0 ) + usleep(1000); } } From ed53146c921ebae347de4f7c5441161aea1f38d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:28:10 +0300 Subject: [PATCH 1135/2732] Stats.log --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_remember.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 531a2fdb0..58bb302ed 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -169,7 +169,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) ap->pubkey = pubp->pubkey; memcpy(ap->pubsecp,pubp->pubsecp,sizeof(ap->pubsecp)); } - printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); + //printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); return(ap); } diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 752c63956..66c0bcc75 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1203,6 +1203,19 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) void LP_tradecommand_log(cJSON *argjson) { - + static FILE *logfp; char *jsonstr; + if ( logfp == 0 ) + { + if ( (logfp= fopen("stats.log","rb+")) != 0 ) + fseek(logfp,0,SEEK_END); + else logfp = fopen("stats.log","wb"); + } + if ( logfp != 0 ) + { + jsonstr = jprint(argjson,0); + fprintf(logfp,"%s\n",jsonstr); + free(jsonstr); + fflush(logfp); + } } From 088a91f482095e122ec7b0db8d79cf802fd0c786 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:30:06 +0300 Subject: [PATCH 1136/2732] Test --- iguana/exchanges/LP_commands.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 31679e2eb..87f493035 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -159,6 +159,11 @@ dividends(coin, height, )\n\ } return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"stop") == 0 ) + { + printf("DEBUG stop\n"); + exit(0); + } else if ( strcmp(method,"getmessages") == 0 ) { if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) From 566c99a5236281fb2b1268c754529e09dd804ad7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:35:30 +0300 Subject: [PATCH 1137/2732] Test --- iguana/exchanges/profile | 1 + iguana/m_mm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/profile diff --git a/iguana/exchanges/profile b/iguana/exchanges/profile new file mode 100755 index 000000000..50c1df851 --- /dev/null +++ b/iguana/exchanges/profile @@ -0,0 +1 @@ +gprof -b ../marketmaker ../gmon.out diff --git a/iguana/m_mm b/iguana/m_mm index b5ba405ca..f124ecaa1 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -1,3 +1,3 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; ./m_LP; cd ../iguana -gcc -g -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm +gcc -pg -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm From 9445a5d9bfa041dca414f4fa4b4fe916201aa8d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:36:31 +0300 Subject: [PATCH 1138/2732] Test --- iguana/exchanges/stop | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 iguana/exchanges/stop diff --git a/iguana/exchanges/stop b/iguana/exchanges/stop new file mode 100644 index 000000000..7bf610384 --- /dev/null +++ b/iguana/exchanges/stop @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"stop\"}" From 8a66df1fcd6f6399577c71dbb536e83c3be36f32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:39:09 +0300 Subject: [PATCH 1139/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cb75b35e8..536480025 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -292,7 +292,7 @@ int32_t LP_nanomsg_recvs(void *ctx) if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); - if ( lastmilli > 0. && milli > lastmilli+1000 ) + if ( lastmilli > 0. && milli > lastmilli+3000 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",milli-lastmilli); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); From 59db65c50c1b7c4522e5f1782f35cb4ffe70cb3b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 01:57:37 +0300 Subject: [PATCH 1140/2732] Withdraw interest --- iguana/exchanges/LP_nativeDEX.c | 10 ++++---- iguana/exchanges/LP_rpc.c | 11 +++++++++ iguana/exchanges/LP_transaction.c | 40 +++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 536480025..c54e2da4f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,13 +18,13 @@ // LP_nativeDEX.c // marketmaker // -// sign critical api calls (pubkey reg, listunspent, orders?) -// stats using local files -// deal with offline pubkeys, reputations, etc. -// dPoW security -> 2: KMD notarized, 3: BTC notarized +// dPoW security -> 4: KMD notarized, 5: BTC notarized +// dICO allocation script // add interest to KMD withdraw +// sign critical api calls (pubkey reg, listunspent, orders?) +// process stats.log local file // verify portfolio, pricearray -// dICO allocation +// deal with offline pubkeys, reputations, etc. // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c6cc3e298..18a7c89e1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -268,6 +268,17 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } } +uint32_t LP_locktime(char *symbol,bits256 txid) +{ + cJSON *txobj; uint32_t locktime = 0; + if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + { + locktime = juint(txobj,"locktime"); + free_json(txobj); + } + return(locktime); +} + cJSON *LP_gettxout_json(bits256 txid,int32_t vout,int32_t height,char *coinaddr,uint64_t value) { cJSON *retjson,*addresses,*sobj; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 48c03efa1..ff032f126 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -778,10 +778,38 @@ cJSON *LP_inputjson(bits256 txid,int32_t vout,char *spendscriptstr) return(item); } +uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime) +{ + int32_t minutes; uint64_t interest = 0; + if ( (minutes= (tiptime - nLockTime) / 60) >= 60 ) + { + if ( minutes > 365 * 24 * 60 ) + minutes = 365 * 24 * 60; + minutes -= 59; + interest = ((nValue / 10512000) * minutes); + } + return(interest); +} + +int64_t LP_komodo_interest(bits256 txid,int64_t value) +{ + uint32_t nLockTime; uint32_t tiptime; int64_t interest = 0; + if ( value >= 10*SATOSHIDEN ) + { + if ( (nLockTime= LP_locktime("KMD",txid)) >= 500000000 ) + { + tiptime = (uint32_t)time(NULL) - 777; + interest = _komodo_interestnew(value,nLockTime,tiptime); + } + } + return(interest); +} + int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen) { - char wifstr[128],spendscriptstr[128]; int32_t i,n,ind,abovei,belowi,maxmode=0; struct vin_info *vp; struct LP_address_utxo *up; int64_t above,below,remains = amount,total = 0; + char wifstr[128],spendscriptstr[128]; int32_t i,n,ind,abovei,belowi,maxmode=0; struct vin_info *vp; struct LP_address_utxo *up; int64_t interest,interestsum,above,below,remains = amount,total = 0; *totalp = 0; + interestsum = 0; init_hexbytes_noT(spendscriptstr,script,scriptlen); bitcoin_priv2wif(coin->wiftaddr,wifstr,privkey,coin->wiftype); for (i=n=0; iU.value; remains -= up->U.value; + //if ( coin->electrum == 0 && strcmp(coin->symbol,"KMD") == 0 ) + { + if ( (interest= LP_komodo_interest(up->U.txid,up->U.value)) > 0 ) + { + interestsum += interest; + char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); + } + } vp = &V[n++]; vp->N = vp->M = 1; vp->signers[0].privkey = privkey; @@ -825,7 +861,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(0); } } - *totalp = total; + *totalp = total + interestsum; return(n); } From bf2148cefad44a8afaadd67b0e2177dad2fc9ecb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 02:19:10 +0300 Subject: [PATCH 1141/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/stop | 0 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 iguana/exchanges/stop diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c54e2da4f..5a4df4fc6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,10 +20,10 @@ // // dPoW security -> 4: KMD notarized, 5: BTC notarized // dICO allocation script -// add interest to KMD withdraw // sign critical api calls (pubkey reg, listunspent, orders?) + // process stats.log local file -// verify portfolio, pricearray +// verify portfolio, pricearray, interest to KMD withdraw // deal with offline pubkeys, reputations, etc. // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 14f452dbe..7b04dc444 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[8192]; static unsigned long dup,total; + static uint32_t crcs[64]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) diff --git a/iguana/exchanges/stop b/iguana/exchanges/stop old mode 100644 new mode 100755 From 4883a3c8fb0367c59e938daecf2306a0aa73dcbc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 11:43:10 +0300 Subject: [PATCH 1142/2732] Test --- iguana/exchanges/LP_commands.c | 7 ++++++- iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 87f493035..6b6dc5df9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -271,7 +271,12 @@ dividends(coin, height, )\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { if ( ptr->userpass[0] == 0 ) - return(clonestr("{\"error\":\"couldnt find coin locally installed\"}")); + { + cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"error","couldnt find coin locally installed"); + jaddstr(retjson,"coin",coin); + return(jprint(retjson,1)); + } if ( LP_conflicts_find(ptr) == 0 ) { ptr->inactive = 0; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5a4df4fc6..4d2888eb2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -24,6 +24,7 @@ // process stats.log local file // verify portfolio, pricearray, interest to KMD withdraw + // deal with offline pubkeys, reputations, etc. // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN From 70ec72915d575e8e3b484268b31030b5a8993e14 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 12:20:09 +0300 Subject: [PATCH 1143/2732] Recent swaps --- iguana/exchanges/LP_commands.c | 5 +++++ iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_remember.c | 32 ++++++++++++++++++++++++++++++++ iguana/exchanges/recentswaps | 3 +++ iguana/exchanges/stop | 1 + 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/recentswaps diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6b6dc5df9..2219b5caa 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -110,6 +110,7 @@ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)*\n\ withdraw(coin, outputs[])*\n\ sendrawtransaction(coin, signedtx)\n\ swapstatus()*\n\ +recentswaps(limit=3)\n\ swapstatus(requestid, quoteid)*\n\ public API:\n \ getcoins()\n\ @@ -159,6 +160,10 @@ dividends(coin, height, )\n\ } return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"recentswaps") == 0 ) + { + return(LP_recent_swaps(jint(argjson,"limit"))); + } else if ( strcmp(method,"stop") == 0 ) { printf("DEBUG stop\n"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4d2888eb2..88837e542 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -24,7 +24,7 @@ // process stats.log local file // verify portfolio, pricearray, interest to KMD withdraw - +// handles<->pubkeys // deal with offline pubkeys, reputations, etc. // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 66c0bcc75..959b08a23 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1219,3 +1219,35 @@ void LP_tradecommand_log(cJSON *argjson) } } +char *LP_recent_swaps(int32_t limit) +{ + char fname[512]; long fsize,offset; FILE *fp; int32_t i=0; uint32_t requestid,quoteid; cJSON *array,*item; + if ( limit <= 0 ) + limit = 3; + sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname); + array = cJSON_CreateArray(); + if ( (fp= fopen(fname,"rb")) != 0 ) + { + fseek(fp,0,SEEK_END); + fsize = ftell(fp); + offset = (sizeof(requestid) + sizeof(quoteid)); + while ( offset <= fsize ) + { + i++; + offset = i * (sizeof(requestid) + sizeof(quoteid)); + fseek(fp,fsize-offset,SEEK_SET); + if ( ftell(fp) == fsize-offset ) + { + if ( fread(&requestid,1,sizeof(requestid),fp) == sizeof(requestid) && fread("eid,1,sizeof(quoteid),fp) == sizeof(quoteid) ) + { + item = cJSON_CreateArray(); + jaddinum(item,requestid); + jaddinum(item,quoteid); + jaddi(array,item); + } else break; + } else break; + } + fclose(fp); + } + return(jprint(array,1)); +} diff --git a/iguana/exchanges/recentswaps b/iguana/exchanges/recentswaps new file mode 100755 index 000000000..d24b99840 --- /dev/null +++ b/iguana/exchanges/recentswaps @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"recentswaps\",\"limit\":1}" diff --git a/iguana/exchanges/stop b/iguana/exchanges/stop index 7bf610384..d13a70243 100755 --- a/iguana/exchanges/stop +++ b/iguana/exchanges/stop @@ -1,2 +1,3 @@ +#!/bin/bash source userpass curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"stop\"}" From 3037ff3b2eabd6cdecf804156f8cadb9dad53894 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 12:34:53 +0300 Subject: [PATCH 1144/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 959b08a23..e7a6a536e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1231,7 +1231,7 @@ char *LP_recent_swaps(int32_t limit) fseek(fp,0,SEEK_END); fsize = ftell(fp); offset = (sizeof(requestid) + sizeof(quoteid)); - while ( offset <= fsize ) + while ( offset <= fsize && i < limit ) { i++; offset = i * (sizeof(requestid) + sizeof(quoteid)); From 05d79003d2b3ceda53fc638e431dc9edca168e12 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 12:45:18 +0300 Subject: [PATCH 1145/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_ordermatch.c | 9 +++++---- iguana/exchanges/LP_remember.c | 21 +++++++++++++++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 2219b5caa..c57e9b3fd 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -132,6 +132,7 @@ electrum(coin, ipaddr, port)*\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ +stop()\n\ \"}")); //sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cbf060638..13c3db920 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -776,7 +776,8 @@ char *LP_bestfit(char *rel,double relvolume) } struct LP_quoteinfo LP_Alicequery; -double LP_Alicemaxprice; int32_t Alice_timeout; +double LP_Alicemaxprice; +uint32_t Alice_expiration; char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; @@ -787,7 +788,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } price = 0.; LP_query(ctx,myipaddr,mypubsock,"request",qp); - LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_timeout = timeout; + LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; return(clonestr("{\"result\":\"success\"}")); } @@ -801,12 +802,12 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) { double price,maxprice = LP_Alicemaxprice; - if ( 0 && time(NULL) > qp->timestamp+Alice_timeout ) + if ( time(NULL) > Alice_expiration ) { printf("time expired for Alice_request\n"); memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; - Alice_timeout = 0; + Alice_expiration = 0; } else if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) { diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index e7a6a536e..208216537 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1219,9 +1219,12 @@ void LP_tradecommand_log(cJSON *argjson) } } +extern struct LP_quoteinfo LP_Alicequery; +extern uint32_t Alice_expiration; + char *LP_recent_swaps(int32_t limit) { - char fname[512]; long fsize,offset; FILE *fp; int32_t i=0; uint32_t requestid,quoteid; cJSON *array,*item; + char fname[512]; long fsize,offset; FILE *fp; int32_t i=0; uint32_t requestid,quoteid; cJSON *array,*item,*retjson; if ( limit <= 0 ) limit = 3; sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname); @@ -1249,5 +1252,19 @@ char *LP_recent_swaps(int32_t limit) } fclose(fp); } - return(jprint(array,1)); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jadd(retjson,"swaps",array); + if ( time(NULL) < Alice_expiration ) + { + item = cJSON_CreateObject(); + jaddnum(item,"expiration",Alice_expiration); + jaddnum(item,"timeleft",Alice_expiration-time(NULL)); + jaddstr(item,"base",LP_Alicequery.srccoin); + jaddnum(item,"basevalue",dstr(LP_Alicequery.satoshis)); + jaddstr(item,"rel",LP_Alicequery.destcoin); + jaddnum(item,"relvalue",dstr(LP_Alicequery.destsatoshis)); + jadd(retjson,"pending",item); + } else Alice_expiration = 0; + return(jprint(retjson,1)); } From 0da2b5024f8ec99246e64a16b7cbb8ebc84383d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 13:45:20 +0300 Subject: [PATCH 1146/2732] Persistent asset chain notarizations --- iguana/dPoW.h | 2 +- iguana/dpow/dpow_fsm.c | 5 +++++ iguana/dpow/dpow_rpc.c | 14 +++++++------- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/iguana_notary.c | 22 +++++++++++++++++++--- 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index 47e9f1642..f2bd64821 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -132,7 +132,7 @@ struct dpow_info char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask; struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE]; struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; - bits256 srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; + bits256 activehash,lastnotarized,srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; uint32_t SRCREALTIME,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; struct pax_transaction *PAX; diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 18afb868b..8adf8ddec 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -447,6 +447,11 @@ void dpow_statemachinestart(void *ptr) dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,0,bp->height,(void *)"ping",0); dpow_nanomsg_update(myinfo); } + else + { + dp->lastnotarized = bp->srctxid; + printf("notarized %s %s\n",dp->symbol,bits256_str(str,bp->srctxid)); + } if ( 0 && dp->cancelratify != 0 && bp->isratify != 0 ) { printf("abort pending ratify\n"); diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 0e294f4d9..64dc63d87 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -1154,10 +1154,11 @@ void dpow_issuer_voutupdate(struct dpow_info *dp,char *symbol,int32_t isspecial, } } -int32_t dpow_issuer_tx(struct dpow_info *dp,struct iguana_info *coin,int32_t height,int32_t txi,char *txidstr,uint32_t port) +int32_t dpow_issuer_tx(int32_t *isspecialp,struct dpow_info *dp,struct iguana_info *coin,int32_t height,int32_t txi,char *txidstr,uint32_t port) { - char *retstr,params[256],*hexstr; uint8_t script[16384]; cJSON *json,*oldpub,*newpub,*result,*vouts,*item,*sobj; int32_t vout,n,len,isspecial,retval = -1; uint64_t value; bits256 txid; + char *retstr,params[256],*hexstr; uint8_t script[16384]; cJSON *json,*oldpub,*newpub,*result,*vouts,*item,*sobj; int32_t vout,n,len,retval = -1; uint64_t value; bits256 txid; sprintf(params,"[\"%s\", 1]",txidstr); + *isspecialp = 0; if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getrawtransaction",params,port)) != 0 ) { if ( (json= cJSON_Parse(retstr)) != 0 ) @@ -1170,7 +1171,6 @@ int32_t dpow_issuer_tx(struct dpow_info *dp,struct iguana_info *coin,int32_t hei retval = 0; if ( oldpub == 0 && newpub == 0 && (vouts= jarray(&n,result,(char *)"vout")) != 0 ) { - isspecial = 0; txid = jbits256(result,(char *)"txid"); for (vout=0; vout> 1; if ( vout == 0 && ((memcmp(&hexstr[2],CRYPTO777_PUBSECPSTR,66) == 0 && len == 35) || (memcmp(&hexstr[6],CRYPTO777_RMD160STR,40) == 0 && len == 25)) ) - isspecial = 1; + *isspecialp = 1; else if ( len <= sizeof(script) ) { decode_hex(script,len,hexstr); - dpow_issuer_voutupdate(dp,coin->symbol,isspecial,height,txi,txid,vout,n,value,script,len); + dpow_issuer_voutupdate(dp,coin->symbol,*isspecialp,height,txi,txid,vout,n,value,script,len); } } } @@ -1202,7 +1202,7 @@ int32_t dpow_issuer_tx(struct dpow_info *dp,struct iguana_info *coin,int32_t hei int32_t dpow_issuer_block(struct dpow_info *dp,struct iguana_info *coin,int32_t height,uint16_t port) { - char *retstr,*retstr2,params[128],*txidstr; int32_t i,n,retval = -1; cJSON *json,*tx=0,*result=0,*result2; + char *retstr,*retstr2,params[128],*txidstr; int32_t i,isspecial,n,retval = -1; cJSON *json,*tx=0,*result=0,*result2; sprintf(params,"[%d]",height); if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getblockhash",params,port)) != 0 ) { @@ -1219,7 +1219,7 @@ int32_t dpow_issuer_block(struct dpow_info *dp,struct iguana_info *coin,int32_t if ( (result2= jobj(json,(char *)"result")) != 0 && (tx= jarray(&n,result2,(char *)"tx")) != 0 ) { for (i=0; ipubkeys +// handles <-> pubkeys // deal with offline pubkeys, reputations, etc. // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 13c3db920..d1982812b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1074,7 +1074,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); - return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); + return(clonestr("{\"error\":\"cant find ordermatch utxo, need to change relvolume to be closer to available\"}")); } pubkeys[numpubs++] = bestutxo->pubkey; if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index b04431d4d..8120fed4c 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -75,8 +75,21 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); - if ( dp->SRCREALTIME == 0 && strcmp(dp->dest,"KMD") == 0 ) - return; + if ( strcmp(dp->dest,"KMD") == 0 ) + { + if ( dp->SRCREALTIME == 0 ) + return; + if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + { + printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); + return; + } + if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) + { + printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); + return; + } + } if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); @@ -84,9 +97,12 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he ptrs[0] = (void *)myinfo; ptrs[1] = (void *)dp; ptrs[2] = (void *)(uint64_t)minsigs; - ptrs[3] = (void *)DPOW_DURATION; + if ( strcmp(dp->dest,"KMD") == 0 ) + ptrs[3] = (void *)(DPOW_DURATION * 60); // essentially try forever for assetchains + else ptrs[3] = (void *)DPOW_DURATION; ptrs[4] = 0; memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint)); + dp->activehash = checkpoint.blockhash.hash; if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)dpow_statemachinestart,(void *)ptrs) != 0 ) { } From ba46c908608c24232272a3dfade6f2f2d8bb7236 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 13:47:16 +0300 Subject: [PATCH 1147/2732] Test --- iguana/iguana_notary.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 8120fed4c..4049b6602 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -89,6 +89,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); return; } + printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); } if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { From dfd881e7a50393d497e49c1668b302b033c9a175 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 14:22:53 +0300 Subject: [PATCH 1148/2732] Test --- iguana/dpow/dpow_rpc.c | 2 +- iguana/iguana_notary.c | 41 ++++++++++++++++++++++++++++------------- iguana/m_splitfund | 1 + 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 64dc63d87..f69d68886 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -177,7 +177,7 @@ bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *c memset(blockhash.bytes,0,sizeof(blockhash)); if ( coin->FULLNODE < 0 ) { - if ( coin->lastbesthashtime+20 > time(NULL) && bits256_nonz(coin->lastbesthash) != 0 ) + if ( coin->lastbesthashtime+2 > time(NULL) && bits256_nonz(coin->lastbesthash) != 0 ) return(coin->lastbesthash); if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"getbestblockhash","")) != 0 ) { diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 4049b6602..2bd00f340 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -60,7 +60,7 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime) { - void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t freq,minsigs; //uint8_t pubkeys[64][33]; + void **ptrs; char str[65]; cJSON *blockjson; struct iguana_info *coin; struct dpow_checkpoint checkpoint; int32_t freq,minsigs; //uint8_t pubkeys[64][33]; dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); checkpoint = dp->srcfifo[dp->srcconfirms]; if ( strcmp("BTC",dp->dest) == 0 ) @@ -73,26 +73,41 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he freq = 1; minsigs = 11; } - printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); if ( strcmp(dp->dest,"KMD") == 0 ) { if ( dp->SRCREALTIME == 0 ) return; - if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + if ( (coin= iguana_coinfind(dp->symbol)) != 0 ) { - printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); - return; - } - if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) - { - printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); - return; - } - printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); + hash = dpow_getbestblockhash(myinfo,coin); + if ( bits256_nonz(hash) != 0 ) + { + if ( (blockjson= dpow_getblock(myinfo,coin,hash)) != 0 ) + { + height = jint(blockjson,"height"); + blocktime = juint(blockjson,"time"); + if ( height > 0 && blocktime > 0 ) + dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); + free_json(blockjson); + if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + { + printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); + return; + } + if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) + { + printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); + return; + } + printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); + } else return; + } else return; + } else return; } if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { + printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint)); ptrs[0] = (void *)myinfo; @@ -193,7 +208,7 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) } if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->srctx,&dp->numsrctx,src)) != dp->last.blockhash.height && height >= 0 ) { - char str[65]; printf("[%s].%d %s %s height.%d vs last.%d\n",dp->dest,dp->SRCHEIGHT,dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); + //char str[65]; printf("[%s].%d %s %s height.%d vs last.%d\n",dp->dest,dp->SRCHEIGHT,dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); if ( dp->lastheight == 0 ) dp->lastheight = height-1; if ( height < dp->last.blockhash.height ) diff --git a/iguana/m_splitfund b/iguana/m_splitfund index dbaf4cb51..342f8e6de 100755 --- a/iguana/m_splitfund +++ b/iguana/m_splitfund @@ -22,6 +22,7 @@ curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"WLC\",\"agent\":\"iguana\ curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"KV\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"50000\",\"sendflag\":1,\"duplicates\":10}" curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"CEAL\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"50000\",\"sendflag\":1,\"duplicates\":10}" curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"MESH\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"50000\",\"sendflag\":1,\"duplicates\":10}" +curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"MNZ\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"50000\",\"sendflag\":1,\"duplicates\":10}" curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"USD\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"50000\",\"sendflag\":1,\"duplicates\":10}" curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"EUR\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"50000\",\"sendflag\":1,\"duplicates\":10}" From 68c14b85fb696fdf82e21b677165350dd784640f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 15:13:15 +0300 Subject: [PATCH 1149/2732] Test --- iguana/dPoW.h | 1 + iguana/iguana_notary.c | 110 ++++++++++++++++++++++++++++++++++------- 2 files changed, 93 insertions(+), 18 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index f2bd64821..b95c550f7 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -20,6 +20,7 @@ #define DPOW_CHECKPOINTFREQ 10 #define DPOW_MINSIGS 13 +#define DPOW_MIN_ASSETCHAIN_SIGS 11 //#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1) #define DPOW_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries) #define DPOW_VERSION 0x0781 diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 2bd00f340..5e61662f6 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -58,6 +58,77 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che checkpoint->blockhash.height = height; } +int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid) +{ + cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[35]; bits256 spenttxid; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; + if ( (txobj= dpow_gettransaction(myinfo,coin,txid)) != 0 ) + { + if ( (vins= jarray(&numvins,txobj,"vin")) != 0 ) + { + if ( numvins >= DPOW_MIN_ASSETCHAIN_SIGS ) + { + numnotaries = 0; + for (i=0; i>= 1; + decode_hex(script,len,hexstr); + if ( script[0] == 33 && script[34] == 0xac ) + { + for (j=0; j 0 ) + { + if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) + hasnotarization = 1; + printf("numnotaries.%d hasnotarization.%d\n",numnotaries,hasnotarization); + } + } + } + free_json(txobj); + } + return(hasnotarization); +} + +int32_t dpow_hasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson) +{ + int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; + if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) + { + for (i=0; isrcfifo,dp->last); if ( strcmp(dp->dest,"KMD") == 0 ) { - if ( dp->SRCREALTIME == 0 ) - return; + //if ( dp->SRCREALTIME == 0 ) + // return; if ( (coin= iguana_coinfind(dp->symbol)) != 0 ) { hash = dpow_getbestblockhash(myinfo,coin); @@ -85,22 +156,25 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he { if ( (blockjson= dpow_getblock(myinfo,coin,hash)) != 0 ) { - height = jint(blockjson,"height"); - blocktime = juint(blockjson,"time"); - if ( height > 0 && blocktime > 0 ) - dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - free_json(blockjson); - if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + if ( dpow_hasnotarization(myinfo,coin,blockjson) <= 0 ) { - printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); - return; - } - if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) - { - printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); - return; - } - printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); + height = jint(blockjson,"height"); + blocktime = juint(blockjson,"time"); + if ( height > 0 && blocktime > 0 ) + dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); + free_json(blockjson); + if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + { + printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); + return; + } + if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) + { + printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); + return; + } + printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); + } else return; } else return; } else return; } else return; From 9bd6e83700c3d44b624424eafc8946dcfc6ac5c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 15:23:38 +0300 Subject: [PATCH 1150/2732] Test --- iguana/iguana_notary.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 5e61662f6..427fdd37f 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -160,15 +160,19 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he { height = jint(blockjson,"height"); blocktime = juint(blockjson,"time"); + free_json(blockjson); if ( height > 0 && blocktime > 0 ) + { dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - free_json(blockjson); - if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + printf("dynamic set %s <- height.%d\n",bits256_str(str,hash),height); + } + else return; + if ( bits256_nonz(dp->activehash) != 0 && bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) { printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); return; } - if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) + else if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) { printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); return; @@ -264,7 +268,7 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->desttx,&dp->numdesttx,dest)) != dp->destchaintip.blockhash.height && height >= 0 ) { char str[65]; - if ( strcmp(dp->symbol,"KMD") == 0 || height != dp->destchaintip.blockhash.height+1 ) + if ( strcmp(dp->symbol,"KMD") == 0 )//|| height != dp->destchaintip.blockhash.height+1 ) printf("[%s].%d %s %s height.%d vs last.%d\n",dp->symbol,dp->SRCHEIGHT,dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height); if ( height <= dp->destchaintip.blockhash.height ) { From ff57103aa9eb406ee256bd250660ea950550da34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 15:27:33 +0300 Subject: [PATCH 1151/2732] Test --- iguana/iguana_notary.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 427fdd37f..69f72b99c 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -306,7 +306,7 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) } } } - else + else if ( strcmp(dp->symbol,"KMD") == 0 ) { while ( dp->lastheight <= height ) { @@ -314,6 +314,12 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); } } + else + { + dp->lastheight = height; + blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); + dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime); + } } //else printf("error getchaintip for %s\n",dp->symbol); } else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest); } From b4b3109eb51b5d29cc94b72681cdd7ac80357e07 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 15:33:44 +0300 Subject: [PATCH 1152/2732] Test --- iguana/iguana_notary.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 69f72b99c..a37c8853c 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -164,9 +164,9 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he if ( height > 0 && blocktime > 0 ) { dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - printf("dynamic set %s <- height.%d\n",bits256_str(str,hash),height); - } - else return; + printf("dynamic set %s/%s %s <- height.%d\n",dp->symbol,dp->dest,bits256_str(str,hash),height); + checkpoint = dp->last; + } else return; if ( bits256_nonz(dp->activehash) != 0 && bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) { printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); From 6bf17b2b34ef7b7f078783faa9d158fe3dc596a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 15:40:19 +0300 Subject: [PATCH 1153/2732] Test --- basilisk/basilisk_bitcoin.c | 4 ++-- iguana/dpow/dpow_fsm.c | 2 +- iguana/iguana_notary.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index ae7937fe9..942539260 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -602,7 +602,7 @@ char *iguana_utxoduplicates(struct supernet_info *myinfo,struct iguana_info *coi free_json(vins); return(rawtx); } - printf("splitfunds tx.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); + printf("%s splitfunds tx.(%s) vins.(%s)\n",coin->symbol,rawtx,jprint(vins,0)); if ( signedtxidp != 0 ) { if ( (signedtx= iguana_signrawtx(myinfo,coin,0,signedtxidp,completedp,vins,rawtx,0,0)) != 0 ) @@ -615,7 +615,7 @@ char *iguana_utxoduplicates(struct supernet_info *myinfo,struct iguana_info *coi free(rawtx); rawtx = signedtx, signedtx = 0; } - } else printf("error signing raw utxoduplicates tx\n"); + } else printf("error signing raw %s utxoduplicates tx\n",coin->symbol); } } if ( vins != 0 ) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 8adf8ddec..848b87bf9 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -326,7 +326,7 @@ void dpow_statemachinestart(void *ptr) return; } bp->myind = myind; - printf("[%d] statemachinestart %s->%s %s ht.%d minsigs.%d duration.%d start.%u\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp); + printf("[%d] notarize %s->%s %s ht.%d minsigs.%d duration.%d start.%u\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp); if ( bp->isratify != 0 && memcmp(bp->notaries[0].pubkey,bp->ratified_pubkeys[0],33) != 0 ) { for (i=0; i<33; i++) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index a37c8853c..c6f98f4f2 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -164,7 +164,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he if ( height > 0 && blocktime > 0 ) { dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - printf("dynamic set %s/%s %s <- height.%d\n",dp->symbol,dp->dest,bits256_str(str,hash),height); + //printf("dynamic set %s/%s %s <- height.%d\n",dp->symbol,dp->dest,bits256_str(str,hash),height); checkpoint = dp->last; } else return; if ( bits256_nonz(dp->activehash) != 0 && bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) @@ -177,7 +177,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); return; } - printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); + //printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); } else return; } else return; } else return; @@ -185,7 +185,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { - printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); + //printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint)); ptrs[0] = (void *)myinfo; From 04d583232c81dd0e03aa4f4b82bfdc1eb9cdd253 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 16:57:11 +0300 Subject: [PATCH 1154/2732] Test --- iguana/dpow/dpow_network.c | 10 +++++----- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/iguana777.h | 2 +- iguana/iguana_mofn.c | 28 ++++++++++++++++++++++------ iguana/main.c | 6 +++++- 5 files changed, 36 insertions(+), 16 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 9899b9cac..c3e8ed36b 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -170,7 +170,7 @@ int32_t signed_nn_recv(void **freeptrp,struct supernet_info *myinfo,uint8_t nota vcalc_sha256(0,packethash.bytes,(void *)&sigpacket->nonce,(int32_t)(sigpacket->packetlen+sizeof(sigpacket->nonce)+sizeof(sigpacket->packetlen))); if ( bits256_cmp(packethash,sigpacket->packethash) == 0 && sigpacket->packethash.bytes[0] == 0 ) { - if ( bitcoin_recoververify(myinfo->ctx,"nnrecv",sigpacket->sig64,sigpacket->packethash,pubkey33,33) == 0 ) + if ( bitcoin_recoververify(myinfo->ctx[1],"nnrecv",sigpacket->sig64,sigpacket->packethash,pubkey33,33) == 0 ) { char *notary0 = "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828"; // expand to official notaries @@ -2020,7 +2020,7 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_blo pfd.events = NN_POLLOUT; if ( nn_poll(&pfd,1,100) > 0 ) { - sentbytes = signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->dpowsock,np,size); + sentbytes = signed_nn_send(myinfo,myinfo->ctx[2],myinfo->persistent_priv,myinfo->dpowsock,np,size); break; } usleep(1000); @@ -2168,13 +2168,13 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) //printf("REP got %d crc.%08x\n",size,calc_crc32(0,(void *)dexp,size)); if ( (retstr= dex_response(&broadcastflag,myinfo,dexp)) != 0 ) { - signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->repsock,retstr,(int32_t)strlen(retstr)+1); + signed_nn_send(myinfo,myinfo->ctx[1],myinfo->persistent_priv,myinfo->repsock,retstr,(int32_t)strlen(retstr)+1); //printf("send back[%ld]\n",strlen(retstr)+1); free(retstr); if ( broadcastflag != 0 ) { printf("BROADCAST dexp request.[%d]\n",size); - signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->dexsock,dexp,size); + signed_nn_send(myinfo,myinfo->ctx[1],myinfo->persistent_priv,myinfo->dexsock,dexp,size); //signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->pubsock,dexp,size); } } @@ -2183,7 +2183,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) if ( (m= myinfo->numdpowipbits) > 0 ) { r = myinfo->dpowipbits[rand() % m]; - signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->repsock,&r,sizeof(r)); + signed_nn_send(myinfo,myinfo->ctx[1],myinfo->persistent_priv,myinfo->repsock,&r,sizeof(r)); printf("REP.%08x <- rand ip m.%d %x\n",dexp->crc32,m,r); } else printf("illegal state without dpowipbits?\n"); if ( dex_packetcheck(myinfo,dexp,size) == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2f5ca02de..2365e1d9c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,14 +19,14 @@ // marketmaker // // dPoW security -> 4: KMD notarized, 5: BTC notarized -// dICO allocation script // sign critical api calls (pubkey reg, listunspent, orders?) - +// // process stats.log local file -// verify portfolio, pricearray, interest to KMD withdraw // handles <-> pubkeys // deal with offline pubkeys, reputations, etc. +// // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN +// verify portfolio, pricearray, interest to KMD withdraw #include diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 74412e6f0..62539d3d0 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -150,7 +150,7 @@ struct supernet_info struct queueitem *DEX_quotes; cJSON *Cunspents,*Cspends; struct basilisk_swap *swaps[256]; int32_t numswaps; struct basilisk_message *messagetable; portable_mutex_t messagemutex; queue_t msgQ,p2pQ; - void *ctx; + void *ctx[4]; uint8_t *pingbuf; struct basilisk_request DEXaccept; FILE *dexfp; diff --git a/iguana/iguana_mofn.c b/iguana/iguana_mofn.c index 2756def45..946833dd1 100755 --- a/iguana/iguana_mofn.c +++ b/iguana/iguana_mofn.c @@ -238,19 +238,35 @@ int32_t gfshare_test(struct supernet_info *myinfo,int32_t M,int32_t N,int32_t da return ok!=1; } +void *bitcoin_ctx() +{ + void *ptr; + ptr = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); + secp256k1_pedersen_context_initialize(ptr); + secp256k1_rangeproof_context_initialize(ptr); + return(ptr); +} + void iguana_fixsecp(struct supernet_info *myinfo) { - myinfo->ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); - secp256k1_pedersen_context_initialize(myinfo->ctx); - secp256k1_rangeproof_context_initialize(myinfo->ctx); + int32_t i; + for (i=0; ictx)/sizeof(*myinfo->ctx); i++) + { + myinfo->ctx[i] = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); + secp256k1_pedersen_context_initialize(myinfo->ctx[i]); + secp256k1_rangeproof_context_initialize(myinfo->ctx[i]); + } } void libgfshare_init(struct supernet_info *myinfo,uint8_t _logs[256],uint8_t _exps[510]) { uint32_t i,x = 1; - myinfo->ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); - secp256k1_pedersen_context_initialize(myinfo->ctx); - secp256k1_rangeproof_context_initialize(myinfo->ctx); + for (i=0; ictx)/sizeof(*myinfo->ctx); i++) + { + myinfo->ctx[i] = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); + secp256k1_pedersen_context_initialize(myinfo->ctx[i]); + secp256k1_rangeproof_context_initialize(myinfo->ctx[i]); + } for (i=0; i<255; i++) { _exps[i] = x; diff --git a/iguana/main.c b/iguana/main.c index b3f9078f0..3444d336b 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -74,10 +74,14 @@ void SuperNET_hex2str(char *str,uint8_t *hex,int32_t len) init_hexbytes_noT(str,hex,len); } +void *bitcoin_ctx(); struct supernet_info *SuperNET_MYINFO(char *passphrase) { - if ( MYINFO.ctx == 0 ) + int32_t i; + if ( MYINFO.ctx[0] == 0 ) { + for (i=0; i Date: Wed, 18 Oct 2017 16:58:35 +0300 Subject: [PATCH 1155/2732] Test --- iguana/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/main.c b/iguana/main.c index 3444d336b..b4ff56136 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -71,7 +71,7 @@ int32_t SuperNET_str2hex(uint8_t *hex,char *str) void SuperNET_hex2str(char *str,uint8_t *hex,int32_t len) { - init_hexbytes_noT(str,hex,len); + init_hexbytes_noT(str,hex,len); } void *bitcoin_ctx(); From 443935c0525896e25133b5ab61df67d99b2a341f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 17:05:32 +0300 Subject: [PATCH 1156/2732] Test --- iguana/iguana_notary.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index c6f98f4f2..4e0015366 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -60,14 +60,14 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid) { - cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[35]; bits256 spenttxid; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; + cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[35]; bits256 spenttxid; uint64_t notarymask; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; if ( (txobj= dpow_gettransaction(myinfo,coin,txid)) != 0 ) { if ( (vins= jarray(&numvins,txobj,"vin")) != 0 ) { if ( numvins >= DPOW_MIN_ASSETCHAIN_SIGS ) { - numnotaries = 0; + notarymask = numnotaries = 0; for (i=0; i Date: Wed, 18 Oct 2017 17:15:37 +0300 Subject: [PATCH 1157/2732] Test --- iguana/dpow/dpow_network.c | 6 +++--- iguana/iguana777.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index c3e8ed36b..ac2f99918 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -2168,13 +2168,13 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) //printf("REP got %d crc.%08x\n",size,calc_crc32(0,(void *)dexp,size)); if ( (retstr= dex_response(&broadcastflag,myinfo,dexp)) != 0 ) { - signed_nn_send(myinfo,myinfo->ctx[1],myinfo->persistent_priv,myinfo->repsock,retstr,(int32_t)strlen(retstr)+1); + signed_nn_send(myinfo,myinfo->ctx[3],myinfo->persistent_priv,myinfo->repsock,retstr,(int32_t)strlen(retstr)+1); //printf("send back[%ld]\n",strlen(retstr)+1); free(retstr); if ( broadcastflag != 0 ) { printf("BROADCAST dexp request.[%d]\n",size); - signed_nn_send(myinfo,myinfo->ctx[1],myinfo->persistent_priv,myinfo->dexsock,dexp,size); + signed_nn_send(myinfo,myinfo->ctx[4],myinfo->persistent_priv,myinfo->dexsock,dexp,size); //signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->pubsock,dexp,size); } } @@ -2183,7 +2183,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) if ( (m= myinfo->numdpowipbits) > 0 ) { r = myinfo->dpowipbits[rand() % m]; - signed_nn_send(myinfo,myinfo->ctx[1],myinfo->persistent_priv,myinfo->repsock,&r,sizeof(r)); + signed_nn_send(myinfo,myinfo->ctx[5],myinfo->persistent_priv,myinfo->repsock,&r,sizeof(r)); printf("REP.%08x <- rand ip m.%d %x\n",dexp->crc32,m,r); } else printf("illegal state without dpowipbits?\n"); if ( dex_packetcheck(myinfo,dexp,size) == 0 ) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 62539d3d0..444565658 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -150,7 +150,7 @@ struct supernet_info struct queueitem *DEX_quotes; cJSON *Cunspents,*Cspends; struct basilisk_swap *swaps[256]; int32_t numswaps; struct basilisk_message *messagetable; portable_mutex_t messagemutex; queue_t msgQ,p2pQ; - void *ctx[4]; + void *ctx[8]; uint8_t *pingbuf; struct basilisk_request DEXaccept; FILE *dexfp; From 95e9808026aa1591a813696aa608a7ea3ce81bd4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 23:15:43 +0300 Subject: [PATCH 1158/2732] Add coin to has notarization --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/iguana_notary.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2365e1d9c..9037ee0e9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -22,8 +22,8 @@ // sign critical api calls (pubkey reg, listunspent, orders?) // // process stats.log local file -// handles <-> pubkeys -// deal with offline pubkeys, reputations, etc. +// +// handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN // verify portfolio, pricearray, interest to KMD withdraw diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 4e0015366..ed6d93c27 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -110,7 +110,7 @@ int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info * { if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) hasnotarization = 1; - printf("numnotaries.%d hasnotarization.%d\n",numnotaries,hasnotarization); + printf("numnotaries.%d %s hasnotarization.%d\n",numnotaries,coin->symbol,hasnotarization); } } } From 987b96ab64de236285dc0c94d2944d9705e8d877 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 12:41:11 +0300 Subject: [PATCH 1159/2732] Test --- iguana/dpow/dpow_network.c | 10 +++++----- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/iguana777.h | 2 +- iguana/iguana_mofn.c | 19 ++++++------------- iguana/main.c | 8 ++++---- includes/iguana_structs.h | 4 ++-- 6 files changed, 21 insertions(+), 28 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index ac2f99918..9899b9cac 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -170,7 +170,7 @@ int32_t signed_nn_recv(void **freeptrp,struct supernet_info *myinfo,uint8_t nota vcalc_sha256(0,packethash.bytes,(void *)&sigpacket->nonce,(int32_t)(sigpacket->packetlen+sizeof(sigpacket->nonce)+sizeof(sigpacket->packetlen))); if ( bits256_cmp(packethash,sigpacket->packethash) == 0 && sigpacket->packethash.bytes[0] == 0 ) { - if ( bitcoin_recoververify(myinfo->ctx[1],"nnrecv",sigpacket->sig64,sigpacket->packethash,pubkey33,33) == 0 ) + if ( bitcoin_recoververify(myinfo->ctx,"nnrecv",sigpacket->sig64,sigpacket->packethash,pubkey33,33) == 0 ) { char *notary0 = "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828"; // expand to official notaries @@ -2020,7 +2020,7 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_blo pfd.events = NN_POLLOUT; if ( nn_poll(&pfd,1,100) > 0 ) { - sentbytes = signed_nn_send(myinfo,myinfo->ctx[2],myinfo->persistent_priv,myinfo->dpowsock,np,size); + sentbytes = signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->dpowsock,np,size); break; } usleep(1000); @@ -2168,13 +2168,13 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) //printf("REP got %d crc.%08x\n",size,calc_crc32(0,(void *)dexp,size)); if ( (retstr= dex_response(&broadcastflag,myinfo,dexp)) != 0 ) { - signed_nn_send(myinfo,myinfo->ctx[3],myinfo->persistent_priv,myinfo->repsock,retstr,(int32_t)strlen(retstr)+1); + signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->repsock,retstr,(int32_t)strlen(retstr)+1); //printf("send back[%ld]\n",strlen(retstr)+1); free(retstr); if ( broadcastflag != 0 ) { printf("BROADCAST dexp request.[%d]\n",size); - signed_nn_send(myinfo,myinfo->ctx[4],myinfo->persistent_priv,myinfo->dexsock,dexp,size); + signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->dexsock,dexp,size); //signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->pubsock,dexp,size); } } @@ -2183,7 +2183,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) if ( (m= myinfo->numdpowipbits) > 0 ) { r = myinfo->dpowipbits[rand() % m]; - signed_nn_send(myinfo,myinfo->ctx[5],myinfo->persistent_priv,myinfo->repsock,&r,sizeof(r)); + signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->repsock,&r,sizeof(r)); printf("REP.%08x <- rand ip m.%d %x\n",dexp->crc32,m,r); } else printf("illegal state without dpowipbits?\n"); if ( dex_packetcheck(myinfo,dexp,size) == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9037ee0e9..83522cdc8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,11 +18,11 @@ // LP_nativeDEX.c // marketmaker // +// error if alice submits order too fast // dPoW security -> 4: KMD notarized, 5: BTC notarized +// new testchain // sign critical api calls (pubkey reg, listunspent, orders?) -// -// process stats.log local file -// +// process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 444565658..74412e6f0 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -150,7 +150,7 @@ struct supernet_info struct queueitem *DEX_quotes; cJSON *Cunspents,*Cspends; struct basilisk_swap *swaps[256]; int32_t numswaps; struct basilisk_message *messagetable; portable_mutex_t messagemutex; queue_t msgQ,p2pQ; - void *ctx[8]; + void *ctx; uint8_t *pingbuf; struct basilisk_request DEXaccept; FILE *dexfp; diff --git a/iguana/iguana_mofn.c b/iguana/iguana_mofn.c index 946833dd1..b4d34230d 100755 --- a/iguana/iguana_mofn.c +++ b/iguana/iguana_mofn.c @@ -249,24 +249,17 @@ void *bitcoin_ctx() void iguana_fixsecp(struct supernet_info *myinfo) { - int32_t i; - for (i=0; ictx)/sizeof(*myinfo->ctx); i++) - { - myinfo->ctx[i] = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); - secp256k1_pedersen_context_initialize(myinfo->ctx[i]); - secp256k1_rangeproof_context_initialize(myinfo->ctx[i]); - } + myinfo->ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); + secp256k1_pedersen_context_initialize(myinfo->ctx); + secp256k1_rangeproof_context_initialize(myinfo->ctx); } void libgfshare_init(struct supernet_info *myinfo,uint8_t _logs[256],uint8_t _exps[510]) { uint32_t i,x = 1; - for (i=0; ictx)/sizeof(*myinfo->ctx); i++) - { - myinfo->ctx[i] = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); - secp256k1_pedersen_context_initialize(myinfo->ctx[i]); - secp256k1_rangeproof_context_initialize(myinfo->ctx[i]); - } + myinfo->ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); + secp256k1_pedersen_context_initialize(myinfo->ctx); + secp256k1_rangeproof_context_initialize(myinfo->ctx); for (i=0; i<255; i++) { _exps[i] = x; diff --git a/iguana/main.c b/iguana/main.c index b4ff56136..85510c3fb 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -77,11 +77,11 @@ void SuperNET_hex2str(char *str,uint8_t *hex,int32_t len) void *bitcoin_ctx(); struct supernet_info *SuperNET_MYINFO(char *passphrase) { - int32_t i; - if ( MYINFO.ctx[0] == 0 ) + //int32_t i; + if ( MYINFO.ctx == 0 ) { - for (i=0; i Date: Thu, 19 Oct 2017 12:46:05 +0300 Subject: [PATCH 1160/2732] Test --- iguana/exchanges/LP_coins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 25d45a602..0f5cef6ee 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -195,8 +195,11 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) jaddstr(item,"wif",wifstr); else jaddstr(item,"wif","error creating wif"); } + jadd(item,"installed",coin->userpass[0] == 0 ? jfalse() : jtrue()); if ( coin->inactive != 0 ) + { jaddstr(item,"status","inactive"); + } else jaddstr(item,"status","active"); if ( coin->isPoS != 0 ) jaddstr(item,"type","PoS"); From 457a1028c0abaadc9879914e1135f6d0afee6956 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 12:49:09 +0300 Subject: [PATCH 1161/2732] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f2ce4ff9d..4d83eeb7c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -771,11 +771,11 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) initonly = (passphrase != 0); memset(privkey.bytes,0,sizeof(privkey)); memset(pubkey.bytes,0,sizeof(pubkey)); - printf("Total coins: %d\n", HASH_COUNT(LP_coins)); - int num_iter = 0; + //printf("Total coins: %d\n", HASH_COUNT(LP_coins)); + //int num_iter = 0; HASH_ITER(hh,LP_coins,coin,tmp) { - printf("LP_privkey_updates [%02d / %02d]\n", num_iter++, HASH_COUNT(LP_coins)); + //printf("LP_privkey_updates [%02d / %02d]\n", num_iter++, HASH_COUNT(LP_coins)); if ( initonly != 0 ) { coin->counter = 0; From efbb5214853002bc2eb6ac379645a3b9edb4dd98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 13:05:03 +0300 Subject: [PATCH 1162/2732] Test --- iguana/exchanges/LP_coins.c | 2 ++ iguana/exchanges/LP_include.h | 1 + 2 files changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 0f5cef6ee..f1bcef3de 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -196,6 +196,8 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) else jaddstr(item,"wif","error creating wif"); } jadd(item,"installed",coin->userpass[0] == 0 ? jfalse() : jtrue()); + jaddnum(item,"height",LP_getheight(coin)); + if ( coin->inactive != 0 ) { jaddstr(item,"status","inactive"); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c18048077..a8890ac04 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -299,6 +299,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); int32_t LP_reserved_msgs(); +int32_t LP_getheight(struct iguana_info *coin); int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); From 1ffbaac87e7cb3fe49c6da5946f4b9c5ab48f1ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 13:09:52 +0300 Subject: [PATCH 1163/2732] Test --- iguana/exchanges/LP_rpc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 18a7c89e1..7620591c7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -203,7 +203,7 @@ cJSON *LP_assethbla(char *assetid) int32_t LP_getheight(struct iguana_info *coin) { - cJSON *retjson; char *method = "getinfo"; int32_t height; + cJSON *retjson; char *retstr,*method = "getinfo"; int32_t height; if ( coin == 0 ) return(-1); height = coin->height; @@ -211,11 +211,16 @@ int32_t LP_getheight(struct iguana_info *coin) { if ( strcmp(coin->symbol,"BTC") == 0 ) method = "getblockchaininfo"; - if ( (retjson= bitcoin_json(coin,method,"[]")) != 0 ) + retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,"[]"); + printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,"[]",retstr); + if ( retstr != 0 && retstr[0] != 0 ) { + retjson = cJSON_Parse(retstr); coin->height = height = jint(retjson,"blocks"); free_json(retjson); - coin->heighttime = (uint32_t)time(NULL); + if ( coin->height > 0 ) + coin->heighttime = (uint32_t)time(NULL); + free(retstr); } } return(height); From b3fec41a1459f304d8777e4737f4a0a8c2fff566 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 13:14:20 +0300 Subject: [PATCH 1164/2732] Test --- iguana/exchanges/LP_coins.c | 4 +++- iguana/exchanges/LP_rpc.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index f1bcef3de..7b0d71693 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -196,7 +196,9 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) else jaddstr(item,"wif","error creating wif"); } jadd(item,"installed",coin->userpass[0] == 0 ? jfalse() : jtrue()); - jaddnum(item,"height",LP_getheight(coin)); + if ( coin->userpass[0] != 0 ) + jaddnum(item,"height",LP_getheight(coin)); + else jaddnum(item,"height",-1); if ( coin->inactive != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7620591c7..5d96b956b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -212,7 +212,6 @@ int32_t LP_getheight(struct iguana_info *coin) if ( strcmp(coin->symbol,"BTC") == 0 ) method = "getblockchaininfo"; retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,"[]"); - printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,"[]",retstr); if ( retstr != 0 && retstr[0] != 0 ) { retjson = cJSON_Parse(retstr); From 840adc15628f395e18b299dba1463d43a7101834 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 13:22:22 +0300 Subject: [PATCH 1165/2732] Test --- iguana/exchanges/LP_coins.c | 10 ++++++++-- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_rpc.c | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 7b0d71693..586154564 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -197,9 +197,15 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) } jadd(item,"installed",coin->userpass[0] == 0 ? jfalse() : jtrue()); if ( coin->userpass[0] != 0 ) + { jaddnum(item,"height",LP_getheight(coin)); - else jaddnum(item,"height",-1); - + jaddnum(item,"balance",dstr(LP_smartbalance(coin))); + } + else + { + jaddnum(item,"height",-1); + jaddnum(item,"balance",0); + } if ( coin->inactive != 0 ) { jaddstr(item,"status","inactive"); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a8890ac04..b4530087b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -299,6 +299,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); int32_t LP_reserved_msgs(); +uint64_t LP_smartbalance(struct iguana_info *coin); int32_t LP_getheight(struct iguana_info *coin); int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5d96b956b..b81fb35f6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -225,6 +225,29 @@ int32_t LP_getheight(struct iguana_info *coin) return(height); } +uint64_t LP_smartbalance(struct iguana_info *coin) +{ + cJSON *array,*item; char buf[512],*retstr; int32_t i,n; uint64_t valuesum,value; + valuesum = 0; + sprintf(buf,"[0, 99999999, [\"%s\"]]",coin->smartaddr); + retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"listunspent","[]"); + if ( retstr != 0 && retstr[0] != 0 ) + { + array = cJSON_Parse(retstr); + if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i Date: Thu, 19 Oct 2017 13:28:03 +0300 Subject: [PATCH 1166/2732] Test --- iguana/exchanges/LP_coins.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 586154564..5dbc20b49 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -186,7 +186,6 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) { struct electrum_info *ep; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); - jaddnum(item,"height",coin->height); if ( showwif != 0 ) { bitcoin_priv2wif(coin->wiftaddr,wifstr,G.LP_mypriv25519,coin->wiftype); From f4b76a93cbcde9f44a037b1a0b778f98725b56c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 14:10:07 +0300 Subject: [PATCH 1167/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d1982812b..3a1a84de4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1057,6 +1057,14 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) timeout = LP_AUTOTRADE_TIMEOUT; + if ( time(NULL) < Alice_expiration ) + return(clonestr("{\"error\":\"only one pending request at a time\"}")); + else + { + Alice_expiration = 0; + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + LP_Alicemaxprice = 0.; + } if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); //if ( strcmp("BTC",rel) == 0 ) From d1220393b7bd74a57773edf46c6e26460a97c322 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 14:40:41 +0300 Subject: [PATCH 1168/2732] Test --- iguana/dPoW.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_ordermatch.c | 1 + iguana/iguana_notary.c | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index b95c550f7..ba9e5c00e 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -134,7 +134,7 @@ struct dpow_info struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE]; struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; bits256 activehash,lastnotarized,srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; - uint32_t SRCREALTIME,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; + uint32_t SRCREALTIME,lastsrcupdate,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; struct pax_transaction *PAX; portable_mutex_t paxmutex,dexmutex; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 83522cdc8..ea317996d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,7 +18,6 @@ // LP_nativeDEX.c // marketmaker // -// error if alice submits order too fast // dPoW security -> 4: KMD notarized, 5: BTC notarized // new testchain // sign critical api calls (pubkey reg, listunspent, orders?) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3a1a84de4..5124c073d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -816,6 +816,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo { memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; + Alice_expiration = 0; LP_query(ctx,myipaddr,mypubsock,"connect",qp); } } diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index ed6d93c27..10744b6b5 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -318,11 +318,12 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); } } - else + else if ( time(NULL) > dp->lastsrcupdate+60 ) { dp->lastheight = height; blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime); + dp->lastsrcupdate = (uint32_t)time(NULL); } } //else printf("error getchaintip for %s\n",dp->symbol); } else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest); From 21b572bb51c2bf697db747405af44726e21d0305 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 14:42:07 +0300 Subject: [PATCH 1169/2732] Test --- iguana/iguana_notary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 10744b6b5..aba869865 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -318,12 +318,12 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); } } - else if ( time(NULL) > dp->lastsrcupdate+60 ) + else if ( time(NULL) > dp->lastsrcupdate+60 || height != dp->lastheight ) { + dp->lastsrcupdate = (uint32_t)time(NULL); dp->lastheight = height; blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime); - dp->lastsrcupdate = (uint32_t)time(NULL); } } //else printf("error getchaintip for %s\n",dp->symbol); } else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest); From a9bce5b3c6d8ed4be7d008f2fd252a3cd67e2766 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 15:00:28 +0300 Subject: [PATCH 1170/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_swap.c | 2 ++ iguana/exchanges/LP_transaction.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ea317996d..43db6df03 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // dPoW security -> 4: KMD notarized, 5: BTC notarized +// locktime to fee // new testchain // sign critical api calls (pubkey reg, listunspent, orders?) // process stats.log local file -> map of realtime activity! diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index c7f4cd457..9118b4b49 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1097,6 +1097,8 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + swap->alicecoin.txfee,0,0,jumblrflag); alicepub33 = pubkey33; } + swap->myfee.I.locktime = swap->I.started + 1; + swap->otherfee.I.locktime = swap->I.started + 1; basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin.txfee,4,0,jumblrflag); basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); swap->bobrefund.I.suppress_pubkeys = 1; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ff032f126..eaf6414f4 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1630,7 +1630,7 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data { if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) { - printf("otherfee amount %.8f -> %s vs %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr); + printf("otherfee amount %.8f -> %s vs %s locktime %u vs %u\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr,swap->otherfee.I.locktime,swap->I.started+1); if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) { printf("dexfee verified\n"); From 11c4c68e9b357d6567e8224fbfc0fca048402e11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 15:37:37 +0300 Subject: [PATCH 1171/2732] Test --- iguana/m_mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/m_mm b/iguana/m_mm index f124ecaa1..b5ba405ca 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -1,3 +1,3 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; ./m_LP; cd ../iguana -gcc -pg -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm +gcc -g -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm From 3b8123d23c511bdc39576b11ff41f0d167254ae8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 15:42:34 +0300 Subject: [PATCH 1172/2732] Test --- iguana/exchanges/sell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/sell b/iguana/exchanges/sell index 6410148c8..fccc4d61e 100755 --- a/iguana/exchanges/sell +++ b/iguana/exchanges/sell @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"BTC\",\"basevolume\":10.0\"price\":0.0005}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"BTC\",\"basevolume\":10.0\",price\":0.0005}" From b6e8792a3388aff9d9606bba6b8f1e41580602f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 15:58:42 +0300 Subject: [PATCH 1173/2732] Enforce dexfee lock time --- iguana/exchanges/LP_transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index eaf6414f4..0c45df38c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1633,9 +1633,11 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data printf("otherfee amount %.8f -> %s vs %s locktime %u vs %u\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr,swap->otherfee.I.locktime,swap->I.started+1); if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) { - printf("dexfee verified\n"); + if ( swap->otherfee.I.locktime == swap->I.started+1 ) + printf("dexfee verified\n"); + else printf("locktime mismatch in otherfee, reject %u vs %u\n",swap->otherfee.I.locktime,swap->I.started+1); return(0); - } + } else printf("destaddress mismatch in other fee, reject (%s) vs (%s)\n",swap->otherfee.I.destaddr,swap->otherfee.p2shaddr); } return(-1); } From c4ceb558a8a2365c0ac1541ee94bd361d742bcc3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 16:32:34 +0300 Subject: [PATCH 1174/2732] Test --- iguana/dpow/dpow_rpc.c | 2 +- iguana/exchanges/LP_commands.c | 6 +++++- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_ordermatch.c | 6 ++++++ iguana/exchanges/LP_prices.c | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index f69d68886..6da004617 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -394,7 +394,7 @@ cJSON *dpow_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,ch char buf[128],*retstr; cJSON *array,*json = 0; if ( coin->FULLNODE < 0 ) { - sprintf(buf,"0, 99999999, [\"%s\"]",coinaddr); + sprintf(buf,"1, 99999999, [\"%s\"]",coinaddr); if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"listunspent",buf)) != 0 ) { json = cJSON_Parse(retstr); diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c57e9b3fd..8cad0c58c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -436,7 +436,10 @@ stop()\n\ } } if ( strcmp(method,"postprice") == 0 ) + { + // LP_checksig retstr = LP_postedprice(argjson); + } else if ( strcmp(method,"postutxos") == 0 ) retstr = LP_postedutxos(argjson); else if ( strcmp(method,"getprices") == 0 ) @@ -496,7 +499,7 @@ stop()\n\ //printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) { - char *coinaddr; //cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; + char *coinaddr; if ( (coinaddr= jstr(argjson,"address")) != 0 ) { if ( coinaddr[0] != 0 ) @@ -535,6 +538,7 @@ stop()\n\ { char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; pub = jbits256(argjson,"pub"); + // LP_checksig if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) { if ( (pubp= LP_pubkeyadd(pub)) != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 43db6df03..fcaaf1ee3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,10 +18,9 @@ // LP_nativeDEX.c // marketmaker // +// sign critical api calls (pubkey reg, listunspent, orders?) // dPoW security -> 4: KMD notarized, 5: BTC notarized -// locktime to fee // new testchain -// sign critical api calls (pubkey reg, listunspent, orders?) // process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5124c073d..86fcecf50 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -222,6 +222,7 @@ char *LP_quotereceived(cJSON *argjson) char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { bits256 zero; cJSON *reqjson = cJSON_CreateObject(); + // LP_addsig memset(zero.bytes,0,sizeof(zero)); jaddbits256(reqjson,"pubkey",G.LP_mypub25519); jaddstr(reqjson,"base",base); @@ -235,6 +236,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re void LP_notify_pubkeys(void *ctx,int32_t pubsock) { bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); + // LP_addsig memset(zero.bytes,0,sizeof(zero)); jaddstr(reqjson,"method","notify"); jaddstr(reqjson,"rmd160",G.LP_myrmd160str); @@ -396,6 +398,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); + // LP_addsig printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); @@ -605,6 +608,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jaddstr(retjson,"pair",pairstr); jaddnum(retjson,"requestid",qp->R.requestid); jaddnum(retjson,"quoteid",qp->R.quoteid); + // LP_addsig char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,1)); retval = 0; @@ -827,6 +831,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { + // LP_checksig LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); @@ -934,6 +939,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, msg = jprint(retjson,1); butxo->T.lasttime = (uint32_t)time(NULL); printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); + // LP_addsig LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 58bb302ed..91b4d29cb 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -845,6 +845,7 @@ char *LP_pricestr(char *base,char *rel,double origprice) if ( LP_pricevalid(price) > 0 ) { retjson = cJSON_CreateObject(); + // LP_addsig jaddstr(retjson,"result","success"); jaddstr(retjson,"method","postprice"); jaddbits256(retjson,"pubkey",G.LP_mypub25519); From ec0bfea29545e6b3b49fb5c7ebf67df647b26092 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 21:41:40 +0300 Subject: [PATCH 1175/2732] Test --- iguana/dpow/dpow_fsm.c | 4 ++-- iguana/iguana_notary.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 848b87bf9..effcf3914 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -449,8 +449,8 @@ void dpow_statemachinestart(void *ptr) } else { - dp->lastnotarized = bp->srctxid; - printf("notarized %s %s\n",dp->symbol,bits256_str(str,bp->srctxid)); + dp->lastnotarized = checkpoint.blockhash.hash; + printf("notarized %s %s\n",dp->symbol,bits256_str(str,checkpoint.blockhash.hash)); } if ( 0 && dp->cancelratify != 0 && bp->isratify != 0 ) { diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index aba869865..c3c7a415c 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -556,7 +556,7 @@ STRING_ARG(iguana,addnotary,ipaddr) char NOTARY_CURRENCIES[][16] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", - "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "LTC", "MNZ" }; + "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "MNZ" }; // "LTC", ZERO_ARGS(dpow,notarychains) { From f00598665fd2a6debf6525ff0781523540d734df Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:21:55 +0300 Subject: [PATCH 1176/2732] Check notarizations --- iguana/exchanges/LP_commands.c | 13 +++ iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_rpc.c | 190 +++++++++++++++++++++++++++++++++ 3 files changed, 204 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8cad0c58c..d6b7eb916 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -222,6 +222,19 @@ stop()\n\ else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } + else if ( strcmp(method,"notarizations") == 0 ) + { + int32_t height; + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + height = LP_notarization_latest(ptr); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddnum(retjson,"lastnotarization",height); + return(jprint(retjson,1)); + } else return(clonestr("{\"error\":\"cant find coin\"}")); + + } else if ( strcmp(method,"autoprice") == 0 ) { //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b4530087b..b8f68e492 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -26,6 +26,7 @@ #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL +#define DPOW_MIN_ASSETCHAIN_SIGS 11 #define LP_ENCRYPTED_MAXSIZE (4096 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) #define LP_MAXPUBKEY_ERRORS 3 diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b81fb35f6..dc50f6fdc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -814,6 +814,22 @@ uint64_t LP_txfee(char *symbol) return(txfee); } +bits256 LP_getbestblockhash(struct iguana_info *coin) +{ + char *retstr; bits256 blockhash; + memset(blockhash.bytes,0,sizeof(blockhash)); + if ( coin->electrum == 0 ) + { + if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"getbestblockhash","")) != 0 ) + { + if ( is_hexstr(retstr,0) == sizeof(blockhash)*2 ) + decode_hex(blockhash.bytes,sizeof(blockhash),retstr); + free(retstr); + } + } + return(blockhash); +} + char *LP_blockhashstr(char *symbol,int32_t height) { cJSON *array; char *paramstr,*retstr; struct iguana_info *coin; @@ -877,3 +893,177 @@ cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t hei return(json); } +const char *Notaries_elected[][2] = +{ + { "0_jl777_testA", "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, + { "0_jl777_testB", "02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" }, + { "0_kolo_testA", "0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec" }, + { "artik_AR", "029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" }, + { "artik_EU", "03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" }, + { "artik_NA", "0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" }, + { "artik_SH", "02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937" }, + { "badass_EU", "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, + { "badass_NA", "02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7" }, + { "badass_SH", "026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b" }, + { "crackers_EU", "03bc819982d3c6feb801ec3b720425b017d9b6ee9a40746b84422cbbf929dc73c3" }, // 10 + { "crackers_NA", "03205049103113d48c7c7af811b4c8f194dafc43a50d5313e61a22900fc1805b45" }, + { "crackers_SH", "02be28310e6312d1dd44651fd96f6a44ccc269a321f907502aae81d246fabdb03e" }, + { "durerus_EU", "02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57" }, + { "etszombi_AR", "031c79168d15edabf17d9ec99531ea9baa20039d0cdc14d9525863b83341b210e9" }, + { "etszombi_EU", "0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7" }, + { "etszombi_SH", "025d7a193c0757f7437fad3431f027e7b5ed6c925b77daba52a8755d24bf682dde" }, + { "farl4web_EU", "0300ecf9121cccf14cf9423e2adb5d98ce0c4e251721fa345dec2e03abeffbab3f" }, + { "farl4web_SH", "0396bb5ed3c57aa1221d7775ae0ff751e4c7dc9be220d0917fa8bbdf670586c030" }, + { "fullmoon_AR", "0254b1d64840ce9ff6bec9dd10e33beb92af5f7cee628f999cb6bc0fea833347cc" }, + { "fullmoon_NA", "031fb362323b06e165231c887836a8faadb96eda88a79ca434e28b3520b47d235b" }, // 20 + { "fullmoon_SH", "030e12b42ec33a80e12e570b6c8274ce664565b5c3da106859e96a7208b93afd0d" }, + { "grewal_NA", "03adc0834c203d172bce814df7c7a5e13dc603105e6b0adabc942d0421aefd2132" }, + { "grewal_SH", "03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68" }, + { "indenodes_AR", "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, + { "indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, + { "indenodes_NA", "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, + { "indenodes_SH", "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, + { "jeezy_EU", "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" }, + { "jsgalt_NA", "027b3fb6fede798cd17c30dbfb7baf9332b3f8b1c7c513f443070874c410232446" }, + { "karasugoi_NA", "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, // 30 + { "kashifali_EU", "033777c52a0190f261c6f66bd0e2bb299d30f012dcb8bfff384103211edb8bb207" }, + { "kolo_AR", "03016d19344c45341e023b72f9fb6e6152fdcfe105f3b4f50b82a4790ff54e9dc6" }, + { "kolo_SH", "02aa24064500756d9b0959b44d5325f2391d8e95c6127e109184937152c384e185" }, + { "metaphilibert_AR", "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, + { "movecrypto_AR", "022783d94518e4dc77cbdf1a97915b29f427d7bc15ea867900a76665d3112be6f3" }, + { "movecrypto_EU", "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" }, + { "movecrypto_NA", "02efb12f4d78f44b0542d1c60146738e4d5506d27ec98a469142c5c84b29de0a80" }, + { "movecrypto_SH", "031f9739a3ebd6037a967ce1582cde66e79ea9a0551c54731c59c6b80f635bc859" }, + { "muros_AR", "022d77402fd7179335da39479c829be73428b0ef33fb360a4de6890f37c2aa005e" }, + { "noashh_AR", "029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" }, // 40 + { "noashh_EU", "02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" }, + { "noashh_NA", "033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1" }, + { "nxtswe_EU", "032fb104e5eaa704a38a52c126af8f67e870d70f82977e5b2f093d5c1c21ae5899" }, + { "polycryptoblog_NA", "02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" }, + { "pondsea_AR", "032e1c213787312099158f2d74a89e8240a991d162d4ce8017d8504d1d7004f735" }, + { "pondsea_EU", "0225aa6f6f19e543180b31153d9e6d55d41bc7ec2ba191fd29f19a2f973544e29d" }, + { "pondsea_NA", "031bcfdbb62268e2ff8dfffeb9ddff7fe95fca46778c77eebff9c3829dfa1bb411" }, + { "pondsea_SH", "02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" }, + { "popcornbag_AR", "02761f106fb34fbfc5ddcc0c0aa831ed98e462a908550b280a1f7bd32c060c6fa3" }, + { "popcornbag_NA", "03c6085c7fdfff70988fda9b197371f1caf8397f1729a844790e421ee07b3a93e8" }, // 50 + { "ptytrader_NA", "0328c61467148b207400b23875234f8a825cce65b9c4c9b664f47410b8b8e3c222" }, + { "ptytrader_SH", "0250c93c492d8d5a6b565b90c22bee07c2d8701d6118c6267e99a4efd3c7748fa4" }, + { "rnr_AR", "029bdb08f931c0e98c2c4ba4ef45c8e33a34168cb2e6bf953cef335c359d77bfcd" }, + { "rnr_EU", "03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b" }, + { "rnr_NA", "02e17c5f8c3c80f584ed343b8dcfa6d710dfef0889ec1e7728ce45ce559347c58c" }, + { "rnr_SH", "037536fb9bdfed10251f71543fb42679e7c52308bcd12146b2568b9a818d8b8377" }, + { "titomane_AR", "03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185" }, + { "titomane_EU", "02e41feded94f0cc59f55f82f3c2c005d41da024e9a805b41105207ef89aa4bfbd" }, + { "titomane_SH", "035f49d7a308dd9a209e894321f010d21b7793461b0c89d6d9231a3fe5f68d9960" }, + { "vanbreuk_EU", "024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" }, // 60 + { "xrobesx_NA", "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, + { "xxspot1_XX", "02ef445a392fcaf3ad4176a5da7f43580e8056594e003eba6559a713711a27f955" }, + { "xxspot2_XX", "03d85b221ea72ebcd25373e7961f4983d12add66a92f899deaf07bab1d8b6f5573" } +}; + +int32_t LP_txhasnotarization(struct iguana_info *coin,bits256 txid) +{ + cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[35]; bits256 spenttxid; uint64_t notarymask; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) + { + if ( (vins= jarray(&numvins,txobj,"vin")) != 0 ) + { + if ( numvins >= DPOW_MIN_ASSETCHAIN_SIGS ) + { + notarymask = numnotaries = 0; + for (i=0; isymbol,spenttxid)) != 0 ) + { + if ( (vouts= jarray(&numvouts,spentobj,"vout")) != 0 ) + { + if ( spentvout < numvouts ) + { + vout = jitem(vouts,spentvout); + if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) == sizeof(script)*2 ) + { + len >>= 1; + decode_hex(script,len,hexstr); + if ( script[0] == 33 && script[34] == 0xac ) + { + for (j=0; j 0 ) + { + if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) + hasnotarization = 1; + printf("numnotaries.%d %s hasnotarization.%d\n",numnotaries,coin->symbol,hasnotarization); + } + } + } + free_json(txobj); + } + return(hasnotarization); +} + +int32_t LP_hasnotarization(struct iguana_info *coin,cJSON *blockjson) +{ + int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; + if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) + { + for (i=0; isymbol,blockhash)) != 0 ) + { + if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) + height = jint(blockjson,"height"); + else + { + blockhash = jbits256(blockjson,"previousblockhash"); + if ( bits256_nonz(blockhash) == 0 ) + { + free_json(blockjson); + break; + } + } + free_json(blockjson); + if ( height > 0 ) + break; + } + } else break; + } + return(height); +} From 1cb0609cb193ed3caa9d60395789e1f16448cc7e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:22:59 +0300 Subject: [PATCH 1177/2732] Test --- iguana/exchanges/notarizations | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 iguana/exchanges/notarizations diff --git a/iguana/exchanges/notarizations b/iguana/exchanges/notarizations new file mode 100755 index 000000000..9484aa5e0 --- /dev/null +++ b/iguana/exchanges/notarizations @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"notarizations\",\"coin\":\"$1\"}" From 78dfd8926d0108b843eb71774e69f9001e0fc012 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:31:12 +0300 Subject: [PATCH 1178/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_rpc.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d6b7eb916..ad7afcc73 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -225,6 +225,7 @@ stop()\n\ else if ( strcmp(method,"notarizations") == 0 ) { int32_t height; + printf("notarizations (%s)\n",coin); if ( (ptr= LP_coinsearch(coin)) != 0 ) { height = LP_notarization_latest(ptr); @@ -233,7 +234,6 @@ stop()\n\ jaddnum(retjson,"lastnotarization",height); return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"cant find coin\"}")); - } else if ( strcmp(method,"autoprice") == 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index dc50f6fdc..4eabea042 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1039,6 +1039,8 @@ int32_t LP_hasnotarization(struct iguana_info *coin,cJSON *blockjson) int32_t LP_notarization_latest(struct iguana_info *coin) { cJSON *blockjson; bits256 blockhash; int32_t height=-1,hasnotarization; + if ( coin->isassetchain == 0 ) + return(-1); memset(blockhash.bytes,0,sizeof(blockhash)); while ( 1 ) { From 6f590cc630f02675ab5a6e7553ded92a062cb4db Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:33:14 +0300 Subject: [PATCH 1179/2732] Test --- iguana/exchanges/LP_commands.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ad7afcc73..acd0769fb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -193,6 +193,18 @@ stop()\n\ return(jprint(retjson,1)); } } + else if ( strcmp(method,"notarizations") == 0 ) + { + int32_t height; + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + height = LP_notarization_latest(ptr); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddnum(retjson,"lastnotarization",height); + return(jprint(retjson,1)); + } else return(clonestr("{\"error\":\"cant find coin\"}")); + } else if ( strcmp(method,"portfolio") == 0 ) { return(LP_portfolio()); @@ -222,19 +234,6 @@ stop()\n\ else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } - else if ( strcmp(method,"notarizations") == 0 ) - { - int32_t height; - printf("notarizations (%s)\n",coin); - if ( (ptr= LP_coinsearch(coin)) != 0 ) - { - height = LP_notarization_latest(ptr); - retjson = cJSON_CreateObject(); - jaddstr(retjson,"result","success"); - jaddnum(retjson,"lastnotarization",height); - return(jprint(retjson,1)); - } else return(clonestr("{\"error\":\"cant find coin\"}")); - } else if ( strcmp(method,"autoprice") == 0 ) { //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); From 06d0930fa72b7655b3505c1de318dda4e907f983 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:35:47 +0300 Subject: [PATCH 1180/2732] Test --- iguana/exchanges/LP_rpc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4eabea042..dc50f6fdc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1039,8 +1039,6 @@ int32_t LP_hasnotarization(struct iguana_info *coin,cJSON *blockjson) int32_t LP_notarization_latest(struct iguana_info *coin) { cJSON *blockjson; bits256 blockhash; int32_t height=-1,hasnotarization; - if ( coin->isassetchain == 0 ) - return(-1); memset(blockhash.bytes,0,sizeof(blockhash)); while ( 1 ) { From 315ce2def2fc64147f0f5b2a51104c778ffb8d86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:36:18 +0300 Subject: [PATCH 1181/2732] Test --- iguana/exchanges/LP_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index dc50f6fdc..31b038ae1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1046,6 +1046,7 @@ int32_t LP_notarization_latest(struct iguana_info *coin) blockhash = LP_getbestblockhash(coin); if ( bits256_nonz(blockhash) != 0 ) { + char str[65]; printf("check %s\n",bits256_str(str,blockhash)); if ( (blockjson= LP_getblock(coin->symbol,blockhash)) != 0 ) { if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) From 7f7012fe192bd239c3644defc9c0b319e897d5c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:39:46 +0300 Subject: [PATCH 1182/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 31b038ae1..1d7572f16 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1050,12 +1050,16 @@ int32_t LP_notarization_latest(struct iguana_info *coin) if ( (blockjson= LP_getblock(coin->symbol,blockhash)) != 0 ) { if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) + { height = jint(blockjson,"height"); + printf("height.%d\n",height); + } else { blockhash = jbits256(blockjson,"previousblockhash"); if ( bits256_nonz(blockhash) == 0 ) { + printf("null prev.(%s)\n",jprint(blockjson,0)); free_json(blockjson); break; } From 7707c8f85db91ac44497ca7db91962f519fe3893 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:44:19 +0300 Subject: [PATCH 1183/2732] Test --- iguana/exchanges/LP_commands.c | 5 +++-- iguana/exchanges/LP_rpc.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index acd0769fb..cc4b8359d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -195,13 +195,14 @@ stop()\n\ } else if ( strcmp(method,"notarizations") == 0 ) { - int32_t height; + int32_t height,bestheight; if ( (ptr= LP_coinsearch(coin)) != 0 ) { - height = LP_notarization_latest(ptr); + height = LP_notarization_latest(&bestheight,ptr); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddnum(retjson,"lastnotarization",height); + jaddnum(retjson,"bestheight",bestheight); return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"cant find coin\"}")); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1d7572f16..6ec086991 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1036,7 +1036,7 @@ int32_t LP_hasnotarization(struct iguana_info *coin,cJSON *blockjson) return(hasnotarization); } -int32_t LP_notarization_latest(struct iguana_info *coin) +int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) { cJSON *blockjson; bits256 blockhash; int32_t height=-1,hasnotarization; memset(blockhash.bytes,0,sizeof(blockhash)); @@ -1049,6 +1049,8 @@ int32_t LP_notarization_latest(struct iguana_info *coin) char str[65]; printf("check %s\n",bits256_str(str,blockhash)); if ( (blockjson= LP_getblock(coin->symbol,blockhash)) != 0 ) { + if ( *bestheightp < 0 ) + *bestheightp = jint(blockjson,"height"); if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) { height = jint(blockjson,"height"); From 8eedabfbac514677138fb4ee286c763b5837a9a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:45:38 +0300 Subject: [PATCH 1184/2732] Test --- iguana/exchanges/LP_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 6ec086991..a71e28ad9 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1039,6 +1039,7 @@ int32_t LP_hasnotarization(struct iguana_info *coin,cJSON *blockjson) int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) { cJSON *blockjson; bits256 blockhash; int32_t height=-1,hasnotarization; + *bestheightp = -1; memset(blockhash.bytes,0,sizeof(blockhash)); while ( 1 ) { From 3baf761edddbdf68d2e8d58e20e23894275fa5c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Oct 2017 22:50:32 +0300 Subject: [PATCH 1185/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_rpc.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index cc4b8359d..944f29520 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -201,6 +201,7 @@ stop()\n\ height = LP_notarization_latest(&bestheight,ptr); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); + jaddstr(retjson,"coin",coin); jaddnum(retjson,"lastnotarization",height); jaddnum(retjson,"bestheight",bestheight); return(jprint(retjson,1)); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a71e28ad9..3ccc412ae 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -995,7 +995,7 @@ int32_t LP_txhasnotarization(struct iguana_info *coin,bits256 txid) { if ( ((1LL << j) & notarymask) == 0 ) { - printf("n%d ",j); + //printf("n%d ",j); numnotaries++; notarymask |= (1LL << j); break; @@ -1013,7 +1013,7 @@ int32_t LP_txhasnotarization(struct iguana_info *coin,bits256 txid) { if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) hasnotarization = 1; - printf("numnotaries.%d %s hasnotarization.%d\n",numnotaries,coin->symbol,hasnotarization); + //printf("numnotaries.%d %s hasnotarization.%d\n",numnotaries,coin->symbol,hasnotarization); } } } @@ -1047,7 +1047,7 @@ int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) blockhash = LP_getbestblockhash(coin); if ( bits256_nonz(blockhash) != 0 ) { - char str[65]; printf("check %s\n",bits256_str(str,blockhash)); + //char str[65]; printf("check %s\n",bits256_str(str,blockhash)); if ( (blockjson= LP_getblock(coin->symbol,blockhash)) != 0 ) { if ( *bestheightp < 0 ) @@ -1055,7 +1055,7 @@ int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) { height = jint(blockjson,"height"); - printf("height.%d\n",height); + //printf("height.%d\n",height); } else { From bdfd1feb5b1fec55051dc36bf6dc6a6138ae97cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 02:54:48 +0300 Subject: [PATCH 1186/2732] Other path test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fcaaf1ee3..65e6941f3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +//printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); // sign critical api calls (pubkey reg, listunspent, orders?) // dPoW security -> 4: KMD notarized, 5: BTC notarized // new testchain diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 86fcecf50..813254c6c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -895,6 +895,10 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else { printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); + value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + if ( (butxo= LP_utxoadd(1,coin->symbol,butxo->payment.txid,butxo->payment.vout,value,butxo->deposit.txid,butxo->deposit.vout,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) + printf("couldnt create bob's utxopair\n"); } } if ( butxo == 0 || butxo == &B ) From 1ae7638eb2bc5cb295ab37402c57d4de270d0275 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 04:12:26 +0300 Subject: [PATCH 1187/2732] Remove zen --- iguana/exchanges/LP_nativeDEX.c | 2 -- iguana/exchanges/coins | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 65e6941f3..e92bee830 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,10 +18,8 @@ // LP_nativeDEX.c // marketmaker // -//printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); // sign critical api calls (pubkey reg, listunspent, orders?) // dPoW security -> 4: KMD notarized, 5: BTC notarized -// new testchain // process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index f5c3a21d4..d08cf1a4c 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,3 +1,3 @@ -export coins="[{\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" - +#{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, From 83482a8a3106f529aaa2999c4d6a9d075bdc9aa5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 13:26:31 +0300 Subject: [PATCH 1188/2732] KMDvalue --- iguana/exchanges/LP_coins.c | 6 ++++-- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_prices.c | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 5dbc20b49..a839b463b 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -184,7 +184,7 @@ uint16_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot, cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) { - struct electrum_info *ep; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); + struct electrum_info *ep; uint64_t balance; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); if ( showwif != 0 ) { @@ -198,7 +198,9 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) if ( coin->userpass[0] != 0 ) { jaddnum(item,"height",LP_getheight(coin)); - jaddnum(item,"balance",dstr(LP_smartbalance(coin))); + balance =LP_smartbalance(coin); + jaddnum(item,"balance",dstr(balance)); + jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance))); } else { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b8f68e492..d53602a4a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -320,6 +320,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_numpeers(); +uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance); int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); void LP_smartutxos_push(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 91b4d29cb..ceb8c96ba 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -833,6 +833,41 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) return(jprint(retjson,1)); } +uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance) +{ + cJSON *bids,*asks,*orderbook,*item; double bid=0,ask=0,price = 0.; int32_t numasks,numbids; char *retstr; uint64_t KMDvalue=0; + if ( balance != 0 ) + { + if ( strcmp(coin->symbol,"KMD") == 0 ) + KMDvalue = balance; + else if ( (retstr= LP_orderbook(coin->symbol,"KMD",0)) != 0 ) + { + if ( (orderbook= cJSON_Parse(retstr)) != 0 ) + { + if ( (asks= jarray(&numasks,orderbook,"asks")) != 0 && numasks > 0 ) + { + item = jitem(asks,0); + price = ask = jdouble(item,"price"); + printf("%s/%s ask %.8f\n",coin->symbol,"KMD",ask); + } + if ( (bids= jarray(&numbids,orderbook,"bids")) != 0 && numbids > 0 ) + { + item = jitem(asks,0); + bid = jdouble(item,"price"); + if ( price == 0. ) + price = bid; + else price = (bid + ask) * 0.5; + printf("%s/%s bid %.8f ask %.8f price %.8f\n",coin->symbol,"KMD",bid,ask,price); + } + KMDvalue = price * balance * SATOSHIDEN; + free_json(orderbook); + } + free(retstr); + } + } + return(KMDvalue); +} + char *LP_pricestr(char *base,char *rel,double origprice) { cJSON *retjson; double price = 0.; From 30673b5103ec9a50ef74b85316b4650fc535bcbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 13:42:41 +0300 Subject: [PATCH 1189/2732] Test --- iguana/exchanges/LP_prices.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ceb8c96ba..99c2a1ec8 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -752,7 +752,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid; + uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 ) @@ -760,7 +760,11 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) if ( (basepp= LP_priceinfofind(base)) == 0 || (relpp= LP_priceinfofind(rel)) == 0 ) return(clonestr("{\"error\":\"base or rel not added\"}")); if ( duration <= 0 ) + { + if ( duration < 0 ) + suppress_prefetch = 1; duration = LP_ORDERBOOK_DURATION; + } baseid = basepp->ind; relid = relpp->ind; now = (uint32_t)time(NULL); @@ -787,7 +791,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 )//|| relcoin->electrum == 0 ) + if ( suppress_prefetch == 0 && n < 10 && bids[i]->numutxos == 0 ) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); @@ -807,7 +811,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 )//|| basecoin->electrum == 0 ) + if ( suppress_prefetch == 0 && n < 10 && asks[i]->numutxos == 0 ) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); @@ -840,7 +844,7 @@ uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance) { if ( strcmp(coin->symbol,"KMD") == 0 ) KMDvalue = balance; - else if ( (retstr= LP_orderbook(coin->symbol,"KMD",0)) != 0 ) + else if ( (retstr= LP_orderbook(coin->symbol,"KMD",-1)) != 0 ) { if ( (orderbook= cJSON_Parse(retstr)) != 0 ) { @@ -848,7 +852,7 @@ uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance) { item = jitem(asks,0); price = ask = jdouble(item,"price"); - printf("%s/%s ask %.8f\n",coin->symbol,"KMD",ask); + //printf("%s/%s ask %.8f\n",coin->symbol,"KMD",ask); } if ( (bids= jarray(&numbids,orderbook,"bids")) != 0 && numbids > 0 ) { @@ -857,9 +861,9 @@ uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance) if ( price == 0. ) price = bid; else price = (bid + ask) * 0.5; - printf("%s/%s bid %.8f ask %.8f price %.8f\n",coin->symbol,"KMD",bid,ask,price); + //printf("%s/%s bid %.8f ask %.8f price %.8f\n",coin->symbol,"KMD",bid,ask,price); } - KMDvalue = price * balance * SATOSHIDEN; + KMDvalue = price * balance; free_json(orderbook); } free(retstr); From 0919bb11077f573ce5f8858d5b747879d18e233e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 14:42:31 +0300 Subject: [PATCH 1190/2732] Error check withdraw amount --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_transaction.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e92bee830..bb2f850fa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,12 +19,12 @@ // marketmaker // // sign critical api calls (pubkey reg, listunspent, orders?) -// dPoW security -> 4: KMD notarized, 5: BTC notarized // process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // // alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN // verify portfolio, pricearray, interest to KMD withdraw +// dPoW security -> 4: KMD notarized, 5: BTC notarized #include diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 0c45df38c..f6f6314c7 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -923,6 +923,12 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf suppress_pubkeys = 1; scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); numvins = LP_vins_select(ctx,coin,&total,amount,V,utxos,numutxos,suppress_pubkeys,ignore_cltverr,privkey,privkeys,vins,script,scriptlen); + if ( total < amount ) + { + printf("change %.8f = total %.8f - amount %.8f, adjust %.8f numvouts.%d, txfee %.8f\n",dstr(change),dstr(total),dstr(amount),dstr(adjust),numvouts,dstr(txfee)); + printf("not enough inputs for amount %.8f < %.8f txfee %.8f\n",dstr(total),dstr(amount),dstr(txfee)); + return(0); + } change = (total - amount); timestamp = (uint32_t)time(NULL); if ( strcmp("KMD",coin->symbol) == 0 ) @@ -936,6 +942,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf adjust = change / numvouts; change = 0; } + printf("change %.8f = total %.8f - amount %.8f, adjust %.8f numvouts.%d\n",dstr(change),dstr(total),dstr(amount),dstr(adjust),numvouts); for (i=0; i Date: Fri, 20 Oct 2017 14:47:10 +0300 Subject: [PATCH 1191/2732] Fix KMDbalance --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index a839b463b..9a7cb7509 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -198,7 +198,7 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) if ( coin->userpass[0] != 0 ) { jaddnum(item,"height",LP_getheight(coin)); - balance =LP_smartbalance(coin); + balance = LP_smartbalance(coin); jaddnum(item,"balance",dstr(balance)); jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance))); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3ccc412ae..cec077f1b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -230,7 +230,7 @@ uint64_t LP_smartbalance(struct iguana_info *coin) cJSON *array,*item; char buf[512],*retstr; int32_t i,n; uint64_t valuesum,value; valuesum = 0; sprintf(buf,"[0, 99999999, [\"%s\"]]",coin->smartaddr); - retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"listunspent","[]"); + retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"listunspent",buf); if ( retstr != 0 && retstr[0] != 0 ) { array = cJSON_Parse(retstr); From 3068d961432e805522a0466b71c58565cd0f7475 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 14:50:01 +0300 Subject: [PATCH 1192/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 ++ iguana/exchanges/coins | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 813254c6c..17ab44602 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1057,6 +1057,8 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce) { uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + if ( strcmp(base,"GAME") == 0 ) + return(clonestr("{\"error\":\"GAME can only be alice coin\"}")); printf("LP_autobuy %s/%s price %.8f vol %.8f nonce %u\n",base,rel,maxprice,relvolume,nonce); if ( (lastnonce= LP_lastnonce) != 0 && nonce <= lastnonce ) { diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index d08cf1a4c..e6da494a4 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,3 +1,4 @@ -export coins="[{\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" #{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, +#{\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, From 9453156e6036ec3e1a55f4aa947647ce194bfe0c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 20 Oct 2017 15:27:29 +0300 Subject: [PATCH 1193/2732] Change ipaddr file location --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bb2f850fa..84c117a53 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -819,10 +819,10 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_reservedmutex); portable_mutex_init(&LP_nanorecvsmutex); #ifndef _WIN32 - if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 ) + if ( system("curl -s4 checkip.amazonaws.com > myipaddr") == 0 ) { char ipfname[64]; - strcpy(ipfname,"DB/myipaddr"); + strcpy(ipfname,"myipaddr"); if ( (myipaddr= OS_filestr(&filesize,ipfname)) != 0 && myipaddr[0] != 0 ) { n = strlen(myipaddr); From 3473598c88a37e3b2e330b310fa97bfccbc30fd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 12:01:41 +0300 Subject: [PATCH 1194/2732] Test --- iguana/exchanges/LP_commands.c | 44 ++------- iguana/exchanges/LP_nativeDEX.c | 47 +--------- iguana/exchanges/LP_ordermatch.c | 148 +++++++++++++++++++++++++++---- iguana/exchanges/LP_prices.c | 5 +- iguana/exchanges/LP_utxo.c | 38 -------- 5 files changed, 143 insertions(+), 139 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 944f29520..d5278e597 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -63,6 +63,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r } if ( method == 0 ) { + if ( is_cJSON_Array(argjson) != 0 ) + printf("RAWARRAY command? %s\n",jprint(argjson,0)); if ( flag == 0 || jobj(argjson,"result") != 0 ) printf("stats_JSON no method: (%s) (%s:%u)\n",jprint(argjson,0),ipaddr,argport); return(0); @@ -228,7 +230,6 @@ stop()\n\ { if ( price > SMALLVAL ) { - //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); if ( LP_mypriceset(&changed,base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); //else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) @@ -238,7 +239,6 @@ stop()\n\ } else if ( strcmp(method,"autoprice") == 0 ) { - //LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN); if ( LP_autoprice(base,rel,argjson) < 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); @@ -450,29 +450,13 @@ stop()\n\ } } if ( strcmp(method,"postprice") == 0 ) - { - // LP_checksig retstr = LP_postedprice(argjson); - } else if ( strcmp(method,"postutxos") == 0 ) retstr = LP_postedutxos(argjson); else if ( strcmp(method,"getprices") == 0 ) return(LP_prices()); else if ( strcmp(method,"uitem") == 0 ) - { - bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr; - txid = jbits256(argjson,"txid"); - vout = jint(argjson,"vout"); - height = jint(argjson,"ht"); - value = j64bits(argjson,"value"); - coinaddr = jstr(argjson,"coinaddr"); - if ( coin != 0 && coinaddr != 0 ) - { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); - LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); - } - return(clonestr("{\"result\":\"success\"}")); - } + retstr = LP_uitem_recv(argjson); else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); else if ( strcmp(method,"listunspent") == 0 ) @@ -549,26 +533,8 @@ stop()\n\ return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); } else if ( strcmp(method,"notify") == 0 ) - { - char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; - pub = jbits256(argjson,"pub"); - // LP_checksig - if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) - { - if ( (pubp= LP_pubkeyadd(pub)) != 0 ) - { - decode_hex(pubp->rmd160,20,rmd160str); - if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) - { - decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); - //printf("got pubkey.(%s)\n",secpstr); - } - } - //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); - } - retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); - } - if ( IAMLP != 0 ) + retstr = LP_notify_recv(argjson); + else if ( IAMLP != 0 ) { if ( strcmp(method,"broadcast") == 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 84c117a53..fdd8e3aea 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,12 +19,13 @@ // marketmaker // // sign critical api calls (pubkey reg, listunspent, orders?) + // process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // -// alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN // verify portfolio, pricearray, interest to KMD withdraw -// dPoW security -> 4: KMD notarized, 5: BTC notarized + +// dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections #include @@ -343,48 +344,6 @@ void command_rpcloop(void *myipaddr) } } -void LP_smartutxos_push(struct iguana_info *coin) -{ - struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; - if ( coin->smartaddr[0] == 0 ) - return; - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) - { - memset(zero.bytes,0,sizeof(zero)); - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); - for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) - free(retstr); - } - } - req = cJSON_CreateObject(); - jaddstr(req,"method","uitem"); - jaddstr(req,"coin",coin->symbol); - jaddstr(req,"coinaddr",coin->smartaddr); - jaddbits256(req,"txid",txid); - jaddnum(req,"vout",vout); - jaddnum(req,"ht",height); - jadd64bits(req,"value",value); - //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_reserved_msg("","",zero,jprint(req,1)); - } - } - free_json(array); - } -} - int32_t LP_utxos_sync(struct LP_peerinfo *peer) { int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 17ab44602..7958b2c21 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -219,6 +219,102 @@ char *LP_quotereceived(cJSON *argjson) } else return(clonestr("{\"error\":\"nullptr\"}")); } +void LP_smartutxos_push(struct iguana_info *coin) +{ + struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; + if ( coin->smartaddr[0] == 0 ) + return; + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); + for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) + free(retstr); + } + } + req = cJSON_CreateObject(); + jaddstr(req,"method","uitem"); + jaddstr(req,"coin",coin->symbol); + jaddstr(req,"coinaddr",coin->smartaddr); + jaddbits256(req,"txid",txid); + jaddnum(req,"vout",vout); + jaddnum(req,"ht",height); + jadd64bits(req,"value",value); + //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_reserved_msg("","",zero,jprint(req,1)); + } + } + free_json(array); + } +} + +void LP_postutxos(char *symbol,char *coinaddr) +{ + bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); + if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); + if ( cJSON_GetArraySize(array) == 0 ) + free_json(array); + else + { + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","postutxos"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"coinaddr",coinaddr); + jadd(reqjson,"utxos",array); + //printf("post (%s) -> %d\n",msg,LP_mypubsock); + LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); + } + } +} + +char *LP_postedutxos(cJSON *argjson) +{ + int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; + //printf("posted.(%s)\n",jprint(argjson,0)); + if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig + { + if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) + { + if ( (array= jarray(&n,argjson,"utxos")) != 0 ) + LP_unspents_array(coin,coinaddr,array); + } + else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) + free_json(array); + } + return(clonestr("{\"result\":\"success\"}")); +} + +char *LP_uitem_recv(cJSON *argjson) +{ + bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; + txid = jbits256(argjson,"txid"); + vout = jint(argjson,"vout"); + height = jint(argjson,"ht"); + value = j64bits(argjson,"value"); + coinaddr = jstr(argjson,"coinaddr"); + if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) + { + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); + } + return(clonestr("{\"result\":\"success\"}")); +} + char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { bits256 zero; cJSON *reqjson = cJSON_CreateObject(); @@ -233,6 +329,22 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re return(clonestr("{\"result\":\"success\"}")); } +char *LP_postedprice(cJSON *argjson) +{ + bits256 pubkey; double price; char *base,*rel; + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) + { + pubkey = jbits256(argjson,"pubkey"); + if ( bits256_nonz(pubkey) != 0 ) + { + LP_pricefeedupdate(pubkey,base,rel,price); + return(clonestr("{\"result\":\"success\"}")); + } + } + return(clonestr("{\"error\":\"missing fields in posted price\"}")); +} + void LP_notify_pubkeys(void *ctx,int32_t pubsock) { bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); @@ -246,6 +358,27 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) LP_reserved_msg("","",zero,jprint(reqjson,1)); } +char *LP_notify_recv(cJSON *argjson) +{ + char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; + pub = jbits256(argjson,"pub"); + // LP_checksig + if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) + { + if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + { + decode_hex(pubp->rmd160,20,rmd160str); + if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) + { + decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); + //printf("got pubkey.(%s)\n",secpstr); + } + } + //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); + } + return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); +} + void LP_listunspent_query(char *symbol,char *coinaddr) { bits256 zero; cJSON *reqjson = cJSON_CreateObject(); @@ -256,21 +389,6 @@ void LP_listunspent_query(char *symbol,char *coinaddr) LP_reserved_msg("","",zero,jprint(reqjson,1)); } -char *LP_postedprice(cJSON *argjson) -{ - bits256 pubkey; double price; char *base,*rel; - //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); - if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) - { - pubkey = jbits256(argjson,"pubkey"); - if ( bits256_nonz(pubkey) != 0 ) - { - LP_pricefeedupdate(pubkey,base,rel,price); - return(clonestr("{\"result\":\"success\"}")); - } - } - return(clonestr("{\"error\":\"missing fields in posted price\"}")); -} int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 99c2a1ec8..1b834481f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -872,7 +872,7 @@ uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance) return(KMDvalue); } -char *LP_pricestr(char *base,char *rel,double origprice) +/*char *LP_pricestr(char *base,char *rel,double origprice) { cJSON *retjson; double price = 0.; if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) @@ -884,7 +884,6 @@ char *LP_pricestr(char *base,char *rel,double origprice) if ( LP_pricevalid(price) > 0 ) { retjson = cJSON_CreateObject(); - // LP_addsig jaddstr(retjson,"result","success"); jaddstr(retjson,"method","postprice"); jaddbits256(retjson,"pubkey",G.LP_mypub25519); @@ -895,7 +894,7 @@ char *LP_pricestr(char *base,char *rel,double origprice) jadd(retjson,"quotes",LP_priceinfomatrix(1)); return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"cant find baserel pair\"}")); -} +}*/ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 26d0c6300..ee152d15b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -429,27 +429,6 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr return(retjson); } -void LP_postutxos(char *symbol,char *coinaddr) -{ - bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); - if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) - { - //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); - if ( cJSON_GetArraySize(array) == 0 ) - free_json(array); - else - { - memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","postutxos"); - jaddstr(reqjson,"coin",symbol); - jaddstr(reqjson,"coinaddr",coinaddr); - jadd(reqjson,"utxos",array); - //printf("post (%s) -> %d\n",msg,LP_mypubsock); - LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); - } - } -} - int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) { int32_t i,n,v,ht,errs,height,count=0; uint64_t value,val; cJSON *item,*txobj; bits256 txid; @@ -493,23 +472,6 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) return(count); } -char *LP_postedutxos(cJSON *argjson) -{ - int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; - //printf("posted.(%s)\n",jprint(argjson,0)); - if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig - { - if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) - { - if ( (array= jarray(&n,argjson,"utxos")) != 0 ) - LP_unspents_array(coin,coinaddr,array); - } - else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) - free_json(array); - } - return(clonestr("{\"result\":\"success\"}")); -} - void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) { memcpy(key,txid.bytes,sizeof(txid)); From b76a41564d9ce12fdd7baa417c833db4c04993f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 12:24:07 +0300 Subject: [PATCH 1195/2732] Test --- iguana/exchanges/LP_commands.c | 104 +++++++++++++++---------------- iguana/exchanges/LP_ordermatch.c | 37 ++++++----- iguana/exchanges/LP_utxos.c | 4 +- 3 files changed, 69 insertions(+), 76 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d5278e597..49dcb96ab 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -96,24 +96,24 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r // return(clonestr("{\"result\":\"success\"}")); else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ -available localhost RPC commands: * means it needs to be a signed request\n \ +available localhost RPC commands: \n \ pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ -setprice(base, rel, price)*\n\ +setprice(base, rel, price)\n\ autoprice(base, rel, minprice, margin, refbase, refrel, factor, offset)*\n\ -goal(coin=*, val=)*\n\ +goal(coin=*, val=)\n\ myprice(base, rel)\n\ -enable(coin)*\n\ -disable(coin)*\n\ +enable(coin)\n\ +disable(coin)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ -buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)*\n\ -sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)*\n\ -withdraw(coin, outputs[])*\n\ +buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ +sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ +withdraw(coin, outputs[])\n\ sendrawtransaction(coin, signedtx)\n\ -swapstatus()*\n\ +swapstatus()\n\ recentswaps(limit=3)\n\ -swapstatus(requestid, quoteid)*\n\ +swapstatus(requestid, quoteid)\n\ public API:\n \ getcoins()\n\ getcoin(coin)\n\ @@ -121,8 +121,8 @@ portfolio()\n\ getpeers()\n\ passphrase(passphrase, gui)\n\ listunspent(coin, address)\n\ -setconfirms(coin, numconfirms, maxconfirms=6)*\n\ -trust(pubkey, trust)*\n\ +setconfirms(coin, numconfirms, maxconfirms=6)\n\ +trust(pubkey, trust)\n\ balance(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ @@ -130,7 +130,7 @@ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ deletemessages(firsti=0, num=100)\n\ secretaddresses(prefix='secretaddress', passphrase, num=10, pubtype=60, taddr=0)\n\ -electrum(coin, ipaddr, port)*\n\ +electrum(coin, ipaddr, port)\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ @@ -141,7 +141,7 @@ stop()\n\ base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); coin = jstr(argjson,"coin"); - if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) + if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) // protected localhost { if ( G.USERPASS_COUNTER == 0 ) { @@ -319,7 +319,6 @@ stop()\n\ } else if ( strcmp(method,"electrum") == 0 ) { - //* if ( (ptr= LP_coinsearch(coin)) != 0 ) { ptr->inactive = 0; @@ -332,7 +331,6 @@ stop()\n\ } else if ( strcmp(method,"withdraw") == 0 ) { - ///* if ( (ptr= LP_coinsearch(coin)) != 0 ) { if ( jobj(argjson,"outputs") == 0 ) @@ -344,7 +342,6 @@ stop()\n\ else if ( strcmp(method,"setconfirms") == 0 ) { int32_t n; - //* n = jint(argjson,"numconfirms"); if ( n < 0 ) return(clonestr("{\"error\":\"illegal numconfirms\"}")); @@ -399,22 +396,15 @@ stop()\n\ } } else if ( strcmp(method,"goal") == 0 ) - { - //* return(LP_portfolio_goal(coin,jdouble(argjson,"val"))); - } else if ( strcmp(method,"getcoin") == 0 ) return(LP_getcoin(coin)); } else if ( strcmp(method,"goal") == 0 ) - { - //* return(LP_portfolio_goal("*",100.)); - } else if ( strcmp(method,"swapstatus") == 0 ) { uint32_t requestid,quoteid; - //* if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) return(basilisk_swapentry(requestid,quoteid)); else return(basilisk_swaplist(0,0)); @@ -429,13 +419,10 @@ stop()\n\ else if ( strcmp(method,"myprices") == 0 ) return(LP_myprices()); else if ( strcmp(method,"trust") == 0 ) - { - //* return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); - } else if ( strcmp(method,"trusted") == 0 ) return(LP_pubkey_trusted()); - } + } // end of protected localhost commands if ( IAMLP == 0 ) { if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) @@ -449,16 +436,42 @@ stop()\n\ argjson = reqjson; } } + // received response if ( strcmp(method,"postprice") == 0 ) - retstr = LP_postedprice(argjson); + retstr = LP_postprice_recv(argjson); else if ( strcmp(method,"postutxos") == 0 ) - retstr = LP_postedutxos(argjson); - else if ( strcmp(method,"getprices") == 0 ) - return(LP_prices()); + retstr = LP_postutxos_recv(argjson); else if ( strcmp(method,"uitem") == 0 ) retstr = LP_uitem_recv(argjson); + else if ( strcmp(method,"notify") == 0 ) + retstr = LP_notify_recv(argjson); + // end received response + + // public access, even from http + else if ( strcmp(method,"balance") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } + else if ( strcmp(method,"pricearray") == 0 ) + { + uint32_t firsttime; + if ( base != 0 && rel != 0 ) + { + if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) + firsttime = (uint32_t)(time(NULL)-30*24*3600); + return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); + } else return(clonestr("{\"error\":\"pricearray needs base and rel\"}")); + } + else if ( strcmp(method,"getprices") == 0 ) + return(LP_prices()); else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); + else if ( strcmp(method,"getpeers") == 0 ) + return(LP_peers()); + else if ( strcmp(method,"getcoins") == 0 ) + return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"listunspent") == 0 ) { if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) @@ -484,14 +497,6 @@ stop()\n\ } else return(clonestr("{\"error\":\"no address specified\"}")); } else return(clonestr("{\"error\":\"cant find coind\"}")); } - else if ( strcmp(method,"balance") == 0 ) - { - if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) - return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); - else return(clonestr("{\"error\":\"cant find coind\"}")); - } - else if ( strcmp(method,"checktxid") == 0 ) - retstr = LP_spentcheck(argjson); else if ( strcmp(method,"addr_unspents") == 0 ) { //printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); @@ -513,28 +518,17 @@ stop()\n\ } retstr = clonestr("{\"result\":\"success\"}"); } + //else if ( strcmp(method,"checktxid") == 0 ) + // retstr = LP_spentcheck(argjson); //else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) // return(clonestr("{\"result\":\"at least one of coins disabled\"}")); //else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) // retstr = clonestr("{\"result\":\"coin is disabled\"}"); - else if ( strcmp(method,"getcoins") == 0 ) - return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); - else if ( strcmp(method,"getpeers") == 0 ) - return(LP_peers()); - else + else // special handling requests { - if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) - { - uint32_t firsttime; - if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) - firsttime = (uint32_t)(time(NULL)-30*24*3600); - return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); - } - else if ( strcmp(method,"notify") == 0 ) - retstr = LP_notify_recv(argjson); - else if ( IAMLP != 0 ) + if ( IAMLP != 0 ) { if ( strcmp(method,"broadcast") == 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7958b2c21..651cfb9c2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -261,6 +261,22 @@ void LP_smartutxos_push(struct iguana_info *coin) } } +char *LP_uitem_recv(cJSON *argjson) +{ + bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; + txid = jbits256(argjson,"txid"); + vout = jint(argjson,"vout"); + height = jint(argjson,"ht"); + value = j64bits(argjson,"value"); + coinaddr = jstr(argjson,"coinaddr"); + if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) + { + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); + } + return(clonestr("{\"result\":\"success\"}")); +} + void LP_postutxos(char *symbol,char *coinaddr) { bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); @@ -282,7 +298,7 @@ void LP_postutxos(char *symbol,char *coinaddr) } } -char *LP_postedutxos(cJSON *argjson) +char *LP_postutxos_recv(cJSON *argjson) { int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; //printf("posted.(%s)\n",jprint(argjson,0)); @@ -299,22 +315,6 @@ char *LP_postedutxos(cJSON *argjson) return(clonestr("{\"result\":\"success\"}")); } -char *LP_uitem_recv(cJSON *argjson) -{ - bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; - txid = jbits256(argjson,"txid"); - vout = jint(argjson,"vout"); - height = jint(argjson,"ht"); - value = j64bits(argjson,"value"); - coinaddr = jstr(argjson,"coinaddr"); - if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) - { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); - LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); - } - return(clonestr("{\"result\":\"success\"}")); -} - char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { bits256 zero; cJSON *reqjson = cJSON_CreateObject(); @@ -329,7 +329,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re return(clonestr("{\"result\":\"success\"}")); } -char *LP_postedprice(cJSON *argjson) +char *LP_postprice_recv(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); @@ -389,7 +389,6 @@ void LP_listunspent_query(char *symbol,char *coinaddr) LP_reserved_msg("","",zero,jprint(reqjson,1)); } - int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo) { int32_t selector,spendvini; bits256 spendtxid; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4d83eeb7c..44cbb2991 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -262,7 +262,7 @@ void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) utxo->T.spentflag = (uint32_t)time(NULL); } -char *LP_spentcheck(cJSON *argjson) +/*char *LP_spentcheck(cJSON *argjson) { bits256 txid,checktxid; int32_t vout,checkvout; struct LP_utxoinfo *utxo; int32_t iambob,retval = 0; txid = jbits256(argjson,"txid"); @@ -291,7 +291,7 @@ char *LP_spentcheck(cJSON *argjson) if ( retval > 0 ) return(clonestr("{\"result\":\"marked as spent\"}")); return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); -} +}*/ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { From f85ab66c314899238d7edf769cb24c5311dc3839 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 15:36:09 +0300 Subject: [PATCH 1196/2732] Fix other path --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 651cfb9c2..416afbd9f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1014,7 +1014,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); - if ( (butxo= LP_utxoadd(1,coin->symbol,butxo->payment.txid,butxo->payment.vout,value,butxo->deposit.txid,butxo->deposit.vout,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid,Q.vout2,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) printf("couldnt create bob's utxopair\n"); } } From e748405a2a98073e837f96e14a2344346f1f2a9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 16:16:22 +0300 Subject: [PATCH 1197/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 416afbd9f..7dfa4ff84 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1014,7 +1014,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid,Q.vout2,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) printf("couldnt create bob's utxopair\n"); } } From eb1580bb2cdccbed8a4cfe78628022e2385de182 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 17:13:45 +0300 Subject: [PATCH 1198/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 366 +---------------------------- iguana/exchanges/LP_signatures.c | 385 +++++++++++++++++++++++++++++++ 3 files changed, 388 insertions(+), 364 deletions(-) create mode 100644 iguana/exchanges/LP_signatures.c diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fdd8e3aea..9cb9b0a53 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -105,6 +105,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_peers.c" #include "LP_utxos.c" #include "LP_forwarding.c" +#include "LP_signatures.c" #include "LP_ordermatch.c" #include "LP_portfolio.c" #include "LP_messages.c" diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7dfa4ff84..7997ce0e4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -42,13 +42,6 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen) return(txfee); } -void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) -{ - *txfeep = LP_txfeecalc(LP_coinfind(base),0,0); - *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0,0); - printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); -} - double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) { uint64_t destsatoshis,satoshis; @@ -66,329 +59,6 @@ double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uin else return(0.); } -struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srchash,bits256 desthash,char *src,uint64_t srcsatoshis,char *dest,uint64_t destsatoshis,uint32_t timestamp,uint32_t quotetime,int32_t DEXselector) -{ - struct basilisk_request R; - memset(rp,0,sizeof(*rp)); - rp->srchash = srchash; - rp->srcamount = srcsatoshis; - rp->timestamp = timestamp; - rp->DEXselector = DEXselector; - safecopy(rp->src,src,sizeof(rp->src)); - safecopy(rp->dest,dest,sizeof(rp->dest)); - R = *rp; - rp->requestid = basilisk_requestid(rp); - rp->quotetime = quotetime; - rp->desthash = desthash; - rp->destamount = destsatoshis; - rp->quoteid = basilisk_quoteid(rp); - printf("r.%u %u, q.%u %u: %s %.8f -> %s %.8f\n",rp->timestamp,rp->requestid,rp->quotetime,rp->quoteid,rp->src,dstr(rp->srcamount),rp->dest,dstr(rp->destamount)); - return(rp); -} - -cJSON *LP_quotejson(struct LP_quoteinfo *qp) -{ - double price; cJSON *retjson = cJSON_CreateObject(); - jaddstr(retjson,"base",qp->srccoin); - jaddstr(retjson,"rel",qp->destcoin); - if ( qp->coinaddr[0] != 0 ) - jaddstr(retjson,"address",qp->coinaddr); - if ( qp->timestamp != 0 ) - jaddnum(retjson,"timestamp",qp->timestamp); - if ( bits256_nonz(qp->txid) != 0 ) - { - jaddbits256(retjson,"txid",qp->txid); - jaddnum(retjson,"vout",qp->vout); - } - if ( bits256_nonz(qp->srchash) != 0 ) - jaddbits256(retjson,"srchash",qp->srchash); - if ( qp->txfee != 0 ) - jadd64bits(retjson,"txfee",qp->txfee); - if ( qp->quotetime != 0 ) - jaddnum(retjson,"quotetime",qp->quotetime); - if ( qp->satoshis != 0 ) - jadd64bits(retjson,"satoshis",qp->satoshis); - if ( bits256_nonz(qp->desthash) != 0 ) - jaddbits256(retjson,"desthash",qp->desthash); - if ( bits256_nonz(qp->txid2) != 0 ) - { - jaddbits256(retjson,"txid2",qp->txid2); - jaddnum(retjson,"vout2",qp->vout2); - } - if ( bits256_nonz(qp->desttxid) != 0 ) - { - if ( qp->destaddr[0] != 0 ) - jaddstr(retjson,"destaddr",qp->destaddr); - jaddbits256(retjson,"desttxid",qp->desttxid); - jaddnum(retjson,"destvout",qp->destvout); - } - if ( bits256_nonz(qp->feetxid) != 0 ) - { - jaddbits256(retjson,"feetxid",qp->feetxid); - jaddnum(retjson,"feevout",qp->feevout); - } - if ( qp->desttxfee != 0 ) - jadd64bits(retjson,"desttxfee",qp->desttxfee); - if ( qp->destsatoshis != 0 ) - { - jadd64bits(retjson,"destsatoshis",qp->destsatoshis); - if ( qp->satoshis != 0 ) - { - price = (double)qp->destsatoshis / (qp->satoshis - qp->txfee); - jaddnum(retjson,"price",price); - } - } - return(retjson); -} - -int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) -{ - safecopy(qp->srccoin,jstr(argjson,"base"),sizeof(qp->srccoin)); - safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr)); - safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin)); - safecopy(qp->destaddr,jstr(argjson,"destaddr"),sizeof(qp->destaddr)); - qp->timestamp = juint(argjson,"timestamp"); - qp->quotetime = juint(argjson,"quotetime"); - qp->txid = jbits256(argjson,"txid"); - qp->txid2 = jbits256(argjson,"txid2"); - qp->vout = jint(argjson,"vout"); - qp->vout2 = jint(argjson,"vout2"); - qp->feevout = jint(argjson,"feevout"); - qp->srchash = jbits256(argjson,"srchash"); - qp->desttxid = jbits256(argjson,"desttxid"); - qp->feetxid = jbits256(argjson,"feetxid"); - qp->destvout = jint(argjson,"destvout"); - qp->desthash = jbits256(argjson,"desthash"); - qp->satoshis = j64bits(argjson,"satoshis"); - qp->destsatoshis = j64bits(argjson,"destsatoshis"); - qp->txfee = j64bits(argjson,"txfee"); - qp->desttxfee = j64bits(argjson,"desttxfee"); - return(0); -} - -int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char *destcoin,double price,uint64_t satoshis,uint64_t destsatoshis) -{ - memset(qp,0,sizeof(*qp)); - if ( qp->timestamp == 0 ) - qp->timestamp = (uint32_t)time(NULL); - safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); - LP_txfees(&qp->txfee,&qp->desttxfee,utxo->coin,qp->destcoin); - qp->satoshis = satoshis;//(destsatoshis / price) + 0.49; - qp->destsatoshis = destsatoshis; - /*if ( qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) //utxo->iambob == 0 || - { - printf("quoteinit error.(%d %d %d %d) %.8f vs %.8f\n",utxo->iambob == 0,qp->txfee >= qp->satoshis,qp->txfee >= utxo->deposit.value,utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis),dstr(utxo->deposit.value),dstr(LP_DEPOSITSATOSHIS(qp->satoshis))); - return(-1); - }*/ - qp->txid = utxo->payment.txid; - qp->vout = utxo->payment.vout; - qp->txid2 = utxo->deposit.txid; - qp->vout2 = utxo->deposit.vout; - if ( qp->desttxfee >= qp->destsatoshis ) - { - printf("quoteinit desttxfee %.8f < %.8f destsatoshis\n",dstr(qp->desttxfee),dstr(qp->destsatoshis)); - return(-2); - } - safecopy(qp->srccoin,utxo->coin,sizeof(qp->srccoin)); - safecopy(qp->coinaddr,utxo->coinaddr,sizeof(qp->coinaddr)); - qp->srchash = utxo->pubkey; - return(0); -} - -int32_t LP_quotedestinfo(struct LP_quoteinfo *qp,bits256 desttxid,int32_t destvout,bits256 feetxid,int32_t feevout,bits256 desthash,char *destaddr) -{ - qp->desttxid = desttxid; - qp->destvout = destvout; - qp->desthash = desthash; - qp->feetxid = feetxid; - qp->feevout = feevout; - safecopy(qp->destaddr,destaddr,sizeof(qp->destaddr)); - return(0); -} - -char *LP_quotereceived(cJSON *argjson) -{ - struct LP_cacheinfo *ptr; double price; struct LP_quoteinfo Q; - LP_quoteparse(&Q,argjson); - price = (double)Q.destsatoshis / (Q.satoshis - Q.txfee); - if ( (ptr= LP_cacheadd(Q.srccoin,Q.destcoin,Q.txid,Q.vout,price,&Q)) != 0 ) - { - ptr->Q = Q; - printf(">>>>>>>>>> received quote %s/%s %.8f\n",Q.srccoin,Q.destcoin,price); - return(clonestr("{\"result\":\"updated\"}")); - } else return(clonestr("{\"error\":\"nullptr\"}")); -} - -void LP_smartutxos_push(struct iguana_info *coin) -{ - struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; - if ( coin->smartaddr[0] == 0 ) - return; - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) - { - memset(zero.bytes,0,sizeof(zero)); - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); - for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) - free(retstr); - } - } - req = cJSON_CreateObject(); - jaddstr(req,"method","uitem"); - jaddstr(req,"coin",coin->symbol); - jaddstr(req,"coinaddr",coin->smartaddr); - jaddbits256(req,"txid",txid); - jaddnum(req,"vout",vout); - jaddnum(req,"ht",height); - jadd64bits(req,"value",value); - //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_reserved_msg("","",zero,jprint(req,1)); - } - } - free_json(array); - } -} - -char *LP_uitem_recv(cJSON *argjson) -{ - bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; - txid = jbits256(argjson,"txid"); - vout = jint(argjson,"vout"); - height = jint(argjson,"ht"); - value = j64bits(argjson,"value"); - coinaddr = jstr(argjson,"coinaddr"); - if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) - { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); - LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); - } - return(clonestr("{\"result\":\"success\"}")); -} - -void LP_postutxos(char *symbol,char *coinaddr) -{ - bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); - if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) - { - //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); - if ( cJSON_GetArraySize(array) == 0 ) - free_json(array); - else - { - memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","postutxos"); - jaddstr(reqjson,"coin",symbol); - jaddstr(reqjson,"coinaddr",coinaddr); - jadd(reqjson,"utxos",array); - //printf("post (%s) -> %d\n",msg,LP_mypubsock); - LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); - } - } -} - -char *LP_postutxos_recv(cJSON *argjson) -{ - int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; - //printf("posted.(%s)\n",jprint(argjson,0)); - if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig - { - if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) - { - if ( (array= jarray(&n,argjson,"utxos")) != 0 ) - LP_unspents_array(coin,coinaddr,array); - } - else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) - free_json(array); - } - return(clonestr("{\"result\":\"success\"}")); -} - -char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) -{ - bits256 zero; cJSON *reqjson = cJSON_CreateObject(); - // LP_addsig - memset(zero.bytes,0,sizeof(zero)); - jaddbits256(reqjson,"pubkey",G.LP_mypub25519); - jaddstr(reqjson,"base",base); - jaddstr(reqjson,"rel",rel); - jaddnum(reqjson,"price",price); - jaddstr(reqjson,"method","postprice"); - LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); - return(clonestr("{\"result\":\"success\"}")); -} - -char *LP_postprice_recv(cJSON *argjson) -{ - bits256 pubkey; double price; char *base,*rel; - //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); - if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) - { - pubkey = jbits256(argjson,"pubkey"); - if ( bits256_nonz(pubkey) != 0 ) - { - LP_pricefeedupdate(pubkey,base,rel,price); - return(clonestr("{\"result\":\"success\"}")); - } - } - return(clonestr("{\"error\":\"missing fields in posted price\"}")); -} - -void LP_notify_pubkeys(void *ctx,int32_t pubsock) -{ - bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); - // LP_addsig - memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","notify"); - jaddstr(reqjson,"rmd160",G.LP_myrmd160str); - jaddbits256(reqjson,"pub",G.LP_mypub25519); - init_hexbytes_noT(secpstr,G.LP_pubsecp,33); - jaddstr(reqjson,"pubsecp",secpstr); - LP_reserved_msg("","",zero,jprint(reqjson,1)); -} - -char *LP_notify_recv(cJSON *argjson) -{ - char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; - pub = jbits256(argjson,"pub"); - // LP_checksig - if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) - { - if ( (pubp= LP_pubkeyadd(pub)) != 0 ) - { - decode_hex(pubp->rmd160,20,rmd160str); - if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) - { - decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); - //printf("got pubkey.(%s)\n",secpstr); - } - } - //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); - } - return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); -} - -void LP_listunspent_query(char *symbol,char *coinaddr) -{ - bits256 zero; cJSON *reqjson = cJSON_CreateObject(); - memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","addr_unspents"); - jaddstr(reqjson,"coin",symbol); - jaddstr(reqjson,"address",coinaddr); - LP_reserved_msg("","",zero,jprint(reqjson,1)); -} - int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo) { int32_t selector,spendvini; bits256 spendtxid; @@ -496,40 +166,6 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) return(-1); } -void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) -{ - cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; - if ( strcmp(method,"request") == 0 ) - { - if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) - LP_unavailableset(utxo,qp->srchash); - else - { - printf("couldnt find my txid to make request\n"); - return; - } - } - reqjson = LP_quotejson(qp); - if ( bits256_nonz(qp->desthash) != 0 ) - flag = 1; - jaddbits256(reqjson,"pubkey",qp->srchash); - jaddstr(reqjson,"method",method); - msg = jprint(reqjson,1); - // LP_addsig - printf("QUERY.(%s)\n",msg); - memset(&zero,0,sizeof(zero)); - portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) - Reserved_msgs[num_Reserved_msgs++] = msg; - else - { - //if ( 1 && strcmp(method,"request") == 0 ) - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); - //else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - } - portable_mutex_unlock(&LP_reservedmutex); -} - int32_t LP_nanobind(void *ctx,char *pairstr) { int32_t i,r,pairsock = -1; uint16_t mypullport; char bindaddr[128]; @@ -1016,12 +652,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) printf("couldnt create bob's utxopair\n"); + else printf("created butxo.(%s %s)\n",bits256_str(str,butxo->payment.txid),bits256_str(str2,butxo->deposit.txid)); } } if ( butxo == 0 || butxo == &B ) butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 ) { + printf("null butxo case\n"); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c new file mode 100644 index 000000000..55f888517 --- /dev/null +++ b/iguana/exchanges/LP_signatures.c @@ -0,0 +1,385 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +// +// LP_signatures.c +// marketmaker +// + +struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srchash,bits256 desthash,char *src,uint64_t srcsatoshis,char *dest,uint64_t destsatoshis,uint32_t timestamp,uint32_t quotetime,int32_t DEXselector) +{ + struct basilisk_request R; + memset(rp,0,sizeof(*rp)); + rp->srchash = srchash; + rp->srcamount = srcsatoshis; + rp->timestamp = timestamp; + rp->DEXselector = DEXselector; + safecopy(rp->src,src,sizeof(rp->src)); + safecopy(rp->dest,dest,sizeof(rp->dest)); + R = *rp; + rp->requestid = basilisk_requestid(rp); + rp->quotetime = quotetime; + rp->desthash = desthash; + rp->destamount = destsatoshis; + rp->quoteid = basilisk_quoteid(rp); + printf("r.%u %u, q.%u %u: %s %.8f -> %s %.8f\n",rp->timestamp,rp->requestid,rp->quotetime,rp->quoteid,rp->src,dstr(rp->srcamount),rp->dest,dstr(rp->destamount)); + return(rp); +} + +cJSON *LP_quotejson(struct LP_quoteinfo *qp) +{ + double price; cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"base",qp->srccoin); + jaddstr(retjson,"rel",qp->destcoin); + if ( qp->coinaddr[0] != 0 ) + jaddstr(retjson,"address",qp->coinaddr); + if ( qp->timestamp != 0 ) + jaddnum(retjson,"timestamp",qp->timestamp); + if ( bits256_nonz(qp->txid) != 0 ) + { + jaddbits256(retjson,"txid",qp->txid); + jaddnum(retjson,"vout",qp->vout); + } + if ( bits256_nonz(qp->srchash) != 0 ) + jaddbits256(retjson,"srchash",qp->srchash); + if ( qp->txfee != 0 ) + jadd64bits(retjson,"txfee",qp->txfee); + if ( qp->quotetime != 0 ) + jaddnum(retjson,"quotetime",qp->quotetime); + if ( qp->satoshis != 0 ) + jadd64bits(retjson,"satoshis",qp->satoshis); + if ( bits256_nonz(qp->desthash) != 0 ) + jaddbits256(retjson,"desthash",qp->desthash); + if ( bits256_nonz(qp->txid2) != 0 ) + { + jaddbits256(retjson,"txid2",qp->txid2); + jaddnum(retjson,"vout2",qp->vout2); + } + if ( bits256_nonz(qp->desttxid) != 0 ) + { + if ( qp->destaddr[0] != 0 ) + jaddstr(retjson,"destaddr",qp->destaddr); + jaddbits256(retjson,"desttxid",qp->desttxid); + jaddnum(retjson,"destvout",qp->destvout); + } + if ( bits256_nonz(qp->feetxid) != 0 ) + { + jaddbits256(retjson,"feetxid",qp->feetxid); + jaddnum(retjson,"feevout",qp->feevout); + } + if ( qp->desttxfee != 0 ) + jadd64bits(retjson,"desttxfee",qp->desttxfee); + if ( qp->destsatoshis != 0 ) + { + jadd64bits(retjson,"destsatoshis",qp->destsatoshis); + if ( qp->satoshis != 0 ) + { + price = (double)qp->destsatoshis / (qp->satoshis - qp->txfee); + jaddnum(retjson,"price",price); + } + } + return(retjson); +} + +int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) +{ + safecopy(qp->srccoin,jstr(argjson,"base"),sizeof(qp->srccoin)); + safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr)); + safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin)); + safecopy(qp->destaddr,jstr(argjson,"destaddr"),sizeof(qp->destaddr)); + qp->timestamp = juint(argjson,"timestamp"); + qp->quotetime = juint(argjson,"quotetime"); + qp->txid = jbits256(argjson,"txid"); + qp->txid2 = jbits256(argjson,"txid2"); + qp->vout = jint(argjson,"vout"); + qp->vout2 = jint(argjson,"vout2"); + qp->feevout = jint(argjson,"feevout"); + qp->srchash = jbits256(argjson,"srchash"); + qp->desttxid = jbits256(argjson,"desttxid"); + qp->feetxid = jbits256(argjson,"feetxid"); + qp->destvout = jint(argjson,"destvout"); + qp->desthash = jbits256(argjson,"desthash"); + qp->satoshis = j64bits(argjson,"satoshis"); + qp->destsatoshis = j64bits(argjson,"destsatoshis"); + qp->txfee = j64bits(argjson,"txfee"); + qp->desttxfee = j64bits(argjson,"desttxfee"); + return(0); +} + +void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) +{ + *txfeep = LP_txfeecalc(LP_coinfind(base),0,0); + *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0,0); + printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); +} + +int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char *destcoin,double price,uint64_t satoshis,uint64_t destsatoshis) +{ + memset(qp,0,sizeof(*qp)); + if ( qp->timestamp == 0 ) + qp->timestamp = (uint32_t)time(NULL); + safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); + LP_txfees(&qp->txfee,&qp->desttxfee,utxo->coin,qp->destcoin); + qp->satoshis = satoshis;//(destsatoshis / price) + 0.49; + qp->destsatoshis = destsatoshis; + /*if ( qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) //utxo->iambob == 0 || + { + printf("quoteinit error.(%d %d %d %d) %.8f vs %.8f\n",utxo->iambob == 0,qp->txfee >= qp->satoshis,qp->txfee >= utxo->deposit.value,utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis),dstr(utxo->deposit.value),dstr(LP_DEPOSITSATOSHIS(qp->satoshis))); + return(-1); + }*/ + qp->txid = utxo->payment.txid; + qp->vout = utxo->payment.vout; + qp->txid2 = utxo->deposit.txid; + qp->vout2 = utxo->deposit.vout; + if ( qp->desttxfee >= qp->destsatoshis ) + { + printf("quoteinit desttxfee %.8f < %.8f destsatoshis\n",dstr(qp->desttxfee),dstr(qp->destsatoshis)); + return(-2); + } + safecopy(qp->srccoin,utxo->coin,sizeof(qp->srccoin)); + safecopy(qp->coinaddr,utxo->coinaddr,sizeof(qp->coinaddr)); + qp->srchash = utxo->pubkey; + return(0); +} + +int32_t LP_quotedestinfo(struct LP_quoteinfo *qp,bits256 desttxid,int32_t destvout,bits256 feetxid,int32_t feevout,bits256 desthash,char *destaddr) +{ + qp->desttxid = desttxid; + qp->destvout = destvout; + qp->desthash = desthash; + qp->feetxid = feetxid; + qp->feevout = feevout; + safecopy(qp->destaddr,destaddr,sizeof(qp->destaddr)); + return(0); +} + +char *LP_quotereceived(cJSON *argjson) +{ + struct LP_cacheinfo *ptr; double price; struct LP_quoteinfo Q; + LP_quoteparse(&Q,argjson); + price = (double)Q.destsatoshis / (Q.satoshis - Q.txfee); + if ( (ptr= LP_cacheadd(Q.srccoin,Q.destcoin,Q.txid,Q.vout,price,&Q)) != 0 ) + { + ptr->Q = Q; + printf(">>>>>>>>>> received quote %s/%s %.8f\n",Q.srccoin,Q.destcoin,price); + return(clonestr("{\"result\":\"updated\"}")); + } else return(clonestr("{\"error\":\"nullptr\"}")); +} + +void LP_smartutxos_push(struct iguana_info *coin) +{ + struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; + if ( coin->smartaddr[0] == 0 ) + return; + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); + for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) + free(retstr); + } + } + req = cJSON_CreateObject(); + jaddstr(req,"method","uitem"); + jaddstr(req,"coin",coin->symbol); + jaddstr(req,"coinaddr",coin->smartaddr); + jaddbits256(req,"txid",txid); + jaddnum(req,"vout",vout); + jaddnum(req,"ht",height); + jadd64bits(req,"value",value); + //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_reserved_msg("","",zero,jprint(req,1)); + } + } + free_json(array); + } +} + +char *LP_uitem_recv(cJSON *argjson) +{ + bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; + txid = jbits256(argjson,"txid"); + vout = jint(argjson,"vout"); + height = jint(argjson,"ht"); + value = j64bits(argjson,"value"); + coinaddr = jstr(argjson,"coinaddr"); + if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) + { + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); + } + return(clonestr("{\"result\":\"success\"}")); +} + +void LP_postutxos(char *symbol,char *coinaddr) +{ + bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); + if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); + if ( cJSON_GetArraySize(array) == 0 ) + free_json(array); + else + { + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","postutxos"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"coinaddr",coinaddr); + jadd(reqjson,"utxos",array); + //printf("post (%s) -> %d\n",msg,LP_mypubsock); + LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); + } + } +} + +char *LP_postutxos_recv(cJSON *argjson) +{ + int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; + //printf("posted.(%s)\n",jprint(argjson,0)); + if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig + { + if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) + { + if ( (array= jarray(&n,argjson,"utxos")) != 0 ) + LP_unspents_array(coin,coinaddr,array); + } + else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) + free_json(array); + } + return(clonestr("{\"result\":\"success\"}")); +} + +char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) +{ + bits256 zero; cJSON *reqjson = cJSON_CreateObject(); + // LP_addsig + memset(zero.bytes,0,sizeof(zero)); + jaddbits256(reqjson,"pubkey",G.LP_mypub25519); + jaddstr(reqjson,"base",base); + jaddstr(reqjson,"rel",rel); + jaddnum(reqjson,"price",price); + jaddstr(reqjson,"method","postprice"); + LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); + return(clonestr("{\"result\":\"success\"}")); +} + +char *LP_postprice_recv(cJSON *argjson) +{ + bits256 pubkey; double price; char *base,*rel; + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) + { + pubkey = jbits256(argjson,"pubkey"); + if ( bits256_nonz(pubkey) != 0 ) + { + LP_pricefeedupdate(pubkey,base,rel,price); + return(clonestr("{\"result\":\"success\"}")); + } + } + return(clonestr("{\"error\":\"missing fields in posted price\"}")); +} + +void LP_notify_pubkeys(void *ctx,int32_t pubsock) +{ + bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); + // LP_addsig + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","notify"); + jaddstr(reqjson,"rmd160",G.LP_myrmd160str); + jaddbits256(reqjson,"pub",G.LP_mypub25519); + init_hexbytes_noT(secpstr,G.LP_pubsecp,33); + jaddstr(reqjson,"pubsecp",secpstr); + LP_reserved_msg("","",zero,jprint(reqjson,1)); +} + +char *LP_notify_recv(cJSON *argjson) +{ + char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; + pub = jbits256(argjson,"pub"); + // LP_checksig + if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) + { + if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + { + decode_hex(pubp->rmd160,20,rmd160str); + if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) + { + decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); + //printf("got pubkey.(%s)\n",secpstr); + } + } + //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); + } + return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); +} + +void LP_listunspent_query(char *symbol,char *coinaddr) +{ + bits256 zero; cJSON *reqjson = cJSON_CreateObject(); + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","addr_unspents"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"address",coinaddr); + LP_reserved_msg("","",zero,jprint(reqjson,1)); +} + +void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) +{ + cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; + if ( strcmp(method,"request") == 0 ) + { + if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) + LP_unavailableset(utxo,qp->srchash); + else + { + printf("couldnt find my txid to make request\n"); + return; + } + } + reqjson = LP_quotejson(qp); + if ( bits256_nonz(qp->desthash) != 0 ) + flag = 1; + jaddbits256(reqjson,"pubkey",qp->srchash); + jaddstr(reqjson,"method",method); + msg = jprint(reqjson,1); + // LP_addsig + printf("QUERY.(%s)\n",msg); + memset(&zero,0,sizeof(zero)); + portable_mutex_lock(&LP_reservedmutex); + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) + Reserved_msgs[num_Reserved_msgs++] = msg; + else + { + //if ( 1 && strcmp(method,"request") == 0 ) + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); + //else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); + } + portable_mutex_unlock(&LP_reservedmutex); +} + From 49a37120ca9623e00dff278d6be1017ec50949ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 17:16:20 +0300 Subject: [PATCH 1199/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7997ce0e4..2c04ea60f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -630,7 +630,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; - if ( LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + if ( 1 )//LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); LP_listunspent_both(Q.srccoin,Q.coinaddr,0); From 845bcf78ae71940f7d56c9d18eae391213b368af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:09:08 +0300 Subject: [PATCH 1200/2732] Test --- iguana/exchanges/LP_ordermatch.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2c04ea60f..01d356fcd 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -556,17 +556,22 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) else return(-1); } -void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) +int32_t LP_alice_eligible() { - double price,maxprice = LP_Alicemaxprice; if ( time(NULL) > Alice_expiration ) { printf("time expired for Alice_request\n"); memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; - } - else if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) + return(1); + } else return(0); +} + +void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) +{ + double price,maxprice = LP_Alicemaxprice; + if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) @@ -592,7 +597,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, retval = 1; if ( strcmp(method,"reserved") == 0 ) { - if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) + if ( LP_alice_eligible() > 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) @@ -603,7 +608,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else if ( strcmp(method,"connected") == 0 ) { - if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) + if ( LP_alice_eligible() > 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_connectedalice(argjson)) != 0 ) From 815dfe81917dbd9d41e4ff9a5c8c29cd0cbd54d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:19:20 +0300 Subject: [PATCH 1201/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 01d356fcd..b85a5a22f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -662,7 +662,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } if ( butxo == 0 || butxo == &B ) butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); - if ( butxo == 0 ) + if ( butxo == 0 || bits256_cmp(Q.txid,butxo->payment.txid) != 0 || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 ) { printf("null butxo case\n"); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); From f8d6051357293b87db68830e7dcf6cb7a5b36937 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:33:49 +0300 Subject: [PATCH 1202/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b85a5a22f..7b170cda9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -597,7 +597,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, retval = 1; if ( strcmp(method,"reserved") == 0 ) { - if ( LP_alice_eligible() > 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) + if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) @@ -608,7 +608,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else if ( strcmp(method,"connected") == 0 ) { - if ( LP_alice_eligible() > 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) + if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_connectedalice(argjson)) != 0 ) From 93e7c254aa9e62e06b4d7aed19cd4c602fc99db0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:40:57 +0300 Subject: [PATCH 1203/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7b170cda9..832d786dd 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -558,14 +558,14 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) int32_t LP_alice_eligible() { - if ( time(NULL) > Alice_expiration ) + if ( Alice_expiration != 0 && time(NULL) > Alice_expiration ) { printf("time expired for Alice_request\n"); memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; - return(1); - } else return(0); + return(0); + } else return(1); } void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) From 6ebcf7a8aabfb3255ca2e2308c4d71b27614b3ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:42:13 +0300 Subject: [PATCH 1204/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 832d786dd..bd479ae5f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -564,8 +564,8 @@ int32_t LP_alice_eligible() memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; - return(0); - } else return(1); + } + return(Alice_expiration == 0); } void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) From 45c20e037210a3d2acca9ea7975629f22382bbdd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:43:25 +0300 Subject: [PATCH 1205/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bd479ae5f..ef1d36f6a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -565,7 +565,7 @@ int32_t LP_alice_eligible() LP_Alicemaxprice = 0.; Alice_expiration = 0; } - return(Alice_expiration == 0); + return(Alice_expiration == 0 || time(NULL) < Alice_expiration); } void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) From 1c889e3e2b1fc5c954f51c539f65fb6ae73f88b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:44:30 +0300 Subject: [PATCH 1206/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ef1d36f6a..395ec3880 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -581,7 +581,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo Alice_expiration = 0; LP_query(ctx,myipaddr,mypubsock,"connect",qp); } - } + } else printf("reject reserved due to not eligible.%d or mismatched quote\n",LP_alice_eligible()); } int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) From 344843751ebac2bd4e9cb37ee4f59648f583ecb5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 18:48:30 +0300 Subject: [PATCH 1207/2732] Test --- iguana/exchanges/LP_ordermatch.c | 113 +++++++++++++++++-------------- 1 file changed, 61 insertions(+), 52 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 395ec3880..a3b50ddda 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -382,6 +382,59 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(retval); } +struct LP_quoteinfo LP_Alicequery; +double LP_Alicemaxprice; +uint32_t Alice_expiration; +char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) +{ + struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; + if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) + { + char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); + return(clonestr("{\"error\":\"cant find alice utxopair\"}")); + } + price = 0.; + LP_query(ctx,myipaddr,mypubsock,"request",qp); + LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; + return(clonestr("{\"result\":\"success\"}")); +} + +int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) +{ + if ( bits256_cmp(qp->srchash,qp2->srchash) == 0 && bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) + return(0); + else return(-1); +} + +int32_t LP_alice_eligible() +{ + if ( Alice_expiration != 0 && time(NULL) > Alice_expiration ) + { + printf("time expired for Alice_request\n"); + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + LP_Alicemaxprice = 0.; + Alice_expiration = 0; + } + return(Alice_expiration == 0 || time(NULL) < Alice_expiration); +} + +void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) +{ + double price,maxprice = LP_Alicemaxprice; + if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) + { + price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); + if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) + { + //memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + //LP_Alicemaxprice = 0.; + //Alice_expiration = 0; + LP_Alicequery = *qp; + LP_query(ctx,myipaddr,mypubsock,"connect",qp); + } + } else printf("reject reserved due to not eligible.%d or mismatched quote\n",LP_alice_eligible()); +} + char *LP_connectedalice(cJSON *argjson) // alice { cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; //uint64_t value,value2; @@ -390,6 +443,14 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s) numpending.%d\n",jprint(argjson,0),G.LP_pendingswaps); + if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) + { + printf("reject mismatched alice query\n"); + return(clonestr("{\"error\",\"mismatched alice query\"}")); + } + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + LP_Alicemaxprice = 0.; + Alice_expiration = 0; /*if ( G.LP_pendingswaps > 0 ) { printf("swap already pending\n"); @@ -532,58 +593,6 @@ char *LP_bestfit(char *rel,double relvolume) return(jprint(LP_utxojson(autxo),1)); } -struct LP_quoteinfo LP_Alicequery; -double LP_Alicemaxprice; -uint32_t Alice_expiration; -char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) -{ - struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; - if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) - { - char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); - return(clonestr("{\"error\":\"cant find alice utxopair\"}")); - } - price = 0.; - LP_query(ctx,myipaddr,mypubsock,"request",qp); - LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; - return(clonestr("{\"result\":\"success\"}")); -} - -int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) -{ - if ( bits256_cmp(qp->srchash,qp2->srchash) == 0 && bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) - return(0); - else return(-1); -} - -int32_t LP_alice_eligible() -{ - if ( Alice_expiration != 0 && time(NULL) > Alice_expiration ) - { - printf("time expired for Alice_request\n"); - memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - LP_Alicemaxprice = 0.; - Alice_expiration = 0; - } - return(Alice_expiration == 0 || time(NULL) < Alice_expiration); -} - -void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) -{ - double price,maxprice = LP_Alicemaxprice; - if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) - { - price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); - if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) - { - memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - LP_Alicemaxprice = 0.; - Alice_expiration = 0; - LP_query(ctx,myipaddr,mypubsock,"connect",qp); - } - } else printf("reject reserved due to not eligible.%d or mismatched quote\n",LP_alice_eligible()); -} - int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); From 258899dc548cc5ad5b801449700d8a58e178561d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 19:36:24 +0300 Subject: [PATCH 1208/2732] Test 1% margin --- iguana/exchanges/LP_ordermatch.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a3b50ddda..f8e047228 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -420,7 +420,7 @@ int32_t LP_alice_eligible() void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) { - double price,maxprice = LP_Alicemaxprice; + double price=0.,maxprice = LP_Alicemaxprice; if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); @@ -432,7 +432,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo LP_Alicequery = *qp; LP_query(ctx,myipaddr,mypubsock,"connect",qp); } - } else printf("reject reserved due to not eligible.%d or mismatched quote\n",LP_alice_eligible()); + } else printf("reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(),price,maxprice); } char *LP_connectedalice(cJSON *argjson) // alice @@ -451,11 +451,6 @@ char *LP_connectedalice(cJSON *argjson) // alice memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; - /*if ( G.LP_pendingswaps > 0 ) - { - printf("swap already pending\n"); - return(clonestr("{\"error\":\"swap already pending\"}")); - }*/ if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { printf("cant find autxo\n"); @@ -849,9 +844,9 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel } if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); - //if ( strcmp("BTC",rel) == 0 ) - // maxprice *= 1.01; - //else maxprice *= 1.001; + if ( strcmp("BTC",rel) == 0 ) + maxprice *= 1.01; + else maxprice *= 1.001; memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; From 2c3d8eacc8b74a43f90a7843eeb1c595a522a584 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 19:38:39 +0300 Subject: [PATCH 1209/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f8e047228..1f3ff2a57 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -770,6 +770,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { item = jitem(asks,i); price = jdouble(item,"price"); + price *= 1.005; pubkey = jbits256(item,"pubkey"); //printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) From a6583d92052832bbdc62f9a7037bf94d2a689a9e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:11:54 +0300 Subject: [PATCH 1210/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 55f888517..25e5d4169 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -197,7 +197,7 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); - if ( (rand() % 100) == 0 && IAMLP == 0 ) + if ( 0 && (rand() % 100) == 0 && IAMLP == 0 ) { HASH_ITER(hh,LP_peerinfos,peer,tmp) { From a6d7dfddc02deaf9d6acba06bedeaa98e2f0fd90 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:16:06 +0300 Subject: [PATCH 1211/2732] Reduce latency --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d53602a4a..18c21d2c6 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -185,7 +185,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; + uint32_t lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9cb9b0a53..623245d91 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -356,6 +356,9 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) continue; if ( coin->smartaddr[0] == 0 ) continue; + if ( coin->lastutxosync != 0 && time(NULL) < coin->lastutxosync+60 ) + continue; + coin->lastutxosync = (uint32_t)time(NULL); total = 0; if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr,0)) == 0 ) continue; @@ -495,8 +498,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { nonz++; LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + needpings++; peer->diduquery = 0; - LP_utxos_sync(peer); } peer->lastpeers = now; } @@ -505,7 +508,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz++; needpings++; LP_peer_pricesquery(peer); - LP_utxos_sync(peer); peer->diduquery = now; } if ( peer->needping != 0 ) @@ -522,6 +524,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz++; //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); + LP_utxos_sync(peer); } if ( (counter % 6000) == 10 ) { From 404d814e016e603b23cc57b8383fdf57ead7ac49 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:19:44 +0300 Subject: [PATCH 1212/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 623245d91..9cb9b0a53 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -356,9 +356,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) continue; if ( coin->smartaddr[0] == 0 ) continue; - if ( coin->lastutxosync != 0 && time(NULL) < coin->lastutxosync+60 ) - continue; - coin->lastutxosync = (uint32_t)time(NULL); total = 0; if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr,0)) == 0 ) continue; @@ -498,8 +495,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { nonz++; LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - needpings++; peer->diduquery = 0; + LP_utxos_sync(peer); } peer->lastpeers = now; } @@ -508,6 +505,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz++; needpings++; LP_peer_pricesquery(peer); + LP_utxos_sync(peer); peer->diduquery = now; } if ( peer->needping != 0 ) @@ -524,7 +522,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz++; //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); - LP_utxos_sync(peer); } if ( (counter % 6000) == 10 ) { From b86305077c5945203d2d6187ffb20bfe3079d794 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:21:24 +0300 Subject: [PATCH 1213/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9cb9b0a53..3ac0b4326 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -235,7 +235,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { - while ( nonz < 100 && recvlen > 0 ) + while ( nonz < 1 && recvlen > 0 ) { memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; From bf44c427147313ce3669bf3d515b197c1941a1bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:26:46 +0300 Subject: [PATCH 1214/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3ac0b4326..04771644c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -54,6 +54,7 @@ int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; int32_t LP_showwif,IAMLP = 0; double LP_profitratio = 1.; +char *LP_lastcommand; struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; @@ -230,12 +231,12 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, return(retstr); } -int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr) +int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr,int32_t maxdepth) { int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { - while ( nonz < 1 && recvlen > 0 ) + while ( nonz < maxdepth && recvlen > 0 ) { memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; @@ -258,6 +259,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } } nonz++; + if ( LP_lastcommand != 0 ) + free(LP_lastcommand); + LP_lastcommand = clonestr((char *)ptr); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -269,6 +273,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) printf("self.(%s)\n",str); + if ( LP_lastcommand != 0 ) + free(LP_lastcommand); + LP_lastcommand = clonestr(str); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { portable_mutex_lock(&LP_commandmutex); @@ -294,7 +301,7 @@ int32_t LP_nanomsg_recvs(void *ctx) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); if ( lastmilli > 0. && milli > lastmilli+3000 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",milli-lastmilli); + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); HASH_ITER(hh,LP_peerinfos,peer,tmp) @@ -310,7 +317,7 @@ int32_t LP_nanomsg_recvs(void *ctx) } } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); - nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr); + nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,10); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -320,7 +327,7 @@ int32_t LP_nanomsg_recvs(void *ctx) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); }*/ if ( LP_mypullsock >= 0 ) - nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); + nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz); } From 42170b7ba0b60a46d165943c80bd03e7a6b0da7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:30:10 +0300 Subject: [PATCH 1215/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 04771644c..ee255566d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -894,7 +894,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( nonz == 0 ) usleep(10000); else if ( IAMLP != 0 ) - usleep(1000); + usleep(1); else usleep(10000); } } From e98e8e8cf4b34d92c3af1c09d983df9d3d4d207b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:33:24 +0300 Subject: [PATCH 1216/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ee255566d..d7c48b309 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -349,6 +349,7 @@ void command_rpcloop(void *myipaddr) } else if ( IAMLP == 0 ) usleep(1000); + else usleep(10); } } @@ -698,7 +699,7 @@ int32_t LP_reserved_msgs() #ifdef __APPLE__ usleep(5000); #else - usleep(100); + usleep(10); #endif } portable_mutex_unlock(&LP_reservedmutex); @@ -894,7 +895,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( nonz == 0 ) usleep(10000); else if ( IAMLP != 0 ) - usleep(1); + usleep(10); else usleep(10000); } } From 9fba11e646560b92339ba1c3b286ec9d0f843afd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:38:29 +0300 Subject: [PATCH 1217/2732] Prevent electrum from being bob --- iguana/exchanges/LP_ordermatch.c | 5 +++++ iguana/exchanges/LP_signatures.c | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1f3ff2a57..bb1f00ceb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -627,6 +627,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } + if ( coin->electrum != 0 ) + { + printf("electrum can only be for alice\n"); + return(retval); + } price = ask; autxo = &A; butxo = &B; diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 25e5d4169..ff428c029 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -277,16 +277,19 @@ char *LP_postutxos_recv(cJSON *argjson) char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { - bits256 zero; cJSON *reqjson = cJSON_CreateObject(); + struct iguana_info *basecoin,*relcoin; bits256 zero; cJSON *reqjson = cJSON_CreateObject(); // LP_addsig - memset(zero.bytes,0,sizeof(zero)); - jaddbits256(reqjson,"pubkey",G.LP_mypub25519); - jaddstr(reqjson,"base",base); - jaddstr(reqjson,"rel",rel); - jaddnum(reqjson,"price",price); - jaddstr(reqjson,"method","postprice"); - LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); - return(clonestr("{\"result\":\"success\"}")); + if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 && relcoin->electrum == 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + jaddbits256(reqjson,"pubkey",G.LP_mypub25519); + jaddstr(reqjson,"base",base); + jaddstr(reqjson,"rel",rel); + jaddnum(reqjson,"price",price); + jaddstr(reqjson,"method","postprice"); + LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); + return(clonestr("{\"result\":\"success\"}")); + } else return(clonestr("{\"error\":\"electrum node cant post bob asks\"}")); } char *LP_postprice_recv(cJSON *argjson) From 46f8d84e3a2f5555c14df4128c8ab8da7befc4e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:41:37 +0300 Subject: [PATCH 1218/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d7c48b309..9857b0829 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -300,7 +300,7 @@ int32_t LP_nanomsg_recvs(void *ctx) if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); - if ( lastmilli > 0. && milli > lastmilli+3000 ) + if ( lastmilli > 0. && milli > lastmilli+1000 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); From 6ba1229b2b7285b224336cc5c7e178ce7ed6ee96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:43:23 +0300 Subject: [PATCH 1219/2732] Prevent GAME from being bob --- iguana/exchanges/LP_ordermatch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bb1f00ceb..86f8aeaae 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -632,6 +632,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("electrum can only be for alice\n"); return(retval); } + if ( strcmp(Q.srccoin,"GAME") == 0 ) + { + printf("{\"error\":\"GAME can only be alice coin\"}\n"); + return(retval); + } price = ask; autxo = &A; butxo = &B; From 83b4ad4fa8096c6e6fab30d3a6912193b1c96e3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:45:25 +0300 Subject: [PATCH 1220/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9857b0829..5564dfdb9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -317,7 +317,7 @@ int32_t LP_nanomsg_recvs(void *ctx) } } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); - nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,10); + nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 86f8aeaae..2c5d1a506 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -588,6 +588,13 @@ char *LP_bestfit(char *rel,double relvolume) return(jprint(LP_utxojson(autxo),1)); } +int32_t LP_aliceonly(char *symbol) +{ + if ( strcmp(symbol,"GAME") == 0 ) + return(1); + else return(0); +} + int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); @@ -632,7 +639,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("electrum can only be for alice\n"); return(retval); } - if ( strcmp(Q.srccoin,"GAME") == 0 ) + if ( LP_aliceonly(Q.srccoin) > 0 ) { printf("{\"error\":\"GAME can only be alice coin\"}\n"); return(retval); @@ -832,7 +839,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce) { uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; - if ( strcmp(base,"GAME") == 0 ) + if ( LP_aliceonly(base) > 0 ) return(clonestr("{\"error\":\"GAME can only be alice coin\"}")); printf("LP_autobuy %s/%s price %.8f vol %.8f nonce %u\n",base,rel,maxprice,relvolume,nonce); if ( (lastnonce= LP_lastnonce) != 0 && nonce <= lastnonce ) From 46ddd5046e0ceffb85d941391a8da4adb32498bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 22:57:53 +0300 Subject: [PATCH 1221/2732] #define LP_AUTOTRADE_TIMEOUT 20 --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 18c21d2c6..ff4c59957 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,7 +44,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 10 +#define LP_AUTOTRADE_TIMEOUT 20 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 From ee5a792d05b8e03218b5bbfcd0dfb83a4e18f9f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:14:42 +0300 Subject: [PATCH 1222/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2c5d1a506..cc5229c22 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -650,12 +650,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); + printf("utxopairfind\n"); if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) butxo = &B; //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; + printf("request.(%s)\n",jprint(argjson,0)); if ( 1 )//LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); @@ -685,7 +687,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 || bits256_cmp(Q.txid,butxo->payment.txid) != 0 || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 ) { - printf("null butxo case\n"); + printf("null butxo.%p case\n",butxo); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); From 8d72b3169ab9079f6398b1d6e9621012c509bd45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:22:13 +0300 Subject: [PATCH 1223/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5564dfdb9..b25945c28 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -699,7 +699,7 @@ int32_t LP_reserved_msgs() #ifdef __APPLE__ usleep(5000); #else - usleep(10); + usleep(1000); #endif } portable_mutex_unlock(&LP_reservedmutex); From d17c3d79851cc2befd59c921b8249c8ae8cb8542 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:25:50 +0300 Subject: [PATCH 1224/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_ordermatch.c | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b25945c28..18194d166 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -682,7 +682,7 @@ int32_t LP_reserved_msgs() bits256 zero; int32_t n = 0; //struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs > 0 ) + while ( num_Reserved_msgs > 0 ) { /*memset(&pfd,0,sizeof(pfd)); pfd.fd = LP_mypubsock; @@ -695,7 +695,8 @@ int32_t LP_reserved_msgs() #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; - n++; + if ( n++ > 10 ) + break; #ifdef __APPLE__ usleep(5000); #else diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cc5229c22..cb5dd3d0f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -426,10 +426,9 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) { - //memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - //LP_Alicemaxprice = 0.; - //Alice_expiration = 0; - LP_Alicequery = *qp; + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + LP_Alicemaxprice = 0.; + Alice_expiration = 0; LP_query(ctx,myipaddr,mypubsock,"connect",qp); } } else printf("reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(),price,maxprice); @@ -443,14 +442,14 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s) numpending.%d\n",jprint(argjson,0),G.LP_pendingswaps); - if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) + /*if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) { printf("reject mismatched alice query\n"); return(clonestr("{\"error\",\"mismatched alice query\"}")); } memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; - Alice_expiration = 0; + Alice_expiration = 0;*/ if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { printf("cant find autxo\n"); @@ -619,7 +618,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else if ( strcmp(method,"connected") == 0 ) { - if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) + if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_connectedalice(argjson)) != 0 ) From fb7e3f274054b6971a6753e2c74bb451f84366ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:40:03 +0300 Subject: [PATCH 1225/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 18194d166..2a2258996 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -695,7 +695,8 @@ int32_t LP_reserved_msgs() #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; - if ( n++ > 10 ) + n++; + if ( n > 0 ) break; #ifdef __APPLE__ usleep(5000); From c85d66faca508d0e0085d26d2ff7fec1a7189d57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:40:15 +0300 Subject: [PATCH 1226/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2a2258996..e55b04644 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -695,14 +695,14 @@ int32_t LP_reserved_msgs() #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; - n++; - if ( n > 0 ) - break; #ifdef __APPLE__ usleep(5000); #else usleep(1000); #endif + n++; + if ( n > 0 ) + break; } portable_mutex_unlock(&LP_reservedmutex); return(n); From cf6054b39cfb6d37cc7d1729ff34e3925f2cc263 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:46:42 +0300 Subject: [PATCH 1227/2732] 3 second latency --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e55b04644..000bcd399 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -300,7 +300,7 @@ int32_t LP_nanomsg_recvs(void *ctx) if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; milli = OS_milliseconds(); - if ( lastmilli > 0. && milli > lastmilli+1000 ) + if ( lastmilli > 0. && milli > lastmilli+3000 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); From 7fe4c5ca679de3eb2df660a81921df9aed45d577 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Oct 2017 23:53:44 +0300 Subject: [PATCH 1228/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 7b04dc444..45307bedf 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -126,7 +126,6 @@ int32_t LP_peerindsock(int32_t *peerindp) struct LP_peerinfo *peer,*tmp; int32_t peerind = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - peerind++; if ( peer->errors < LP_MAXPEER_ERRORS && peer->pushsock >= 0 ) { if ( peerind < *peerindp ) @@ -135,6 +134,7 @@ int32_t LP_peerindsock(int32_t *peerindp) //printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); return(peer->pushsock); } + peerind++; } return(-1); } From a969ae6c9d66e7cf59917005a37efc54ece8300c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 11:53:19 +0300 Subject: [PATCH 1229/2732] Gui string --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 14 ++++++++++---- iguana/exchanges/LP_signatures.c | 2 ++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ff4c59957..141fa9023 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -252,7 +252,7 @@ struct LP_quoteinfo bits256 srchash,desthash,txid,txid2,desttxid,feetxid,privkey; uint64_t satoshis,txfee,destsatoshis,desttxfee; uint32_t timestamp,quotetime; int32_t vout,vout2,destvout,feevout,pair; - char srccoin[16],coinaddr[64],destcoin[16],destaddr[64]; + char srccoin[16],coinaddr[64],destcoin[16],destaddr[64],gui[64]; }; struct LP_endpoint { int32_t pair; char ipaddr[64]; uint16_t port; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 000bcd399..7a9021013 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -299,10 +299,6 @@ int32_t LP_nanomsg_recvs(void *ctx) int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; - milli = OS_milliseconds(); - if ( lastmilli > 0. && milli > lastmilli+3000 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); - lastmilli = milli; //portable_mutex_lock(&LP_nanorecvsmutex); HASH_ITER(hh,LP_peerinfos,peer,tmp) { @@ -317,7 +313,11 @@ int32_t LP_nanomsg_recvs(void *ctx) } } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); + milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); + if ( lastmilli > 0. && milli > lastmilli+1000 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); + lastmilli = milli; } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -327,7 +327,13 @@ int32_t LP_nanomsg_recvs(void *ctx) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); }*/ if ( LP_mypullsock >= 0 ) + { + milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); + if ( lastmilli > 0. && milli > lastmilli+1000 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); + lastmilli = milli; + } //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index ff428c029..27d47d1f5 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -42,6 +42,7 @@ struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srch cJSON *LP_quotejson(struct LP_quoteinfo *qp) { double price; cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"gui",qp->gui[0] != 0 ? qp->gui : LP_gui); jaddstr(retjson,"base",qp->srccoin); jaddstr(retjson,"rel",qp->destcoin); if ( qp->coinaddr[0] != 0 ) @@ -96,6 +97,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) { + safecopy(qp->gui,LP_gui,sizeof(qp->gui)); safecopy(qp->srccoin,jstr(argjson,"base"),sizeof(qp->srccoin)); safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr)); safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin)); From 68ae05ec06549afca7abbe49ec717114a7b7190d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 11:59:43 +0300 Subject: [PATCH 1230/2732] Test --- iguana/exchanges/LP_prices.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1b834481f..a7587186d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -186,9 +186,10 @@ struct LP_pubkeyinfo *LP_pubkeyfind(bits256 pubkey) struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) { struct LP_pubkeyinfo *pubp=0; - if ( (pubp= LP_pubkeyfind(pubkey)) == 0 ) + portable_mutex_lock(&LP_pubkeymutex); + HASH_FIND(hh,LP_pubkeyinfos,&pubkey,sizeof(pubkey),pubp); + if ( pubp == 0 ) { - portable_mutex_lock(&LP_pubkeymutex); pubp = calloc(1,sizeof(*pubp)); pubp->pubkey = pubkey; if ( bits256_cmp(G.LP_mypub25519,pubkey) == 0 ) @@ -197,10 +198,11 @@ struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) memcpy(pubp->pubsecp,G.LP_pubsecp,sizeof(pubp->pubsecp)); } HASH_ADD_KEYPTR(hh,LP_pubkeyinfos,&pubp->pubkey,sizeof(pubp->pubkey),pubp); - portable_mutex_unlock(&LP_pubkeymutex); - if ( (pubp= LP_pubkeyfind(pubkey)) == 0 ) + HASH_FIND(hh,LP_pubkeyinfos,&pubkey,sizeof(pubkey),pubp); + if ( pubp == 0 ) printf("pubkeyadd find error after add\n"); } + portable_mutex_unlock(&LP_pubkeymutex); return(pubp); } From 7f2f2edd0712f8667d26092772461b1320ab06e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:14:51 +0300 Subject: [PATCH 1231/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 6 +++--- iguana/exchanges/LP_utxos.c | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cb5dd3d0f..8348629ac 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -798,7 +798,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i break; if ( j != numavoids ) continue; - if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) + if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyfind(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); LP_listunspent_query(base,coinaddr); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a7587186d..eaebd8212 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -504,7 +504,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) basepp->myprices[relpp->ind] = price; // ask //printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); //relpp->myprices[basepp->ind] = (1. / price); // bid - if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) + if ( (pubp= LP_pubkeyfind(G.LP_mypub25519)) != 0 ) { pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); @@ -1063,7 +1063,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) fwrite(&price64,1,sizeof(price64),fp); fflush(fp); } - if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) + if ( (pubp= LP_pubkeyfind(pubkey)) != 0 ) { if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { @@ -1074,7 +1074,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); } pubp->timestamp = (uint32_t)time(NULL); - } else printf("error creating pubkey entry\n"); + } else printf("error finding pubkey entry\n"); } //else if ( (rand() % 100) == 0 ) // printf("error finding %s/%s %.8f\n",base,rel,price); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 44cbb2991..ed328c508 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -762,6 +762,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan checkkey.bytes[0] &= 248, checkkey.bytes[31] &= 127, checkkey.bytes[31] |= 64; G.LP_mypub25519 = *pubkeyp = curve25519(checkkey,curve25519_basepoint9()); G.LP_mypriv25519 = checkkey; + LP_pubkeyadd(G.LP_mypub25519); return(privkey); } From d003ecfb2b33cb377b89eddf3b9c008c92c36c34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:16:48 +0300 Subject: [PATCH 1232/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index eaebd8212..65fa5d04c 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1074,7 +1074,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); } pubp->timestamp = (uint32_t)time(NULL); - } else printf("error finding pubkey entry\n"); + } else printf("error finding pubkey entry %s, ok if rare\n",bits256_str(str,pubkey)); } //else if ( (rand() % 100) == 0 ) // printf("error finding %s/%s %.8f\n",base,rel,price); From 99f4152c5dbfb39ba7373425371911c93a45c466 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:20:21 +0300 Subject: [PATCH 1233/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7a9021013..974e6e524 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -315,7 +315,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( lastmilli > 0. && milli > lastmilli+1000 ) + if ( lastmilli > 0. && milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; } @@ -330,7 +330,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( lastmilli > 0. && milli > lastmilli+1000 ) + if ( lastmilli > 0. && milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; } From c17c72d32b4fd7157260ca584b5471998b21380c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:22:22 +0300 Subject: [PATCH 1234/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 65fa5d04c..4d11b23ef 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1063,7 +1063,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) fwrite(&price64,1,sizeof(price64),fp); fflush(fp); } - if ( (pubp= LP_pubkeyfind(pubkey)) != 0 ) + if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { From c86313c8eef192e6521185894cb89e9a4ea9ade1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:25:34 +0300 Subject: [PATCH 1235/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 974e6e524..84a943bb5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -315,7 +315,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( lastmilli > 0. && milli > lastmilli+100 ) + if ( lastmilli > 0. )//&& milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; } @@ -330,7 +330,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( lastmilli > 0. && milli > lastmilli+100 ) + if ( lastmilli > 0. )//&& milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; } From 3685f8df1105f7e8d2289f2e860f8f8e5394da0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:31:14 +0300 Subject: [PATCH 1236/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 84a943bb5..1db4c0fba 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -525,7 +525,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( peer->needping != 0 ) { nonz++; - needpings++; if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); peer->needping = 0; @@ -534,7 +533,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( needpings != 0 || (counter % 6000) == 5 ) { nonz++; - //printf("needpings.%d send notify\n",needpings); + printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) From 3cdd2a41844bbfaaa0bc58609592ab89b5bde6a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:37:34 +0300 Subject: [PATCH 1237/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1db4c0fba..123eaddf8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -315,7 +315,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( lastmilli > 0. )//&& milli > lastmilli+100 ) + if ( lastmilli > 0. && milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; } @@ -330,7 +330,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( lastmilli > 0. )//&& milli > lastmilli+100 ) + if ( lastmilli > 0. && milli > lastmilli+100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); lastmilli = milli; } @@ -494,7 +494,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 10000) == 0 ) + if ( (rand() % 100000) == 0 ) { peer->errors--; if ( peer->errors < LP_MAXPEER_ERRORS ) @@ -503,7 +503,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+60 || (rand() % 10000) == 0 ) + if ( now > peer->lastpeers+60 )//|| (rand() % 10000) == 0 ) { if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { @@ -517,7 +517,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( peer->diduquery == 0 ) { nonz++; - needpings++; LP_peer_pricesquery(peer); LP_utxos_sync(peer); peer->diduquery = now; @@ -528,9 +527,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); peer->needping = 0; + needpings++; } } - if ( needpings != 0 || (counter % 6000) == 5 ) + if ( needpings != 0 )//|| (counter % 6000) == 5 ) { nonz++; printf("needpings.%d send notify\n",needpings); From ae6d1f1cf520a3614a1ebfeabe0606999c135387 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:40:33 +0300 Subject: [PATCH 1238/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 27d47d1f5..11f66cb9c 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -325,7 +325,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) char *LP_notify_recv(cJSON *argjson) { - char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; + char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; double millis = OS_milliseconds(); pub = jbits256(argjson,"pub"); // LP_checksig if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) @@ -339,7 +339,7 @@ char *LP_notify_recv(cJSON *argjson) //printf("got pubkey.(%s)\n",secpstr); } } - //printf("NOTIFIED pub %s rmd160 %s\n",bits256_str(str,pub),rmd160str); + char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); } return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); } From 2fc24f0d703d9390aab7a802c465870e2c874c57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:49:53 +0300 Subject: [PATCH 1239/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8348629ac..cb5dd3d0f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -798,7 +798,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i break; if ( j != numavoids ) continue; - if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyfind(pubkey)) != 0 ) + if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); LP_listunspent_query(base,coinaddr); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 4d11b23ef..98f0e7d40 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -209,7 +209,7 @@ struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) int32_t LP_pubkey_istrusted(bits256 pubkey) { struct LP_pubkeyinfo *pubp; - if ( (pubp= LP_pubkeyfind(pubkey)) != 0 ) + if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) return(pubp->istrusted != 0); return(0); } @@ -217,7 +217,7 @@ int32_t LP_pubkey_istrusted(bits256 pubkey) char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) { struct LP_pubkeyinfo *pubp; - if ( (pubp= LP_pubkeyfind(pubkey)) != 0 ) + if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { pubp->istrusted = trustval; return(clonestr("{\"result\":\"success\"}")); @@ -504,7 +504,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) basepp->myprices[relpp->ind] = price; // ask //printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); //relpp->myprices[basepp->ind] = (1. / price); // bid - if ( (pubp= LP_pubkeyfind(G.LP_mypub25519)) != 0 ) + if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) { pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); From df197f921c1ee0757559700e6e9fe8c414abff47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:55:10 +0300 Subject: [PATCH 1240/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 123eaddf8..729cddfa0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -159,7 +159,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate != 0 ) dup++; @@ -216,14 +215,15 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; + portable_mutex_lock(&LP_commandmutex); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } + portable_mutex_unlock(&LP_commandmutex); free_json(argjson); } } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); - portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && encrypted == 0 ) free(jsonstr); if ( ptr != 0 ) From 0750aed25cca630475a9c9abab33fe0ac5224985 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 12:56:20 +0300 Subject: [PATCH 1241/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 729cddfa0..365101b7b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -117,6 +117,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson char *retstr=0; if ( jobj(argjson,"result") != 0 || jobj(argjson,"error") != 0 ) return(0); + double millis = OS_milliseconds(); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) @@ -126,6 +127,8 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); + if ( OS_milliseconds()-millis > 100 ) + printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); return(retstr); } From ff7808783c07d2ca7abcfc4c396da5c495efceb2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:00:55 +0300 Subject: [PATCH 1242/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 365101b7b..a9bd47d71 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -218,11 +218,13 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; + double millis = OS_milliseconds(); portable_mutex_lock(&LP_commandmutex); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } portable_mutex_unlock(&LP_commandmutex); + printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); free_json(argjson); } } From 573330c0cb403c5c1b3d3b335b5514fd0a159ce0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:06:41 +0300 Subject: [PATCH 1243/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a9bd47d71..1c9d62d26 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -159,6 +159,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { static uint32_t dup,uniq; int32_t i,len,cipherlen,datalen=0,duplicate=0,encrypted=0; char *method,*method2,*tmp,*cipherstr,*retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; + double millis = OS_milliseconds(); crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; @@ -218,7 +219,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - double millis = OS_milliseconds(); portable_mutex_lock(&LP_commandmutex); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { From c4f4a8a3d634a07c5c24fc6a7923b1ce02b17a89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:10:24 +0300 Subject: [PATCH 1244/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1c9d62d26..2fcb1e0d1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -535,7 +535,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int needpings++; } } - if ( needpings != 0 )//|| (counter % 6000) == 5 ) + if ( needpings != 0 || (counter % 100000) == 5 ) { nonz++; printf("needpings.%d send notify\n",needpings); From b3057234dba459225472371e92d01e17bdb44e9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:15:15 +0300 Subject: [PATCH 1245/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2fcb1e0d1..6aba19bdd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -238,7 +238,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr,int32_t maxdepth) { - int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char methodstr[64],*retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < maxdepth && recvlen > 0 ) @@ -250,16 +250,17 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - if ( 0 ) + if ( 1 ) { - cJSON *recvjson; char *mstr,*cstr; + cJSON *recvjson; //char *mstr,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { - if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && + /*if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { printf("%s RECV.(%s)\n",typestr,(char *)ptr); - } + }*/ + safecopy(methodstr,jstr(recvjson,"method"),sizeof(methodstr)); free_json(recvjson); } } @@ -267,6 +268,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( LP_lastcommand != 0 ) free(LP_lastcommand); LP_lastcommand = clonestr((char *)ptr); + double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -292,6 +294,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } + printf("%.3f LP_process_message %s\n",OS_milliseconds()-millis,methodstr); } } } From 87ccbef35c2fd7fcf30455efbbf6a4b576ac80c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:17:12 +0300 Subject: [PATCH 1246/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6aba19bdd..c96c27f22 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -243,6 +243,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { while ( nonz < maxdepth && recvlen > 0 ) { + nonz++; memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; @@ -264,7 +265,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - nonz++; if ( LP_lastcommand != 0 ) free(LP_lastcommand); LP_lastcommand = clonestr((char *)ptr); From d53fa3ea8464cc6a2557b3ca877493ce98aa7c5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:18:54 +0300 Subject: [PATCH 1247/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c96c27f22..0f4722c58 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -303,7 +303,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t LP_nanomsg_recvs(void *ctx) { - static double lastmilli; int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -323,9 +322,8 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( lastmilli > 0. && milli > lastmilli+100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); - lastmilli = milli; + if ( OS_milliseconds()-milli > 100 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -338,9 +336,8 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( lastmilli > 0. && milli > lastmilli+100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); - lastmilli = milli; + if ( OS_milliseconds()-milli > 100 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz); From 8c47d8ce4d344dd952dfe5ab54c2c07c12ee07e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:37:18 +0300 Subject: [PATCH 1248/2732] Test --- iguana/exchanges/LP_portfolio.c | 9 ++++++-- iguana/exchanges/LP_signatures.c | 36 ++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 482327f49..6d27a07aa 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -596,7 +596,7 @@ int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *a void prices_loop(void *ignore) { - char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; uint32_t expiration; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -634,7 +634,12 @@ void prices_loop(void *ignore) } free(retstr); } - sleep(60); + expiration = (uint32_t)time(NULL) + 60; + while ( time(NULL) < expiration ) + { + if ( LP_utxosQ_process() == 0 ) + usleep(10000); + } } } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 11f66cb9c..b09e548fb 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -260,21 +260,39 @@ void LP_postutxos(char *symbol,char *coinaddr) } } +queue_t utxosQ; +struct LP_utxos_qitem { struct queueitem DL; cJSON *argjson; }; + char *LP_postutxos_recv(cJSON *argjson) { - int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; - //printf("posted.(%s)\n",jprint(argjson,0)); - if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig + struct LP_utxos_qitem *uitem; + uitem = calloc(1,sizeof(*uitem)); + uitem->argjson = jduplicate(argjson); + queue_enqueue("utxosQ",&utxosQ,&uitem->DL); + return(clonestr("{\"result\":\"success\"}")); +} + +int32_t LP_utxosQ_process() +{ + struct LP_utxos_qitem *uitem; int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; + if ( (uitem= queue_dequeue(&utxosQ)) != 0 ) { - if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) + printf("LP_utxosQ_process.(%s)\n",jprint(uitem->argjson,0)); + if ( (coinaddr= jstr(uitem->argjson,"coinaddr")) != 0 && (symbol= jstr(uitem->argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig { - if ( (array= jarray(&n,argjson,"utxos")) != 0 ) - LP_unspents_array(coin,coinaddr,array); + if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) + { + if ( (array= jarray(&n,uitem->argjson,"utxos")) != 0 ) + LP_unspents_array(coin,coinaddr,array); + } + else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) + free_json(array); } - else if ( (array= electrum_address_listunspent(symbol,coin->electrum,&array,coinaddr,1)) != 0 ) - free_json(array); + free_json(uitem->argjson); + free(uitem); + return(1); } - return(clonestr("{\"result\":\"success\"}")); + return(0); } char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) From 35e651d006272136ee3a75d1d0eae97906d246fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:41:02 +0300 Subject: [PATCH 1249/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 +++++++++--------- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0f4722c58..af0374ab7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -117,7 +117,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson char *retstr=0; if ( jobj(argjson,"result") != 0 || jobj(argjson,"error") != 0 ) return(0); - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) @@ -127,8 +127,8 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); - if ( OS_milliseconds()-millis > 100 ) - printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); + //if ( OS_milliseconds()-millis > 100 ) + // printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); return(retstr); } @@ -159,7 +159,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { static uint32_t dup,uniq; int32_t i,len,cipherlen,datalen=0,duplicate=0,encrypted=0; char *method,*method2,*tmp,*cipherstr,*retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; @@ -224,7 +224,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { } portable_mutex_unlock(&LP_commandmutex); - printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); + //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); free_json(argjson); } } @@ -268,7 +268,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( LP_lastcommand != 0 ) free(LP_lastcommand); LP_lastcommand = clonestr((char *)ptr); - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -294,7 +294,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - printf("%.3f LP_process_message %s\n",OS_milliseconds()-millis,methodstr); + //printf("%.3f LP_process_message %s\n",OS_milliseconds()-millis,methodstr); } } } @@ -322,7 +322,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( OS_milliseconds()-milli > 100 ) + if ( OS_milliseconds()-milli > 3 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht @@ -336,7 +336,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( OS_milliseconds()-milli > 100 ) + if ( OS_milliseconds()-milli > 3 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } //portable_mutex_unlock(&LP_nanorecvsmutex); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b09e548fb..823698676 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -277,7 +277,7 @@ int32_t LP_utxosQ_process() struct LP_utxos_qitem *uitem; int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; if ( (uitem= queue_dequeue(&utxosQ)) != 0 ) { - printf("LP_utxosQ_process.(%s)\n",jprint(uitem->argjson,0)); + //printf("LP_utxosQ_process.(%s)\n",jprint(uitem->argjson,0)); if ( (coinaddr= jstr(uitem->argjson,"coinaddr")) != 0 && (symbol= jstr(uitem->argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig { if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 ) From b310426c72b709e47df9a2988a12786eec264149 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:44:11 +0300 Subject: [PATCH 1250/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index af0374ab7..cd2522d60 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,7 +322,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( OS_milliseconds()-milli > 3 ) + if ( OS_milliseconds()-milli > 13 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht @@ -336,7 +336,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( OS_milliseconds()-milli > 3 ) + if ( OS_milliseconds()-milli > 13 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } //portable_mutex_unlock(&LP_nanorecvsmutex); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 823698676..82890b3e6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -357,7 +357,7 @@ char *LP_notify_recv(cJSON *argjson) //printf("got pubkey.(%s)\n",secpstr); } } - char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); + //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); } return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); } From 9873b27ad468223a82cfb4d1934a959b463c37b6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:50:02 +0300 Subject: [PATCH 1251/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cd2522d60..aa3e9c7c7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,7 +322,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( OS_milliseconds()-milli > 13 ) + if ( OS_milliseconds()-milli > 100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht @@ -336,7 +336,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( OS_milliseconds()-milli > 13 ) + if ( OS_milliseconds()-milli > 100 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } //portable_mutex_unlock(&LP_nanorecvsmutex); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 82890b3e6..f674380b4 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -343,7 +343,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) char *LP_notify_recv(cJSON *argjson) { - char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; double millis = OS_milliseconds(); + char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; //double millis = OS_milliseconds(); pub = jbits256(argjson,"pub"); // LP_checksig if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) From c7399d29ff8f44b5b7bc74976471269c6085c834 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:57:07 +0300 Subject: [PATCH 1252/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_signatures.c | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index aa3e9c7c7..e597ab390 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -708,7 +708,7 @@ int32_t LP_reserved_msgs() #ifdef __APPLE__ usleep(5000); #else - usleep(1000); + usleep(3000); #endif n++; if ( n > 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cb5dd3d0f..d91db40fe 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -727,6 +727,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); // LP_addsig LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index f674380b4..87bee3dc4 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -374,7 +374,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -391,12 +391,16 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); + msg2 = clonestr(msg); // LP_addsig printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) + { Reserved_msgs[num_Reserved_msgs++] = msg; + Reserved_msgs[num_Reserved_msgs++] = msg2; + } else { //if ( 1 && strcmp(method,"request") == 0 ) From a7ee96aa1569ee9b25306e939d05190cc6b49d3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:59:43 +0300 Subject: [PATCH 1253/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e597ab390..fb2a7e8f7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -519,15 +519,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } peer->lastpeers = now; } - if ( peer->diduquery == 0 ) + if ( peer->diduquery == 0 || peer->needping != 0 ) { - nonz++; LP_peer_pricesquery(peer); LP_utxos_sync(peer); peer->diduquery = now; - } - if ( peer->needping != 0 ) - { nonz++; if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); @@ -535,7 +531,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int needpings++; } } - if ( needpings != 0 || (counter % 100000) == 5 ) + if ( needpings != 0 || (counter % 10000) == 5 ) { nonz++; printf("needpings.%d send notify\n",needpings); From 8a7ebabf3bd72a13c65d379b6f58ec2f5e199e94 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:02:53 +0300 Subject: [PATCH 1254/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ++--------- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fb2a7e8f7..9ab921b91 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -54,7 +54,6 @@ int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; int32_t LP_showwif,IAMLP = 0; double LP_profitratio = 1.; -char *LP_lastcommand; struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; @@ -265,9 +264,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - if ( LP_lastcommand != 0 ) - free(LP_lastcommand); - LP_lastcommand = clonestr((char *)ptr); //double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -280,9 +276,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) printf("self.(%s)\n",str); - if ( LP_lastcommand != 0 ) - free(LP_lastcommand); - LP_lastcommand = clonestr(str); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { portable_mutex_lock(&LP_commandmutex); @@ -323,7 +316,7 @@ int32_t LP_nanomsg_recvs(void *ctx) milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); if ( OS_milliseconds()-milli > 100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",OS_milliseconds()-milli); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -337,7 +330,7 @@ int32_t LP_nanomsg_recvs(void *ctx) milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); if ( OS_milliseconds()-milli > 100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",OS_milliseconds()-milli); } //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 87bee3dc4..b3ff9a9c9 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -391,13 +391,13 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); - msg2 = clonestr(msg); // LP_addsig printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) { + msg2 = clonestr(msg); Reserved_msgs[num_Reserved_msgs++] = msg; Reserved_msgs[num_Reserved_msgs++] = msg2; } From 4f37be01575b7d43b59d238f475b8359235f427f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:08:05 +0300 Subject: [PATCH 1255/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_signatures.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9ab921b91..55f5bcb57 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -601,7 +601,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //LP_getestimatedrate(coin); break; } - if ( (counter % 6000) == 60 ) + if ( (counter % 100000) == 90000 ) { if ( (retstr= basilisk_swapentry(0,0)) != 0 ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b3ff9a9c9..ac006543a 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -374,7 +374,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -395,11 +395,9 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-1 ) { - msg2 = clonestr(msg); Reserved_msgs[num_Reserved_msgs++] = msg; - Reserved_msgs[num_Reserved_msgs++] = msg2; } else { From 9d0d6cc7422eeb4348679d7ed82c469f1265ba3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:11:03 +0300 Subject: [PATCH 1256/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- iguana/exchanges/LP_signatures.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d91db40fe..80632ac5b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -596,7 +596,7 @@ int32_t LP_aliceonly(char *symbol) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*msg2,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { // LP_checksig @@ -726,8 +726,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); // LP_addsig + msg2 = clonestr(msg); LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); - LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index ac006543a..7a55e0f96 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -315,7 +315,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postprice_recv(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); @@ -374,7 +374,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -391,13 +391,15 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); + msg2 = clonestr(msg); // LP_addsig printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-1 ) + if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) { Reserved_msgs[num_Reserved_msgs++] = msg; + Reserved_msgs[num_Reserved_msgs++] = msg2; } else { From ba96a477de30a3fd60f11e825bd66cc673251449 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:13:42 +0300 Subject: [PATCH 1257/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 7a55e0f96..87bee3dc4 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -315,7 +315,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postprice_recv(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); From ec55a86f316cf14b366ee2135f353f862624e153 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:14:49 +0300 Subject: [PATCH 1258/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 141fa9023..4a44fe7d2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,7 +44,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 20 +#define LP_AUTOTRADE_TIMEOUT 30 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 From 9e5ae025c855a9256ab999a1e558465e70192b0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:17:39 +0300 Subject: [PATCH 1259/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 55f5bcb57..48d3f9a99 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -689,8 +689,8 @@ int32_t LP_reserved_msgs() if ( nn_poll(&pfd,1,1) != 1 ) break;*/ num_Reserved_msgs--; + printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); #ifdef __APPLE__ -// printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; From 2d600d8c9ac7c3537bedbc4d84c48b37e3460826 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:21:52 +0300 Subject: [PATCH 1260/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 48d3f9a99..43c2af5f6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -689,7 +689,7 @@ int32_t LP_reserved_msgs() if ( nn_poll(&pfd,1,1) != 1 ) break;*/ num_Reserved_msgs--; - printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); + //printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); #ifdef __APPLE__ #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); From d1cfd72f662a9c16a867daac2ba7fc88d61d9098 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:26:51 +0300 Subject: [PATCH 1261/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4a44fe7d2..193137fb2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,7 +44,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 30 +#define LP_AUTOTRADE_TIMEOUT 10 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 From dc5347636f494fc6913aded6f79835ac384f6b6c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:29:35 +0300 Subject: [PATCH 1262/2732] Test --- iguana/exchanges/LP_signatures.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 87bee3dc4..830759eeb 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -390,6 +390,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ flag = 1; jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); + jaddnum(reqjson,"timestamp",time(NULL)); msg = jprint(reqjson,1); msg2 = clonestr(msg); // LP_addsig From 5f2c362f9663e83a8957265a747ad8b6cfd75361 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:32:54 +0300 Subject: [PATCH 1263/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 43c2af5f6..fca19aa4c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -250,6 +250,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { + methodstr[0] = 0; if ( 1 ) { cJSON *recvjson; //char *mstr,*cstr; @@ -264,7 +265,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - //double millis = OS_milliseconds(); + double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -287,7 +288,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - //printf("%.3f LP_process_message %s\n",OS_milliseconds()-millis,methodstr); + printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } } } From 49d1209967a99ed59ad24268ff9d3ac8d6f394e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:43:27 +0300 Subject: [PATCH 1264/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fca19aa4c..416c810a6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -265,7 +265,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -288,7 +288,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); + //printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 80632ac5b..ff1c5d286 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -295,7 +295,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** } else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); - } else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); + } //else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); return(0); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ee152d15b..562ef6b3e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -800,7 +800,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( bypass != 0 ) val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); - if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) + /*if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) { //printf("%s/v%d spent %d\n",bits256_str(str,txid),vout,up->spendheight); return(-2); @@ -809,7 +809,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol { //printf("%s/v%d spent %d\n",bits256_str(str,txid2),vout2,up->spendheight); return(-3); - } + }*/ txfee = LP_txfeecalc(LP_coinfind(symbol),0,0); if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { From e5d53122267ed270590198b26ffd0c8ca68820fa Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:48:34 +0300 Subject: [PATCH 1265/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 416c810a6..e1678d664 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -528,7 +528,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( needpings != 0 || (counter % 10000) == 5 ) { nonz++; - printf("needpings.%d send notify\n",needpings); + //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) From 9b9ff4b1f0df0051df0fd1f2c8d7a5af2b7a2bb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 14:49:31 +0300 Subject: [PATCH 1266/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e1678d664..74a20ecb8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -265,7 +265,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - //double millis = OS_milliseconds(); + double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -288,7 +288,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - //printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); + if ( OS_milliseconds()-millis > 100 ) + printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } } } @@ -297,7 +298,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t LP_nanomsg_recvs(void *ctx) { - int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; + int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; //portable_mutex_lock(&LP_nanorecvsmutex); @@ -314,10 +315,7 @@ int32_t LP_nanomsg_recvs(void *ctx) } } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); - milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( OS_milliseconds()-milli > 100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",OS_milliseconds()-milli); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -328,10 +326,7 @@ int32_t LP_nanomsg_recvs(void *ctx) }*/ if ( LP_mypullsock >= 0 ) { - milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( OS_milliseconds()-milli > 100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds\n",OS_milliseconds()-milli); } //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz); From 1d8a3fd5048893cbb64424f5c508e3602e9dd9f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 15:52:20 +0300 Subject: [PATCH 1267/2732] Pubkey sig --- iguana/exchanges/LP_include.h | 12 +++++ iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_prices.c | 45 ++++++------------- iguana/exchanges/LP_signatures.c | 77 +++++++++++++++++++++++++++----- iguana/exchanges/LP_utxo.c | 4 +- 5 files changed, 97 insertions(+), 44 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 193137fb2..bcad7e661 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -275,6 +275,18 @@ struct basilisk_swap }; +#define LP_MAXPRICEINFOS 256 +struct LP_pubkeyinfo +{ + UT_hash_handle hh; + bits256 pubkey; + double matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; + uint32_t timestamp,istrusted,numerrors; + uint8_t rmd160[20],sig[76],pubsecp[33],siglen; +}; + +void LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); +int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); uint32_t basilisk_requestid(struct basilisk_request *rp); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 74a20ecb8..cbc989829 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -37,6 +37,7 @@ int32_t num_Reserved_msgs,max_Reserved_msgs; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; +struct LP_pubkeyinfo *LP_pubkeyinfos; #include "LP_network.c" char *activecoins[] = { "BTC", "KMD" }; @@ -497,7 +498,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+60 )//|| (rand() % 10000) == 0 ) + if ( now > peer->lastpeers+60 || (rand() % 10000) == 0 ) { if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 98f0e7d40..0831173e0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -20,7 +20,6 @@ struct LP_orderbookentry { bits256 pubkey; double price; uint64_t minsatoshis,maxsatoshis; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; -#define LP_MAXPRICEINFOS 256 struct LP_priceinfo { char symbol[16]; @@ -48,15 +47,6 @@ struct LP_cacheinfo uint32_t timestamp; } *LP_cacheinfos; -struct LP_pubkeyinfo -{ - UT_hash_handle hh; - bits256 pubkey; - double matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; - uint32_t timestamp,istrusted,numerrors; - uint8_t rmd160[20],pubsecp[33]; -} *LP_pubkeyinfos; - int32_t LP_pricevalid(double price) { if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) @@ -258,7 +248,7 @@ uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { - int32_t baseid,relid,i,j; char *base,hexstr[67],hexstr2[67]; double price; cJSON *item,*array,*obj; + int32_t baseid,relid,i,j; char *base,hexstr[67],hexstr2[67],sigstr[256]; double price; cJSON *item,*array,*obj; obj = cJSON_CreateObject(); array = cJSON_CreateArray(); for (baseid=0; baseidpubsecp,sizeof(pubp->pubsecp)); jaddstr(obj,"pubsecp",hexstr2); + if ( pubp->siglen > 0 ) + { + init_hexbytes_noT(sigstr,pubp->sig,pubp->siglen); + jaddstr(obj,"sig",sigstr); + } //printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); + //LP_pubkey_sigadd(obj,pubp->pubkey,pubp->rmd160,pubp->pubsecp); break; } } @@ -316,32 +312,19 @@ char *LP_prices() void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { - static uint8_t zeroes[20]; - struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid,mismatch; char *base,*rel,*hexstr,*pubsecpstr; double askprice; uint32_t now; + struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid,mismatch; char *base,*rel,*hexstr; double askprice; uint32_t now; now = (uint32_t)time(NULL); pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { if ( (hexstr= jstr(obj,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) - { decode_hex(rmd160,sizeof(rmd160),hexstr); - if ( memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) - mismatch = 1; - else mismatch = 0; - if ( bits256_cmp(pubkey,G.LP_mypub25519) == 0 && mismatch == 0 ) - peer->needping = 0; - if ( mismatch != 0 && memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) - { - for (i=0; i<20; i++) - printf("%02x",pubp->rmd160[i]); - memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - if ( (pubsecpstr= jstr(obj,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) - { - decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),pubsecpstr); - char str[65]; printf(" -> rmd160.(%s) for %s (%s)\n",hexstr,bits256_str(str,pubkey),pubsecpstr); - } - } - } + if ( memcmp(pubp->rmd160,rmd160,sizeof(rmd160)) != 0 ) + mismatch = 1; + else mismatch = 0; + if ( bits256_cmp(pubkey,G.LP_mypub25519) == 0 && mismatch == 0 ) + peer->needping = 0; + LP_pubkey_sigcheck(pubp,obj); timestamp = juint(obj,"timestamp"); if ( timestamp > now ) timestamp = now; diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 830759eeb..376bbd10a 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -328,6 +328,40 @@ char *LP_postprice_recv(cJSON *argjson) return(clonestr("{\"error\":\"missing fields in posted price\"}")); } +bits256 LP_pubkey_sighash(bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) +{ + uint8_t buf[sizeof(pub) + 20 + 33]; bits256 sighash; + memcpy(buf,pub.bytes,sizeof(pub)); + memcpy(&buf[sizeof(pub)],rmd160,20); + memcpy(&buf[sizeof(pub)+20],pubsecp,33); + vcalc_sha256(0,sighash.bytes,buf,sizeof(buf)); + return(sighash); +} + +int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) +{ + static void *ctx; + uint8_t sig[128]; int32_t siglen=0; bits256 sighash; char sigstr[256]; + sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,0)) > 0 && siglen < 76 ) + { + init_hexbytes_noT(sigstr,sig,siglen); + jaddstr(item,"sig",sigstr); + return(siglen); + } else return(0); +} + +int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) +{ + static void *ctx; + bits256 sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + return(bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33)); +} + void LP_notify_pubkeys(void *ctx,int32_t pubsock) { bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); @@ -338,25 +372,48 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) jaddbits256(reqjson,"pub",G.LP_mypub25519); init_hexbytes_noT(secpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",secpstr); + LP_pubkey_sigadd(reqjson,G.LP_mypriv25519,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); LP_reserved_msg("","",zero,jprint(reqjson,1)); } -char *LP_notify_recv(cJSON *argjson) +void LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { - char *rmd160str,*secpstr; bits256 pub; struct LP_pubkeyinfo *pubp; //double millis = OS_milliseconds(); - pub = jbits256(argjson,"pub"); - // LP_checksig - if ( bits256_nonz(pub) != 0 && (rmd160str= jstr(argjson,"rmd160")) != 0 && strlen(rmd160str) == 40 ) + int32_t i,siglen,len; uint8_t rmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; + if ( (hexstr= jstr(item,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) { - if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + decode_hex(rmd160,sizeof(rmd160),hexstr); + memset(zeroes,0,sizeof(zeroes)); + if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) { - decode_hex(pubp->rmd160,20,rmd160str); - if ( (secpstr= jstr(argjson,"pubsecp")) != 0 ) + if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { - decode_hex(pubp->pubsecp,sizeof(pubp->pubsecp),secpstr); - //printf("got pubkey.(%s)\n",secpstr); + decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); + if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) > 70*2 && len < 76*2 ) + { + siglen = len >> 1; + decode_hex(sig,siglen,sigstr); + if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + { + for (i=0; i<20; i++) + printf("%02x",pubp->rmd160[i]); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + } else printf("sig error\n"); + } } } + } +} + +char *LP_notify_recv(cJSON *argjson) +{ + bits256 pub; struct LP_pubkeyinfo *pubp; + pub = jbits256(argjson,"pub"); + if ( bits256_nonz(pub) != 0 ) + { + if ( (pubp= LP_pubkeyadd(pub)) != 0 ) + LP_pubkey_sigcheck(pubp,argjson); //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); } return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 562ef6b3e..fc5857199 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -787,8 +787,8 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - //struct LP_utxoinfo *utxo; - struct LP_address_utxo *up; uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64],str[65]; struct iguana_info *coin = LP_coinfind(symbol); + //struct LP_utxoinfo *utxo; struct LP_address_utxo *up; + uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64],str[65]; struct iguana_info *coin = LP_coinfind(symbol); if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) { printf("null txid not eligible\n"); From ea87a289e29f8632d1aa1593fce2e995124cdd49 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 15:52:52 +0300 Subject: [PATCH 1268/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cbc989829..e74f5c626 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -289,7 +289,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - if ( OS_milliseconds()-millis > 100 ) + if ( OS_milliseconds()-millis > 1000 ) printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } } From 682abbc540a0cf23fffb4b330a954575f84f9222 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 15:58:50 +0300 Subject: [PATCH 1269/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_signatures.c | 38 ++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index bcad7e661..75545f2d9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -285,7 +285,7 @@ struct LP_pubkeyinfo uint8_t rmd160[20],sig[76],pubsecp[33],siglen; }; -void LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); +int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 376bbd10a..79fa10ab5 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -362,23 +362,9 @@ int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd return(bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33)); } -void LP_notify_pubkeys(void *ctx,int32_t pubsock) -{ - bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); - // LP_addsig - memset(zero.bytes,0,sizeof(zero)); - jaddstr(reqjson,"method","notify"); - jaddstr(reqjson,"rmd160",G.LP_myrmd160str); - jaddbits256(reqjson,"pub",G.LP_mypub25519); - init_hexbytes_noT(secpstr,G.LP_pubsecp,33); - jaddstr(reqjson,"pubsecp",secpstr); - LP_pubkey_sigadd(reqjson,G.LP_mypriv25519,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); - LP_reserved_msg("","",zero,jprint(reqjson,1)); -} - -void LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) +int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { - int32_t i,siglen,len; uint8_t rmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; + int32_t i,siglen,len,retval=-1; uint8_t rmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; if ( (hexstr= jstr(item,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) { decode_hex(rmd160,sizeof(rmd160),hexstr); @@ -399,11 +385,29 @@ void LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); - } else printf("sig error\n"); + retval = 0; + } else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); } } } } + return(retval); +} + +void LP_notify_pubkeys(void *ctx,int32_t pubsock) +{ + bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); + // LP_addsig + memset(zero.bytes,0,sizeof(zero)); + jaddstr(reqjson,"method","notify"); + jaddstr(reqjson,"rmd160",G.LP_myrmd160str); + jaddbits256(reqjson,"pub",G.LP_mypub25519); + init_hexbytes_noT(secpstr,G.LP_pubsecp,33); + jaddstr(reqjson,"pubsecp",secpstr); + LP_pubkey_sigadd(reqjson,G.LP_mypriv25519,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); + if ( LP_pubkey_sigcheck(LP_pubkeyadd(G.LP_mypub25519),reqjson) == 0 ) + printf("sig verified\n"); + LP_reserved_msg("","",zero,jprint(reqjson,1)); } char *LP_notify_recv(cJSON *argjson) From a5ef76640d7e9a863c79738eb7480381060c719e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:02:47 +0300 Subject: [PATCH 1270/2732] Test --- iguana/exchanges/LP_signatures.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 79fa10ab5..8bd80f48d 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -338,6 +338,15 @@ bits256 LP_pubkey_sighash(bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) return(sighash); } +int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) +{ + static void *ctx; + bits256 sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + return(bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33)); +} + int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) { static void *ctx; @@ -349,19 +358,11 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui { init_hexbytes_noT(sigstr,sig,siglen); jaddstr(item,"sig",sigstr); + printf("sigadd check: %d %s siglen.%d\n",_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); return(siglen); } else return(0); } -int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) -{ - static void *ctx; - bits256 sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); - if ( ctx == 0 ) - ctx = bitcoin_ctx(); - return(bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33)); -} - int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { int32_t i,siglen,len,retval=-1; uint8_t rmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; @@ -407,6 +408,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) LP_pubkey_sigadd(reqjson,G.LP_mypriv25519,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); if ( LP_pubkey_sigcheck(LP_pubkeyadd(G.LP_mypub25519),reqjson) == 0 ) printf("sig verified\n"); + else printf("sig error\n"); LP_reserved_msg("","",zero,jprint(reqjson,1)); } From 5260c7c3468c711f593cb2a35077cad6795dfb2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:06:56 +0300 Subject: [PATCH 1271/2732] Test --- iguana/exchanges/LP_secp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_secp.c b/iguana/exchanges/LP_secp.c index 7d4409911..9c7032e23 100644 --- a/iguana/exchanges/LP_secp.c +++ b/iguana/exchanges/LP_secp.c @@ -179,7 +179,7 @@ int32_t bitcoin_verify(void *ctx,uint8_t *sig,int32_t siglen,bits256 txhash2,uin secp256k1_ecdsa_signature_parse_der(ctx,&SIG,sig,siglen); if ( secp256k1_ecdsa_verify(ctx,&SIG,txhash2.bytes,&PUB) != 0 ) retval = 0; - } + } else printf("error parsing pubkey\n"); ENDSECP_ENSURE_CTX } return(retval); From 1da8e8a19c9ec92ad7d9e32d608410b11748a68c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:09:18 +0300 Subject: [PATCH 1272/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 8bd80f48d..0b2f3bca6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -358,7 +358,7 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui { init_hexbytes_noT(sigstr,sig,siglen); jaddstr(item,"sig",sigstr); - printf("sigadd check: %d %s siglen.%d\n",_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); + printf("sigadd check: %d/%d %s siglen.%d\n",bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33),_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); return(siglen); } else return(0); } From 703da4406292094808261d5cfa93d37cbfbe12ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:12:17 +0300 Subject: [PATCH 1273/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0b2f3bca6..ca1c84022 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -354,11 +354,11 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,0)) > 0 && siglen < 76 ) + if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 64 ) { init_hexbytes_noT(sigstr,sig,siglen); jaddstr(item,"sig",sigstr); - printf("sigadd check: %d/%d %s siglen.%d\n",bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33),_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); + printf("sigadd check: %d/%d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pubsecp,33),_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); return(siglen); } else return(0); } From cb5203e3a65043c70adb773d5529a768a412e746 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:16:11 +0300 Subject: [PATCH 1274/2732] Test --- iguana/exchanges/LP_signatures.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index ca1c84022..c71fe4f98 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -350,7 +350,7 @@ int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) { static void *ctx; - uint8_t sig[128]; int32_t siglen=0; bits256 sighash; char sigstr[256]; + uint8_t sig[128],pub33[33]; int32_t i,siglen=0; bits256 sighash; char sigstr[256]; sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); if ( ctx == 0 ) ctx = bitcoin_ctx(); @@ -358,7 +358,16 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui { init_hexbytes_noT(sigstr,sig,siglen); jaddstr(item,"sig",sigstr); - printf("sigadd check: %d/%d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pubsecp,33),_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); + printf("sigadd check: %d/%d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pub33,33),_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); + if ( memcmp(pub33,pubsecp,33) != 0 ) + { + for (i=0; i<33; i++) + printf("%02x",pubsecp[i]); + printf(" pubsecp -> "); + for (i=0; i<33; i++) + printf("%02x",pub33[i]); + printf(" mismatched recovered pubkey\n"); + } return(siglen); } else return(0); } @@ -375,6 +384,8 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); // transition + memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) > 70*2 && len < 76*2 ) { siglen = len >> 1; @@ -387,7 +398,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); retval = 0; - } else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); } } } From db57dca0bf68cbca37d8cc18940d1adb75218f5d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:19:47 +0300 Subject: [PATCH 1275/2732] Test --- iguana/exchanges/LP_signatures.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index c71fe4f98..2d5d01c95 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -354,7 +354,7 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 64 ) + if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 65 ) { init_hexbytes_noT(sigstr,sig,siglen); jaddstr(item,"sig",sigstr); @@ -417,9 +417,6 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) init_hexbytes_noT(secpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",secpstr); LP_pubkey_sigadd(reqjson,G.LP_mypriv25519,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); - if ( LP_pubkey_sigcheck(LP_pubkeyadd(G.LP_mypub25519),reqjson) == 0 ) - printf("sig verified\n"); - else printf("sig error\n"); LP_reserved_msg("","",zero,jprint(reqjson,1)); } From 10d70532a1d51ef2aab6365098d86eb769f082c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:26:54 +0300 Subject: [PATCH 1276/2732] Test --- iguana/exchanges/LP_signatures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 2d5d01c95..96f70fc52 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -358,7 +358,8 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui { init_hexbytes_noT(sigstr,sig,siglen); jaddstr(item,"sig",sigstr); - printf("sigadd check: %d/%d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pub33,33),_LP_pubkey_sigcheck(sig,siglen,pub,rmd160,pubsecp),sigstr,siglen); + memset(pub33,0,33); + printf("sigadd check: %d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0),sigstr,siglen); if ( memcmp(pub33,pubsecp,33) != 0 ) { for (i=0; i<33; i++) From a6193659389ebf66a00305098343c00cf28885e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:31:18 +0300 Subject: [PATCH 1277/2732] Test --- iguana/exchanges/LP_signatures.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 96f70fc52..fde4661ba 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -341,10 +341,10 @@ bits256 LP_pubkey_sighash(bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) { static void *ctx; - bits256 sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); + uint8_t pub33[33]; bits256 sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); if ( ctx == 0 ) ctx = bitcoin_ctx(); - return(bitcoin_verify(ctx,sig,siglen,sighash,pubsecp,33)); + return(bitcoin_recoververify(ctx,"sigcheck",sig,sighash,pub33,0)); } int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) @@ -365,6 +365,10 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui for (i=0; i<33; i++) printf("%02x",pubsecp[i]); printf(" pubsecp -> "); + for (i=0; i<33; i++) + printf("%02x",pub33[i]); + printf(" recovered, "); + bitcoin_pubkey33(ctx,pub33,priv); for (i=0; i<33; i++) printf("%02x",pub33[i]); printf(" mismatched recovered pubkey\n"); From 4de545353068e5ff3ed5264187b19baec10e69ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:39:05 +0300 Subject: [PATCH 1278/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ed328c508..0df37e199 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -721,6 +721,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan printf("WIF.(%s) -> %s or %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkkey)); } } + privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; bitcoin_priv2pub(ctx,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); if ( coin->counter == 0 ) { @@ -762,6 +763,9 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan checkkey.bytes[0] &= 248, checkkey.bytes[31] &= 127, checkkey.bytes[31] |= 64; G.LP_mypub25519 = *pubkeyp = curve25519(checkkey,curve25519_basepoint9()); G.LP_mypriv25519 = checkkey; + char str[65],str2[65]; + if ( bits256_cmp(checkkey,privkey) != 0 ) + printf("??????????? privkey mismatch %s vs %s\n",bits256_str(str,privkey),bits256_str(str2,checkkey)); LP_pubkeyadd(G.LP_mypub25519); return(privkey); } From 9a8313e21248e9421afc8d42727a67c9782c36eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:43:07 +0300 Subject: [PATCH 1279/2732] Test --- iguana/exchanges/LP_coins.c | 4 ++-- iguana/exchanges/LP_commands.c | 12 ++++++------ iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/LP_utxos.c | 6 ++---- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 9a7cb7509..5ef612669 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -188,9 +188,9 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) jaddstr(item,"coin",coin->symbol); if ( showwif != 0 ) { - bitcoin_priv2wif(coin->wiftaddr,wifstr,G.LP_mypriv25519,coin->wiftype); + bitcoin_priv2wif(coin->wiftaddr,wifstr,G.LP_privkey,coin->wiftype); bitcoin_wif2priv(coin->wiftaddr,&tmptype,&checkkey,wifstr); - if ( bits256_cmp(G.LP_mypriv25519,checkkey) == 0 ) + if ( bits256_cmp(G.LP_privkey,checkkey) == 0 ) jaddstr(item,"wif",wifstr); else jaddstr(item,"wif","error creating wif"); } diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 49dcb96ab..dc9ca2ca5 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -382,9 +382,9 @@ stop()\n\ { //privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR); //LP_utxopurge(0); - if ( bits256_nonz(G.LP_mypriv25519) != 0 ) - LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); - else printf("no LP_mypriv25519\n"); + if ( bits256_nonz(G.LP_privkey) != 0 ) + LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); + else printf("no LP_privkey\n"); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"coin",coin); @@ -483,9 +483,9 @@ stop()\n\ { LP_address(ptr,coinaddr); LP_listunspent_issue(coin,coinaddr,1); - if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - LP_privkey_init(-1,ptr,G.LP_mypriv25519,G.LP_mypub25519); + LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); } else @@ -508,7 +508,7 @@ stop()\n\ if ( coinaddr[0] != 0 ) { LP_address(ptr,coinaddr); - if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { //printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); ptr->addr_listunspent_requested = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e74f5c626..aee72a9d0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -61,7 +61,7 @@ struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; struct LP_globals { struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; - bits256 LP_mypub25519,LP_mypriv25519; + bits256 LP_mypub25519,LP_privkey,LP_mypriv25519; uint64_t LP_skipstatus[10000]; uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 6d27a07aa..9bb176b00 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -93,7 +93,7 @@ char *LP_portfolio() continue; if ( iter == 0 ) { - LP_privkey_init(-1,coin,G.LP_mypriv25519,G.LP_mypub25519); + LP_privkey_init(-1,coin,G.LP_privkey,G.LP_mypub25519); coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); if ( strcmp(coin->symbol,"KMD") != 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index fde4661ba..bf9ce82fd 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -421,7 +421,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) jaddbits256(reqjson,"pub",G.LP_mypub25519); init_hexbytes_noT(secpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",secpstr); - LP_pubkey_sigadd(reqjson,G.LP_mypriv25519,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); + LP_pubkey_sigadd(reqjson,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); LP_reserved_msg("","",zero,jprint(reqjson,1)); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0df37e199..565cfdda2 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -730,6 +730,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,G.LP_myrmd160,coin->smartaddr); LP_privkeyadd(privkey,G.LP_myrmd160); + G.LP_privkey = privkey; if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( G.counter++ == 0 ) @@ -763,9 +764,6 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan checkkey.bytes[0] &= 248, checkkey.bytes[31] &= 127, checkkey.bytes[31] |= 64; G.LP_mypub25519 = *pubkeyp = curve25519(checkkey,curve25519_basepoint9()); G.LP_mypriv25519 = checkkey; - char str[65],str2[65]; - if ( bits256_cmp(checkkey,privkey) != 0 ) - printf("??????????? privkey mismatch %s vs %s\n",bits256_str(str,privkey),bits256_str(str2,checkkey)); LP_pubkeyadd(G.LP_mypub25519); return(privkey); } @@ -791,7 +789,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) //printf("i.%d of %d\n",i,LP_numcoins); else if ( IAMLP == 0 || coin->inactive == 0 ) { - if ( LP_privkey_init(pubsock,coin,G.LP_mypriv25519,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) + if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } } From 0f5b828564de4a7822f52e1427ecca85b695e8e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:50:25 +0300 Subject: [PATCH 1280/2732] test --- iguana/exchanges/LP_signatures.c | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index bf9ce82fd..d6391e12c 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -350,31 +350,31 @@ int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) { static void *ctx; - uint8_t sig[128],pub33[33]; int32_t i,siglen=0; bits256 sighash; char sigstr[256]; + uint8_t sig[128],pub33[33]; int32_t i,j,siglen=0; bits256 sighash; char sigstr[256]; sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 65 ) + for (j=0; j<100; j++) { - init_hexbytes_noT(sigstr,sig,siglen); - jaddstr(item,"sig",sigstr); - memset(pub33,0,33); - printf("sigadd check: %d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0),sigstr,siglen); - if ( memcmp(pub33,pubsecp,33) != 0 ) + if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 65 ) { - for (i=0; i<33; i++) - printf("%02x",pubsecp[i]); - printf(" pubsecp -> "); - for (i=0; i<33; i++) - printf("%02x",pub33[i]); - printf(" recovered, "); - bitcoin_pubkey33(ctx,pub33,priv); - for (i=0; i<33; i++) - printf("%02x",pub33[i]); - printf(" mismatched recovered pubkey\n"); + init_hexbytes_noT(sigstr,sig,siglen); + jaddstr(item,"sig",sigstr); + memset(pub33,0,33); + //printf("sigadd check: %d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0),sigstr,siglen); + if ( memcmp(pub33,pubsecp,33) == 0 ) + return(siglen); + { + for (i=0; i<33; i++) + printf("%02x",pubsecp[i]); + printf(" pubsecp -> "); + for (i=0; i<33; i++) + printf("%02x",pub33[i]); + printf(" mismatched recovered pubkey.%d of %d\n",i,100); + } } - return(siglen); - } else return(0); + } + return(0); } int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) From 6718ce46dfe66f7b46a2d3e5b0221b8883957e7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:52:47 +0300 Subject: [PATCH 1281/2732] Test --- iguana/exchanges/LP_signatures.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index d6391e12c..883b278a0 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -358,19 +358,20 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui { if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 65 ) { - init_hexbytes_noT(sigstr,sig,siglen); - jaddstr(item,"sig",sigstr); memset(pub33,0,33); - //printf("sigadd check: %d %s siglen.%d\n",bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0),sigstr,siglen); - if ( memcmp(pub33,pubsecp,33) == 0 ) + if ( bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0) == 0 && memcmp(pub33,pubsecp,33) == 0 ) + { + init_hexbytes_noT(sigstr,sig,siglen); + jaddstr(item,"sig",sigstr); return(siglen); + } { for (i=0; i<33; i++) printf("%02x",pubsecp[i]); printf(" pubsecp -> "); for (i=0; i<33; i++) printf("%02x",pub33[i]); - printf(" mismatched recovered pubkey.%d of %d\n",i,100); + printf(" mismatched recovered pubkey.%d of %d\n",j,100); } } } From d67d9aed5d27ce48a845d4a6fdc17ddf5ec0041c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:54:28 +0300 Subject: [PATCH 1282/2732] Test --- iguana/exchanges/LP_signatures.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 883b278a0..bb8105d50 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -390,9 +390,9 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); - memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); // transition - memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); - if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) > 70*2 && len < 76*2 ) + //memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); // transition + //memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) { siglen = len >> 1; decode_hex(sig,siglen,sigstr); From cf8cbfc7b006d3576019b47a41ace3854dc58898 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 16:57:33 +0300 Subject: [PATCH 1283/2732] Test --- iguana/exchanges/LP_signatures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index bb8105d50..b67bcd3e1 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -365,6 +365,7 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui jaddstr(item,"sig",sigstr); return(siglen); } + if ( 0 ) { for (i=0; i<33; i++) printf("%02x",pubsecp[i]); @@ -385,7 +386,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { decode_hex(rmd160,sizeof(rmd160),hexstr); memset(zeroes,0,sizeof(zeroes)); - if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) + if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 && memcmp(rmd160,pubp->rmd160,20) != 0 ) { if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { From c61465be750175b77dd0d5d56959b83a81e6f237 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:08:37 +0300 Subject: [PATCH 1284/2732] Test --- iguana/exchanges/LP_signatures.c | 41 ++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b67bcd3e1..c8655828b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -381,33 +381,38 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { - int32_t i,siglen,len,retval=-1; uint8_t rmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; + int32_t i,siglen,len,retval=-1; uint8_t rmd160[20],checkrmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; if ( (hexstr= jstr(item,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) { decode_hex(rmd160,sizeof(rmd160),hexstr); memset(zeroes,0,sizeof(zeroes)); - if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 && memcmp(rmd160,pubp->rmd160,20) != 0 ) + if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) { - if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) + if ( memcmp(rmd160,pubp->rmd160,20) != 0 ) { - decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); - //memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); // transition - //memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); - if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) + if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { - siglen = len >> 1; - decode_hex(sig,siglen,sigstr); - if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); + calc_rmd160(0,checkrmd160,pubsecp,33); + //memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); // transition + //memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + if ( memcmp(checkrmd160,rmd160,20) == 0 && (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) { - for (i=0; i<20; i++) - printf("%02x",pubp->rmd160[i]); - memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); - char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); - retval = 0; - } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + siglen = len >> 1; + decode_hex(sig,siglen,sigstr); + if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + { + for (i=0; i<20; i++) + printf("%02x",pubp->rmd160[i]); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + retval = 0; + pubp->timestamp = (uint32_t)time(NULL); + } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + } } - } + } else pubp->timestamp = (uint32_t)time(NULL); } } return(retval); From 557557e95e87f0a36ba91c2f0c71ceb9335fb693 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:16:01 +0300 Subject: [PATCH 1285/2732] Test --- iguana/exchanges/LP_signatures.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index c8655828b..68b832a9f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -394,8 +394,6 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); calc_rmd160(0,checkrmd160,pubsecp,33); - //memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); // transition - //memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); if ( memcmp(checkrmd160,rmd160,20) == 0 && (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) { siglen = len >> 1; @@ -411,6 +409,15 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) pubp->timestamp = (uint32_t)time(NULL); } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); } + else + { + for (i=0; i<20; i++) + printf("%02x",rmd160[i]); + printf(" rmd160 vs "); + for (i=0; i<20; i++) + printf("%02x",checkrmd160[i]); + printf(" for %s\n",pubsecpstr); + } } } else pubp->timestamp = (uint32_t)time(NULL); } From f5fbe607e7a2c183fbf5b95d818a72cea765c8af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:17:47 +0300 Subject: [PATCH 1286/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 68b832a9f..0416630b2 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -393,7 +393,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); - calc_rmd160(0,checkrmd160,pubsecp,33); + calc_rmd160_sha256(checkrmd160,pubsecp,33); if ( memcmp(checkrmd160,rmd160,20) == 0 && (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) { siglen = len >> 1; From 85d01b1afb8800b8b315629a195a2383e58ba0ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:19:46 +0300 Subject: [PATCH 1287/2732] Test --- iguana/exchanges/LP_signatures.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0416630b2..3801752c6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -394,20 +394,23 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); calc_rmd160_sha256(checkrmd160,pubsecp,33); - if ( memcmp(checkrmd160,rmd160,20) == 0 && (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) + if ( memcmp(checkrmd160,rmd160,20) == 0 ) { - siglen = len >> 1; - decode_hex(sig,siglen,sigstr); - if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) { - for (i=0; i<20; i++) - printf("%02x",pubp->rmd160[i]); - memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); - char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); - retval = 0; - pubp->timestamp = (uint32_t)time(NULL); - } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + siglen = len >> 1; + decode_hex(sig,siglen,sigstr); + if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + { + for (i=0; i<20; i++) + printf("%02x",pubp->rmd160[i]); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + retval = 0; + pubp->timestamp = (uint32_t)time(NULL); + } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + } } else { From c3ae67ee09ffbb54e8dbcde414f28ffe823da92a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:25:01 +0300 Subject: [PATCH 1288/2732] Test --- iguana/exchanges/LP_signatures.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 3801752c6..4ffc77c36 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -467,7 +467,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -485,7 +485,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddstr(reqjson,"method",method); jaddnum(reqjson,"timestamp",time(NULL)); msg = jprint(reqjson,1); - msg2 = clonestr(msg); + //msg2 = clonestr(msg); // LP_addsig printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); @@ -493,7 +493,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) { Reserved_msgs[num_Reserved_msgs++] = msg; - Reserved_msgs[num_Reserved_msgs++] = msg2; + //Reserved_msgs[num_Reserved_msgs++] = msg2; } else { From 23ad3bd9f69f4e40d3c3d0117c58911a1c16f92c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:26:46 +0300 Subject: [PATCH 1289/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index aee72a9d0..e81edbd8e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -675,29 +675,28 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t LP_reserved_msgs() { - bits256 zero; int32_t n = 0; //struct nn_pollfd pfd; + bits256 zero; int32_t n = 0; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); while ( num_Reserved_msgs > 0 ) { - /*memset(&pfd,0,sizeof(pfd)); + memset(&pfd,0,sizeof(pfd)); pfd.fd = LP_mypubsock; pfd.events = NN_POLLOUT; if ( nn_poll(&pfd,1,1) != 1 ) - break;*/ + break; num_Reserved_msgs--; //printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); #ifdef __APPLE__ #endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; -#ifdef __APPLE__ +/*#ifdef __APPLE__ usleep(5000); #else usleep(3000); -#endif - n++; - if ( n > 0 ) +#endif*/ + if ( ++n > 0 ) break; } portable_mutex_unlock(&LP_reservedmutex); From 82776e9f6a1a2547d3461f398939e64075bb8d19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:31:01 +0300 Subject: [PATCH 1290/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 40 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e81edbd8e..531965a88 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -677,29 +677,35 @@ int32_t LP_reserved_msgs() { bits256 zero; int32_t n = 0; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); - portable_mutex_lock(&LP_reservedmutex); - while ( num_Reserved_msgs > 0 ) + while ( 1 ) { - memset(&pfd,0,sizeof(pfd)); - pfd.fd = LP_mypubsock; - pfd.events = NN_POLLOUT; - if ( nn_poll(&pfd,1,1) != 1 ) - break; - num_Reserved_msgs--; - //printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); + portable_mutex_lock(&LP_reservedmutex); + if ( num_Reserved_msgs > 0 ) + { + portable_mutex_unlock(&LP_reservedmutex); + memset(&pfd,0,sizeof(pfd)); + pfd.fd = LP_mypubsock; + pfd.events = NN_POLLOUT; + if ( nn_poll(&pfd,1,1) == 1 ) + { + portable_mutex_lock(&LP_reservedmutex); + num_Reserved_msgs--; + //printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); #ifdef __APPLE__ #endif - LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); - Reserved_msgs[num_Reserved_msgs] = 0; -/*#ifdef __APPLE__ - usleep(5000); -#else - usleep(3000); -#endif*/ + LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); + Reserved_msgs[num_Reserved_msgs] = 0; + /*#ifdef __APPLE__ + usleep(5000); + #else + usleep(3000); + #endif*/ + } + } + portable_mutex_unlock(&LP_reservedmutex); if ( ++n > 0 ) break; } - portable_mutex_unlock(&LP_reservedmutex); return(n); } From da27ffd3e14b06b30db4450fc122db458405bbab Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:37:46 +0300 Subject: [PATCH 1291/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 531965a88..c0b495513 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -675,34 +675,31 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t LP_reserved_msgs() { - bits256 zero; int32_t n = 0; struct nn_pollfd pfd; + bits256 zero; int32_t flag,n = 0; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); while ( 1 ) { - portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs > 0 ) { - portable_mutex_unlock(&LP_reservedmutex); - memset(&pfd,0,sizeof(pfd)); - pfd.fd = LP_mypubsock; - pfd.events = NN_POLLOUT; - if ( nn_poll(&pfd,1,1) == 1 ) + flag = 0; + if ( LP_mypubsock >= 0 ) + { + memset(&pfd,0,sizeof(pfd)); + pfd.fd = LP_mypubsock; + pfd.events = NN_POLLOUT; + if ( nn_poll(&pfd,1,1) == 1 ) + flag = 1; + } else flag = 1; + if ( flag == 1 ) { portable_mutex_lock(&LP_reservedmutex); num_Reserved_msgs--; //printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); -#ifdef __APPLE__ -#endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; - /*#ifdef __APPLE__ - usleep(5000); - #else - usleep(3000); - #endif*/ + portable_mutex_unlock(&LP_reservedmutex); } } - portable_mutex_unlock(&LP_reservedmutex); if ( ++n > 0 ) break; } From 90e35d64f5c2e79ef0f9043b61ac349352e6e1f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:44:28 +0300 Subject: [PATCH 1292/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0831173e0..6a5890f54 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -274,9 +274,9 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); jaddstr(obj,"rmd160",hexstr); - for (j=0; ipubsecp); i++) + for (j=0; jpubsecp); j++) { - if ( pubp->pubsecp[i] != 0 ) + if ( pubp->pubsecp[j] != 0 ) { init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); jaddstr(obj,"pubsecp",hexstr2); From 031792e445819ef9c74612904a995db738539312 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:50:16 +0300 Subject: [PATCH 1293/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_prices.c | 33 +++++++------------------------- iguana/exchanges/LP_signatures.c | 4 +++- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 75545f2d9..d054999ac 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -282,7 +282,7 @@ struct LP_pubkeyinfo bits256 pubkey; double matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; uint32_t timestamp,istrusted,numerrors; - uint8_t rmd160[20],sig[76],pubsecp[33],siglen; + uint8_t rmd160[20],sig[65],pubsecp[33],siglen; }; int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6a5890f54..0c2535e16 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -248,7 +248,7 @@ uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { - int32_t baseid,relid,i,j; char *base,hexstr[67],hexstr2[67],sigstr[256]; double price; cJSON *item,*array,*obj; + int32_t baseid,relid; char *base,hexstr[67],hexstr2[67],sigstr[256]; double price; cJSON *item,*array,*obj; obj = cJSON_CreateObject(); array = cJSON_CreateArray(); for (baseid=0; baseidpubkey); - for (i=0; irmd160); i++) - { - if ( pubp->rmd160[i] != 0 ) - { - init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); - jaddstr(obj,"rmd160",hexstr); - for (j=0; jpubsecp); j++) - { - if ( pubp->pubsecp[j] != 0 ) - { - init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); - jaddstr(obj,"pubsecp",hexstr2); - if ( pubp->siglen > 0 ) - { - init_hexbytes_noT(sigstr,pubp->sig,pubp->siglen); - jaddstr(obj,"sig",sigstr); - } - //printf("nonz rmd160 (%s %s)\n",hexstr,hexstr2); - //LP_pubkey_sigadd(obj,pubp->pubkey,pubp->rmd160,pubp->pubsecp); - break; - } - } - break; - } - } + init_hexbytes_noT(hexstr,pubp->rmd160,sizeof(pubp->rmd160)); + jaddstr(obj,"rmd160",hexstr); + init_hexbytes_noT(hexstr2,pubp->pubsecp,sizeof(pubp->pubsecp)); + jaddstr(obj,"pubsecp",hexstr2); + init_hexbytes_noT(sigstr,pubp->sig,pubp->siglen); + jaddstr(obj,"sig",sigstr); jaddnum(obj,"timestamp",pubp->timestamp); jadd(obj,"asks",array); if ( pubp->istrusted != 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 4ffc77c36..59d778901 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -381,7 +381,7 @@ int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,ui int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { - int32_t i,siglen,len,retval=-1; uint8_t rmd160[20],checkrmd160[20],pubsecp[33],sig[128],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; + int32_t i,len,siglen,retval=-1; uint8_t rmd160[20],checkrmd160[20],pubsecp[33],sig[65],zeroes[20]; char *sigstr,*hexstr,*pubsecpstr; if ( (hexstr= jstr(item,"rmd160")) != 0 && strlen(hexstr) == 2*sizeof(rmd160) ) { decode_hex(rmd160,sizeof(rmd160),hexstr); @@ -406,6 +406,8 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) printf("%02x",pubp->rmd160[i]); memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + memcpy(pubp->sig,sig,sizeof(pubp->sig)); + pubp->siglen = siglen; char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); retval = 0; pubp->timestamp = (uint32_t)time(NULL); From 5f09dc71d4b94aefab97df054025e74fc89bb341 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:55:34 +0300 Subject: [PATCH 1294/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d054999ac..4766854ee 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,7 +44,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 10 +#define LP_AUTOTRADE_TIMEOUT 30 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 From f2b97efb7bceedd739758963abd2a111bb875b25 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:59:09 +0300 Subject: [PATCH 1295/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index dc9ca2ca5..622163521 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -548,7 +548,7 @@ stop()\n\ else { memset(zero.bytes,0,sizeof(zero)); -//printf("broadcast.(%s)\n",Broadcaststr); +printf("broadcast.(%s)\n",Broadcaststr); LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c0b495513..19f9ce125 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -126,7 +126,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } - } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); + } else printf("finished tradecommand (%s)\n",jprint(argjson,0)); //if ( OS_milliseconds()-millis > 100 ) // printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); return(retstr); From 36c3712cd6dcc94e6746179e04a54922f845d34e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 18:16:12 +0300 Subject: [PATCH 1296/2732] Test --- iguana/exchanges/LP_commands.c | 6 +++--- iguana/exchanges/LP_nativeDEX.c | 35 +++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 622163521..af6960311 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -530,7 +530,7 @@ stop()\n\ { if ( IAMLP != 0 ) { - if ( strcmp(method,"broadcast") == 0 ) + /*if ( strcmp(method,"broadcast") == 0 ) { bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) @@ -548,13 +548,13 @@ stop()\n\ else { memset(zero.bytes,0,sizeof(zero)); -printf("broadcast.(%s)\n",Broadcaststr); +//printf("broadcast.(%s)\n",Broadcaststr); LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); } - else if ( strcmp(method,"psock") == 0 ) + else*/ if ( strcmp(method,"psock") == 0 ) { if ( myipaddr == 0 || myipaddr[0] == 0 || strcmp(myipaddr,"127.0.0.1") == 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 19f9ce125..855d762c8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -219,12 +219,39 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - portable_mutex_lock(&LP_commandmutex); - if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + if ( strcmp(method,"broadcast") == 0 ) { + bits256 zero; cJSON *reqjson; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; + if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) + { + Broadcaststr = jprint(reqjson,0); + if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) + { + cipherlen = (int32_t)strlen(cipherstr) >> 1; + if ( cipherlen <= sizeof(cipher) ) + { + decode_hex(cipher,cipherlen,cipherstr); + LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,"","",cipher,cipherlen); + } else retstr = clonestr("{\"error\":\"cipher too big\"}"); + } + else + { + memset(zero.bytes,0,sizeof(zero)); + printf("broadcast.(%s)\n",Broadcaststr); + LP_reserved_msg("","",zero,jprint(reqjson,0)); + } + retstr = clonestr("{\"result\":\"success\"}"); + } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); + } + else + { + portable_mutex_lock(&LP_commandmutex); + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + { + } + portable_mutex_unlock(&LP_commandmutex); + //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); } - portable_mutex_unlock(&LP_commandmutex); - //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); free_json(argjson); } } From 016a2dfcfe511ea48562a435ab13ba1b4c2b5519 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 18:30:21 +0300 Subject: [PATCH 1297/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 855d762c8..fd2127aff 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -219,7 +219,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - if ( strcmp(method,"broadcast") == 0 ) + if ( (method= jstr(argjson,"method")) != 0 && strcmp(method,"broadcast") == 0 ) { bits256 zero; cJSON *reqjson; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) From 981fa12ffe72d8d05e79d297ddceb5af9d34fc35 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 18:41:17 +0300 Subject: [PATCH 1298/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fd2127aff..52a4f71d7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -237,10 +237,12 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, else { memset(zero.bytes,0,sizeof(zero)); - printf("broadcast.(%s)\n",Broadcaststr); + if ( (method= jstr(reqjson,"method")) != 0 && (strcmp(method,"request") == 0 || strcmp(method,"requested") == 0 || strcmp(method,"connect") == 0 || strcmp(method,"connected") == 0) ) + printf("broadcast.(%s)\n",Broadcaststr); LP_reserved_msg("","",zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); + free_json(reqjson); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); } else From f95fd27517ea0324a0055c272398129ab0557f8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 18:42:28 +0300 Subject: [PATCH 1299/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ff1c5d286..9f10a8e28 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -596,7 +596,7 @@ int32_t LP_aliceonly(char *symbol) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*msg2,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { // LP_checksig @@ -726,9 +726,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); // LP_addsig - msg2 = clonestr(msg); + //msg2 = clonestr(msg); LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); - LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); + //LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } From a9e47dad1438263487d829450c160cf46042d40f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 18:51:39 +0300 Subject: [PATCH 1300/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 52a4f71d7..834637e93 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -728,8 +728,8 @@ int32_t LP_reserved_msgs() Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); } - } - if ( ++n > 0 ) + } else break; + if ( ++n > 100 ) break; } return(n); From a0cb92cd3ece409840cd9fd53b4245a94cfeb7fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:01:32 +0300 Subject: [PATCH 1301/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 834637e93..f0331fd3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -534,13 +534,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz++; LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; + LP_peer_pricesquery(peer); LP_utxos_sync(peer); + needpings++; } peer->lastpeers = now; } if ( peer->diduquery == 0 || peer->needping != 0 ) { - LP_peer_pricesquery(peer); LP_utxos_sync(peer); peer->diduquery = now; nonz++; From ba50fce5b88aaf6f469102a74aadb1d2793e4754 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:06:28 +0300 Subject: [PATCH 1302/2732] Test --- iguana/exchanges/LP_network.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 45307bedf..10d0cd7ca 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -242,6 +242,10 @@ printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); peerind = (rand() % maxind); else peerind = 0; sock0 = LP_peerindsock(&peerind); + if ( (maxind= LP_numpeers()) > 0 ) + peerind = (rand() % maxind); + else peerind = 0; + sock1 = LP_peerindsock(&peerind); } if ( sock0 >= 0 ) _LP_sendqueueadd(crc32,sock0,msg,msglen,needack * peerind); From 0367785acd148e5c97df3ee689403bcf58198b54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:11:34 +0300 Subject: [PATCH 1303/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 10d0cd7ca..76d082dda 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[64]; static unsigned long dup,total; + static uint32_t crcs[1024]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) @@ -177,7 +177,7 @@ void queue_loop(void *ignore) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } - else if ( 0 ) // too much beyond duplicate filter when network is busy + else //if ( 0 ) // too much beyond duplicate filter when network is busy { printf("couldnt find.%u peerind.%d Q.%d err.%d match.%d\n",ptr->crc32,ptr->peerind,LP_Qenqueued,LP_Qerrors,LP_Qfound); ptr->peerind++; From 7f5d9773e0fcfd8b54c9a6ca2c09e67b26d002e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:15:28 +0300 Subject: [PATCH 1304/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f0331fd3e..76df501a3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -728,7 +728,8 @@ int32_t LP_reserved_msgs() LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); - } + usleep(5000); + } else break; } else break; if ( ++n > 100 ) break; From 1a0f4e57b886ff710fa6bd23dfbef754f83e72f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:22:41 +0300 Subject: [PATCH 1305/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 76d082dda..ae9a8c8c9 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -167,7 +167,7 @@ void queue_loop(void *ignore) else flag = 1; } //else printf("sock not ready to send.%d\n",ptr->msglen); } - else if ( time(NULL) > ptr->starttime+13 ) + else if ( 0 && time(NULL) > ptr->starttime+13 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) @@ -177,7 +177,7 @@ void queue_loop(void *ignore) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } - else //if ( 0 ) // too much beyond duplicate filter when network is busy + else if ( 0 ) // too much beyond duplicate filter when network is busy { printf("couldnt find.%u peerind.%d Q.%d err.%d match.%d\n",ptr->crc32,ptr->peerind,LP_Qenqueued,LP_Qerrors,LP_Qfound); ptr->peerind++; From 4338727a2a53b04c7bae1c2cbb022952d0937949 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:24:00 +0300 Subject: [PATCH 1306/2732] Test --- iguana/exchanges/LP_network.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ae9a8c8c9..1419c8b6e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -126,6 +126,7 @@ int32_t LP_peerindsock(int32_t *peerindp) struct LP_peerinfo *peer,*tmp; int32_t peerind = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { + peerind++; if ( peer->errors < LP_MAXPEER_ERRORS && peer->pushsock >= 0 ) { if ( peerind < *peerindp ) @@ -134,7 +135,6 @@ int32_t LP_peerindsock(int32_t *peerindp) //printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); return(peer->pushsock); } - peerind++; } return(-1); } @@ -158,9 +158,6 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); -#ifdef __APPLE__ -//else printf("%d %p qsent %u msglen.%d peerind.%d (%s)\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind,ptr->msg); -#endif ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -239,12 +236,12 @@ printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); else { if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind); - else peerind = 0; + peerind = (rand() % maxind) + 1; + else peerind = 1; sock0 = LP_peerindsock(&peerind); if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind); - else peerind = 0; + peerind = (rand() % maxind) + 1; + else peerind = 1; sock1 = LP_peerindsock(&peerind); } if ( sock0 >= 0 ) From 449c193f5fdc9918b8a63ba145f1be866661c8c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:32:42 +0300 Subject: [PATCH 1307/2732] Test --- iguana/exchanges/LP_ordermatch.c | 9 ++++++--- iguana/exchanges/LP_signatures.c | 11 +++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9f10a8e28..5baf980a9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -363,7 +363,9 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jaddnum(retjson,"quoteid",qp->R.quoteid); // LP_addsig char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); - LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,1)); + LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,0)); + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->desthash,jprint(retjson,0)); + free_json(retjson); retval = 0; } else printf("error launching swaploop\n"); } else printf("couldnt bind to any port %s\n",pairstr); @@ -722,13 +724,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddbits256(retjson,"desthash",butxo->S.otherpubkey); jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); jaddstr(retjson,"method","reserved"); - msg = jprint(retjson,1); + msg = jprint(retjson,0); butxo->T.lasttime = (uint32_t)time(NULL); printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); // LP_addsig //msg2 = clonestr(msg); LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); - //LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg2); + LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); + free_json(retjson); return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 59d778901..88476c59f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -469,7 +469,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg; int32_t flag = 0; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) { if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) @@ -487,7 +487,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddstr(reqjson,"method",method); jaddnum(reqjson,"timestamp",time(NULL)); msg = jprint(reqjson,1); - //msg2 = clonestr(msg); + msg2 = clonestr(msg); // LP_addsig printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); @@ -497,12 +497,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ Reserved_msgs[num_Reserved_msgs++] = msg; //Reserved_msgs[num_Reserved_msgs++] = msg2; } - else - { - //if ( 1 && strcmp(method,"request") == 0 ) - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg); - //else LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); - } + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg2); portable_mutex_unlock(&LP_reservedmutex); } From 4e5d040e4d869af2c7443c00343e5afc1710183b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:36:47 +0300 Subject: [PATCH 1308/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 76df501a3..5386f47b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -126,7 +126,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } - } else printf("finished tradecommand (%s)\n",jprint(argjson,0)); + } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); //if ( OS_milliseconds()-millis > 100 ) // printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); return(retstr); @@ -728,7 +728,7 @@ int32_t LP_reserved_msgs() LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); - usleep(5000); + usleep(1000); } else break; } else break; if ( ++n > 100 ) From f4564fe08e9ba48597b5f167c750e63f4b3469be Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:41:22 +0300 Subject: [PATCH 1309/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5386f47b5..ef0d40223 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -728,10 +728,10 @@ int32_t LP_reserved_msgs() LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); - usleep(1000); + usleep(5000); } else break; } else break; - if ( ++n > 100 ) + if ( ++n > 1 ) break; } return(n); From 5e8e617a2836b0b2f65de4114760d91a298879bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:47:25 +0300 Subject: [PATCH 1310/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ef0d40223..590de3511 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -518,7 +518,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 100000) == 0 ) + if ( (rand() % 10000) == 0 ) { peer->errors--; if ( peer->errors < LP_MAXPEER_ERRORS ) @@ -540,7 +540,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } peer->lastpeers = now; } - if ( peer->diduquery == 0 || peer->needping != 0 ) + if ( peer->needping != 0 ) { LP_utxos_sync(peer); peer->diduquery = now; @@ -554,7 +554,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( needpings != 0 || (counter % 10000) == 5 ) { nonz++; - //printf("needpings.%d send notify\n",needpings); + printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 0c2535e16..2fd10dd8b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -309,7 +309,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) timestamp = juint(obj,"timestamp"); if ( timestamp > now ) timestamp = now; - if ( timestamp > pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) + if ( timestamp >= pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) { pubp->timestamp = timestamp; for (i=0; i Date: Sun, 22 Oct 2017 19:54:09 +0300 Subject: [PATCH 1311/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 590de3511..6e481e4b4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -378,8 +378,7 @@ void command_rpcloop(void *myipaddr) else usleep(10000); } else if ( IAMLP == 0 ) - usleep(1000); - else usleep(10); + usleep(100); } } @@ -728,7 +727,7 @@ int32_t LP_reserved_msgs() LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); - usleep(5000); + usleep(3000); } else break; } else break; if ( ++n > 1 ) @@ -924,10 +923,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) - usleep(10000); - else if ( IAMLP != 0 ) - usleep(10); - else usleep(10000); + usleep(1000); + else if ( IAMLP == 0 ) + usleep(1000); } } From a96358172fc3ba7220ab83ad17831ef5e146dc85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:57:25 +0300 Subject: [PATCH 1312/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6e481e4b4..19f42f918 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -553,7 +553,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( needpings != 0 || (counter % 10000) == 5 ) { nonz++; - printf("needpings.%d send notify\n",needpings); + //printf("needpings.%d send notify\n",needpings); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) From bb2e76b2b93ffedb0269c35be6ed9bb33665190b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 20:13:34 +0300 Subject: [PATCH 1313/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 +- iguana/exchanges/LP_signatures.c | 117 ++++++++++++++++--------------- 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index af6960311..f84c47ff0 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -526,7 +526,7 @@ stop()\n\ // retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); - else // special handling requests + else // psock requests/response { if ( IAMLP != 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 19f42f918..7bb32a06a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,12 +18,10 @@ // LP_nativeDEX.c // marketmaker // -// sign critical api calls (pubkey reg, listunspent, orders?) - // process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // -// verify portfolio, pricearray, interest to KMD withdraw +// verify portfolio, pricearray, interest to KMD withdraw, reliable networking // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 88476c59f..9626aba6b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -181,64 +181,6 @@ char *LP_quotereceived(cJSON *argjson) } else return(clonestr("{\"error\":\"nullptr\"}")); } -void LP_smartutxos_push(struct iguana_info *coin) -{ - struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; - if ( coin->smartaddr[0] == 0 ) - return; - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) - { - memset(zero.bytes,0,sizeof(zero)); - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); - for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) - free(retstr); - } - } - req = cJSON_CreateObject(); - jaddstr(req,"method","uitem"); - jaddstr(req,"coin",coin->symbol); - jaddstr(req,"coinaddr",coin->smartaddr); - jaddbits256(req,"txid",txid); - jaddnum(req,"vout",vout); - jaddnum(req,"ht",height); - jadd64bits(req,"value",value); - //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_reserved_msg("","",zero,jprint(req,1)); - } - } - free_json(array); - } -} - -char *LP_uitem_recv(cJSON *argjson) -{ - bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; - txid = jbits256(argjson,"txid"); - vout = jint(argjson,"vout"); - height = jint(argjson,"ht"); - value = j64bits(argjson,"value"); - coinaddr = jstr(argjson,"coinaddr"); - if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) - { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); - LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); - } - return(clonestr("{\"result\":\"success\"}")); -} - void LP_postutxos(char *symbol,char *coinaddr) { bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); @@ -457,6 +399,65 @@ char *LP_notify_recv(cJSON *argjson) return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); } +void LP_smartutxos_push(struct iguana_info *coin) +{ + struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; + if ( coin->smartaddr[0] == 0 ) + return; + LP_notify_pubkeys(coin->ctx,LP_mypubsock); + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + //printf("PUSH %s %s\n",coin->symbol,coin->smartaddr); + for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) + free(retstr); + } + } + req = cJSON_CreateObject(); + jaddstr(req,"method","uitem"); + jaddstr(req,"coin",coin->symbol); + jaddstr(req,"coinaddr",coin->smartaddr); + jaddbits256(req,"txid",txid); + jaddnum(req,"vout",vout); + jaddnum(req,"ht",height); + jadd64bits(req,"value",value); + //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_reserved_msg("","",zero,jprint(req,1)); + } + } + free_json(array); + } +} + +char *LP_uitem_recv(cJSON *argjson) +{ + bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; + txid = jbits256(argjson,"txid"); + vout = jint(argjson,"vout"); + height = jint(argjson,"ht"); + value = j64bits(argjson,"value"); + coinaddr = jstr(argjson,"coinaddr"); + if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) + { + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); + } + return(clonestr("{\"result\":\"success\"}")); +} + void LP_listunspent_query(char *symbol,char *coinaddr) { bits256 zero; cJSON *reqjson = cJSON_CreateObject(); From 42437fbf1f33335352e0db8af0fc321d329d2a25 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 20:26:26 +0300 Subject: [PATCH 1314/2732] Test --- iguana/exchanges/LP_commands.c | 11 +++++++++++ iguana/exchanges/LP_prices.c | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f84c47ff0..34f959136 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -472,6 +472,17 @@ stop()\n\ return(LP_peers()); else if ( strcmp(method,"getcoins") == 0 ) return(jprint(LP_coinsjson(0),1)); + else if ( strcmp(method,"wantnotify") == 0 ) + { + bits256 pub; + pub = jbits256(argjson,"pub"); + if ( bits256_cmp(pub,G.LP_mypub25519) == 0 ) + { + printf("wantnotify for me!\n"); + LP_notify_pubkeys(ctx,LP_mypubsock); + } + retstr = clonestr("{\"result\":\"success\"}"); + } else if ( strcmp(method,"listunspent") == 0 ) { if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2fd10dd8b..d3bf21a59 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -670,6 +670,23 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d return(op); } +void LP_pubkeys_query() +{ + uint8_t zeroes[20]; bits256 zero; cJSON *reqjson; struct LP_pubkeyinfo *pubp=0,*tmp; + memset(zero.bytes,0,sizeof(zero)); + memset(zeroes,0,sizeof(zeroes)); + HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) + { + if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) + { + reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","wantnotify"); + jaddbits256(reqjson,"pub",pubp->pubkey); + LP_reserved_msg("","",zero,jprint(reqjson,1)); + } + } +} + int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis; @@ -731,6 +748,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) suppress_prefetch = 1; duration = LP_ORDERBOOK_DURATION; } + LP_pubkeys_query(); baseid = basepp->ind; relid = relpp->ind; now = (uint32_t)time(NULL); From 609a2bd7dbbabf49e8d4268396ca019ce890f259 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 20:28:44 +0300 Subject: [PATCH 1315/2732] Test --- iguana/exchanges/LP_prices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d3bf21a59..7a75e92df 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -682,6 +682,7 @@ void LP_pubkeys_query() reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); + printf("%s\n",jprint(reqjson,0)); LP_reserved_msg("","",zero,jprint(reqjson,1)); } } From 0b812876caf23cac1cd5e33e94d6da0192992d6f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 20:33:24 +0300 Subject: [PATCH 1316/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 34f959136..6a4db8b49 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -476,6 +476,7 @@ stop()\n\ { bits256 pub; pub = jbits256(argjson,"pub"); + char str[65]; printf("got wantnotify.(%s) vs %s\n",jprint(argjson,0),bits256_str(str,G.LP_mypub25519)); if ( bits256_cmp(pub,G.LP_mypub25519) == 0 ) { printf("wantnotify for me!\n"); From a1e6ea3dd64c91dd854d5434bcbe9c5e8ea8c12e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 20:37:51 +0300 Subject: [PATCH 1317/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6a4db8b49..216a902d8 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -476,7 +476,7 @@ stop()\n\ { bits256 pub; pub = jbits256(argjson,"pub"); - char str[65]; printf("got wantnotify.(%s) vs %s\n",jprint(argjson,0),bits256_str(str,G.LP_mypub25519)); + //char str[65]; printf("got wantnotify.(%s) vs %s\n",jprint(argjson,0),bits256_str(str,G.LP_mypub25519)); if ( bits256_cmp(pub,G.LP_mypub25519) == 0 ) { printf("wantnotify for me!\n"); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7a75e92df..7fb1cac2c 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -682,7 +682,7 @@ void LP_pubkeys_query() reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); - printf("%s\n",jprint(reqjson,0)); + //printf("%s\n",jprint(reqjson,0)); LP_reserved_msg("","",zero,jprint(reqjson,1)); } } From cf26246774c2747057cbc30c90066126ec949e10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:07:33 +0300 Subject: [PATCH 1318/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_remember.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7bb32a06a..d5b5b47f7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,13 +19,13 @@ // marketmaker // // process stats.log local file -> map of realtime activity! +// sign price +// select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // // verify portfolio, pricearray, interest to KMD withdraw, reliable networking - // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections - #include #include "LP_include.h" portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 208216537..3e9af4ac9 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -814,7 +814,7 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi rswap->sentflags[txi] = 1; _LP_refht_update(coin,rswap->txids[txi],tx->height); } else LP_refht_update(symbol,rswap->txids[txi]); - } + } else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); return(0); } From ab76528e246b113f778f1d570510df31fa36323d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:17:24 +0300 Subject: [PATCH 1319/2732] Test --- iguana/exchanges/LP_remember.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 3e9af4ac9..f70ba6cc5 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -804,16 +804,19 @@ void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) { - struct LP_transaction *tx; struct iguana_info *coin; char str[65]; + struct LP_transaction *tx=0; struct iguana_info *coin; char str[65]; if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) { coin = LP_coinfind(symbol); - printf("[%s] %s txbytes.%p %s\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi])); - if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 && tx->height > 0 ) + if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 ) { rswap->sentflags[txi] = 1; - _LP_refht_update(coin,rswap->txids[txi],tx->height); + if ( tx->height <= 0 ) + tx->height = LP_txheight(coin,rswap->txids[txi]); + if ( tx->height > 0 ) + _LP_refht_update(coin,rswap->txids[txi],tx->height); } else LP_refht_update(symbol,rswap->txids[txi]); + printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),tx!=0?tx->height:-1); } else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); return(0); } From 54dd52559b8b102d5d2660bdb805403dea744846 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:22:32 +0300 Subject: [PATCH 1320/2732] Test --- iguana/exchanges/LP_remember.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f70ba6cc5..1ae21c336 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -804,19 +804,18 @@ void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) { - struct LP_transaction *tx=0; struct iguana_info *coin; char str[65]; + int32_t ht; struct LP_transaction *tx=0; struct iguana_info *coin; char str[65]; if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) { - coin = LP_coinfind(symbol); - if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 ) + if ( (coin= LP_coinfind(symbol)) != 0 ) { - rswap->sentflags[txi] = 1; - if ( tx->height <= 0 ) - tx->height = LP_txheight(coin,rswap->txids[txi]); - if ( tx->height > 0 ) + if ( (ht= LP_txheight(coin,rswap->txids[txi])) > 0 ) + { + rswap->sentflags[txi] = 1; _LP_refht_update(coin,rswap->txids[txi],tx->height); - } else LP_refht_update(symbol,rswap->txids[txi]); - printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),tx!=0?tx->height:-1); + } else LP_refht_update(symbol,rswap->txids[txi]); + printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),tx!=0?tx->height:-1); + } } else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); return(0); } From 4aa13ba3e626f151cecbafd5547b87b1b668ad5d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:28:00 +0300 Subject: [PATCH 1321/2732] Test --- iguana/exchanges/LP_remember.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 1ae21c336..00590c8c8 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -260,7 +260,7 @@ bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,in } txid = txids[utxoind]; memset(&spendtxid,0,sizeof(spendtxid)); - if ( bits256_nonz(txid) != 0 ) + if ( bits256_nonz(txid) != 0 && sentflags[utxoind] != 0 ) { destaddr[0] = 0; spendtxid = LP_swap_spendtxid(symbol,destaddr,txid,vout); @@ -804,7 +804,7 @@ void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) { - int32_t ht; struct LP_transaction *tx=0; struct iguana_info *coin; char str[65]; + int32_t ht; struct iguana_info *coin; char str[65]; if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) { if ( (coin= LP_coinfind(symbol)) != 0 ) @@ -812,9 +812,9 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi if ( (ht= LP_txheight(coin,rswap->txids[txi])) > 0 ) { rswap->sentflags[txi] = 1; - _LP_refht_update(coin,rswap->txids[txi],tx->height); + _LP_refht_update(coin,rswap->txids[txi],ht); } else LP_refht_update(symbol,rswap->txids[txi]); - printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),tx!=0?tx->height:-1); + printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),ht); } } else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); return(0); From 6c16c8d83f1337a0a202806cfafe2d87f817147a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:37:56 +0300 Subject: [PATCH 1322/2732] Test --- iguana/exchanges/LP_utxo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fc5857199..97c40c7b0 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -628,6 +628,8 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS spentvout = jint(vin,"vout"); if ( i == 0 && bits256_nonz(spenttxid) == 0 ) continue; + if ( strcmp("REVS",coin->symbol) == 0 ) + printf("ht.%d vini.%d %s/v%d spent\n",height,i,bits256_str(str,spenttxid),spentvout); if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) { if ( spentvout < tx->numvouts ) From 75d48167dfef88f29b9ebd56fc526419a7f760bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:43:18 +0300 Subject: [PATCH 1323/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d5b5b47f7..0f640624a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -606,10 +606,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht; continue; } - if ( (coin->lastscanht % 1000) == 0 ) - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + //if ( (coin->lastscanht % 1000) == 0 ) for (j=0; j<100; j++) { + if ( strcmp("REVS",coin->symbol) == 0 ) + printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); @@ -619,9 +620,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->lastscanht == coin->longestchain+1 ) break; } + nonz++; if ( j < 100 ) continue; - nonz++; //LP_getestimatedrate(coin); break; } From 6db5b63484ae5d57c1f75da3665c2c64e4f67387 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:52:38 +0300 Subject: [PATCH 1324/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0f640624a..d2ccdc896 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -586,7 +586,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastgetinfo = (uint32_t)time(NULL); } if ( coin->firstrefht == 0 ) + { + printf("%s no firstrefht\n",coin->symbol); continue; + } else if ( coin->firstscanht == 0 ) coin->lastscanht = coin->firstscanht = coin->firstrefht; else if ( coin->firstrefht < coin->firstscanht ) @@ -595,7 +598,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht = coin->firstrefht; } if ( coin->lastscanht == coin->longestchain+1 ) + { + printf("%s lastscanht.%d is longest.%d + 1\n",coin->synbol,coin->lastscanht,coin->longestchain) continue; + } else if ( coin->lastscanht > coin->longestchain+1 ) { printf("detected chain rewind lastscanht.%d vs longestchain.%d, first.%d ref.%d\n",coin->lastscanht,coin->longestchain,coin->firstscanht,coin->firstrefht); @@ -609,7 +615,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //if ( (coin->lastscanht % 1000) == 0 ) for (j=0; j<100; j++) { - if ( strcmp("REVS",coin->symbol) == 0 ) + //if ( strcmp("REVS",coin->symbol) == 0 ) printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { @@ -623,6 +629,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz++; if ( j < 100 ) continue; + printf("break out of coins iters\n"); //LP_getestimatedrate(coin); break; } From 95af33379d5350e05953bd315156be2f84527541 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 21:55:30 +0300 Subject: [PATCH 1325/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d2ccdc896..0a7d33402 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -561,6 +561,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { + fprintf(stderr,"%s ",coin->symbol); memset(&zero,0,sizeof(zero)); if ( coin->addr_listunspent_requested != 0 ) { @@ -599,7 +600,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( coin->lastscanht == coin->longestchain+1 ) { - printf("%s lastscanht.%d is longest.%d + 1\n",coin->synbol,coin->lastscanht,coin->longestchain) + printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); continue; } else if ( coin->lastscanht > coin->longestchain+1 ) From 2aa5bbe4fcf250b4fe4747d60cd67f126d7489c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:01:20 +0300 Subject: [PATCH 1326/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0a7d33402..0634a25ac 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -511,6 +511,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int myipaddr = "127.0.0.1"; numpeers = LP_numpeers(); needpings = 0; + fprintf(stderr,"P"); HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors >= LP_MAXPEER_ERRORS ) @@ -529,9 +530,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; + fprintf(stderr,"q"); LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; + fprintf(stderr,"p"); LP_peer_pricesquery(peer); + fprintf(stderr,"u"); LP_utxos_sync(peer); needpings++; } @@ -539,9 +543,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->needping != 0 ) { + fprintf(stderr,"u"); LP_utxos_sync(peer); peer->diduquery = now; nonz++; + fprintf(stderr,"n"); if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); peer->needping = 0; @@ -552,13 +558,16 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { nonz++; //printf("needpings.%d send notify\n",needpings); + fprintf(stderr,"p"); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) { + fprintf(stderr,"K"); nonz++; LP_privkey_updates(ctx,pubsock,0); } + fprintf(stderr,"C"); HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { fprintf(stderr,"%s ",coin->symbol); @@ -634,6 +643,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //LP_getestimatedrate(coin); break; } + fprintf(stderr,"S"); if ( (counter % 100000) == 90000 ) { if ( (retstr= basilisk_swapentry(0,0)) != 0 ) @@ -929,6 +939,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; + fprintf(stderr," nonz.%d\n",nonz); if ( nonz == 0 ) usleep(1000); else if ( IAMLP == 0 ) From f3b5158fdb564b65441913711a00db554e934293 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:06:20 +0300 Subject: [PATCH 1327/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0634a25ac..2eeec8ef7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -536,7 +536,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int fprintf(stderr,"p"); LP_peer_pricesquery(peer); fprintf(stderr,"u"); - LP_utxos_sync(peer); + //LP_utxos_sync(peer); needpings++; } peer->lastpeers = now; @@ -575,6 +575,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( coin->addr_listunspent_requested != 0 ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + fprintf(stderr,">"); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } @@ -587,12 +588,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { nonz++; + fprintf(stderr,"X"); if ( (height= LP_getheight(coin)) > coin->longestchain ) { coin->longestchain = height; if ( coin->firstrefht != 0 ) printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); - } else LP_mempoolscan(coin->symbol,zero); + } //else LP_mempoolscan(coin->symbol,zero); coin->lastgetinfo = (uint32_t)time(NULL); } if ( coin->firstrefht == 0 ) From e62afd4a9be4a1d6ba75af7017da0a01c2cd472a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:17:11 +0300 Subject: [PATCH 1328/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 129 +++++++++++++++++--------------- iguana/exchanges/coins | 2 +- 2 files changed, 71 insertions(+), 60 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2eeec8ef7..457e3d9c6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -500,10 +500,69 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) return(posted); } +void LP_coinsloop(void *myipaddr) +{ + struct iguana_info *coin,*ctmp; bits256 zero; int32_t j,nonz; + while ( 1 ) + { + nonz = 0; + HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht + { + memset(&zero,0,sizeof(zero)); + if ( coin->inactive != 0 ) + continue; + if ( coin->electrum != 0 ) + continue; + if ( coin->firstrefht == 0 ) + continue; + else if ( coin->firstscanht == 0 ) + coin->lastscanht = coin->firstscanht = coin->firstrefht; + else if ( coin->firstrefht < coin->firstscanht ) + { + printf("detected %s firstrefht.%d < firstscanht.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht); + coin->lastscanht = coin->firstscanht = coin->firstrefht; + } + if ( coin->lastscanht == coin->longestchain+1 ) + { + printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); + continue; + } + else if ( coin->lastscanht > coin->longestchain+1 ) + { + printf("detected chain rewind lastscanht.%d vs longestchain.%d, first.%d ref.%d\n",coin->lastscanht,coin->longestchain,coin->firstscanht,coin->firstrefht); + LP_undospends(coin,coin->longestchain-1); + //LP_mempoolscan(coin->symbol,zero); + coin->lastscanht = coin->longestchain - 1; + if ( coin->firstscanht < coin->lastscanht ) + coin->lastscanht = coin->firstscanht; + continue; + } + //if ( (coin->lastscanht % 1000) == 0 ) + for (j=0; j<100; j++) + { + //if ( strcmp("REVS",coin->symbol) == 0 ) + printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + if ( LP_blockinit(coin,coin->lastscanht) < 0 ) + { + printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); + break; + } + coin->lastscanht++; + if ( coin->lastscanht == coin->longestchain+1 ) + break; + } + nonz++; + continue; + } + if ( nonz == 0 ) + usleep(1000); + } +} + int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t needpings,j,height,nonz = 0; + struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t needpings,height,nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -571,7 +630,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { fprintf(stderr,"%s ",coin->symbol); - memset(&zero,0,sizeof(zero)); if ( coin->addr_listunspent_requested != 0 ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); @@ -579,12 +637,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } - if ( coin->inactive != 0 ) - continue; - if ( coin->electrum != 0 ) - continue; - //if ( coin->obooktime == 0 ) - // continue; if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { nonz++; @@ -597,57 +649,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } //else LP_mempoolscan(coin->symbol,zero); coin->lastgetinfo = (uint32_t)time(NULL); } - if ( coin->firstrefht == 0 ) - { - printf("%s no firstrefht\n",coin->symbol); - continue; - } - else if ( coin->firstscanht == 0 ) - coin->lastscanht = coin->firstscanht = coin->firstrefht; - else if ( coin->firstrefht < coin->firstscanht ) - { - printf("detected %s firstrefht.%d < firstscanht.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht); - coin->lastscanht = coin->firstscanht = coin->firstrefht; - } - if ( coin->lastscanht == coin->longestchain+1 ) - { - printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); - continue; - } - else if ( coin->lastscanht > coin->longestchain+1 ) - { - printf("detected chain rewind lastscanht.%d vs longestchain.%d, first.%d ref.%d\n",coin->lastscanht,coin->longestchain,coin->firstscanht,coin->firstrefht); - LP_undospends(coin,coin->longestchain-1); - LP_mempoolscan(coin->symbol,zero); - coin->lastscanht = coin->longestchain - 1; - if ( coin->firstscanht < coin->lastscanht ) - coin->lastscanht = coin->firstscanht; - continue; - } - //if ( (coin->lastscanht % 1000) == 0 ) - for (j=0; j<100; j++) - { - //if ( strcmp("REVS",coin->symbol) == 0 ) - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - if ( LP_blockinit(coin,coin->lastscanht) < 0 ) - { - printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); - break; - } - coin->lastscanht++; - if ( coin->lastscanht == coin->longestchain+1 ) - break; - } - nonz++; - if ( j < 100 ) - continue; - printf("break out of coins iters\n"); - //LP_getestimatedrate(coin); - break; } - fprintf(stderr,"S"); if ( (counter % 100000) == 90000 ) { + fprintf(stderr,"S"); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) { //printf("SWAPS.(%s)\n",retstr); @@ -655,6 +660,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); } } + fprintf(stderr,"."); counter++; return(nonz); } @@ -913,17 +919,22 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)&myipaddr) != 0 ) { - printf("error launching stats rpcloop for port.%u\n",myport); + printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)&myipaddr) != 0 ) { - printf("error launching stats rpcloop for port.%u\n",myport); + printf("error launching queue_loop for port.%u\n",myport); exit(-1); } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)&myipaddr) != 0 ) { - printf("error launching stats rpcloop for port.%u\n",myport); + printf("error launching prices_loop for port.%u\n",myport); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)&myipaddr) != 0 ) + { + printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index e6da494a4..60511920f 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,4 +1,4 @@ -export coins="[{\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" #{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, #{\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, From fdeee4a33b41759e62e7493fae2307f98890e615 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:18:41 +0300 Subject: [PATCH 1329/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 457e3d9c6..9d7718cc6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -629,7 +629,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int fprintf(stderr,"C"); HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - fprintf(stderr,"%s ",coin->symbol); if ( coin->addr_listunspent_requested != 0 ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); From 4a42ad4cc2bd0f588360032b2a6ed37e952a6053 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:27:56 +0300 Subject: [PATCH 1330/2732] Test --- iguana/exchanges/LP_include.h | 1 - iguana/exchanges/LP_nativeDEX.c | 46 +++++++++++++++++---------------- iguana/exchanges/LP_network.c | 1 - iguana/exchanges/LP_portfolio.c | 8 +----- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4766854ee..cb5f54bd0 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -311,7 +311,6 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); -int32_t LP_reserved_msgs(); uint64_t LP_smartbalance(struct iguana_info *coin); int32_t LP_getheight(struct iguana_info *coin); int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9d7718cc6..83da086eb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -380,6 +380,15 @@ void command_rpcloop(void *myipaddr) } } +void utxosQ_loop(void *myipaddr) +{ + while ( 1 ) + { + if ( LP_utxosQ_process() == 0 ) + usleep(10000); + } +} + int32_t LP_utxos_sync(struct LP_peerinfo *peer) { int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; @@ -570,7 +579,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int myipaddr = "127.0.0.1"; numpeers = LP_numpeers(); needpings = 0; - fprintf(stderr,"P"); HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors >= LP_MAXPEER_ERRORS ) @@ -589,12 +597,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; - fprintf(stderr,"q"); LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; - fprintf(stderr,"p"); LP_peer_pricesquery(peer); - fprintf(stderr,"u"); //LP_utxos_sync(peer); needpings++; } @@ -602,11 +607,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( peer->needping != 0 ) { - fprintf(stderr,"u"); LP_utxos_sync(peer); peer->diduquery = now; nonz++; - fprintf(stderr,"n"); if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); peer->needping = 0; @@ -617,29 +620,24 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { nonz++; //printf("needpings.%d send notify\n",needpings); - fprintf(stderr,"p"); LP_notify_pubkeys(ctx,pubsock); } if ( (counter % 6000) == 10 ) { - fprintf(stderr,"K"); nonz++; LP_privkey_updates(ctx,pubsock,0); } - fprintf(stderr,"C"); HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { if ( coin->addr_listunspent_requested != 0 ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); - fprintf(stderr,">"); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { nonz++; - fprintf(stderr,"X"); if ( (height= LP_getheight(coin)) > coin->longestchain ) { coin->longestchain = height; @@ -651,7 +649,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( (counter % 100000) == 90000 ) { - fprintf(stderr,"S"); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) { //printf("SWAPS.(%s)\n",retstr); @@ -659,7 +656,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); } } - fprintf(stderr,"."); counter++; return(nonz); } @@ -726,9 +722,9 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } } -int32_t LP_reserved_msgs() +void LP_reserved_msgs(void *ignore) { - bits256 zero; int32_t flag,n = 0; struct nn_pollfd pfd; + bits256 zero; int32_t flag; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); while ( 1 ) { @@ -751,13 +747,10 @@ int32_t LP_reserved_msgs() LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); - usleep(3000); - } else break; - } else break; - if ( ++n > 1 ) - break; + } + } + usleep(3000); } - return(n); } int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) @@ -911,6 +904,16 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + { + printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + { + printf("error launching utxosQ_loop for (%s)\n",myipaddr); + exit(-1); + } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); @@ -951,7 +954,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; - fprintf(stderr," nonz.%d\n",nonz); if ( nonz == 0 ) usleep(1000); else if ( IAMLP == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1419c8b6e..f947b9f03 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -144,7 +144,6 @@ void queue_loop(void *ignore) struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; while ( 1 ) { - LP_reserved_msgs(); nonz = 0; //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); n = 0; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 9bb176b00..99644a956 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -596,7 +596,7 @@ int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *a void prices_loop(void *ignore) { - char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; uint32_t expiration; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -634,12 +634,6 @@ void prices_loop(void *ignore) } free(retstr); } - expiration = (uint32_t)time(NULL) + 60; - while ( time(NULL) < expiration ) - { - if ( LP_utxosQ_process() == 0 ) - usleep(10000); - } } } From bbcf8414a7278bb7ad39ee025508fcba426a8046 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:38:05 +0300 Subject: [PATCH 1331/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 69 +++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 83da086eb..0e0f53128 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -616,17 +616,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int needpings++; } } - if ( needpings != 0 || (counter % 10000) == 5 ) - { - nonz++; - //printf("needpings.%d send notify\n",needpings); - LP_notify_pubkeys(ctx,pubsock); - } - if ( (counter % 6000) == 10 ) - { - nonz++; - LP_privkey_updates(ctx,pubsock,0); - } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { if ( coin->addr_listunspent_requested != 0 ) @@ -647,15 +636,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastgetinfo = (uint32_t)time(NULL); } } - if ( (counter % 100000) == 90000 ) - { - if ( (retstr= basilisk_swapentry(0,0)) != 0 ) - { - //printf("SWAPS.(%s)\n",retstr); - nonz++; - free(retstr); - } - } counter++; return(nonz); } @@ -722,6 +702,38 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } } +void LP_pubkeysloop(void *ctx) +{ + sleep(10); + while ( 1 ) + { + LP_notify_pubkeys(ctx,LP_mypubsock); + sleep(60); + } +} + +void LP_privkeysloop(void *ctx) +{ + sleep(20); + while ( 1 ) + { + LP_privkey_updates(ctx,LP_mypubsock,0); + sleep(60); + } +} + +void LP_swapsloop(void *ignore) +{ + char *retstr; + sleep(50); + while ( 1 ) + { + if ( (retstr= basilisk_swapentry(0,0)) != 0 ) + free(retstr); + sleep(600); + } +} + void LP_reserved_msgs(void *ignore) { bits256 zero; int32_t flag; struct nn_pollfd pfd; @@ -939,7 +951,22 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)&myipaddr) != 0 ) + { + printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)&myipaddr) != 0 ) + { + printf("error launching LP_privkeysloop for ctx.%p\n",ctx); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)&myipaddr) != 0 ) + { + printf("error launching LP_swapsloop for port.%u\n",myport); + exit(-1); + } + //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) // free(retstr); int32_t nonz; printf("start mainloop\n"); From 20f0a60e12f776aba42ec97ccfe2ff9d8f37266d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:41:01 +0300 Subject: [PATCH 1332/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0e0f53128..7267f2d3f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -547,7 +547,7 @@ void LP_coinsloop(void *myipaddr) continue; } //if ( (coin->lastscanht % 1000) == 0 ) - for (j=0; j<100; j++) + for (j=0; j<1; j++) { //if ( strcmp("REVS",coin->symbol) == 0 ) printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 97c40c7b0..0dab4f3a9 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -628,8 +628,8 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS spentvout = jint(vin,"vout"); if ( i == 0 && bits256_nonz(spenttxid) == 0 ) continue; - if ( strcmp("REVS",coin->symbol) == 0 ) - printf("ht.%d vini.%d %s/v%d spent\n",height,i,bits256_str(str,spenttxid),spentvout); + //if ( strcmp("REVS",coin->symbol) == 0 ) + // printf("ht.%d vini.%d %s/v%d spent\n",height,i,bits256_str(str,spenttxid),spentvout); if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) { if ( spentvout < tx->numvouts ) From 701f753fa3c0a023371d23342dde11e26ec6a561 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:49:43 +0300 Subject: [PATCH 1333/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 00590c8c8..2d1795fbd 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -353,7 +353,7 @@ int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflag { if ( bits256_nonz(txids[BASILISK_BOBDEPOSIT]) == 0 && sentflags[BASILISK_BOBDEPOSIT] == 0 ) return(1); - else if ( bits256_nonz(txids[BASILISK_BOBPAYMENT]) == 0 && sentflags[BASILISK_BOBPAYMENT] == 0 ) + else if ( bits256_nonz(txids[BASILISK_BOBPAYMENT]) == 0 || sentflags[BASILISK_BOBPAYMENT] == 0 ) { if ( bits256_nonz(depositspent) != 0 ) return(1); From a71351a87c93d7e3ab6f622c4bcc77a6b28ff0da Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:50:56 +0300 Subject: [PATCH 1334/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7267f2d3f..d62d4ba41 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -546,11 +546,10 @@ void LP_coinsloop(void *myipaddr) coin->lastscanht = coin->firstscanht; continue; } - //if ( (coin->lastscanht % 1000) == 0 ) + if ( (coin->lastscanht % 1000) == 0 ) + printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); for (j=0; j<1; j++) { - //if ( strcmp("REVS",coin->symbol) == 0 ) - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); From 5fcb9ee98d62ff649efc1fea8a87d19d35fc12c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 22:51:11 +0300 Subject: [PATCH 1335/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d62d4ba41..b4da4c940 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -533,7 +533,7 @@ void LP_coinsloop(void *myipaddr) } if ( coin->lastscanht == coin->longestchain+1 ) { - printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); + //printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); continue; } else if ( coin->lastscanht > coin->longestchain+1 ) From d275f9333320a811eb8bb1ca90ae6172311a47f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 23:11:49 +0300 Subject: [PATCH 1336/2732] test --- iguana/exchanges/LP_remember.c | 46 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 2d1795fbd..fec9242a4 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -847,7 +847,7 @@ int32_t LP_spends_set(struct LP_swap_remember *rswap) cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64]; cJSON *item; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64]; cJSON *item,*txoutobj; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) @@ -927,7 +927,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.paymentspent) == 0 ) { - //if ( txbytes[BASILISK_ALICESPEND] == 0 ) + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1; + if ( flag == 0 ) { if ( bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 ) { @@ -952,15 +955,18 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1)) != 0 ) printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]); } + LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); } - LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); } } if ( rswap.sentflags[BASILISK_ALICECLAIM] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { if ( time(NULL) > rswap.expiration ) { - //if ( txbytes[BASILISK_ALICECLAIM] == 0 ) + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1; + if ( flag == 0 ) { if ( rswap.Dredeemlen != 0 ) redeemlen = rswap.Dredeemlen, memcpy(redeemscript,rswap.Dredeemscript,rswap.Dredeemlen); @@ -976,13 +982,16 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); } } + LP_txbytes_update("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],&rswap.txids[BASILISK_ALICECLAIM],&rswap.depositspent,&rswap.sentflags[BASILISK_ALICECLAIM]); } - LP_txbytes_update("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],&rswap.txids[BASILISK_ALICECLAIM],&rswap.depositspent,&rswap.sentflags[BASILISK_ALICECLAIM]); } else printf("now %u before expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } if ( rswap.sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(rswap.Apaymentspent) == 0 && rswap.sentflags[BASILISK_ALICECLAIM] == 0 ) { - //if ( txbytes[BASILISK_ALICERECLAIM] == 0 ) + if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1; + if ( flag == 0 ) { rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn); if ( bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) != 0 && bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) @@ -990,8 +999,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (rswap.txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_ALICERECLAIM],rswap.alicepaymentaddr)) != 0 ) printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICERECLAIM]); } + LP_txbytes_update("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],&rswap.txids[BASILISK_ALICERECLAIM],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_ALICERECLAIM]); } - LP_txbytes_update("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],&rswap.txids[BASILISK_ALICERECLAIM],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_ALICERECLAIM]); } } else if ( rswap.iambob == 1 ) @@ -1001,7 +1010,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 || bits256_nonz(rswap.privAm) != 0 ) { - //if ( txbytes[BASILISK_BOBSPEND] == 0 ) + if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1; + if ( flag == 0 ) { if ( bits256_nonz(rswap.privAm) == 0 ) { @@ -1013,13 +1025,16 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (rswap.txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_BOBSPEND],rswap.alicepaymentaddr)) != 0 ) printf("bobspend.(%s)\n",rswap.txbytes[BASILISK_BOBSPEND]); } + LP_txbytes_update("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],&rswap.txids[BASILISK_BOBSPEND],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_BOBSPEND]); } - LP_txbytes_update("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],&rswap.txids[BASILISK_BOBSPEND],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_BOBSPEND]); } } if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > rswap.expiration && bits256_nonz(rswap.paymentspent) == 0 ) { - //if ( txbytes[BASILISK_BOBRECLAIM] == 0 ) + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1; + if ( flag == 0 ) { // bobreclaim redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,rswap.plocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,zero,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); @@ -1034,12 +1049,15 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf(" secretAm, myprivs[1].(%s) bobreclaim.(%s)\n",bits256_str(str,rswap.myprivs[1]),rswap.txbytes[BASILISK_BOBRECLAIM]); } } + LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]); } - LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]); } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { - if ( bits256_nonz(rswap.Apaymentspent) != 0 || time(NULL) > rswap.expiration ) + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1; + if ( flag == 0 && (bits256_nonz(rswap.Apaymentspent) != 0 || time(NULL) > rswap.expiration) ) { printf("do the refund! paymentspent.%s now.%u vs expiration.%u\n",bits256_str(str,rswap.paymentspent),(uint32_t)time(NULL),rswap.expiration); //if ( txbytes[BASILISK_BOBREFUND] == 0 ) @@ -1052,7 +1070,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]); - } else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),rswap.expiration); + } + else if ( flag == 0 ) + printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } } } From 367016a8d1e2ee1ef6797122bf44cb70c5817812 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 23:19:26 +0300 Subject: [PATCH 1337/2732] Test --- iguana/exchanges/LP_remember.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index fec9242a4..062b78886 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -847,11 +847,12 @@ int32_t LP_spends_set(struct LP_swap_remember *rswap) cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64]; cJSON *item,*txoutobj; bits256 rev,signedtxid,zero; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64]; cJSON *item,*txoutobj; bits256 rev,signedtxid,zero,deadtxid; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) return(cJSON_Parse("{\"error\":\"couldnt initialize rswap, are all coins active?\"}")); + decode_hex(deadtxid.bytes,32,"dead0000000000000000000000000000"); LP_swap_load(&rswap); memset(zero.bytes,0,sizeof(zero)); otheraddr[0] = 0; @@ -929,7 +930,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) free_json(txoutobj), flag = 0; - else flag = -1; + else flag = -1, rswap.paymentspent = deadtxid; if ( flag == 0 ) { if ( bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 ) @@ -965,7 +966,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) free_json(txoutobj), flag = 0; - else flag = -1; + else flag = -1, rswap.depositspent = deadtxid; if ( flag == 0 ) { if ( rswap.Dredeemlen != 0 ) @@ -990,7 +991,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) free_json(txoutobj), flag = 0; - else flag = -1; + else flag = -1, rswap.Apaymentspent = deadtxid; if ( flag == 0 ) { rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn); @@ -1012,7 +1013,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) free_json(txoutobj), flag = 0; - else flag = -1; + else flag = -1, rswap.Apaymentspent = deadtxid; if ( flag == 0 ) { if ( bits256_nonz(rswap.privAm) == 0 ) @@ -1033,7 +1034,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) free_json(txoutobj), flag = 0; - else flag = -1; + else flag = -1, rswap.paymentspent = deadtxid; if ( flag == 0 ) { // bobreclaim @@ -1056,7 +1057,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) free_json(txoutobj), flag = 0; - else flag = -1; + else flag = -1, rswap.depositspent = deadtxid; if ( flag == 0 && (bits256_nonz(rswap.Apaymentspent) != 0 || time(NULL) > rswap.expiration) ) { printf("do the refund! paymentspent.%s now.%u vs expiration.%u\n",bits256_str(str,rswap.paymentspent),(uint32_t)time(NULL),rswap.expiration); From 8ab979fc2c0bd30913c1b50149088392daecc1a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 23:28:43 +0300 Subject: [PATCH 1338/2732] Test --- iguana/exchanges/LP_remember.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 062b78886..30893c288 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -852,7 +852,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) return(cJSON_Parse("{\"error\":\"couldnt initialize rswap, are all coins active?\"}")); - decode_hex(deadtxid.bytes,32,"dead0000000000000000000000000000"); + decode_hex(deadtxid.bytes,32,"dead000000000000000000000000000000000000000000000000000000000000"); LP_swap_load(&rswap); memset(zero.bytes,0,sizeof(zero)); otheraddr[0] = 0; @@ -1030,12 +1030,12 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } } - if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > rswap.expiration && bits256_nonz(rswap.paymentspent) == 0 ) + if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && bits256_nonz(rswap.paymentspent) == 0 ) { if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) free_json(txoutobj), flag = 0; else flag = -1, rswap.paymentspent = deadtxid; - if ( flag == 0 ) + if ( flag == 0 && time(NULL) > rswap.expiration ) { // bobreclaim redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,rswap.plocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,zero,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); @@ -1051,7 +1051,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]); - } + } else printf("bobpayment spent.%d or now.%u < expiration %u\n",flag,(uint32_t)time(NULL),rswap.expiration); } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { From 2d05eb383d789e41a15e90daf8a5d3a98d25e728 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 23:30:41 +0300 Subject: [PATCH 1339/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 30893c288..eb3340d89 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -852,7 +852,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti ctx = bitcoin_ctx(); if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 ) return(cJSON_Parse("{\"error\":\"couldnt initialize rswap, are all coins active?\"}")); - decode_hex(deadtxid.bytes,32,"dead000000000000000000000000000000000000000000000000000000000000"); + decode_hex(deadtxid.bytes,32,"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); LP_swap_load(&rswap); memset(zero.bytes,0,sizeof(zero)); otheraddr[0] = 0; From 12ca02ad7d0ca73e7ab458f6a4e8520907e19186 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 23:35:49 +0300 Subject: [PATCH 1340/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index eb3340d89..062c01997 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -260,7 +260,7 @@ bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,in } txid = txids[utxoind]; memset(&spendtxid,0,sizeof(spendtxid)); - if ( bits256_nonz(txid) != 0 && sentflags[utxoind] != 0 ) + if ( bits256_nonz(txid) != 0 )//&& sentflags[utxoind] != 0 ) { destaddr[0] = 0; spendtxid = LP_swap_spendtxid(symbol,destaddr,txid,vout); From 1a353a7be7137835989eb5c9f10ffea57e6a1cae Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 04:38:32 +0300 Subject: [PATCH 1341/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index cb5f54bd0..93421deae 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,7 +44,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 30 +#define LP_AUTOTRADE_TIMEOUT 15 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5baf980a9..0aad4f785 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -81,7 +81,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str printf(">>>>>>> quote satoshis.(%.8f %.8f) %s %.8f -> %s %.8f\n",dstr(qp->satoshis),dstr(qp->destsatoshis),qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); if ( butxo != 0 ) { - if (LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) + if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { printf("bob not eligible %s\n",jprint(LP_quotejson(qp),1)); return(-2); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0dab4f3a9..572faff33 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -628,8 +628,6 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS spentvout = jint(vin,"vout"); if ( i == 0 && bits256_nonz(spenttxid) == 0 ) continue; - //if ( strcmp("REVS",coin->symbol) == 0 ) - // printf("ht.%d vini.%d %s/v%d spent\n",height,i,bits256_str(str,spenttxid),spentvout); if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) { if ( spentvout < tx->numvouts ) @@ -640,7 +638,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); - if ( 0 && strcmp(coin->symbol,"BTC") != 0 ) + if ( strcmp(coin->symbol,"REVS") == 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d spendheight.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts,tx->outpoints[spentvout].spendheight); From d369178681e2fe8f337d931ae28b10a205c8edf7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 04:45:05 +0300 Subject: [PATCH 1342/2732] test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b4da4c940..3a4837243 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -548,7 +548,7 @@ void LP_coinsloop(void *myipaddr) } if ( (coin->lastscanht % 1000) == 0 ) printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - for (j=0; j<1; j++) + for (j=0; j<100; j++) { if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { From 6258ad1f0bbb8a12723b26df13d6aecb8c2fa195 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 04:48:15 +0300 Subject: [PATCH 1343/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3a4837243..b4da4c940 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -548,7 +548,7 @@ void LP_coinsloop(void *myipaddr) } if ( (coin->lastscanht % 1000) == 0 ) printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - for (j=0; j<100; j++) + for (j=0; j<1; j++) { if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { From 434072eaaff09da226aaa0e3842129715628df3b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 04:54:51 +0300 Subject: [PATCH 1344/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b4da4c940..114c7c204 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -546,7 +546,7 @@ void LP_coinsloop(void *myipaddr) coin->lastscanht = coin->firstscanht; continue; } - if ( (coin->lastscanht % 1000) == 0 ) + //if ( (coin->lastscanht % 1000) == 0 ) printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); for (j=0; j<1; j++) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 572faff33..999c9ec4e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -638,7 +638,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); - if ( strcmp(coin->symbol,"REVS") == 0 ) + if ( 0 && strcmp(coin->symbol,"REVS") == 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d spendheight.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts,tx->outpoints[spentvout].spendheight); From 2643edd11e372255d928cfcb18c5be06edfd2158 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:01:48 +0300 Subject: [PATCH 1345/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_remember.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 114c7c204..75ff5541c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -533,7 +533,7 @@ void LP_coinsloop(void *myipaddr) } if ( coin->lastscanht == coin->longestchain+1 ) { - //printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); + printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); continue; } else if ( coin->lastscanht > coin->longestchain+1 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 062c01997..34c3229bd 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -267,17 +267,17 @@ bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,in if ( bits256_nonz(spendtxid) != 0 ) { sentflags[utxoind] = 1; - printf("utxoind.%d Alice.(%s %s) Bob.(%s %s) vs destaddr.(%s)\n",utxoind,aliceaddr,Adest,bobaddr,dest,destaddr); + //printf("utxoind.%d Alice.(%s %s) Bob.(%s %s) vs destaddr.(%s)\n",utxoind,aliceaddr,Adest,bobaddr,dest,destaddr); if ( aliceaddr != 0 && (strcmp(destaddr,aliceaddr) == 0 || strcmp(Adest,destaddr) == 0) ) { - printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); + //printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[alicespent] = 1; sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } else if ( bobaddr != 0 && (strcmp(destaddr,bobaddr) == 0 || strcmp(dest,destaddr) == 0) ) { - printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); + //printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[bobspent] = 1; sentflags[alicespent] = 0; txids[bobspent] = spendtxid; @@ -298,7 +298,7 @@ bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,in txids[alicespent] = spendtxid; } } - } else printf("no spend of %s/v%d detected\n",bits256_str(str,txid),vout); + } //else printf("no spend of %s/v%d detected\n",bits256_str(str,txid),vout); } else printf("utxoind.%d null txid\n",utxoind); return(spendtxid); } @@ -804,7 +804,7 @@ void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) { - int32_t ht; struct iguana_info *coin; char str[65]; + int32_t ht; struct iguana_info *coin; //char str[65]; if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) { if ( (coin= LP_coinfind(symbol)) != 0 ) @@ -814,9 +814,9 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi rswap->sentflags[txi] = 1; _LP_refht_update(coin,rswap->txids[txi],ht); } else LP_refht_update(symbol,rswap->txids[txi]); - printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),ht); + //printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),ht); } - } else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); + } //else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); return(0); } @@ -1008,7 +1008,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( rswap.sentflags[BASILISK_BOBSPEND] == 0 && bits256_nonz(rswap.Apaymentspent) == 0 ) { - printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); + //printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 || bits256_nonz(rswap.privAm) != 0 ) { if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) @@ -1019,7 +1019,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( bits256_nonz(rswap.privAm) == 0 ) { rswap.privAm = basilisk_swap_privbob_extract(rswap.bobcoin,rswap.txids[BASILISK_ALICESPEND],0,1); - printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); + //printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); } if ( bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) { From 5093e8771a79a1de66e8bd87c0e113306b63e71b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:12:27 +0300 Subject: [PATCH 1346/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 27 ++++++++++++++++++--------- iguana/exchanges/LP_remember.c | 4 +++- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 75ff5541c..769fece73 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -509,14 +509,18 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) return(posted); } -void LP_coinsloop(void *myipaddr) +void LP_coinsloop(void *_coins) { - struct iguana_info *coin,*ctmp; bits256 zero; int32_t j,nonz; + struct iguana_info *coin,*ctmp; bits256 zero; int32_t j,nonz; char *coins = _coins; while ( 1 ) { nonz = 0; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { + if ( coins[0] != 0 && strcmp(coins,coin->symbol) != 0 ) + continue; + else if ( strcmp("BTC",coin->symbol) == 0 ) + continue; memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; @@ -547,7 +551,7 @@ void LP_coinsloop(void *myipaddr) continue; } //if ( (coin->lastscanht % 1000) == 0 ) - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); for (j=0; j<1; j++) { if ( LP_blockinit(coin,coin->lastscanht) < 0 ) @@ -910,7 +914,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu LP_initcoins(ctx,pubsock,coinsjson); G.waiting = 1; LP_passphrase_init(passphrase,jstr(argjson,"gui")); - if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) + if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)myipaddr) != 0 ) { printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); @@ -930,27 +934,32 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)myipaddr) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + { + printf("error launching BTC LP_coinsloop for port.%u\n",myport); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 34c3229bd..979e44a35 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1051,7 +1051,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } } LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]); - } else printf("bobpayment spent.%d or now.%u < expiration %u\n",flag,(uint32_t)time(NULL),rswap.expiration); + } + else if ( flag == 0 ) + printf("bobpayment: now.%u < expiration %u\n",(uint32_t)time(NULL),rswap.expiration); } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { From e3ff8f66f8b891af41a54bc344f2fe174382955b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:14:17 +0300 Subject: [PATCH 1347/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 769fece73..05463498c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -552,7 +552,7 @@ void LP_coinsloop(void *_coins) } //if ( (coin->lastscanht % 1000) == 0 ) printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); - for (j=0; j<1; j++) + for (j=0; j<100; j++) { if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { From b865f27975039d4442df47d7e464cc17de82e39b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:19:52 +0300 Subject: [PATCH 1348/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 05463498c..37176a928 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -519,7 +519,7 @@ void LP_coinsloop(void *_coins) { if ( coins[0] != 0 && strcmp(coins,coin->symbol) != 0 ) continue; - else if ( strcmp("BTC",coin->symbol) == 0 ) + else if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) continue; memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) @@ -537,7 +537,7 @@ void LP_coinsloop(void *_coins) } if ( coin->lastscanht == coin->longestchain+1 ) { - printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); + //printf("%s lastscanht.%d is longest.%d + 1\n",coin->symbol,coin->lastscanht,coin->longestchain); continue; } else if ( coin->lastscanht > coin->longestchain+1 ) @@ -959,6 +959,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + { + printf("error launching KMD LP_coinsloop for port.%u\n",myport); + exit(-1); + } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); From 718b7a146314d6c19702c382170d6c29aff04e51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:25:13 +0300 Subject: [PATCH 1349/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_remember.c | 6 +++--- iguana/exchanges/LP_transaction.c | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 37176a928..fcf10404b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -521,6 +521,8 @@ void LP_coinsloop(void *_coins) continue; else if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) continue; + if ( coins[0] != 0 ) + printf("%s loop\n",coins); memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 979e44a35..778da68f4 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -670,7 +670,7 @@ int32_t LP_refht_update(char *symbol,bits256 txid) int32_t LP_swap_load(struct LP_swap_remember *rswap) { - int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj,*fileobj; bits256 txid,checktxid; uint64_t value; + int32_t i,needflag,addflag; long fsize; char fname[1024],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj,*fileobj; bits256 txid,checktxid; uint64_t value; rswap->iambob = -1; sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap->requestid,rswap->quoteid), OS_compatible_path(fname); if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) @@ -767,7 +767,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) } free_json(sentobj); } - printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); + //printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); } } } //else printf("no symbol\n"); @@ -1089,7 +1089,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti for (i=0; i 0 ) - printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); + { + //printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); + } else if ( 0 && (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 ) { if ( (retjson= LP_gettxout(symbol,coinaddr,utxotxid,vout)) == 0 ) From 2db98761d42d157fffe2593629546b25e8cb3864 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:28:58 +0300 Subject: [PATCH 1350/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fcf10404b..4f930281d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -517,10 +517,16 @@ void LP_coinsloop(void *_coins) nonz = 0; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coins[0] != 0 && strcmp(coins,coin->symbol) != 0 ) - continue; - else if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) - continue; + if ( coins[0] != 0 ) + { + if ( strcmp(coins,coin->symbol) != 0 ) + continue; + } + else // avoid hardcode special case LP_coinsloop + { + if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) + continue; + } if ( coins[0] != 0 ) printf("%s loop\n",coins); memset(&zero,0,sizeof(zero)); From 8ebc7e51d02858682e5d4df7a42d768a8485dbb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 05:29:40 +0300 Subject: [PATCH 1351/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4f930281d..df9a0d6eb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -527,8 +527,6 @@ void LP_coinsloop(void *_coins) if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) continue; } - if ( coins[0] != 0 ) - printf("%s loop\n",coins); memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; From 02fcf328ac8333dbecbc9bed9576c0d50e6a9ba9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 06:35:41 +0300 Subject: [PATCH 1352/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_signatures.c | 230 +++++++++++++++++++++++-------- 3 files changed, 176 insertions(+), 58 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 93421deae..5ec7f2350 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -286,7 +286,7 @@ struct LP_pubkeyinfo }; int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); -int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); +int32_t LP_pubkey_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); uint32_t basilisk_requestid(struct basilisk_request *rp); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index df9a0d6eb..05bef27d5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,7 @@ // marketmaker // // process stats.log local file -> map of realtime activity! -// sign price +// serialize sighash functions // select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 9626aba6b..b38c5028f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -181,9 +181,106 @@ char *LP_quotereceived(cJSON *argjson) } else return(clonestr("{\"error\":\"nullptr\"}")); } +int32_t LP_bitcoinsig_add(cJSON *item,bits256 priv,uint8_t *pubsecp,bits256 sighash) +{ + static void *ctx; int32_t i,j,siglen; uint8_t pub33[33],sig[65]; char sigstr[128]; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + for (j=0; j<100; j++) + { + if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 65 ) + { + memset(pub33,0,33); + if ( bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0) == 0 && memcmp(pub33,pubsecp,33) == 0 ) + { + init_hexbytes_noT(sigstr,sig,siglen); + jaddstr(item,"sig",sigstr); + return(siglen); + } + if ( 0 ) + { + for (i=0; i<33; i++) + printf("%02x",pubsecp[i]); + printf(" pubsecp -> "); + for (i=0; i<33; i++) + printf("%02x",pub33[i]); + printf(" mismatched recovered pubkey.%d of %d\n",j,100); + } + } + } + return(-1); +} + +bits256 LP_price_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,char *base,char *rel,uint64_t price64) +{ + uint8_t buf[sizeof(pubkey) + 33 + sizeof(uint64_t)*3 + sizeof(timestamp)]; uint64_t basebits,relbits; bits256 sighash; + basebits = stringbits(base); + relbits = stringbits(rel); + memcpy(buf,pubkey.bytes,sizeof(pubkey)); + memcpy(&buf[sizeof(pubkey)],pubsecp,33); + memcpy(&buf[sizeof(pubkey)+33],&price64,sizeof(price64)); + memcpy(&buf[sizeof(pubkey)+33+sizeof(price64)],&basebits,sizeof(basebits)); + memcpy(&buf[sizeof(pubkey)+33+sizeof(price64)+sizeof(basebits)],&relbits,sizeof(relbits)); + memcpy(&buf[sizeof(pubkey)+33+sizeof(price64)+sizeof(basebits)+sizeof(relbits)],×tamp,sizeof(timestamp)); + vcalc_sha256(0,sighash.bytes,buf,sizeof(buf)); + return(sighash); +} + +bits256 LP_pubkey_sighash(uint32_t timestamp,bits256 pubkey,uint8_t *rmd160,uint8_t *pubsecp) +{ + uint8_t buf[sizeof(pubkey) + 20 + 33 + sizeof(timestamp)]; bits256 sighash; + memcpy(buf,pubkey.bytes,sizeof(pubkey)); + memcpy(&buf[sizeof(pubkey)],rmd160,20); + memcpy(&buf[sizeof(pubkey)+20],pubsecp,33); + memcpy(&buf[sizeof(pubkey)+20+33],×tamp,sizeof(timestamp)); + vcalc_sha256(0,sighash.bytes,buf,sizeof(buf)); + return(sighash); +} + +bits256 LP_utxos_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,char *msg) +{ + uint8_t *buf; bits256 sighash; int32_t len; + len = (int32_t)strlen(msg) + sizeof(pubkey)+33+sizeof(timestamp); + buf = malloc(len+1); + memcpy(buf,pubkey.bytes,sizeof(pubkey)); + memcpy(&buf[sizeof(pubkey)],pubsecp,33); + memcpy(&buf[sizeof(pubkey)+33],×tamp,sizeof(timestamp)); + strcpy((char *)&buf[sizeof(pubkey)+33+sizeof(timestamp)],msg); + vcalc_sha256(0,sighash.bytes,buf,len); + free(buf); + return(sighash); +} + +int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,char *msg) +{ + static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + if ( sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + { + decode_hex(sig,65,sigstr); + decode_hex(pubsecp,33,pubsecpstr); + sighash = LP_utxos_sighash(timestamp,pubsecp,pubkey,msg); + retval = bitcoin_recoververify(ctx,"price",sig,sighash,pub33,0); + if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) + { + printf("LP_utxos_sigcheck failure\n"); + retval = -1; + } else retval = 0; + } + return(retval); +} + +int32_t LP_utxos_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,uint8_t *pubsecp,bits256 pubkey,char *msg) +{ + bits256 sighash; + sighash = LP_utxos_sighash(timestamp,pubsecp,pubkey,msg); + return(LP_bitcoinsig_add(item,priv,pubsecp,sighash)); +} + void LP_postutxos(char *symbol,char *coinaddr) { - bits256 zero; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); + bits256 zero; uint32_t timestamp; char *msg,pubsecpstr[67]; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); @@ -196,6 +293,14 @@ void LP_postutxos(char *symbol,char *coinaddr) jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"coinaddr",coinaddr); jadd(reqjson,"utxos",array); + timestamp = (uint32_t)time(NULL); + jaddnum(reqjson,"timetamp",timestamp); + init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); + jaddstr(reqjson,"pubsecp",pubsecpstr); + jaddbits256(reqjson,"pubkey",G.LP_mypub25519); + msg = jprint(array,0); + LP_utxos_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,msg); + free(msg); //printf("post (%s) -> %d\n",msg,LP_mypubsock); LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); } @@ -207,11 +312,21 @@ struct LP_utxos_qitem { struct queueitem DL; cJSON *argjson; }; char *LP_postutxos_recv(cJSON *argjson) { - struct LP_utxos_qitem *uitem; - uitem = calloc(1,sizeof(*uitem)); - uitem->argjson = jduplicate(argjson); - queue_enqueue("utxosQ",&utxosQ,&uitem->DL); - return(clonestr("{\"result\":\"success\"}")); + struct LP_utxos_qitem *uitem; char *msg; cJSON *obj; + if ( (obj= jobj(argjson,"utxos")) != 0 ) + { + msg = jprint(obj,0); + if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),jbits256(argjson,"pubkey"),msg) == 0 ) + { + free(msg); + uitem = calloc(1,sizeof(*uitem)); + uitem->argjson = jduplicate(argjson); + queue_enqueue("utxosQ",&utxosQ,&uitem->DL); + return(clonestr("{\"result\":\"success\"}")); + } + free(msg); + } + return(clonestr("{\"error\":\"sig failure\"}")); } int32_t LP_utxosQ_process() @@ -237,9 +352,36 @@ int32_t LP_utxosQ_process() return(0); } +int32_t LP_price_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,char *base,char *rel,uint64_t price64) +{ + static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + if ( sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + { + decode_hex(sig,65,sigstr); + decode_hex(pubsecp,33,pubsecpstr); + sighash = LP_price_sighash(timestamp,pubsecp,pubkey,base,rel,price64); + retval = bitcoin_recoververify(ctx,"price",sig,sighash,pub33,0); + if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) + { + printf("LP_price_sigcheck failure\n"); + retval = -1; + } else retval = 0; + } + return(retval); +} + +int32_t LP_price_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,uint8_t *pubsecp,bits256 pubkey,char *base,char *rel,uint64_t price64) +{ + bits256 sighash; + sighash = LP_price_sighash(timestamp,pubsecp,pubkey,base,rel,price64); + return(LP_bitcoinsig_add(item,priv,pubsecp,sighash)); +} + char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { - struct iguana_info *basecoin,*relcoin; bits256 zero; cJSON *reqjson = cJSON_CreateObject(); + struct iguana_info *basecoin,*relcoin; char pubsecpstr[67]; uint32_t timestamp; uint64_t price64; bits256 zero; cJSON *reqjson = cJSON_CreateObject(); // LP_addsig if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 && relcoin->electrum == 0 ) { @@ -247,8 +389,15 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddbits256(reqjson,"pubkey",G.LP_mypub25519); jaddstr(reqjson,"base",base); jaddstr(reqjson,"rel",rel); + price64 = price * SATOSHIDEN + 0.0000000049; jaddnum(reqjson,"price",price); + jadd64bits(reqjson,"price64",price64); jaddstr(reqjson,"method","postprice"); + timestamp = (uint32_t)time(NULL); + jaddnum(reqjson,"timestamp",timestamp); + init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); + jaddstr(reqjson,"pubsecp",pubsecpstr); + LP_price_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,base,rel,price64); LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); return(clonestr("{\"result\":\"success\"}")); } else return(clonestr("{\"error\":\"electrum node cant post bob asks\"}")); @@ -263,62 +412,30 @@ char *LP_postprice_recv(cJSON *argjson) pubkey = jbits256(argjson,"pubkey"); if ( bits256_nonz(pubkey) != 0 ) { - LP_pricefeedupdate(pubkey,base,rel,price); - return(clonestr("{\"result\":\"success\"}")); + if ( LP_price_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,base,rel,j64bits(argjson,"price64")) == 0 ) + { + LP_pricefeedupdate(pubkey,base,rel,price); + return(clonestr("{\"result\":\"success\"}")); + } else return(clonestr("{\"error\":\"sig failure\"}")); } } return(clonestr("{\"error\":\"missing fields in posted price\"}")); } -bits256 LP_pubkey_sighash(bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) -{ - uint8_t buf[sizeof(pub) + 20 + 33]; bits256 sighash; - memcpy(buf,pub.bytes,sizeof(pub)); - memcpy(&buf[sizeof(pub)],rmd160,20); - memcpy(&buf[sizeof(pub)+20],pubsecp,33); - vcalc_sha256(0,sighash.bytes,buf,sizeof(buf)); - return(sighash); -} - -int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) +int32_t _LP_pubkey_sigcheck(uint8_t *sig,int32_t siglen,uint32_t timestamp,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) { - static void *ctx; - uint8_t pub33[33]; bits256 sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); + static void *ctx; uint8_t pub33[33]; bits256 sighash; if ( ctx == 0 ) ctx = bitcoin_ctx(); - return(bitcoin_recoververify(ctx,"sigcheck",sig,sighash,pub33,0)); + sighash = LP_pubkey_sighash(timestamp,pub,rmd160,pubsecp); + return(bitcoin_recoververify(ctx,"pubkey",sig,sighash,pub33,0)); } -int32_t LP_pubkey_sigadd(cJSON *item,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) +int32_t LP_pubkey_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp) { - static void *ctx; - uint8_t sig[128],pub33[33]; int32_t i,j,siglen=0; bits256 sighash; char sigstr[256]; - sighash = LP_pubkey_sighash(pub,rmd160,pubsecp); - if ( ctx == 0 ) - ctx = bitcoin_ctx(); - for (j=0; j<100; j++) - { - if ( (siglen= bitcoin_sign(ctx,"sigadd",sig,sighash,priv,1)) > 0 && siglen == 65 ) - { - memset(pub33,0,33); - if ( bitcoin_recoververify(ctx,"test",sig,sighash,pub33,0) == 0 && memcmp(pub33,pubsecp,33) == 0 ) - { - init_hexbytes_noT(sigstr,sig,siglen); - jaddstr(item,"sig",sigstr); - return(siglen); - } - if ( 0 ) - { - for (i=0; i<33; i++) - printf("%02x",pubsecp[i]); - printf(" pubsecp -> "); - for (i=0; i<33; i++) - printf("%02x",pub33[i]); - printf(" mismatched recovered pubkey.%d of %d\n",j,100); - } - } - } - return(0); + bits256 sighash; + sighash = LP_pubkey_sighash(timestamp,pub,rmd160,pubsecp); + return(LP_bitcoinsig_add(item,priv,pubsecp,sighash)); } int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) @@ -342,7 +459,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { siglen = len >> 1; decode_hex(sig,siglen,sigstr); - if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + if ( _LP_pubkey_sigcheck(sig,siglen,juint(item,"timestamp"),pubp->pubkey,rmd160,pubsecp) == 0 ) { for (i=0; i<20; i++) printf("%02x",pubp->rmd160[i]); @@ -374,15 +491,16 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) void LP_notify_pubkeys(void *ctx,int32_t pubsock) { - bits256 zero; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); - // LP_addsig + bits256 zero; uint32_t timestamp; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); jaddstr(reqjson,"method","notify"); jaddstr(reqjson,"rmd160",G.LP_myrmd160str); jaddbits256(reqjson,"pub",G.LP_mypub25519); init_hexbytes_noT(secpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",secpstr); - LP_pubkey_sigadd(reqjson,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); + timestamp = (uint32_t)time(NULL); + jaddnum(reqjson,"timestamp",timestamp); + LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); LP_reserved_msg("","",zero,jprint(reqjson,1)); } From f668e9a1f03b42ac53b7b4480b2bfdcc7407d706 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 06:51:46 +0300 Subject: [PATCH 1353/2732] Test --- iguana/exchanges/LP_signatures.c | 63 +++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b38c5028f..8d461a450 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -237,21 +237,18 @@ bits256 LP_pubkey_sighash(uint32_t timestamp,bits256 pubkey,uint8_t *rmd160,uint return(sighash); } -bits256 LP_utxos_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,char *msg) +bits256 LP_utxos_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,bits256 utxoshash) { - uint8_t *buf; bits256 sighash; int32_t len; - len = (int32_t)strlen(msg) + sizeof(pubkey)+33+sizeof(timestamp); - buf = malloc(len+1); + uint8_t buf[sizeof(pubkey)+sizeof(utxoshash)+33+sizeof(timestamp)]; bits256 sighash; memcpy(buf,pubkey.bytes,sizeof(pubkey)); memcpy(&buf[sizeof(pubkey)],pubsecp,33); memcpy(&buf[sizeof(pubkey)+33],×tamp,sizeof(timestamp)); - strcpy((char *)&buf[sizeof(pubkey)+33+sizeof(timestamp)],msg); - vcalc_sha256(0,sighash.bytes,buf,len); - free(buf); + memcpy(&buf[sizeof(pubkey)+33+sizeof(timestamp)],utxoshash.bytes,sizeof(utxoshash)); + vcalc_sha256(0,sighash.bytes,buf,sizeof(buf)); return(sighash); } -int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,char *msg) +int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,bits256 utxoshash) { static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; if ( ctx == 0 ) @@ -260,8 +257,8 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { decode_hex(sig,65,sigstr); decode_hex(pubsecp,33,pubsecpstr); - sighash = LP_utxos_sighash(timestamp,pubsecp,pubkey,msg); - retval = bitcoin_recoververify(ctx,"price",sig,sighash,pub33,0); + sighash = LP_utxos_sighash(timestamp,pubsecp,pubkey,utxoshash); + retval = bitcoin_recoververify(ctx,"utxos",sig,sighash,pub33,0); if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) { printf("LP_utxos_sigcheck failure\n"); @@ -271,16 +268,34 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 return(retval); } -int32_t LP_utxos_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,uint8_t *pubsecp,bits256 pubkey,char *msg) +bits256 LP_utxoshash_calc(cJSON *array) +{ + int32_t i,j,n; bits256 utxoshash,txid; cJSON *item; + memset(utxoshash.bytes,0,sizeof(utxoshash)); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; ismartaddr); @@ -298,9 +313,9 @@ void LP_postutxos(char *symbol,char *coinaddr) init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",pubsecpstr); jaddbits256(reqjson,"pubkey",G.LP_mypub25519); - msg = jprint(array,0); - LP_utxos_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,msg); - free(msg); + utxoshash = LP_utxoshash_calc(array); + char str[65]; printf("utxoshash add %s\n",bits256_str(str,utxoshash)); + LP_utxos_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,utxoshash); //printf("post (%s) -> %d\n",msg,LP_mypubsock); LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); } @@ -312,19 +327,18 @@ struct LP_utxos_qitem { struct queueitem DL; cJSON *argjson; }; char *LP_postutxos_recv(cJSON *argjson) { - struct LP_utxos_qitem *uitem; char *msg; cJSON *obj; + struct LP_utxos_qitem *uitem; bits256 utxoshash; cJSON *obj; if ( (obj= jobj(argjson,"utxos")) != 0 ) { - msg = jprint(obj,0); - if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),jbits256(argjson,"pubkey"),msg) == 0 ) + utxoshash = LP_utxoshash_calc(obj); + char str[65]; printf("got utxoshash %s\n",bits256_str(str,utxoshash)); + if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),jbits256(argjson,"pubkey"),utxoshash) == 0 ) { - free(msg); uitem = calloc(1,sizeof(*uitem)); uitem->argjson = jduplicate(argjson); queue_enqueue("utxosQ",&utxosQ,&uitem->DL); return(clonestr("{\"result\":\"success\"}")); } - free(msg); } return(clonestr("{\"error\":\"sig failure\"}")); } @@ -367,7 +381,12 @@ int32_t LP_price_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { printf("LP_price_sigcheck failure\n"); retval = -1; - } else retval = 0; + } + else + { + retval = 0; + printf("valid price sig %s/%s %.8f\n",base,rel,dstr(price64)); + } } return(retval); } From 77c947733bdc29ee32109fa74c05ef503145f2b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 06:56:06 +0300 Subject: [PATCH 1354/2732] Test --- iguana/exchanges/LP_signatures.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 8d461a450..830dae61b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -261,7 +261,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 retval = bitcoin_recoververify(ctx,"utxos",sig,sighash,pub33,0); if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) { - printf("LP_utxos_sigcheck failure\n"); + printf("LP_utxos_sigcheck failure, probably from node with older version\n"); retval = -1; } else retval = 0; } @@ -314,7 +314,7 @@ void LP_postutxos(char *symbol,char *coinaddr) jaddstr(reqjson,"pubsecp",pubsecpstr); jaddbits256(reqjson,"pubkey",G.LP_mypub25519); utxoshash = LP_utxoshash_calc(array); - char str[65]; printf("utxoshash add %s\n",bits256_str(str,utxoshash)); + //char str[65]; printf("utxoshash add %s\n",bits256_str(str,utxoshash)); LP_utxos_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,utxoshash); //printf("post (%s) -> %d\n",msg,LP_mypubsock); LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); @@ -331,7 +331,7 @@ char *LP_postutxos_recv(cJSON *argjson) if ( (obj= jobj(argjson,"utxos")) != 0 ) { utxoshash = LP_utxoshash_calc(obj); - char str[65]; printf("got utxoshash %s\n",bits256_str(str,utxoshash)); + //char str[65]; printf("got utxoshash %s\n",bits256_str(str,utxoshash)); if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),jbits256(argjson,"pubkey"),utxoshash) == 0 ) { uitem = calloc(1,sizeof(*uitem)); @@ -385,7 +385,7 @@ int32_t LP_price_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 else { retval = 0; - printf("valid price sig %s/%s %.8f\n",base,rel,dstr(price64)); + //printf("valid price sig %s/%s %.8f\n",base,rel,dstr(price64)); } } return(retval); From fe54d0a3825a5b6cd863c79f20dd1e612d7611f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 14:02:59 +0300 Subject: [PATCH 1355/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_rpc.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 05bef27d5..5467673aa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,13 +18,13 @@ // LP_nativeDEX.c // marketmaker // -// process stats.log local file -> map of realtime activity! -// serialize sighash functions // select oldest utxo first +// process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // // verify portfolio, pricearray, interest to KMD withdraw, reliable networking // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections +// serialize sighash functions -> otherwise bigendian architectures not supported #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cec077f1b..02f9d4d03 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1047,7 +1047,6 @@ int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) blockhash = LP_getbestblockhash(coin); if ( bits256_nonz(blockhash) != 0 ) { - //char str[65]; printf("check %s\n",bits256_str(str,blockhash)); if ( (blockjson= LP_getblock(coin->symbol,blockhash)) != 0 ) { if ( *bestheightp < 0 ) @@ -1055,7 +1054,7 @@ int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) { height = jint(blockjson,"height"); - //printf("height.%d\n",height); + char str[65]; printf("%s height.%d\n",bits256_str(str,blockhash),height); } else { From 77ef39a821358156bb0448b9dff8afed3df95eb4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 14:07:10 +0300 Subject: [PATCH 1356/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 02f9d4d03..4f3084b4e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1054,7 +1054,7 @@ int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) if ( (hasnotarization= LP_hasnotarization(coin,blockjson)) > 0 ) { height = jint(blockjson,"height"); - char str[65]; printf("%s height.%d\n",bits256_str(str,blockhash),height); + //char str[65]; printf("%s height.%d\n",bits256_str(str,blockhash),height); } else { From ee20bb9efa85f09b15eaacc0b182ce7c8a96202f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 18:33:35 +0300 Subject: [PATCH 1357/2732] Test --- iguana/exchanges/LP_bitcoin.c | 42 ------------------------------- iguana/exchanges/LP_nativeDEX.c | 4 +-- iguana/exchanges/LP_transaction.c | 41 ++++++++++++++++++++++++++++++ iguana/exchanges/LP_utxos.c | 3 +++ 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 20cc5858f..3874991b7 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -325,33 +325,6 @@ enum opcodetype OP_INVALIDOPCODE = 0xff, }; -bits256 LP_privkeyfind(uint8_t rmd160[20]) -{ - int32_t i; static bits256 zero; - for (i=0; i no privkey\n"); - return(zero); -} - -int32_t LP_privkeyadd(bits256 privkey,uint8_t rmd160[20]) -{ - bits256 tmpkey; - tmpkey = LP_privkeyfind(rmd160); - if ( bits256_nonz(tmpkey) != 0 ) - return(-bits256_cmp(privkey,tmpkey)); - G.LP_privkeys[G.LP_numprivkeys].privkey = privkey; - memcpy(G.LP_privkeys[G.LP_numprivkeys].rmd160,rmd160,20); - //int32_t i; for (i=0; i<20; i++) - // printf("%02x",rmd160[i]); - //char str[65]; printf(" -> add privkey.(%s)\n",bits256_str(str,privkey)); - G.LP_numprivkeys++; - return(G.LP_numprivkeys); -} - int32_t iguana_rwnum(int32_t rwflag,uint8_t *serialized,int32_t len,void *endianedp) { int32_t i; uint64_t x; @@ -2231,21 +2204,6 @@ int32_t bitcoin_priv2wiflong(uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8 return((int32_t)strlen(wifstr)); } -bits256 LP_privkey(char *coinaddr,uint8_t taddr) -{ - bits256 privkey; uint8_t addrtype,rmd160[20]; - bitcoin_addr2rmd160(taddr,&addrtype,rmd160,coinaddr); - privkey = LP_privkeyfind(rmd160); - return(privkey); -} - -bits256 LP_pubkey(bits256 privkey) -{ - bits256 pubkey; - pubkey = curve25519(privkey,curve25519_basepoint9()); - return(pubkey); -} - char *_setVsigner(uint8_t wiftaddr,uint8_t pubtype,struct vin_info *V,int32_t ind,char *pubstr,char *wifstr) { uint8_t addrtype; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5467673aa..bc9f16777 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,13 +18,13 @@ // LP_nativeDEX.c // marketmaker // -// select oldest utxo first // process stats.log local file -> map of realtime activity! +// select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // // verify portfolio, pricearray, interest to KMD withdraw, reliable networking // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections -// serialize sighash functions -> otherwise bigendian architectures not supported +// bigendian architectures need to use little endian for sighash calcs #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 8ecad59c7..b72cb111a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -18,6 +18,47 @@ // LP_transaction.c // marketmaker // +bits256 LP_privkeyfind(uint8_t rmd160[20]) +{ + int32_t i; static bits256 zero; + for (i=0; i no privkey\n"); + return(zero); +} + +int32_t LP_privkeyadd(bits256 privkey,uint8_t rmd160[20]) +{ + bits256 tmpkey; + tmpkey = LP_privkeyfind(rmd160); + if ( bits256_nonz(tmpkey) != 0 ) + return(-bits256_cmp(privkey,tmpkey)); + G.LP_privkeys[G.LP_numprivkeys].privkey = privkey; + memcpy(G.LP_privkeys[G.LP_numprivkeys].rmd160,rmd160,20); + //int32_t i; for (i=0; i<20; i++) + // printf("%02x",rmd160[i]); + //char str[65]; printf(" -> add privkey.(%s)\n",bits256_str(str,privkey)); + G.LP_numprivkeys++; + return(G.LP_numprivkeys); +} + +bits256 LP_privkey(char *coinaddr,uint8_t taddr) +{ + bits256 privkey; uint8_t addrtype,rmd160[20]; + bitcoin_addr2rmd160(taddr,&addrtype,rmd160,coinaddr); + privkey = LP_privkeyfind(rmd160); + return(privkey); +} + +bits256 LP_pubkey(bits256 privkey) +{ + bits256 pubkey; + pubkey = curve25519(privkey,curve25519_basepoint9()); + return(pubkey); +} int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 565cfdda2..54b5aec3a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -18,6 +18,9 @@ // marketmaker // + + + int32_t LP_ismine(struct LP_utxoinfo *utxo) { if ( utxo != 0 && bits256_cmp(utxo->pubkey,G.LP_mypub25519) == 0 ) From ec7b57f9b06a6fb1362151e890767435b6925c15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 21:48:10 +0300 Subject: [PATCH 1358/2732] Getrawtransaction --- iguana/exchanges/LP_commands.c | 135 +++++++++++++++-------------- iguana/exchanges/getrawtransaction | 3 + 2 files changed, 73 insertions(+), 65 deletions(-) create mode 100755 iguana/exchanges/getrawtransaction diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 216a902d8..6b49ad323 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -//printf("stats_JSON(%s)\n",jprint(argjson,0)); + //printf("stats_JSON(%s)\n",jprint(argjson,0)); method = jstr(argjson,"method"); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { @@ -51,10 +51,10 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r if ( 0 && (otherpeers= jint(argjson,"numpeers")) > peer->numpeers ) peer->numpeers = otherpeers; /*if ( 0 && (othernumutxos= jint(argjson,"numutxos")) > peer->numutxos ) - { - printf("change.(%s) numutxos.%d -> %d mynumutxos.%d\n",peer->ipaddr,peer->numutxos,othernumutxos,LP_mypeer != 0 ? LP_mypeer->numutxos:0); - peer->numutxos = othernumutxos; - }*/ + { + printf("change.(%s) numutxos.%d -> %d mynumutxos.%d\n",peer->ipaddr,peer->numutxos,othernumutxos,LP_mypeer != 0 ? LP_mypeer->numutxos:0); + peer->numutxos = othernumutxos; + }*/ if ( peer->sessionid == 0 ) peer->sessionid = juint(argjson,"session"); //printf("peer.(%s) found (%d %d) (%d %d) (%s)\n",peer->ipaddr,peer->numpeers,peer->numutxos,otherpeers,othernumutxos,jprint(argjson,0)); @@ -70,32 +70,32 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r return(0); } /*if ( strcmp(method,"hello") == 0 ) - { - //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); - return(0); - } - else*/ if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) - { - static char *laststr; - char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); - if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,G.LP_mypub25519) == 0 ) - { - newstr = jprint(argjson,0); - if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) - { - printf("got message.(%s) from %s:%u\n",newstr,ipaddr!=0?ipaddr:"",argport); - if ( laststr != 0 ) - free(laststr); - laststr = newstr; - LP_gotmessage(argjson); - retstr = clonestr(laststr); - } - } else retstr = clonestr("{\"error\":\"duplicate message\"}"); - } + { + //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); + return(0); + } + else*/ if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) + { + static char *laststr; + char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); + if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,G.LP_mypub25519) == 0 ) + { + newstr = jprint(argjson,0); + if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) + { + printf("got message.(%s) from %s:%u\n",newstr,ipaddr!=0?ipaddr:"",argport); + if ( laststr != 0 ) + free(laststr); + laststr = newstr; + LP_gotmessage(argjson); + retstr = clonestr(laststr); + } + } else retstr = clonestr("{\"error\":\"duplicate message\"}"); + } //else if ( strcmp(method,"nn_tests") == 0 ) // return(clonestr("{\"result\":\"success\"}")); - else if ( strcmp(method,"help") == 0 ) - return(clonestr("{\"result\":\" \ + else if ( strcmp(method,"help") == 0 ) + return(clonestr("{\"result\":\" \ available localhost RPC commands: \n \ pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ setprice(base, rel, price)\n\ @@ -104,6 +104,7 @@ goal(coin=*, val=)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ +getrawtransaction(coin, txid)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ @@ -137,7 +138,7 @@ dividends(coin, height, )\n\ stop()\n\ \"}")); //sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ - + base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); coin = jstr(argjson,"coin"); @@ -329,6 +330,10 @@ stop()\n\ { return(LP_sendrawtransaction(coin,jstr(argjson,"signedtx"))); } + else if ( strcmp(method,"getrawtransaction") == 0 ) + { + return(jprint(LP_gettx(coin,jbits256(argjson,"txid")),0)); + } else if ( strcmp(method,"withdraw") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) @@ -543,41 +548,41 @@ stop()\n\ if ( IAMLP != 0 ) { /*if ( strcmp(method,"broadcast") == 0 ) - { - bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; - if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) - { - Broadcaststr = jprint(reqjson,0); - if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) - { - cipherlen = (int32_t)strlen(cipherstr) >> 1; - if ( cipherlen <= sizeof(cipher) ) - { - decode_hex(cipher,cipherlen,cipherstr); - LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,base,rel,cipher,cipherlen); - } else retstr = clonestr("{\"error\":\"cipher too big\"}"); - } - else - { - memset(zero.bytes,0,sizeof(zero)); -//printf("broadcast.(%s)\n",Broadcaststr); - LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); - } - retstr = clonestr("{\"result\":\"success\"}"); - } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); - } - else*/ if ( strcmp(method,"psock") == 0 ) - { - if ( myipaddr == 0 || myipaddr[0] == 0 || strcmp(myipaddr,"127.0.0.1") == 0 ) - { - if ( LP_mypeer != 0 ) - myipaddr = LP_mypeer->ipaddr; - else printf("LP_psock dont have actual ipaddr?\n"); - } - if ( jint(argjson,"ispaired") != 0 ) - return(LP_psock(myipaddr,jint(argjson,"ispaired"))); - else return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - } + { + bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; + if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) + { + Broadcaststr = jprint(reqjson,0); + if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) + { + cipherlen = (int32_t)strlen(cipherstr) >> 1; + if ( cipherlen <= sizeof(cipher) ) + { + decode_hex(cipher,cipherlen,cipherstr); + LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,base,rel,cipher,cipherlen); + } else retstr = clonestr("{\"error\":\"cipher too big\"}"); + } + else + { + memset(zero.bytes,0,sizeof(zero)); + //printf("broadcast.(%s)\n",Broadcaststr); + LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + } + retstr = clonestr("{\"result\":\"success\"}"); + } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); + } + else*/ if ( strcmp(method,"psock") == 0 ) + { + if ( myipaddr == 0 || myipaddr[0] == 0 || strcmp(myipaddr,"127.0.0.1") == 0 ) + { + if ( LP_mypeer != 0 ) + myipaddr = LP_mypeer->ipaddr; + else printf("LP_psock dont have actual ipaddr?\n"); + } + if ( jint(argjson,"ispaired") != 0 ) + return(LP_psock(myipaddr,jint(argjson,"ispaired"))); + else return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + } } else { diff --git a/iguana/exchanges/getrawtransaction b/iguana/exchanges/getrawtransaction new file mode 100755 index 000000000..c9d042c65 --- /dev/null +++ b/iguana/exchanges/getrawtransaction @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getrawtransaction\",\"coin\":\"KMD\",\"txid\":\"107a2683abbfa9188f78e17d3bcba66ece5bd7cbe105ab5bbaae79364159e84d\"}" From f5f6acaf2c53155e30510c357292cb879bbe969a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 22:33:31 +0300 Subject: [PATCH 1359/2732] Tradestatus --- iguana/exchanges/LP_commands.c | 6 ++++++ iguana/exchanges/LP_remember.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6b49ad323..2a45899ba 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -453,6 +453,12 @@ stop()\n\ // end received response // public access, even from http + else if ( strcmp(method,"tradestatus") == 0 ) + { + LP_tradecommand_log(argjson); + printf("GOT TRADESTATUS! %s\n",jprint(argjson,0)); + retstr = clonestr("{\"result\":\"success\"}"); + } else if ( strcmp(method,"balance") == 0 ) { if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 778da68f4..74aca2ba1 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1107,9 +1107,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap.requestid,rswap.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { + jaddstr(item,"method","tradestatus"); itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); - free(itemstr); + LP_reserved_msg(rswap.src,rswap.dest,zero,itemstr); fclose(fp); } } From 5bafc60fe62a3579522ac68240266174c75103ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 23:01:50 +0300 Subject: [PATCH 1360/2732] Test --- iguana/exchanges/LP_remember.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 74aca2ba1..c0887eea8 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1110,7 +1110,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti jaddstr(item,"method","tradestatus"); itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); - LP_reserved_msg(rswap.src,rswap.dest,zero,itemstr); + LP_reserved_msg(rswap.src,rswap.dest,zero,clonestr(itemstr)); + LP_broadcast_message(LP_mypubsock,rswap.src,rswap.dest,zero,itemstr); fclose(fp); } } From c883e7143521955944107d8242f34ec15a3f50b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 23:14:53 +0300 Subject: [PATCH 1361/2732] Test --- iguana/exchanges/LP_signatures.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 830dae61b..880d5e9ba 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -250,7 +250,7 @@ bits256 LP_utxos_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,bits int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,bits256 utxoshash) { - static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; + static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; char str[65]; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) @@ -261,7 +261,9 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 retval = bitcoin_recoververify(ctx,"utxos",sig,sighash,pub33,0); if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) { - printf("LP_utxos_sigcheck failure, probably from node with older version\n"); + static uint32_t counter; + if ( counter++ < 100 ) + printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey)); retval = -1; } else retval = 0; } From cc0acad6af3d53a23099aa304362536b92537e51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Oct 2017 23:53:21 +0300 Subject: [PATCH 1362/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c7046072d..b90e14048 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 55ae020df812781fb14c39c1af08362c3d4a3452 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:08:39 +0300 Subject: [PATCH 1363/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b90e14048..9927ceca2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); + printf("%s -> %s LISTUNSPENT.(%s)\n",coin->lastunspent,addr,jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 0d825e6ec552c0ab2218aebfc995b6d71c0684e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:12:33 +0300 Subject: [PATCH 1364/2732] test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9927ceca2..5396442b1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s -> %s LISTUNSPENT.(%s)\n",coin->lastunspent,addr,jprint(retjson,0)); + printf("%s lag.%ld %s -> %s LISTUNSPENT.(%s)\n",coin->symbol,time(NULL) -( coin->unspenttime+30),coin->lastunspent,addr,jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 0acab1f183c224c23b8163b9a3dde4a6b56d789e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:16:47 +0300 Subject: [PATCH 1365/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5396442b1..a7c3a81f2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s lag.%ld %s -> %s LISTUNSPENT.(%s)\n",coin->symbol,time(NULL) -( coin->unspenttime+30),coin->lastunspent,addr,jprint(retjson,0)); + printf("%s u.%u t.%ld %s -> %s LISTUNSPENT.(%s)\n",coin->symbol,coin->unspenttime,time(NULL),coin->lastunspent,addr,jprint(retjson,0)); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 580069c98cf55b1e748756f4f493c5c111e886aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:22:59 +0300 Subject: [PATCH 1366/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a7c3a81f2..195bb79b9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,11 +522,12 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s u.%u t.%ld %s -> %s LISTUNSPENT.(%s)\n",coin->symbol,coin->unspenttime,time(NULL),coin->lastunspent,addr,jprint(retjson,0)); + printf("%s u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); + printf("%s u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); } } else retjson = LP_address_utxos(coin,addr,1); return(retjson); From e545bf3c24c1ea261c12896989f62a0b451314d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:25:31 +0300 Subject: [PATCH 1367/2732] Test --- iguana/exchanges/LP_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 195bb79b9..0f652a105 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,12 +522,11 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); + printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); coin->unspenttime = (uint32_t)time(NULL); - printf("%s u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); } } else retjson = LP_address_utxos(coin,addr,1); return(retjson); From 3a4edcaeafbcd8eddab47adaa106c0ac268ef4de Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:28:21 +0300 Subject: [PATCH 1368/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0f652a105..16910cd3f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -518,7 +518,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 ) + if ( coin != 0 && (strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30) ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { @@ -526,7 +526,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); - coin->unspenttime = (uint32_t)time(NULL); + //coin->unspenttime = (uint32_t)time(NULL); } } else retjson = LP_address_utxos(coin,addr,1); return(retjson); From 6052f5f1bee6558725feb744e983502e5d5deccc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:30:18 +0300 Subject: [PATCH 1369/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 16910cd3f..1d869244f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -526,7 +526,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); - //coin->unspenttime = (uint32_t)time(NULL); + coin->unspenttime = (uint32_t)time(NULL); } } else retjson = LP_address_utxos(coin,addr,1); return(retjson); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 54b5aec3a..6c0f07440 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -453,10 +453,7 @@ cJSON *LP_inventory(char *symbol) myipaddr = LP_mypeer->ipaddr; else myipaddr = "127.0.0.1"; if ( (coin= LP_coinfind(symbol)) != 0 ) - { - coin->unspenttime = (uint32_t)time(NULL) - 777; LP_listunspent_both(symbol,coin->smartaddr,0); - } HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { char str[65]; From 972be976c764b5ea8501d7c24baa459083777911 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 00:31:07 +0300 Subject: [PATCH 1370/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1d869244f..0116b7091 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -522,7 +522,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); + //printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From 91004439c840fe729a9f048d1fdfe3c4be656ac4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 11:57:13 +0300 Subject: [PATCH 1371/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_socket.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bc9f16777..3e00a58d4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +// electrum swaps efficiency // process stats.log local file -> map of realtime activity! // select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0116b7091..a71a21b99 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -373,6 +373,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); +printf("%s\n",stratumreq); memset(ep->buf,0,ep->bufsize); sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; @@ -522,7 +523,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); + printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); From b851ae545784a255d339d9d77a200f2882a01e40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 12:30:25 +0300 Subject: [PATCH 1372/2732] Test --- iguana/exchanges/LP_include.h | 8 +++++--- iguana/exchanges/LP_ordermatch.c | 6 ------ iguana/exchanges/LP_socket.c | 29 +++++++++++++++++++++++------ iguana/exchanges/LP_swap.c | 3 +++ 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5ec7f2350..f66db99ff 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -185,9 +185,9 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime; + uint32_t lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; - char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64]; + char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; void *electrum; void *ctx; @@ -231,7 +231,8 @@ struct LP_address struct LP_address_utxo *utxos; bits256 pubkey; int64_t balance,total; - uint32_t timestamp,n; + uint32_t timestamp,n,unspenttime; + int32_t unspentheight; char coinaddr[40]; uint8_t pubsecp[33],pad; }; @@ -287,6 +288,7 @@ struct LP_pubkeyinfo int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); int32_t LP_pubkey_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); +struct LP_address *LP_address(struct iguana_info *coin,char *coinaddr); void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); uint32_t basilisk_requestid(struct basilisk_request *rp); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0aad4f785..93b8f7e75 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -485,7 +485,6 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); - //G.LP_pendingswaps--; printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } @@ -493,16 +492,12 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); - //G.LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } printf("%s/%s bid %.8f ask %.8f values %.8f %.8f\n",Q.srccoin,Q.destcoin,bid,ask,dstr(butxo->payment.value),dstr(butxo->deposit.value)); price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) - { - //G.LP_pendingswaps--; return(clonestr("{\"error\":\"cant get alicecoin\"}")); - } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); if ( bits256_nonz(Q.privkey) != 0 )//&& Q.quotetime >= Q.timestamp-3 ) { @@ -531,7 +526,6 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("connected result.(%s)\n",jprint(retjson,0)); if ( jobj(retjson,"error") != 0 ) LP_availableset(autxo); - else G.LP_pendingswaps++; return(jprint(retjson,1)); } else diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a71a21b99..c074718a2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -373,7 +373,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s\n",stratumreq); +printf("%s %s\n",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; @@ -517,17 +517,34 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr,int32_t electrumflag) { - cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol); + cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; + if ( (coin= LP_coinfind(symbol)) == 0 ) + return(0); + if ( ep->heightp == 0 ) + height = coin->longestchain; + else height = *(ep->heightp); + if ( (ap= LP_address(coin,addr)) != 0 ) + { + if ( ap->unspenttime == 0 ) + usecache = 0; + else if ( ap->unspentheight < height ) + usecache = 0; + else if ( G.LP_pendingswaps != 0 && time(NULL) > ap->unspenttime+20 ) + usecache = 0; + } //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( coin != 0 && (strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30) ) + if ( usecache == 0 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0))); + printf("%s u.%u t.%ld %s LISTUNSPENT.(%ld)\n",coin->symbol,ap->unspenttime,time(NULL),addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); - safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent)); - coin->unspenttime = (uint32_t)time(NULL); + if ( ap != 0 ) + { + ap->unspenttime = (uint32_t)time(NULL); + ap->unspentheight = height; + } } } else retjson = LP_address_utxos(coin,addr,1); return(retjson); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 9118b4b49..dfafa0499 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -746,6 +746,7 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t void LP_bobloop(void *_swap) { uint8_t *data; int32_t maxlen,m,n; uint32_t expiration; struct basilisk_swap *swap = _swap; + G.LP_pendingswaps++; fprintf(stderr,"start swap iambob\n"); maxlen = 1024*1024 + sizeof(*swap); data = malloc(maxlen); @@ -804,11 +805,13 @@ void LP_bobloop(void *_swap) basilisk_swap_finished(swap); //free(swap); } else printf("swap timed out\n"); + G.LP_pendingswaps--; } void LP_aliceloop(void *_swap) { uint8_t *data; int32_t maxlen,n,m; uint32_t expiration; struct basilisk_swap *swap = _swap; + G.LP_pendingswaps++; maxlen = 1024*1024 + sizeof(*swap); data = malloc(maxlen); expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT; From e6c3ea9022a6c8313b57894f11da323426bb1ebd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 12:33:06 +0300 Subject: [PATCH 1373/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3e00a58d4..f683c22cb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -634,7 +634,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } - if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) + if ( coin->inactive == 0 && time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { nonz++; if ( (height= LP_getheight(coin)) > coin->longestchain ) From 2647c9cf3c93b7be40e6e89fbbe86a77daae068f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 12:36:52 +0300 Subject: [PATCH 1374/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c074718a2..6920826b4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -537,7 +537,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s u.%u t.%ld %s LISTUNSPENT.(%ld)\n",coin->symbol,ap->unspenttime,time(NULL),addr,strlen(jprint(retjson,0))); + printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%ld)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); if ( ap != 0 ) From c014782566d0e4e7928b5afe2e08cba4b3f14161 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 12:55:08 +0300 Subject: [PATCH 1375/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 880d5e9ba..05e2b99ee 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -263,7 +263,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { static uint32_t counter; if ( counter++ < 100 ) - printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey)); + printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey)); retval = -1; } else retval = 0; } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 999c9ec4e..027544a6d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -242,7 +242,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) + //if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From cf29e3735021223633abb7756f35c996c021aaff Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 14:08:48 +0300 Subject: [PATCH 1376/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 42 ++++++++++++++++++--- iguana/exchanges/LP_ordermatch.c | 65 +++++++++++++++++--------------- iguana/exchanges/LP_utxo.c | 30 ++------------- 4 files changed, 77 insertions(+), 62 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f66db99ff..7849e40d9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,7 +44,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 15 +#define LP_AUTOTRADE_TIMEOUT 10 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f683c22cb..a03d9f858 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,10 @@ // LP_nativeDEX.c // marketmaker // +// variable timeout based on number of electrums in swap +// listunspent on each new block or 30 seconds if doing swap +// reject swap response from bob? +// // electrum swaps efficiency // process stats.log local file -> map of realtime activity! // select oldest utxo first @@ -397,7 +401,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) return(0); HASH_ITER(hh,LP_coins,coin,ctmp) { - if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) + if ( IAMLP == 0 && coin->inactive != 0 ) continue; if ( coin->smartaddr[0] == 0 ) continue; @@ -512,7 +516,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) void LP_coinsloop(void *_coins) { - struct iguana_info *coin,*ctmp; bits256 zero; int32_t j,nonz; char *coins = _coins; + struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; while ( 1 ) { nonz = 0; @@ -531,8 +535,37 @@ void LP_coinsloop(void *_coins) memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; - if ( coin->electrum != 0 ) + if ( (ep= coin->electrum) != 0 ) + { + if ( (backupep= ep->prev) == 0 ) + backupep = ep; + HASH_ITER(hh,coin->addresses,ap,atmp) + { + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->SPV == 0 ) + { + nonz++; + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV > 0 ) + printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } + else if ( up->SPV == -1 ) + { + nonz++; + printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); + oldht = up->U.height; + LP_txheight_check(coin,ap->coinaddr,up); + if ( oldht != up->U.height ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV <= 0 ) + up->SPV = -2; + else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } + } + } continue; + } if ( coin->firstrefht == 0 ) continue; else if ( coin->firstscanht == 0 ) @@ -557,6 +590,7 @@ void LP_coinsloop(void *_coins) coin->lastscanht = coin->firstscanht; continue; } + nonz++; //if ( (coin->lastscanht % 1000) == 0 ) printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); for (j=0; j<100; j++) @@ -570,8 +604,6 @@ void LP_coinsloop(void *_coins) if ( coin->lastscanht == coin->longestchain+1 ) break; } - nonz++; - continue; } if ( nonz == 0 ) usleep(1000); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 93b8f7e75..9899bf9bc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -200,7 +200,7 @@ int32_t LP_nanobind(void *ctx,char *pairstr) int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { - int32_t i,oldht,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; char str[65]; int64_t dist; uint64_t mindist = (1LL << 60); + int32_t i,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; int64_t dist; uint64_t mindist = (1LL << 60); if ( (ep= coin->electrum) != 0 ) { if ( (backupep= ep->prev) == 0 ) @@ -215,25 +215,6 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a //printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); if ( up->spendheight <= 0 ) { - if ( coin->electrum != 0 ) - { - if ( up->SPV == 0 || up->SPV == -1 ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV == 0 || up->SPV == -1 ) - { - printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); - if ( up->SPV == -1 ) - { - oldht = up->U.height; - LP_txheight_check(coin,coinaddr,up); - if ( oldht != up->U.height ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV < 0 ) - up->SPV = -2; - } - continue; - } //else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); - } if ( (coin->electrum == 0 || up->SPV > 0) && dist >= 0 && dist < mindist ) { //printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); @@ -800,20 +781,30 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - LP_listunspent_query(base,coinaddr); - LP_listunspent_both(base,coinaddr,1); asatoshis = autxo->S.satoshis; - for (j=0; jelectrum != 0 ) + { + price *= 1.01; + *ordermatchpricep = price; + *bestsatoshisp = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); + *bestdestsatoshisp = asatoshis; + } + else*/ { - if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) + LP_listunspent_query(base,coinaddr); + LP_listunspent_both(base,coinaddr,1); + for (j=0; jpubkey,gui)) != 0 ) + { + printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); + break; + } + asatoshis = (asatoshis / 64) * 63; } - asatoshis = (asatoshis / 64) * 63; + if ( j < maxiters ) + break; } - if ( j < maxiters ) - break; } else printf("self trading or blacklisted peer\n"); } else @@ -838,7 +829,11 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce) { - uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + basecoin = LP_coinfind(base); + relcoin = LP_coinfind(rel); + if ( basecoin == 0 || basecoin->inactive != 0 || relcoin == 0 || relcoin->inactive != 0 ) + return(clonestr("{\"error\":\"base or rel not found or inactive\"}")); if ( LP_aliceonly(base) > 0 ) return(clonestr("{\"error\":\"GAME can only be alice coin\"}")); printf("LP_autobuy %s/%s price %.8f vol %.8f nonce %u\n",base,rel,maxprice,relvolume,nonce); @@ -852,6 +847,16 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) timeout = LP_AUTOTRADE_TIMEOUT; + if ( basecoin->electrum != 0 && relcoin->electrum != 0 ) + { + if ( timeout < 3*LP_AUTOTRADE_TIMEOUT ) + timeout = 3*LP_AUTOTRADE_TIMEOUT; + } + else if ( basecoin->electrum != 0 || relcoin->electrum != 0 ) + { + if ( timeout < 2*LP_AUTOTRADE_TIMEOUT ) + timeout = 2*LP_AUTOTRADE_TIMEOUT; + } if ( time(NULL) < Alice_expiration ) return(clonestr("{\"error\":\"only one pending request at a time\"}")); else diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 027544a6d..998d12ce1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -18,19 +18,6 @@ // marketmaker // -// listunspent: valid for local node, mostly valid for electrum - -// full node + electrum for external listunspent, gettxout to validate -// pruned node + electrum for external listunspent, gettxout to validate -// full node, network for external listunspent, gettxout to validate -// pruned node, network for external listunspent, gettxout to validate -// electrum only, network for gettxout - -// handle spurious errors -// handle invalid data - -//REJECT KMD ccee27b53b52ca61bbc9fdc7de5feb0a12c14d4d92639414d372f002cc3d092f/v0 value.468169379 vs 468169380 ({"bestblock":"080400d4216c02d100004fd2f4f3505ddb507b643785e02703d3412feba39fb1","confirmations":2356,"value":4.68169380,"scriptPubKey":{"asm":"0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842 OP_CHECKSIG","hex":"210224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842ac","reqSigs":1,"type":"pubkey","addresses":["RFssbc211PJdVy1bvcvAG5X2N4ovPAoy5o"]},"version":1,"coinbase":true}) - uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { double val = 0.; uint64_t value = 0; int32_t electrumflag; @@ -208,12 +195,8 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) { flag = 1; - if ( height > 0 && up->U.height != height && up->SPV <= 0 ) - { - if ( up->U.height > 0 ) - printf("%s SPV.%d update %s/v%d up->U.height %d <- %d\n",coin->symbol,up->SPV,bits256_str(str,up->U.txid),up->U.vout,up->U.height,height); + if ( height > 0 && up->U.height != height ) up->U.height = height, flag |= 2; - } if ( spendheight > 0 && up->spendheight != spendheight ) up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) @@ -240,9 +223,9 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, up->spendheight = spendheight; portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); - portable_mutex_unlock(&coin->addrmutex); + portable_mutex_unlock(&coin->addrmutex); retval = 1; - //if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) + if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); @@ -354,15 +337,10 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; struct electrum_info *ep,*backupep=0; + cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; array = cJSON_CreateArray(); if ( coinaddr != 0 && coinaddr[0] != 0 ) { - if ( (ep= coin->electrum) != 0 ) - { - if ( (backupep= ep->prev) == 0 ) - backupep = ep; - } //portable_mutex_lock(&coin->addrmutex); if ( (ap= _LP_addressfind(coin,coinaddr)) != 0 ) { From 01e7fccd1ecf0a77f8d1df0d20aa4bad213505a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 15:07:24 +0300 Subject: [PATCH 1377/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_ordermatch.c | 44 ++++++++++++-- iguana/exchanges/LP_statemachine.c | 30 +++++++++ iguana/exchanges/LP_utxo.c | 97 ++++++++++++++++-------------- iguana/exchanges/LP_utxos.c | 36 ----------- 5 files changed, 122 insertions(+), 86 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7849e40d9..d66187044 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -306,6 +306,7 @@ struct LP_peerinfo *LP_peerfind(uint32_t ipbits,uint16_t port); uint64_t LP_value_extract(cJSON *obj,int32_t addinterest); int32_t LP_swap_getcoinaddr(char *symbol,char *coinaddr,bits256 txid,int32_t vout); char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen); +int64_t LP_komodo_interest(bits256 txid,int64_t value); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9899bf9bc..afbcfc5a4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -77,7 +77,7 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo, double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp,int32_t iambob) { - double qprice=0.; uint64_t txfee,desttxfee,srcvalue=0,srcvalue2=0,destvalue=0,destvalue2=0; + double qprice=0.; char str[65]; cJSON *txout; uint64_t txfee,desttxfee,srcvalue=0,srcvalue2=0,destvalue=0,destvalue2=0; printf(">>>>>>> quote satoshis.(%.8f %.8f) %s %.8f -> %s %.8f\n",dstr(qp->satoshis),dstr(qp->destsatoshis),qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); if ( butxo != 0 ) { @@ -86,6 +86,20 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str printf("bob not eligible %s\n",jprint(LP_quotejson(qp),1)); return(-2); } + if ( (txout= LP_gettxout(qp->srccoin,qp->coinaddr,qp->txid,qp->vout)) != 0 ) + free_json(txout); + else + { + printf("%s %s payment %s/v%d is spent\n",qp->srccoin,qp->coinaddr,bits256_str(str,qp->txid),qp->vout); + return(-21); + } + if ( (txout= LP_gettxout(qp->srccoin,qp->coinaddr,qp->txid2,qp->vout2)) != 0 ) + free_json(txout); + else + { + printf("%s %s deposit %s/v%d is spent\n",qp->srccoin,qp->coinaddr,bits256_str(str,qp->txid2),qp->vout2); + return(-22); + } if ( bits256_cmp(butxo->deposit.txid,qp->txid2) != 0 || butxo->deposit.vout != qp->vout2 ) { char str[65],str2[65]; printf("%s != %s v%d != %d\n",bits256_str(str,butxo->deposit.txid),bits256_str(str2,qp->txid2),butxo->deposit.vout,qp->vout2); @@ -97,10 +111,27 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-7); } } - if ( autxo != 0 && LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) + if ( autxo != 0 ) { - char str[65]; printf("alice not eligible (%.8f %.8f) %s/v%d\n",dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); - return(-3); + if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) + { + char str[65]; printf("alice not eligible (%.8f %.8f) %s/v%d\n",dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); + return(-3); + } + if ( (txout= LP_gettxout(qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout)) != 0 ) + free_json(txout); + else + { + printf("%s %s Apayment %s/v%d is spent\n",qp->destcoin,qp->destaddr,bits256_str(str,qp->desttxid),qp->destvout); + return(-23); + } + if ( (txout= LP_gettxout(qp->destcoin,qp->destaddr,qp->feetxid,qp->feevout)) != 0 ) + free_json(txout); + else + { + printf("%s %s dexfee %s/v%d is spent\n",qp->destcoin,qp->destaddr,bits256_str(str,qp->feetxid),qp->feevout); + return(-24); + } } if ( LP_quote_checkmempool(qp,autxo,butxo) < 0 ) return(-4); @@ -746,7 +777,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max = 10000; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; maxiters = 100; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; @@ -755,6 +786,9 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i duration = LP_ORDERBOOK_DURATION; if ( maxprice <= 0. || LP_priceinfofind(base) == 0 || basecoin == 0 ) return(0); + if ( basecoin->electrum == 0 ) + max = 1000; + else max = 20; utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 7eafd0392..72ff7189d 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1831,6 +1831,36 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) } } +/*char *LP_spentcheck(cJSON *argjson) + { + bits256 txid,checktxid; int32_t vout,checkvout; struct LP_utxoinfo *utxo; int32_t iambob,retval = 0; + txid = jbits256(argjson,"txid"); + vout = jint(argjson,"vout"); + for (iambob=0; iambob<=1; iambob++) + { + if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 && utxo->T.spentflag == 0 ) + { + if ( jobj(argjson,"check") == 0 ) + checktxid = txid, checkvout = vout; + else + { + checktxid = jbits256(argjson,"checktxid"); + checkvout = jint(argjson,"checkvout"); + } + if ( LP_txvalue(0,utxo->coin,checktxid,checkvout) == 0 ) + { + //if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) + // LP_mypeer->numutxos--; + utxo->T.spentflag = (uint32_t)time(NULL); + retval++; + printf("indeed txid was spent\n"); + } + } + } + if ( retval > 0 ) + return(clonestr("{\"result\":\"marked as spent\"}")); + return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); + }*/ void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; struct iguana_info *coin; char str[65]; uint32_t now = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 998d12ce1..7b8362aa1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -544,32 +544,6 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i return(tx); } -uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) -{ - uint64_t interest,value = 0; cJSON *txobj; - *interestp = 0; - destaddr[0] = 0; - if ( (txobj= LP_gettxout(coin->symbol,destaddr,txid,vout)) != 0 ) - { - if ( (value= LP_value_extract(txobj,0)) == 0 ) - { - char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); - } - else if ( strcmp(coin->symbol,"KMD") == 0 ) - { - if ( (interest= jdouble(txobj,"interest")) != 0. ) - { - //printf("add interest of %.8f to %.8f\n",interest,dstr(value)); - *interestp = SATOSHIDEN * interest; - } - } - LP_destaddr(destaddr,txobj); - //char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); - free_json(txobj); - } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } - return(value); -} - cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; @@ -692,6 +666,35 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int return(numconfirms); } +uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_info *coin,bits256 txid,int32_t vout) +{ + uint64_t interest,value = 0; cJSON *txobj; + *interestp = 0; + destaddr[0] = 0; + if ( (txobj= LP_gettxout(coin->symbol,destaddr,txid,vout)) != 0 ) + { + if ( (value= LP_value_extract(txobj,0)) == 0 ) + { + char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout); + } + else if ( strcmp(coin->symbol,"KMD") == 0 ) + { + if ( coin->electrum == 0 ) + { + if ((interest= jdouble(txobj,"interest")) != 0. ) + { + //printf("add interest of %.8f to %.8f\n",interest,dstr(value)); + *interestp = SATOSHIDEN * interest; + } + } else *interestp = LP_komodo_interest(txid,value); + } + LP_destaddr(destaddr,txobj); + //char str[65]; printf("dest.(%s) %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + free_json(txobj); + } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } + return(value); +} + int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) { char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; @@ -704,7 +707,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; cJSON *txobj=0; uint64_t value; struct iguana_info *coin; char str[65],_coinaddr[65]; + struct LP_transaction *tx; cJSON *txobj=0; struct iguana_info *coin; char str[65];//,_coinaddr[65]; uint64_t value; if ( bits256_nonz(txid) == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) @@ -723,7 +726,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( vout < tx->numvouts ) { - if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) + /*if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) { //printf("LP_txvalue %s/v%d is spent at %s\n",bits256_str(str,txid),vout,bits256_str(str2,tx->outpoints[vout].spendtxid)); return(0); @@ -738,12 +741,14 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) //printf("(%s) return value %.8f + interest %.8f\n",coinaddr,dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); } return(tx->outpoints[vout].value + 0*tx->outpoints[vout].interest); - } + }*/ + return(tx->outpoints[vout].value); } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); } else { - if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) != 0 ) + printf("LP_txvalue: unexpected null tx %s %s %s/v%d\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); + /*if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) != 0 ) { value = LP_value_extract(txobj,0);//SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); if ( coinaddr == 0 ) @@ -758,15 +763,14 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) } printf("pruned node? LP_txvalue couldnt find %s tx %s/v%d (%s)\n",coin->symbol,bits256_str(str,txid),vout,txobj!=0?jprint(txobj,0):""); if ( txobj != 0 ) - free_json(txobj); + free_json(txobj);*/ } return(0); } int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - //struct LP_utxoinfo *utxo; struct LP_address_utxo *up; - uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64],str[65]; struct iguana_info *coin = LP_coinfind(symbol); + uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct LP_transaction *tx; struct LP_address_utxo *up; struct iguana_info *coin = LP_coinfind(symbol); if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) { printf("null txid not eligible\n"); @@ -778,16 +782,6 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( bypass != 0 ) val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); - /*if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) - { - //printf("%s/v%d spent %d\n",bits256_str(str,txid),vout,up->spendheight); - return(-2); - } - if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) - { - //printf("%s/v%d spent %d\n",bits256_str(str,txid2),vout2,up->spendheight); - return(-3); - }*/ txfee = LP_txfeecalc(LP_coinfind(symbol),0,0); if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { @@ -805,18 +799,31 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol { *valp = val; *val2p = val2; + if ( destaddr[0] == 0 ) + strcpy(destaddr,destaddr2); + if ( coin != 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) + return(0); + if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 ) + return(0); + if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) + return(0); + if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) + return(0); + } return(1); } } // else printf("no val2\n"); } - char str2[65]; + /*char str2[65]; if ( val != 0 && val2 != 0 ) printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); if ( val == 0 ) LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,-1,1); if ( val2 == 0 ) LP_address_utxoadd(coin,destaddr,txid2,vout2,threshold,-1,1); - /*for (iter=0; iter<2; iter++) + for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6c0f07440..3cfd35c65 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -265,37 +265,6 @@ void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) utxo->T.spentflag = (uint32_t)time(NULL); } -/*char *LP_spentcheck(cJSON *argjson) -{ - bits256 txid,checktxid; int32_t vout,checkvout; struct LP_utxoinfo *utxo; int32_t iambob,retval = 0; - txid = jbits256(argjson,"txid"); - vout = jint(argjson,"vout"); - for (iambob=0; iambob<=1; iambob++) - { - if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 && utxo->T.spentflag == 0 ) - { - if ( jobj(argjson,"check") == 0 ) - checktxid = txid, checkvout = vout; - else - { - checktxid = jbits256(argjson,"checktxid"); - checkvout = jint(argjson,"checkvout"); - } - if ( LP_txvalue(0,utxo->coin,checktxid,checkvout) == 0 ) - { - //if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) - // LP_mypeer->numutxos--; - utxo->T.spentflag = (uint32_t)time(NULL); - retval++; - printf("indeed txid was spent\n"); - } - } - } - if ( retval > 0 ) - return(clonestr("{\"result\":\"marked as spent\"}")); - return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); -}*/ - struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; @@ -305,11 +274,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("session.%u addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } - /*if ( iambob != 0 ) - { - printf("deprecated bob utxos\n"); - return(0); - }*/ if ( (coin= LP_coinfind(symbol)) == 0 || (IAMLP == 0 && coin->inactive != 0) ) { //printf("LP_utxoadd reject inactive %s\n",symbol); From f7dc9a2ffbbbd5670011915c27a33eeb6ccad78b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 15:16:50 +0300 Subject: [PATCH 1378/2732] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3cfd35c65..361aab14e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -483,7 +483,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) - LP_listunspent_issue(coin->symbol,coin->smartaddr,0); + LP_listunspent_issue(coin->symbol,coin->smartaddr,1); LP_address(coin,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { @@ -516,12 +516,12 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); if ( satoshis != 0 && satoshis != value ) - printf("unexpected privkey_init value mismatch %.8f vs %.8f (%s) %.8f %.8f\n",dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); + printf("%s %s unexpected privkey_init value mismatch %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) { //printf("%s\n",jprint(item,0)); values[i] = satoshis; - flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); + //flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; } //printf("array.%d\n",n); From 0c55fbec5e444cee809462c858f68b00b557cde5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 15:24:25 +0300 Subject: [PATCH 1379/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 35 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a03d9f858..8e0a3c045 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -543,24 +543,27 @@ void LP_coinsloop(void *_coins) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { - if ( up->SPV == 0 ) + if ( up->U.height > 0 && up->spendheight < 0 ) { - nonz++; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV > 0 ) - printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); - } - else if ( up->SPV == -1 ) - { - nonz++; - printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); - oldht = up->U.height; - LP_txheight_check(coin,ap->coinaddr,up); - if ( oldht != up->U.height ) + if ( up->SPV == 0 ) + { + nonz++; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV <= 0 ) - up->SPV = -2; - else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + if ( up->SPV > 0 ) + printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } + else if ( up->SPV == -1 ) + { + nonz++; + printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); + oldht = up->U.height; + LP_txheight_check(coin,ap->coinaddr,up); + if ( oldht != up->U.height ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV <= 0 ) + up->SPV = -2; + else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } } } } From 9caae35da816a096e8f9de8b38daca66890ebcf9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 15:36:49 +0300 Subject: [PATCH 1380/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6920826b4..897a1ca86 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -339,7 +339,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep if (tx->height <= 0 ) { tx->height = ht; - //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); + printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } if ( v >= 0 && v < tx->numvouts ) { @@ -537,7 +537,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%ld)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,strlen(jprint(retjson,0))); + printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%s)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); if ( ap != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7b8362aa1..c295cb171 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -566,7 +566,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); - //printf("from transaction init\n"); + printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); //LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); From 14d763bcf3044f3cdfbd7e4f9b9f3460f628d98b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 15:45:59 +0300 Subject: [PATCH 1381/2732] Test --- iguana/exchanges/LP_socket.c | 7 ++++++- iguana/exchanges/LP_utxo.c | 3 ++- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 897a1ca86..d34358c6b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -546,7 +546,12 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON ap->unspentheight = height; } } - } else retjson = LP_address_utxos(coin,addr,1); + } + else + { + retjson = LP_address_utxos(coin,addr,1); + printf("CACHED.%s\n",jprint(retjson,0)); + } return(retjson); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c295cb171..8c32f526a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -240,7 +240,8 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 { jaddbits256(item,"txid",up->U.txid); jaddnum(item,"vout",up->U.vout); - jaddnum(item,"confirmations",LP_getheight(coin) - up->U.height + 1); + if ( up->U.height > 0 ) + jaddnum(item,"confirmations",LP_getheight(coin) - up->U.height + 1); jaddnum(item,"amount",dstr(up->U.value)); jaddstr(item,"scriptPubKey",""); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 361aab14e..9287a7f8b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -483,7 +483,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) - LP_listunspent_issue(coin->symbol,coin->smartaddr,1); + LP_listunspent_issue(coin->symbol,coin->smartaddr,0); LP_address(coin,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { From 37f6ad2f391807939ecfd111a17044f5034097af Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 15:52:37 +0300 Subject: [PATCH 1382/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8c32f526a..1a85a228c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -225,8 +225,8 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) - printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + if ( value == 0 ) + printf("null? ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9287a7f8b..bfcc45ccd 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -490,7 +490,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - //printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); + printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) From f3d8c4635570027911ac1ec151d1991a9a1c2019 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:08:53 +0300 Subject: [PATCH 1383/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 42 ++---------------------------- iguana/exchanges/LP_statemachine.c | 38 ++++++++++++++++++++++++++- iguana/exchanges/LP_swap.c | 4 +-- iguana/exchanges/LP_utxo.c | 6 +++-- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8e0a3c045..7be8e72cb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -396,7 +396,7 @@ void utxosQ_loop(void *myipaddr) int32_t LP_utxos_sync(struct LP_peerinfo *peer) { - int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2,*array3; uint64_t total,total2,metric; struct iguana_info *coin,*ctmp; struct LP_address *ap; char *retstr,*retstr2,*coinaddr; + int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2; uint64_t total,total2; struct iguana_info *coin,*ctmp; char *retstr,*retstr2; if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) return(0); HASH_ITER(hh,LP_coins,coin,ctmp) @@ -473,43 +473,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) } free_json(array); } - if ( 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) - { - if ( (array2= cJSON_Parse(retstr)) != 0 ) - { - if ( (m= cJSON_GetArraySize(array2)) > 0 ) - { - for (j=0; j %.8f n.%d\n",coinaddr,dstr(metric>>16),(uint16_t)metric); - if ( (ap= LP_addressfind(coin,coinaddr)) == 0 || _LP_unspents_metric(ap->total,ap->n) != metric ) - { - if ( ap == 0 || ap->n < (metric & 0xffff) ) - { - if ( (retstr2= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) - { - if ( (array3= cJSON_Parse(retstr2)) != 0 ) - { - LP_unspents_array(coin,coinaddr,array3); - //printf("pulled.(%s)\n",retstr2); - free_json(array3); - } - free(retstr2); - } - } //else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap!=0?ap->n:-1,(uint16_t)metric); - } - } - } - } - free_json(array2); - } - //printf("processed.(%s)\n",retstr); - free(retstr); - } } return(posted); } @@ -645,14 +608,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; LP_peer_pricesquery(peer); - //LP_utxos_sync(peer); + LP_utxos_sync(peer); needpings++; } peer->lastpeers = now; } if ( peer->needping != 0 ) { - LP_utxos_sync(peer); peer->diduquery = now; nonz++; if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 72ff7189d..5db3f3c40 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1958,7 +1958,43 @@ if ( aliceutxo->S.swap == 0 ) LP_availableset(aliceutxo); return(jprint(bestitem,0)); } - +if ( 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) +{ + if ( (array2= cJSON_Parse(retstr)) != 0 ) + { + if ( (m= cJSON_GetArraySize(array2)) > 0 ) + { + for (j=0; j %.8f n.%d\n",coinaddr,dstr(metric>>16),(uint16_t)metric); + if ( (ap= LP_addressfind(coin,coinaddr)) == 0 || _LP_unspents_metric(ap->total,ap->n) != metric ) + { + if ( ap == 0 || ap->n < (metric & 0xffff) ) + { + if ( (retstr2= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coinaddr)) != 0 ) + { + if ( (array3= cJSON_Parse(retstr2)) != 0 ) + { + LP_unspents_array(coin,coinaddr,array3); + //printf("pulled.(%s)\n",retstr2); + free_json(array3); + } + free(retstr2); + } + } //else printf("wait for %s to pull %d vs %d\n",peer->ipaddr,ap!=0?ap->n:-1,(uint16_t)metric); + } + } + } + } + free_json(array2); + } + //printf("processed.(%s)\n",retstr); + free(retstr); +} /*if ( time(NULL) > coin->lastmonitor+60 ) { //portable_mutex_lock(&coin->addrmutex); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index dfafa0499..d09439a94 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -786,7 +786,7 @@ void LP_bobloop(void *_swap) while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); - sleep(3); + sleep(10); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) printf("error sending bobpayment\n"); @@ -853,7 +853,7 @@ void LP_aliceloop(void *_swap) while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { char str[65];printf("%d waiting for bobpayment %s to be confirmed.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); - sleep(LP_SWAPSTEP_TIMEOUT); + sleep(10); } /*if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1a85a228c..218e448f1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -251,6 +251,8 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 jaddnum(item,"tx_pos",up->U.vout); jaddnum(item,"height",up->U.height); jadd64bits(item,"value",up->U.value); + if ( up->U.value == 0 ) + printf("ERROR LP_address_item illegal.(%s)\n",jprint(item,0)); } return(item); } @@ -356,9 +358,9 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum up->spendheight = 1; else free_json(txobj); } - if ( up->spendheight <= 0 ) + if ( up->spendheight <= 0 && up->U.value != 0 ) { - if ( up->SPV >= 0 ) + if ( coin->electrum == 0 || up->SPV > 0 ) { jaddi(array,LP_address_item(coin,up,electrumret)); n++; From 3fbf7f0cccccf3aa46f8e5a428c254f2bb6ad72d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:12:44 +0300 Subject: [PATCH 1384/2732] Test --- iguana/exchanges/LP_socket.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d34358c6b..897a1ca86 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -546,12 +546,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON ap->unspentheight = height; } } - } - else - { - retjson = LP_address_utxos(coin,addr,1); - printf("CACHED.%s\n",jprint(retjson,0)); - } + } else retjson = LP_address_utxos(coin,addr,1); return(retjson); } From 9ca35efd1160f380c2f32b325b0b86f018eed9f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:16:32 +0300 Subject: [PATCH 1385/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_portfolio.c | 1 + iguana/exchanges/LP_utxos.c | 1 + 3 files changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 2a45899ba..f2b605120 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -508,6 +508,7 @@ stop()\n\ LP_listunspent_issue(coin,coinaddr,1); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { + printf("network invoked\n"); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 99644a956..975fb66d4 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -93,6 +93,7 @@ char *LP_portfolio() continue; if ( iter == 0 ) { + printf("from portfolio\n"); LP_privkey_init(-1,coin,G.LP_privkey,G.LP_mypub25519); coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index bfcc45ccd..560fdce12 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -753,6 +753,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) //printf("i.%d of %d\n",i,LP_numcoins); else if ( IAMLP == 0 || coin->inactive == 0 ) { + printf("from updates\n"); if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } From 27cc5d9d17e7437f3dc50ad2163741539efdde0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:19:34 +0300 Subject: [PATCH 1386/2732] Test --- iguana/exchanges/LP_portfolio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 975fb66d4..05184ded6 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -635,6 +635,7 @@ void prices_loop(void *ignore) } free(retstr); } + sleep(60); } } From 294f16c9e39ba1f6325a792c571af329fba5c798 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:28:28 +0300 Subject: [PATCH 1387/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_signatures.c | 4 ++-- iguana/exchanges/LP_socket.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 10 +++++----- iguana/exchanges/LP_utxos.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d66187044..371cb7bc5 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -335,7 +335,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_numpeers(); uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance); -int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); +int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); void LP_smartutxos_push(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index afbcfc5a4..c999fe346 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -576,7 +576,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) value = LP_value_extract(item,0); height = LP_txheight(coin,txid); //char str[65]; printf("LP_listunspent_both: %s/v%d ht.%d %.8f\n",bits256_str(str,txid),v,height,dstr(value)); - LP_address_utxoadd(coin,coinaddr,txid,v,value,height,-1); + LP_address_utxoadd("LP_listunspent_both",coin,coinaddr,txid,v,value,height,-1); } } } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 05184ded6..f3492daf6 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -93,7 +93,7 @@ char *LP_portfolio() continue; if ( iter == 0 ) { - printf("from portfolio\n"); + //printf("from portfolio\n"); LP_privkey_init(-1,coin,G.LP_privkey,G.LP_mypub25519); coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 05e2b99ee..66a518465 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -591,8 +591,8 @@ char *LP_uitem_recv(cJSON *argjson) coinaddr = jstr(argjson,"coinaddr"); if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); - LP_address_utxoadd(LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); + char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + LP_address_utxoadd("LP_uitem,recv",LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 897a1ca86..eb3adb6ab 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -315,7 +315,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep else { //printf("external unspent has no gettxout\n"); - flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,0,1); + flag += LP_address_utxoadd("electrum process",coin,coinaddr,txid,v,value,0,1); } } else @@ -349,10 +349,10 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep tx->outpoints[v].value = value; } } - if ( value != 0 || tx->height > 0 ) + if ( tx->height > 0 ) { //printf("from electrum_process_array\n"); - flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); + flag += LP_address_utxoadd("electrum process2",coin,coinaddr,txid,v,value,tx->height,-1); } //printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } //else printf("cant find tx\n"); @@ -486,7 +486,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; //printf("from history\n"); - LP_address_utxoadd(coin,addr,txid,0,0,height,-1); + LP_address_utxoadd("electrum history",coin,addr,txid,0,0,height,-1); } } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 218e448f1..9f20b7ab6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -178,7 +178,7 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina return(0); } -int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) +int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; if ( coin == 0 ) @@ -226,7 +226,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, portable_mutex_unlock(&coin->addrmutex); retval = 1; if ( value == 0 ) - printf("null? ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + printf("%s null? ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); @@ -446,7 +446,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) if ( errs == 0 ) { //printf("from LP_unspents_array\n"); - LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); + LP_address_utxoadd("LP_unspents_array",coin,coinaddr,txid,v,val,height,-1); count++; } } @@ -570,7 +570,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); - //LP_address_utxoadd(coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); + LP_address_utxoadd("LP_transactioninit iter0",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); } @@ -592,7 +592,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[spentvout].spendtxid = txid; tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; - LP_address_utxoadd(coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + LP_address_utxoadd("LP_transactioninit iter1",coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); if ( 0 && strcmp(coin->symbol,"REVS") == 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 560fdce12..a305968c7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -753,7 +753,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) //printf("i.%d of %d\n",i,LP_numcoins); else if ( IAMLP == 0 || coin->inactive == 0 ) { - printf("from updates\n"); + printf("from updates %s\n",coin->symbol); if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } From 038edb1179a3aaebb71944c46e860509b6a57794 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:40:45 +0300 Subject: [PATCH 1388/2732] test --- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/LP_utxo.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 66a518465..ca32089d5 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -591,7 +591,7 @@ char *LP_uitem_recv(cJSON *argjson) coinaddr = jstr(argjson,"coinaddr"); if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) { - char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd("LP_uitem,recv",LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9f20b7ab6..cb3531baa 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -199,13 +199,13 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b up->U.height = height, flag |= 2; if ( spendheight > 0 && up->spendheight != spendheight ) up->spendheight = spendheight, flag |= 4; - if ( up->U.value == 0 && up->U.value != value ) + if ( value != 0 && up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; //printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } - if ( flag == 0 ) + if ( flag == 0 && value != 0 ) { if ( coin->electrum == 0 ) { @@ -569,7 +569,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); - printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); + //printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); LP_address_utxoadd("LP_transactioninit iter0",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); From a7dda988a6e717530faed8d613d7ad2a02f16d34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 16:49:56 +0300 Subject: [PATCH 1389/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_socket.c | 5 ++--- iguana/exchanges/LP_utxos.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7be8e72cb..0b7b60258 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -512,7 +512,7 @@ void LP_coinsloop(void *_coins) { nonz++; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV > 0 ) + if ( 0 && up->SPV > 0 ) printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } else if ( up->SPV == -1 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index eb3adb6ab..1575ffec7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -339,7 +339,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep if (tx->height <= 0 ) { tx->height = ht; - printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); + //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } if ( v >= 0 && v < tx->numvouts ) { @@ -373,7 +373,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s\n",symbol,stratumreq); +printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; @@ -485,7 +485,6 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * if ( tx->height > 0 && tx->height != height ) printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; - //printf("from history\n"); LP_address_utxoadd("electrum history",coin,addr,txid,0,0,height,-1); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a305968c7..676ae391c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -490,7 +490,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); + //printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) @@ -753,7 +753,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) //printf("i.%d of %d\n",i,LP_numcoins); else if ( IAMLP == 0 || coin->inactive == 0 ) { - printf("from updates %s\n",coin->symbol); + //printf("from updates %s\n",coin->symbol); if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } From fb5e66b32ef65e04282b0bd26d351bacfc94e834 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 17:04:01 +0300 Subject: [PATCH 1390/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_socket.c | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7fb1cac2c..d3ad1432b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -776,7 +776,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 ) + if ( suppress_prefetch == 0 && n < 3 && bids[i]->numutxos == 0 ) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); @@ -796,7 +796,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 ) + if ( suppress_prefetch == 0 && n < 3 && asks[i]->numutxos == 0 ) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1575ffec7..c5e16dd47 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -373,7 +373,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s",symbol,stratumreq); +//printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; @@ -536,7 +536,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%s)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(jprint(retjson,0))); + printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%ld)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); if ( ap != 0 ) @@ -558,9 +558,13 @@ cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,c cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } -cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } +cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) +{ + return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); +} + cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) { uint8_t *extraspace; cJSON *txobj; char str[65],str2[65]; struct iguana_msgtx msgtx; bits256 checktxid; From e939bd745a72583fc0293f9b5b8ffe5119eb6e6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 17:19:24 +0300 Subject: [PATCH 1391/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 371cb7bc5..e418a2b47 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -72,7 +72,7 @@ #define LP_RESERVETIME 60 #define LP_AVETXSIZE 256 #define LP_CACHEDURATION 60 -#define BASILISK_DEFAULT_NUMCONFIRMS 3 +#define BASILISK_DEFAULT_NUMCONFIRMS 1 #define BASILISK_DEFAULT_MAXCONFIRMS 6 #define DEX_SLEEP 3 #define BASILISK_KEYSIZE ((int32_t)(2*sizeof(bits256)+sizeof(uint32_t)*2)) From 1659f308716a06d96cc65226974874d921d6104f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 17:58:43 +0300 Subject: [PATCH 1392/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ---- iguana/exchanges/LP_signatures.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0b7b60258..8c187dd4a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,11 +18,7 @@ // LP_nativeDEX.c // marketmaker // -// variable timeout based on number of electrums in swap -// listunspent on each new block or 30 seconds if doing swap -// reject swap response from bob? // -// electrum swaps efficiency // process stats.log local file -> map of realtime activity! // select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index ca32089d5..42a20cc82 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -92,6 +92,10 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) jaddnum(retjson,"price",price); } } + if ( qp->R.requestid != 0 ) + jaddnum(retjson,"requestid",qp->R.requestid); + if ( qp->R.quoteid != 0 ) + jaddnum(retjson,"quoteid",qp->R.quoteid); return(retjson); } From 731148d6ae39eae674fb965d5fc399f1f46fa7a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 18:04:15 +0300 Subject: [PATCH 1393/2732] Test --- iguana/exchanges/LP_signatures.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 42a20cc82..34fe9ca32 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -101,6 +101,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) { + uint32_t rid,qid; safecopy(qp->gui,LP_gui,sizeof(qp->gui)); safecopy(qp->srccoin,jstr(argjson,"base"),sizeof(qp->srccoin)); safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr)); @@ -122,6 +123,18 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) qp->destsatoshis = j64bits(argjson,"destsatoshis"); qp->txfee = j64bits(argjson,"txfee"); qp->desttxfee = j64bits(argjson,"desttxfee"); + qp->R.requestid = juint(argjson,"requestid"); + qp->R.quoteid = juint(argjson,"quoteid"); + if ( qp->R.requestid != (rid= basilisk_requestid(&qp->R)) ) + { + printf("requestid.%u -> %u\n",qp->R.requestid,rid); + qp->R.requestid = rid; + } + if ( qp->R.quoteid != (qid= basilisk_quoteid(&qp->R)) ) + { + printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); + qp->R.quoteid = qid; + } return(0); } From 4b00693c01f06b6dae5342f82999e5618ba57a5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 18:31:23 +0300 Subject: [PATCH 1394/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d3ad1432b..ae42cd6c8 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -776,7 +776,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 ) + if ( suppress_prefetch == 0 && n < 7 && bids[i]->numutxos == 0 ) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); @@ -796,7 +796,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 ) + if ( suppress_prefetch == 0 && n < 7 && asks[i]->numutxos == 0 ) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); From b4002e8fb76ce847856c3a7bfff75e9612ec1e27 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 18:38:09 +0300 Subject: [PATCH 1395/2732] Test --- iguana/exchanges/LP_utxo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index cb3531baa..12a33173a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -748,10 +748,10 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) return(tx->outpoints[vout].value); } else printf("LP_txvalue vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); } - else + else if ( coin->electrum == 0 ) { - printf("LP_txvalue: unexpected null tx %s %s %s/v%d\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); - /*if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) != 0 ) + uint64_t value; char _coinaddr[64]; + if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) != 0 ) { value = LP_value_extract(txobj,0);//SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); if ( coinaddr == 0 ) @@ -764,9 +764,9 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) return(value); } } - printf("pruned node? LP_txvalue couldnt find %s tx %s/v%d (%s)\n",coin->symbol,bits256_str(str,txid),vout,txobj!=0?jprint(txobj,0):""); + //printf("pruned node? LP_txvalue couldnt find %s tx %s/v%d (%s)\n",coin->symbol,bits256_str(str,txid),vout,txobj!=0?jprint(txobj,0):""); if ( txobj != 0 ) - free_json(txobj);*/ + free_json(txobj); } return(0); } From bab43df20e9bff0cd958ee7043016bd38e3bce51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:10:03 +0300 Subject: [PATCH 1396/2732] Statslog parse --- iguana/exchanges/LP_commands.c | 2 + iguana/exchanges/LP_nativeDEX.c | 8 ++-- iguana/exchanges/LP_remember.c | 18 -------- iguana/exchanges/LP_stats.c | 81 +++++++++++++++++++++++++++++++++ iguana/exchanges/LP_utxo.c | 2 +- 5 files changed, 88 insertions(+), 23 deletions(-) create mode 100644 iguana/exchanges/LP_stats.c diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f2b605120..078bfebb3 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -214,6 +214,8 @@ stop()\n\ { return(LP_portfolio()); } + else if ( strcmp(method,"") == 0 ) + return(LP_statslog_parse()); else if ( strcmp(method,"secretaddresses") == 0 ) { uint8_t taddr,pubtype; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8c187dd4a..089150cd8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,12 +18,11 @@ // LP_nativeDEX.c // marketmaker // -// // process stats.log local file -> map of realtime activity! -// select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. -// -// verify portfolio, pricearray, interest to KMD withdraw, reliable networking +// select oldest utxo first + +// verify portfolio, pricearray, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -100,6 +99,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_prices.c" #include "LP_scan.c" #include "LP_transaction.c" +#include "LP_stats.c" #include "LP_remember.c" #include "LP_swap.c" #include "LP_peers.c" diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c0887eea8..59361bd37 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1228,24 +1228,6 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) return(retstr); } -void LP_tradecommand_log(cJSON *argjson) -{ - static FILE *logfp; char *jsonstr; - if ( logfp == 0 ) - { - if ( (logfp= fopen("stats.log","rb+")) != 0 ) - fseek(logfp,0,SEEK_END); - else logfp = fopen("stats.log","wb"); - } - if ( logfp != 0 ) - { - jsonstr = jprint(argjson,0); - fprintf(logfp,"%s\n",jsonstr); - free(jsonstr); - fflush(logfp); - } -} - extern struct LP_quoteinfo LP_Alicequery; extern uint32_t Alice_expiration; diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c new file mode 100644 index 000000000..10bc0ce55 --- /dev/null +++ b/iguana/exchanges/LP_stats.c @@ -0,0 +1,81 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_stats.c +// marketmaker +// + +#define LP_STATSLOG_FNAME "stats.log" + +void LP_tradecommand_log(cJSON *argjson) +{ + static FILE *logfp; char *jsonstr; + if ( logfp == 0 ) + { + if ( (logfp= fopen(LP_STATSLOG_FNAME,"rb+")) != 0 ) + fseek(logfp,0,SEEK_END); + else logfp = fopen(LP_STATSLOG_FNAME,"wb"); + } + if ( logfp != 0 ) + { + jsonstr = jprint(argjson,0); + fprintf(logfp,"%s\n",jsonstr); + free(jsonstr); + fflush(logfp); + } +} + +char *LP_statslog_disp(int32_t n) +{ + cJSON *retjson; + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddnum(retjson,"newlines",n); + return(jprint(retjson,1)); +} + +char *LP_statslog_parse() +{ + static long lastpos; FILE *fp; char line[8192]; cJSON *lineobj; int32_t n = 0; + if ( (fp= fopen(LP_STATSLOG_FNAME,"rb")) != 0 ) + { + if ( lastpos > 0 ) + { + fseek(fp,0,SEEK_END); + if ( ftell(fp) > lastpos ) + fseek(fp,lastpos,SEEK_SET); + else + { + fclose(fp); + return(clonestr("{\"result\":\"success\"}")); + } + } + while ( fgets(line,sizeof(line),fp) > 0 ) + { + lastpos = ftell(fp); + if ( (lineobj= cJSON_Parse(line)) != 0 ) + { + n++; + printf("%s\n",jprint(lineobj,0)); + free_json(lineobj); + } + } + fclose(fp); + } + return(LP_statslog_disp(n)); +} + + diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 12a33173a..3ed28c5b3 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -710,7 +710,7 @@ int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { - struct LP_transaction *tx; cJSON *txobj=0; struct iguana_info *coin; char str[65];//,_coinaddr[65]; uint64_t value; + struct LP_transaction *tx; cJSON *txobj=0; struct iguana_info *coin; if ( bits256_nonz(txid) == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) From 220343b56f778033ed82dc45e2a880201075e71a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:11:19 +0300 Subject: [PATCH 1397/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/parselog | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/parselog diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 078bfebb3..26e27e7b0 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -214,7 +214,7 @@ stop()\n\ { return(LP_portfolio()); } - else if ( strcmp(method,"") == 0 ) + else if ( strcmp(method,"parselog") == 0 ) return(LP_statslog_parse()); else if ( strcmp(method,"secretaddresses") == 0 ) { diff --git a/iguana/exchanges/parselog b/iguana/exchanges/parselog new file mode 100755 index 000000000..c594944e9 --- /dev/null +++ b/iguana/exchanges/parselog @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"parselog\"}" From 07df88b9938dd215d7c523806e0260620be0606b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:27:22 +0300 Subject: [PATCH 1398/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_stats.c | 36 ++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 26e27e7b0..9674d95a3 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -104,6 +104,8 @@ goal(coin=*, val=)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ +notarizations(coin)\n\ +parselog()\n\ getrawtransaction(coin, txid)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 10bc0ce55..082c7e2fd 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,12 +38,43 @@ void LP_tradecommand_log(cJSON *argjson) } } +uint32_t LP_requests,LP_requesteds,LP_connects,LP_connecteds,LP_tradestatuses,LP_unknowns; + +void LP_statslog_parseline(cJSON *lineobj) +{ + char *method; + if ( (method= jstr(lineobj,"method")) != 0 ) + { + if ( strcmp(method,"request") == 0 ) + LP_requests++; + else if ( strcmp(method,"requested") == 0 ) + LP_requesteds++; + if ( strcmp(method,"connect") == 0 ) + LP_connects++; + else if ( strcmp(method,"connected") == 0 ) + LP_connecteds++; + else if ( strcmp(method,"tradestatus") == 0 ) + LP_tradestatuses++; + else + { + LP_unknowns++; + printf("parseline unknown method.(%s)\n",jprint(lineobj,0)); + } + } else printf("parseline no method.(%s)\n",jprint(lineobj,0)); +} + char *LP_statslog_disp(int32_t n) { cJSON *retjson; retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddnum(retjson,"newlines",n); + jaddnum(retjson,"request",LP_requests); + jaddnum(retjson,"requested",LP_requesteds); + jaddnum(retjson,"connect",LP_connects); + jaddnum(retjson,"connected",LP_connecteds); + jaddnum(retjson,"tradestatus",LP_tradestatuses); + jaddnum(retjson,"unknown",LP_unknowns); return(jprint(retjson,1)); } @@ -60,7 +91,7 @@ char *LP_statslog_parse() else { fclose(fp); - return(clonestr("{\"result\":\"success\"}")); + return(clonestr("{\"result\":\"success\",\"newlines\":0}")); } } while ( fgets(line,sizeof(line),fp) > 0 ) @@ -69,7 +100,8 @@ char *LP_statslog_parse() if ( (lineobj= cJSON_Parse(line)) != 0 ) { n++; - printf("%s\n",jprint(lineobj,0)); + LP_statslog_parseline(lineobj); + //printf("%s\n",jprint(lineobj,0)); free_json(lineobj); } } From ea50361704520cb54fd369a9f51754b881052204 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:32:26 +0300 Subject: [PATCH 1399/2732] Test --- iguana/exchanges/LP_remember.c | 1 + iguana/exchanges/LP_stats.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 59361bd37..3a68982ae 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1110,6 +1110,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti jaddstr(item,"method","tradestatus"); itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); + LP_tradecommand_log(item); LP_reserved_msg(rswap.src,rswap.dest,zero,clonestr(itemstr)); LP_broadcast_message(LP_mypubsock,rswap.src,rswap.dest,zero,itemstr); fclose(fp); diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 082c7e2fd..8644b9f3c 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,7 +38,7 @@ void LP_tradecommand_log(cJSON *argjson) } } -uint32_t LP_requests,LP_requesteds,LP_connects,LP_connecteds,LP_tradestatuses,LP_unknowns; +uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_unknowns; void LP_statslog_parseline(cJSON *lineobj) { @@ -47,8 +47,8 @@ void LP_statslog_parseline(cJSON *lineobj) { if ( strcmp(method,"request") == 0 ) LP_requests++; - else if ( strcmp(method,"requested") == 0 ) - LP_requesteds++; + else if ( strcmp(method,"reserved") == 0 ) + LP_reserveds++; if ( strcmp(method,"connect") == 0 ) LP_connects++; else if ( strcmp(method,"connected") == 0 ) @@ -58,7 +58,7 @@ void LP_statslog_parseline(cJSON *lineobj) else { LP_unknowns++; - printf("parseline unknown method.(%s)\n",jprint(lineobj,0)); + printf("parseline unknown method.(%s) (%s)\n",method,jprint(lineobj,0)); } } else printf("parseline no method.(%s)\n",jprint(lineobj,0)); } @@ -70,7 +70,7 @@ char *LP_statslog_disp(int32_t n) jaddstr(retjson,"result","success"); jaddnum(retjson,"newlines",n); jaddnum(retjson,"request",LP_requests); - jaddnum(retjson,"requested",LP_requesteds); + jaddnum(retjson,"reserved",LP_reserveds); jaddnum(retjson,"connect",LP_connects); jaddnum(retjson,"connected",LP_connecteds); jaddnum(retjson,"tradestatus",LP_tradestatuses); From 9a3abf84a120cbaa841a8608aa4187259f67ff76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:33:44 +0300 Subject: [PATCH 1400/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 8644b9f3c..06e5c4597 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -49,7 +49,7 @@ void LP_statslog_parseline(cJSON *lineobj) LP_requests++; else if ( strcmp(method,"reserved") == 0 ) LP_reserveds++; - if ( strcmp(method,"connect") == 0 ) + else if ( strcmp(method,"connect") == 0 ) LP_connects++; else if ( strcmp(method,"connected") == 0 ) LP_connecteds++; From f96f67705a834da85e5881016244a15a32428449 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:42:21 +0300 Subject: [PATCH 1401/2732] Test --- iguana/exchanges/LP_commands.c | 3 +++ iguana/exchanges/statsdisp | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 iguana/exchanges/statsdisp diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9674d95a3..f2c641d94 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -106,6 +106,7 @@ enable(coin)\n\ disable(coin)\n\ notarizations(coin)\n\ parselog()\n\ +statsdisp()\n\ getrawtransaction(coin, txid)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ @@ -218,6 +219,8 @@ stop()\n\ } else if ( strcmp(method,"parselog") == 0 ) return(LP_statslog_parse()); + else if ( strcmp(method,"statsdisp") == 0 ) + return(LP_statslog_disp(0)); else if ( strcmp(method,"secretaddresses") == 0 ) { uint8_t taddr,pubtype; diff --git a/iguana/exchanges/statsdisp b/iguana/exchanges/statsdisp new file mode 100755 index 000000000..d322235a2 --- /dev/null +++ b/iguana/exchanges/statsdisp @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\"}" From da65a390e93238a5e897593d11804098325e84ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:52:42 +0300 Subject: [PATCH 1402/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_stats.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e418a2b47..7bdddd748 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -288,6 +288,7 @@ struct LP_pubkeyinfo int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); int32_t LP_pubkey_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); +int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson); struct LP_address *LP_address(struct iguana_info *coin,char *coinaddr); void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,uint8_t *data,int32_t datalen,int32_t vout); void basilisk_dontforget_update(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx); diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 06e5c4597..adc14b7ff 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,11 +38,11 @@ void LP_tradecommand_log(cJSON *argjson) } } -uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_unknowns; +uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns; void LP_statslog_parseline(cJSON *lineobj) { - char *method; + char *method; struct LP_quoteinfo Q; if ( (method= jstr(lineobj,"method")) != 0 ) { if ( strcmp(method,"request") == 0 ) @@ -52,7 +52,18 @@ void LP_statslog_parseline(cJSON *lineobj) else if ( strcmp(method,"connect") == 0 ) LP_connects++; else if ( strcmp(method,"connected") == 0 ) + { LP_connecteds++; + if ( LP_quoteparse(&Q,lineobj) < 0 ) + { + printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); + LP_parse_errors++; + } + else + { + printf("connected requestid.%u quoteid.%u\n",Q.R.requestid,Q.R.quoteid); + } + } else if ( strcmp(method,"tradestatus") == 0 ) LP_tradestatuses++; else @@ -73,6 +84,7 @@ char *LP_statslog_disp(int32_t n) jaddnum(retjson,"reserved",LP_reserveds); jaddnum(retjson,"connect",LP_connects); jaddnum(retjson,"connected",LP_connecteds); + jaddnum(retjson,"parse_errors",LP_parse_errors); jaddnum(retjson,"tradestatus",LP_tradestatuses); jaddnum(retjson,"unknown",LP_unknowns); return(jprint(retjson,1)); From fe053423cffebc6cc979a2ec4488adfb93ae684f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:56:35 +0300 Subject: [PATCH 1403/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- iguana/exchanges/LP_stats.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 34fe9ca32..4bc33de4d 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -125,7 +125,7 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) qp->desttxfee = j64bits(argjson,"desttxfee"); qp->R.requestid = juint(argjson,"requestid"); qp->R.quoteid = juint(argjson,"quoteid"); - if ( qp->R.requestid != (rid= basilisk_requestid(&qp->R)) ) + /*if ( qp->R.requestid != (rid= basilisk_requestid(&qp->R)) ) { printf("requestid.%u -> %u\n",qp->R.requestid,rid); qp->R.requestid = rid; @@ -134,7 +134,7 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) { printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); qp->R.quoteid = qid; - } + }*/ return(0); } diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index adc14b7ff..330ea60d8 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -54,6 +54,7 @@ void LP_statslog_parseline(cJSON *lineobj) else if ( strcmp(method,"connected") == 0 ) { LP_connecteds++; + memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); From b6e1b459faccd84696710293f4c8970418c057ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 19:57:45 +0300 Subject: [PATCH 1404/2732] Test --- iguana/exchanges/LP_signatures.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 4bc33de4d..2e62cb482 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -125,16 +125,18 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) qp->desttxfee = j64bits(argjson,"desttxfee"); qp->R.requestid = juint(argjson,"requestid"); qp->R.quoteid = juint(argjson,"quoteid"); - /*if ( qp->R.requestid != (rid= basilisk_requestid(&qp->R)) ) + if ( qp->R.requestid == 0 ) { + rid= basilisk_requestid(&qp->R); printf("requestid.%u -> %u\n",qp->R.requestid,rid); qp->R.requestid = rid; } - if ( qp->R.quoteid != (qid= basilisk_quoteid(&qp->R)) ) + if ( qp->R.quoteid == 0 ) { + qid= basilisk_quoteid(&qp->R); printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); qp->R.quoteid = qid; - }*/ + } return(0); } From 526b3ed0222f9a622c4a22b3cf3bc5c88a4c428b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 20:05:35 +0300 Subject: [PATCH 1405/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 2e62cb482..7dd0fdf55 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -128,13 +128,13 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) if ( qp->R.requestid == 0 ) { rid= basilisk_requestid(&qp->R); - printf("requestid.%u -> %u\n",qp->R.requestid,rid); + //printf("requestid.%u -> %u\n",qp->R.requestid,rid); qp->R.requestid = rid; } if ( qp->R.quoteid == 0 ) { qid= basilisk_quoteid(&qp->R); - printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); + //printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); qp->R.quoteid = qid; } return(0); From 559b6834d3ce9449b8ba44e4c15bddcf482c9f81 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 20:15:54 +0300 Subject: [PATCH 1406/2732] Test --- iguana/exchanges/LP_stats.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 330ea60d8..94cdd655d 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,11 +38,12 @@ void LP_tradecommand_log(cJSON *argjson) } } -uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns; +uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates; +uint64_t Ridqids[128]; void LP_statslog_parseline(cJSON *lineobj) { - char *method; struct LP_quoteinfo Q; + char *method; int32_t i,duplicate; struct LP_quoteinfo Q; uint64_t ridqid; if ( (method= jstr(lineobj,"method")) != 0 ) { if ( strcmp(method,"request") == 0 ) @@ -53,7 +54,6 @@ void LP_statslog_parseline(cJSON *lineobj) LP_connects++; else if ( strcmp(method,"connected") == 0 ) { - LP_connecteds++; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -62,8 +62,23 @@ void LP_statslog_parseline(cJSON *lineobj) } else { - printf("connected requestid.%u quoteid.%u\n",Q.R.requestid,Q.R.quoteid); + ridqid = (((uint64_t)Q.R.requestid << 32) | Q.R.quoteid); + for (i=duplicate=0; i Date: Tue, 24 Oct 2017 20:18:19 +0300 Subject: [PATCH 1407/2732] Test --- iguana/exchanges/LP_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 94cdd655d..41c2e308e 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -75,7 +75,7 @@ void LP_statslog_parseline(cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_connecteds % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; - printf("connected requestid.%u quoteid.%u\n",Q.R.requestid,Q.R.quoteid); + printf("connected requestid.%u quoteid.%u -> %d\n",Q.R.requestid,Q.R.quoteid,(int32_t)(LP_connecteds % (sizeof(Ridqids)/sizeof(*Ridqids)))); } } LP_connecteds++; @@ -102,7 +102,7 @@ char *LP_statslog_disp(int32_t n) jaddnum(retjson,"connected",LP_connecteds); jaddnum(retjson,"duplicates",LP_duplicates); jaddnum(retjson,"parse_errors",LP_parse_errors); - jaddnum(retjson,"uniqes",LP_connecteds-LP_duplicates); + jaddnum(retjson,"uniques",LP_connecteds-LP_duplicates); jaddnum(retjson,"tradestatus",LP_tradestatuses); jaddnum(retjson,"unknown",LP_unknowns); return(jprint(retjson,1)); From dd117d47f1de57792da5f16fa5bb332b4f95b710 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 20:59:02 +0300 Subject: [PATCH 1408/2732] Test --- iguana/exchanges/LP_signatures.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 7dd0fdf55..703f70c5b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -348,7 +348,15 @@ struct LP_utxos_qitem { struct queueitem DL; cJSON *argjson; }; char *LP_postutxos_recv(cJSON *argjson) { - struct LP_utxos_qitem *uitem; bits256 utxoshash; cJSON *obj; + struct LP_utxos_qitem *uitem; struct iguana_info *coin; char *coinaddr,*symbol; bits256 utxoshash; cJSON *obj; + if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) + { + if ( strcmp(coinaddr,coin->smartaddr) == 0 ) + { + printf("ignore my utxo from external source %s %s\n",symbol,coinaddr); + return(clonestr("{\"result\":\"success\"}")); + } + } if ( (obj= jobj(argjson,"utxos")) != 0 ) { utxoshash = LP_utxoshash_calc(obj); @@ -602,16 +610,18 @@ void LP_smartutxos_push(struct iguana_info *coin) char *LP_uitem_recv(cJSON *argjson) { - bits256 txid; int32_t vout,height; uint64_t value; char *coinaddr,*symbol; + bits256 txid; int32_t vout,height; uint64_t value; struct iguana_info *coin; char *coinaddr,*symbol; txid = jbits256(argjson,"txid"); vout = jint(argjson,"vout"); height = jint(argjson,"ht"); value = j64bits(argjson,"value"); coinaddr = jstr(argjson,"coinaddr"); - if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 ) + if ( (symbol= jstr(argjson,"coin")) != 0 && coinaddr != 0 && (coin= LP_coinfind(symbol)) != 0 ) { //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); - LP_address_utxoadd("LP_uitem,recv",LP_coinfind(symbol),coinaddr,txid,vout,value,height,-1); + if ( strcmp(coin->smartaddr,coinaddr) != 0 ) + LP_address_utxoadd("LP_uitem,recv",coin,coinaddr,txid,vout,value,height,-1); + else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); } return(clonestr("{\"result\":\"success\"}")); } From f3fcd4aa755d01998d00c890223a5a035af4ceec Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:05:57 +0300 Subject: [PATCH 1409/2732] Test --- iguana/exchanges/LP_stats.c | 65 ++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 41c2e308e..6bb3fa3f1 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,12 +38,43 @@ void LP_tradecommand_log(cJSON *argjson) } } -uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates; +uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; uint64_t Ridqids[128]; +int32_t LP_statslog_parsequote(cJSON *lineobj) +{ + int32_t i,duplicate=0; struct LP_quoteinfo Q; uint64_t ridqid; + memset(&Q,0,sizeof(Q)); + if ( LP_quoteparse(&Q,lineobj) < 0 ) + { + printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); + LP_parse_errors++; + } + else + { + ridqid = (((uint64_t)Q.R.requestid << 32) | Q.R.quoteid); + for (i=0; i %d\n",Q.R.requestid,Q.R.quoteid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids)))); + } + } + return(duplicate == 0); +} + void LP_statslog_parseline(cJSON *lineobj) { - char *method; int32_t i,duplicate; struct LP_quoteinfo Q; uint64_t ridqid; + char *method; if ( (method= jstr(lineobj,"method")) != 0 ) { if ( strcmp(method,"request") == 0 ) @@ -51,33 +82,13 @@ void LP_statslog_parseline(cJSON *lineobj) else if ( strcmp(method,"reserved") == 0 ) LP_reserveds++; else if ( strcmp(method,"connect") == 0 ) + { + LP_statslog_parsequote(lineobj); LP_connects++; + } else if ( strcmp(method,"connected") == 0 ) { - memset(&Q,0,sizeof(Q)); - if ( LP_quoteparse(&Q,lineobj) < 0 ) - { - printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); - LP_parse_errors++; - } - else - { - ridqid = (((uint64_t)Q.R.requestid << 32) | Q.R.quoteid); - for (i=duplicate=0; i %d\n",Q.R.requestid,Q.R.quoteid,(int32_t)(LP_connecteds % (sizeof(Ridqids)/sizeof(*Ridqids)))); - } - } + LP_statslog_parsequote(lineobj); LP_connecteds++; } else if ( strcmp(method,"tradestatus") == 0 ) @@ -102,7 +113,7 @@ char *LP_statslog_disp(int32_t n) jaddnum(retjson,"connected",LP_connecteds); jaddnum(retjson,"duplicates",LP_duplicates); jaddnum(retjson,"parse_errors",LP_parse_errors); - jaddnum(retjson,"uniques",LP_connecteds-LP_duplicates); + jaddnum(retjson,"uniques",LP_numridqids); jaddnum(retjson,"tradestatus",LP_tradestatuses); jaddnum(retjson,"unknown",LP_unknowns); return(jprint(retjson,1)); From 0b02309a32feb8ca3fa694e10be7cda9d08bcec9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:09:43 +0300 Subject: [PATCH 1410/2732] Test --- iguana/exchanges/LP_stats.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 6bb3fa3f1..989fc96ae 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -39,9 +39,9 @@ void LP_tradecommand_log(cJSON *argjson) } uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; -uint64_t Ridqids[128]; +uint64_t Ridqids[16]; -int32_t LP_statslog_parsequote(cJSON *lineobj) +int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { int32_t i,duplicate=0; struct LP_quoteinfo Q; uint64_t ridqid; memset(&Q,0,sizeof(Q)); @@ -66,7 +66,7 @@ int32_t LP_statslog_parsequote(cJSON *lineobj) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; LP_numridqids++; - printf("connected requestid.%u quoteid.%u -> %d\n",Q.R.requestid,Q.R.quoteid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids)))); + printf("%10s requestid.%-10u quoteid.%-10u -> %d\n",method,Q.R.requestid,Q.R.quoteid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids)))); } } return(duplicate == 0); @@ -83,12 +83,12 @@ void LP_statslog_parseline(cJSON *lineobj) LP_reserveds++; else if ( strcmp(method,"connect") == 0 ) { - LP_statslog_parsequote(lineobj); + LP_statslog_parsequote(method,lineobj); LP_connects++; } else if ( strcmp(method,"connected") == 0 ) { - LP_statslog_parsequote(lineobj); + LP_statslog_parsequote(method,lineobj); LP_connecteds++; } else if ( strcmp(method,"tradestatus") == 0 ) From b6dc3c5dccf26637187f493f00b39d2e7acbb491 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:12:23 +0300 Subject: [PATCH 1411/2732] Test --- iguana/exchanges/LP_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 989fc96ae..8cfd5868c 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -39,7 +39,7 @@ void LP_tradecommand_log(cJSON *argjson) } uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; -uint64_t Ridqids[16]; +uint64_t Ridqids[128]; int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { @@ -66,7 +66,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; LP_numridqids++; - printf("%10s requestid.%-10u quoteid.%-10u -> %d\n",method,Q.R.requestid,Q.R.quoteid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids)))); + char str[65]; printf("%10s requestid.%-10u quoteid.%-10u -> %d %s/v%d\n",method,Q.R.requestid,Q.R.quoteid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,jbits256(lineobj,"desttxid")),jint(lineobj,"destvout")); } } return(duplicate == 0); From 9507067022c347a3027566c5df8061b9602c085d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:21:24 +0300 Subject: [PATCH 1412/2732] Test --- iguana/exchanges/LP_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 8cfd5868c..e4c072493 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -52,7 +52,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { - ridqid = (((uint64_t)Q.R.requestid << 32) | Q.R.quoteid); + ridqid = (((uint64_t)Q.desttxid.uints[0] << 48) | ((uint64_t)Q.destvout << 32) || ((uint64_t)Q.feetxid.uints[0] << 16) | (uint32_t)Q.feevout); for (i=0; i %d %s/v%d\n",method,Q.R.requestid,Q.R.quoteid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,jbits256(lineobj,"desttxid")),jint(lineobj,"destvout")); + char str[65]; printf("%10s ridqid.%-16llx -> %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,jbits256(lineobj,"desttxid")),jint(lineobj,"destvout")); } } return(duplicate == 0); From b4879162337d8bc823a5b2354e78a08aff36db2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:34:21 +0300 Subject: [PATCH 1413/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_stats.c | 10 +++++++--- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/LP_utxo.c | 17 +++++++++++++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c999fe346..71a5eeefc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -272,7 +272,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { - if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap,coinaddr)) > 1 ) + if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); if ( 0 ) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index e4c072493..3e9510754 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -43,7 +43,7 @@ uint64_t Ridqids[128]; int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - int32_t i,duplicate=0; struct LP_quoteinfo Q; uint64_t ridqid; + int32_t i,destvout,feevout,duplicate=0; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t ridqid; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -52,7 +52,11 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { - ridqid = (((uint64_t)Q.desttxid.uints[0] << 48) | ((uint64_t)Q.destvout << 32) || ((uint64_t)Q.feetxid.uints[0] << 16) | (uint32_t)Q.feevout); + desttxid = jbits256(lineobj,"desttxid"); + destvout = jint(lineobj,"destvout"); + feetxid = jbits256(lineobj,"feetxid"); + feevout = jint(lineobj,"feevout"); + ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) || ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); for (i=0; i %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,jbits256(lineobj,"desttxid")),jint(lineobj,"destvout")); + char str[65]; printf("%10s ridqid.%-16llx -> %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,desttxid),destvout); } } return(duplicate == 0); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b72cb111a..b1ad63380 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -955,7 +955,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } memset(utxos,0,sizeof(utxos)); - if ( (numutxos= LP_address_utxo_ptrs(0,utxos,max,ap,coin->smartaddr)) <= 0 ) + if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) { printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); return(0); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3ed28c5b3..bada9ffe2 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -138,9 +138,9 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) return(0); } -int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) +int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) { - struct LP_address_utxo *up,*tmp; int32_t n = 0; + struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; //printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); @@ -150,6 +150,19 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 ) { + if ( coin->electrum == 0 ) + { + if ( (txout= LP_gettxout(coin->symbol,coinaddr,up->U.txid,up->U.vout)) != 0 ) + free_json(txout); + else + { + char str[65]; printf("%s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); + up->spendheight = 1; + if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) + tx->outpoints[up->U.vout].spendheight = 1; + continue; + } + } if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; From 9e35b677f9a29d1b0eb54ab5693d53d433c65d0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:36:44 +0300 Subject: [PATCH 1414/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/LP_stats.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 703f70c5b..64a6fe72e 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -353,7 +353,7 @@ char *LP_postutxos_recv(cJSON *argjson) { if ( strcmp(coinaddr,coin->smartaddr) == 0 ) { - printf("ignore my utxo from external source %s %s\n",symbol,coinaddr); + //printf("ignore my utxo from external source %s %s\n",symbol,coinaddr); return(clonestr("{\"result\":\"success\"}")); } } diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 3e9510754..2b195e146 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -56,6 +56,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) destvout = jint(lineobj,"destvout"); feetxid = jbits256(lineobj,"feetxid"); feevout = jint(lineobj,"feevout"); + printf("%s\n",jprint(lineobj,0)); ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) || ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); for (i=0; i Date: Tue, 24 Oct 2017 21:42:13 +0300 Subject: [PATCH 1415/2732] Test --- iguana/exchanges/LP_stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 2b195e146..076f97005 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -52,11 +52,12 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { + char str[65],str2[65]; desttxid = jbits256(lineobj,"desttxid"); destvout = jint(lineobj,"destvout"); feetxid = jbits256(lineobj,"feetxid"); feevout = jint(lineobj,"feevout"); - printf("%s\n",jprint(lineobj,0)); + printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) || ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); for (i=0; i %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,desttxid),destvout); + printf("%10s ridqid.%-16llx -> %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,desttxid),destvout); } } return(duplicate == 0); From 8d5e11479055450849dbb82bfd1887ecd3917bc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:44:01 +0300 Subject: [PATCH 1416/2732] test --- iguana/exchanges/LP_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 076f97005..d2f6e80d2 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -58,7 +58,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) feetxid = jbits256(lineobj,"feetxid"); feevout = jint(lineobj,"feevout"); printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); - ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) || ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); + ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); for (i=0; i %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,desttxid),destvout); + LP_numridqids++; } } return(duplicate == 0); From 315b351d70918d6e573d15857a8591ec1ef0ee1d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:51:16 +0300 Subject: [PATCH 1417/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_socket.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7bdddd748..6bb3e54a5 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -193,6 +193,7 @@ struct iguana_info void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33]; + bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen; }; struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout,height; }; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c5e16dd47..f00d83a07 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -597,6 +597,14 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso return(txobj); } } + if ( bits256_cmp(txid,coin->cachedtxid) == 0 ) + { + if ( (txobj= LP_transaction_fromdata(coin,txid,coin->cachedtxiddata,coin->cachedtxidlen)) != 0 ) + { + *retjsonp = txobj; + return(txobj); + } + } hexjson = electrum_hasharg(symbol,ep,&hexjson,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT); hexstr = jprint(hexjson,0); if ( strlen(hexstr) > 60000 ) @@ -615,7 +623,12 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso { len = (int32_t)strlen(hexstr+1) >> 1; serialized = malloc(len); + if ( coin->cachedtxiddata != 0 ) + free(coin->cachedtxiddata); + coin->cachedtxiddata = malloc(len); + coin->cachedtxidlen = len; decode_hex(serialized,len,hexstr+1); + memcpy(coin->cachedtxiddata,serialized,len); free(hexstr); //printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); txobj = LP_transaction_fromdata(coin,txid,serialized,len); From e12b514e1ce2f2010bb871bbbf03fac2b3b646e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 21:52:59 +0300 Subject: [PATCH 1418/2732] Test --- iguana/exchanges/LP_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index d2f6e80d2..a0cadda7e 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -52,12 +52,12 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { - char str[65],str2[65]; + char str[65]; desttxid = jbits256(lineobj,"desttxid"); destvout = jint(lineobj,"destvout"); feetxid = jbits256(lineobj,"feetxid"); feevout = jint(lineobj,"feevout"); - printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); + //printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); for (i=0; i Date: Tue, 24 Oct 2017 21:59:25 +0300 Subject: [PATCH 1419/2732] Test --- iguana/exchanges/LP_stats.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index a0cadda7e..5d6d91e97 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -43,20 +43,32 @@ uint64_t Ridqids[128]; int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - int32_t i,destvout,feevout,duplicate=0; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t ridqid; + double qprice; int32_t i,destvout,feevout,duplicate=0; char *base,*rel; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t ridqid; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); LP_parse_errors++; + return(-1); } else { - char str[65]; + base = jstr(lineobj,"base"); + rel = jstr(lineobj,"rel"); + satoshis = j64bits(lineobj,"satoshis"); + if ( base == 0 || rel == 0 || satoshis == 0 ) + { + printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); + LP_parse_errors++; + return(-1); + } + txfee = j64bits(lineobj,"txfee"); + destsatoshis = j64bits(lineobj,"destsatoshis"); desttxid = jbits256(lineobj,"desttxid"); destvout = jint(lineobj,"destvout"); feetxid = jbits256(lineobj,"feetxid"); feevout = jint(lineobj,"feevout"); + qprice = ((double)destsatoshis / (satoshis - txfee)); //printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); for (i=0; i %d %s/v%d\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),bits256_str(str,desttxid),destvout); + printf("%10s ridqid.%-16llx -> [%d] %.8f %s -> %.8f %s %.8f\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From 7b4ccb2560e46c49dd1275298137534fb8260124 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:09:44 +0300 Subject: [PATCH 1420/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 5d6d91e97..57d088e16 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -83,7 +83,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; - printf("%10s ridqid.%-16llx -> [%d] %.8f %s -> %.8f %s %.8f\n",method,(long long)ridqid,(int32_t)(LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))),dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + printf("%-4d %8s ridqid.%-16llx -> %.8f %5s -> %.8f %5s %.8f\n",LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From f5364496af23f37555fa9fad8e612dae2726fd84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:11:52 +0300 Subject: [PATCH 1421/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 57d088e16..513804070 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -83,7 +83,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; - printf("%-4d %8s ridqid.%-16llx -> %.8f %5s -> %.8f %5s %.8f\n",LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + printf("%-4d %9s swap.%-16llx -> %.8f %5s -> %.8f %5s %.8f\n",LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From 9d142be4a4f02cf797c3fdf327f76fb510c34aff Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:15:45 +0300 Subject: [PATCH 1422/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 513804070..869f93dd2 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -83,7 +83,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; - printf("%-4d %9s swap.%-16llx -> %.8f %5s -> %.8f %5s %.8f\n",LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + printf("%-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From 900f1504b9ef4d5056eb36d8cc4396a05019a405 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:21:37 +0300 Subject: [PATCH 1423/2732] Test --- iguana/exchanges/LP_stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 869f93dd2..72b25d4dd 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -43,7 +43,7 @@ uint64_t Ridqids[128]; int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - double qprice; int32_t i,destvout,feevout,duplicate=0; char *base,*rel; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t ridqid; + double qprice; uint32_t timestamp; int32_t i,destvout,feevout,duplicate=0; char *base,*rel,tstr[128]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t ridqid; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -63,6 +63,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) return(-1); } txfee = j64bits(lineobj,"txfee"); + timestamp = juint(lineobj,"timestamp"); destsatoshis = j64bits(lineobj,"destsatoshis"); desttxid = jbits256(lineobj,"desttxid"); destvout = jint(lineobj,"destvout"); @@ -83,7 +84,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = ridqid; - printf("%-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + printf("%s %-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From a7651d88fe3a3799e3fe9b98fc3891e179f43c0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:38:37 +0300 Subject: [PATCH 1424/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_remember.c | 7 +++++-- iguana/exchanges/LP_signatures.c | 2 ++ iguana/exchanges/LP_stats.c | 15 ++++++++++----- iguana/exchanges/LP_swap.c | 1 + 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6bb3e54a5..ab48099b2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -252,7 +252,7 @@ struct LP_quoteinfo { struct basilisk_request R; bits256 srchash,desthash,txid,txid2,desttxid,feetxid,privkey; - uint64_t satoshis,txfee,destsatoshis,desttxfee; + uint64_t satoshis,txfee,destsatoshis,desttxfee,aliceid; uint32_t timestamp,quotetime; int32_t vout,vout2,destvout,feevout,pair; char srccoin[16],coinaddr[64],destcoin[16],destaddr[64],gui[64]; }; @@ -272,7 +272,7 @@ struct basilisk_swap bits256 privkeys[INSTANTDEX_DECKSIZE]; struct basilisk_swapmessage *messages; int32_t nummessages,sentflag; char Bdeposit[64],Bpayment[64]; - uint64_t otherdeck[INSTANTDEX_DECKSIZE][2],deck[INSTANTDEX_DECKSIZE][2]; + uint64_t aliceid,otherdeck[INSTANTDEX_DECKSIZE][2],deck[INSTANTDEX_DECKSIZE][2]; uint8_t persistent_pubkey33[33],persistent_other33[33],changermd160[20],pad[15],verifybuf[100000]; }; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 71a5eeefc..33ccbb20e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -611,7 +611,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %s\n",method); + printf("LP_tradecommand: check received method %s aliceid.%u\n",method,(long long)Q.aliceid); retval = 1; if ( strcmp(method,"reserved") == 0 ) { diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 3a68982ae..669d55102 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -93,7 +93,7 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx sprintf(fname,"%s/SWAPS/%u-%u",GLOBAL_DBDIR,swap->I.req.requestid,swap->I.req.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { - fprintf(fp,"{\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u,\"Atxfee\":%llu,\"Btxfee\":%llu",swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime,(long long)swap->I.Atxfee,(long long)swap->I.Btxfee); + fprintf(fp,"{\"aliceid\":\"%llu\",\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u,\"Atxfee\":%llu,\"Btxfee\":%llu",(long long)swap->aliceid,swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime,(long long)swap->I.Atxfee,(long long)swap->I.Btxfee); if ( memcmp(zeroes,swap->I.secretAm,20) != 0 ) { init_hexbytes_noT(secretAmstr,swap->I.secretAm,20); @@ -463,7 +463,8 @@ void LP_totals_update(int32_t iambob,char *alicecoin,char *bobcoin,int64_t *KMDt struct LP_swap_remember { bits256 pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)]; - uint64_t Atxfee,Btxfee,srcamount,destamount; int64_t values[sizeof(txnames)/sizeof(*txnames)]; + uint64_t Atxfee,Btxfee,srcamount,destamount,aliceid; + int64_t values[sizeof(txnames)/sizeof(*txnames)]; uint32_t requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; @@ -483,6 +484,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) jaddstr(item,"alice",rswap->dest); jaddnum(item,"destamount",dstr(rswap->destamount)); jaddnum(item,"alicetxfee",dstr(rswap->Atxfee)); + jadd64bits(item,"aliceid",rswap->aliceid); array = cJSON_CreateArray(); for (i=0; iiambob = jint(item,"iambob"); + rswap->aliceid = j64bits(item,"aliceid"); if ( (secretstr= jstr(item,"secretAm")) != 0 && strlen(secretstr) == 40 ) decode_hex(rswap->secretAm,20,secretstr); if ( (secretstr= jstr(item,"secretAm256")) != 0 && strlen(secretstr) == 64 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 64a6fe72e..97fad7b84 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -43,6 +43,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) { double price; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"gui",qp->gui[0] != 0 ? qp->gui : LP_gui); + jadd64bits(retjson,"aliceid",qp->aliceid); jaddstr(retjson,"base",qp->srccoin); jaddstr(retjson,"rel",qp->destcoin); if ( qp->coinaddr[0] != 0 ) @@ -107,6 +108,7 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr)); safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin)); safecopy(qp->destaddr,jstr(argjson,"destaddr"),sizeof(qp->destaddr)); + qp->aliceid = j64bits(argjson,"aliceid"); qp->timestamp = juint(argjson,"timestamp"); qp->quotetime = juint(argjson,"quotetime"); qp->txid = jbits256(argjson,"txid"); diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 72b25d4dd..c5e741116 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -41,9 +41,14 @@ void LP_tradecommand_log(cJSON *argjson) uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; uint64_t Ridqids[128]; +uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32_t feevout) +{ + return((((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout)); +} + int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - double qprice; uint32_t timestamp; int32_t i,destvout,feevout,duplicate=0; char *base,*rel,tstr[128]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t ridqid; + double qprice; uint32_t timestamp; int32_t i,destvout,feevout,duplicate=0; char *base,*rel,tstr[128]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t aliceid; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -71,10 +76,10 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) feevout = jint(lineobj,"feevout"); qprice = ((double)destsatoshis / (satoshis - txfee)); //printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); - ridqid = (((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout); + aliceid = LP_aliceid_calc(desttxid,destvout,feetxid,feevout); for (i=0; i (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),LP_numridqids,method,(long long)ridqid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = aliceid; + printf("%s %-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),LP_numridqids,method,(long long)aliceid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index d09439a94..6e7a8b7bc 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1134,6 +1134,7 @@ struct basilisk_swap *LP_swapinit(int32_t iambob,int32_t optionduration,bits256 { struct basilisk_swap *swap; bits256 pubkey25519; uint8_t pubkey33[33]; swap = calloc(1,sizeof(*swap)); + swap->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); swap->I.req.quoteid = rp->quoteid; swap->ctx = bitcoin_ctx(); vcalc_sha256(0,swap->I.orderhash.bytes,(uint8_t *)rp,sizeof(*rp)); From 6dba9d1b987e9efb33d1e390114f3874424ca187 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:41:09 +0300 Subject: [PATCH 1425/2732] Test --- iguana/exchanges/LP_stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index c5e741116..d47a0033f 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -48,7 +48,7 @@ uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32 int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - double qprice; uint32_t timestamp; int32_t i,destvout,feevout,duplicate=0; char *base,*rel,tstr[128]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t aliceid; + double qprice; uint32_t timestamp; int32_t i,destvout,feevout,duplicate=0; char *gui,*base,*rel,tstr[128]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t aliceid; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -60,6 +60,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { base = jstr(lineobj,"base"); rel = jstr(lineobj,"rel"); + gui = jstr(lineobj,"gui"); satoshis = j64bits(lineobj,"satoshis"); if ( base == 0 || rel == 0 || satoshis == 0 ) { @@ -89,7 +90,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = aliceid; - printf("%s %-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),LP_numridqids,method,(long long)aliceid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + printf("%s %8s %-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),gui!=0?gui:"",LP_numridqids,method,(long long)aliceid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From 23339d6359ea6785b23e99676684c5ab72e6d948 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:47:34 +0300 Subject: [PATCH 1426/2732] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++----- iguana/exchanges/LP_stats.c | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 33ccbb20e..66a2dbb04 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -371,8 +371,8 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ retjson = LP_quotejson(qp); jaddstr(retjson,"method","connected"); jaddstr(retjson,"pair",pairstr); - jaddnum(retjson,"requestid",qp->R.requestid); - jaddnum(retjson,"quoteid",qp->R.quoteid); + //jaddnum(retjson,"requestid",qp->R.requestid); + //jaddnum(retjson,"quoteid",qp->R.quoteid); // LP_addsig char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,0)); @@ -529,10 +529,10 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("alice pairstr.(%s) pairsock.%d\n",pairstr,pairsock); if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_aliceloop,(void *)swap) == 0 ) { + retjson = LP_quotejson(&Q); jaddstr(retjson,"result","success"); - jadd(retjson,"trade",LP_quotejson(&Q)); - jaddnum(retjson,"requestid",Q.R.requestid); - jaddnum(retjson,"quoteid",Q.R.quoteid); + //jaddnum(retjson,"requestid",Q.R.requestid); + //jaddnum(retjson,"quoteid",Q.R.quoteid); } else jaddstr(retjson,"error","couldnt aliceloop"); } else printf("connect error %s\n",nn_strerror(nn_errno())); printf("connected result.(%s)\n",jprint(retjson,0)); diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index d47a0033f..64b4a92de 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -99,7 +99,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) void LP_statslog_parseline(cJSON *lineobj) { - char *method; + char *method; cJSON *obj; if ( (method= jstr(lineobj,"method")) != 0 ) { if ( strcmp(method,"request") == 0 ) @@ -108,7 +108,9 @@ void LP_statslog_parseline(cJSON *lineobj) LP_reserveds++; else if ( strcmp(method,"connect") == 0 ) { - LP_statslog_parsequote(method,lineobj); + if ( (obj= jobj(lineobj,"trade")) == 0 ) + obj = lineobj; + LP_statslog_parsequote(method,obj); LP_connects++; } else if ( strcmp(method,"connected") == 0 ) From 42ffca6733b2378fa6fd8e138e0a0f8026f67986 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 22:55:25 +0300 Subject: [PATCH 1427/2732] Test --- iguana/exchanges/LP_utxo.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bada9ffe2..6e7292c91 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -140,7 +140,7 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) { - struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; + struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; char str[65]; //printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); @@ -156,13 +156,20 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a free_json(txout); else { - char str[65]; printf("%s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); + printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; continue; } } + else + { + if ( up->SPV <= 0 || up->U.height == 0 ) + { + printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); + } + } if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; From c45cc8c615f130cc137c0d7a54f6633291a25bb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 23:01:39 +0300 Subject: [PATCH 1428/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 66a2dbb04..03793b9eb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -611,7 +611,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %s aliceid.%u\n",method,(long long)Q.aliceid); + printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); retval = 1; if ( strcmp(method,"reserved") == 0 ) { From 58a5ee194de7e3ad26282c4e3ee9f53f6fbe66de Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 23:20:09 +0300 Subject: [PATCH 1429/2732] Test --- iguana/exchanges/LP_swap.c | 9 ++++++++- iguana/exchanges/LP_transaction.c | 6 ++++-- iguana/exchanges/LP_utxo.c | 17 +++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 6e7a8b7bc..a7be85525 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1123,9 +1123,16 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->bobpayment.utxotxid = qp->txid, swap->bobpayment.utxovout = qp->vout; swap->bobdeposit.utxotxid = qp->txid2, swap->bobdeposit.utxovout = qp->vout2; swap->alicepayment.utxotxid = qp->desttxid, swap->alicepayment.utxovout = qp->destvout; + LP_mark_spent(swap->bobcoin.symbol,qp->txid,qp->vout); + LP_mark_spent(swap->bobcoin.symbol,qp->txid2,qp->vout2); + LP_mark_spent(swap->alicecoin.symbol,qp->desttxid,qp->destvout); if ( swap->I.iambob != 0 ) swap->otherfee.utxotxid = qp->feetxid, swap->otherfee.utxovout = qp->feevout; - else swap->myfee.utxotxid = qp->feetxid, swap->myfee.utxovout = qp->feevout; + else + { + swap->myfee.utxotxid = qp->feetxid, swap->myfee.utxovout = qp->feevout; + LP_mark_spent(swap->alicecoin.symbol,qp->feetxid,qp->feevout); + } char str[65],str2[65],str3[65]; printf("IAMBOB.%d %s %s %s\n",swap->I.iambob,bits256_str(str,qp->txid),bits256_str(str2,qp->txid2),bits256_str(str3,qp->feetxid)); return(swap); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b1ad63380..96dcfa42a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -604,6 +604,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + LP_mark_spent(symbol,utxotxid,utxovout); if ( txfee > 0 && txfee < 10000 ) txfee = 10000; *destamountp = 0; @@ -1176,7 +1177,7 @@ int32_t basilisk_alicescript(uint8_t *redeemscript,int32_t *redeemlenp,uint8_t * return(n); } -char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t vout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) +char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t utxovout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) { char msigaddr[64],*signedtx = 0; int32_t spendlen,redeemlen; uint8_t tmp33[33],redeemscript[512],spendscript[128]; bits256 pubAm,pubBn,signedtxid; uint64_t txfee; if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) @@ -1200,7 +1201,8 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wifta txfee = LP_MIN_TXFEE; } //txfee = LP_txfee(symbol); - signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,vout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1); + signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1); + LP_mark_spent(symbol,utxotxid,utxovout); } return(signedtx); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6e7292c91..89ac0aa72 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -198,6 +198,23 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina return(0); } +void LP_mark_spent(char *symbol,bits256 txid,int32_t vout) +{ + struct iguana_info *coin; struct LP_transaction *tx; struct LP_address_utxo *up; + if ( (coin= LP_coinfind(symbol)) != 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + { + if ( vout < tx->numvouts ) + { + tx->outpoints[vout].spendheight = 1; + if ( (up= LP_address_utxofind(coin,tx->outpoints[vout].coinaddr,txid,vout)) != 0 ) + up->spendheight = 1; + } + } + } +} + int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; From 4d93553297a83c6b9ecb4696f5d5e7e9a94e126e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 23:29:59 +0300 Subject: [PATCH 1430/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 64b4a92de..f5b244822 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -90,7 +90,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( duplicate == 0 ) { Ridqids[LP_numridqids % (sizeof(Ridqids)/sizeof(*Ridqids))] = aliceid; - printf("%s %8s %-4d %9s swap.%-16llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),gui!=0?gui:"",LP_numridqids,method,(long long)aliceid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); + printf("%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),gui!=0?gui:"",LP_numridqids,method,(long long)aliceid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); LP_numridqids++; } } From 652ea55b86dab55f05cfee451ac89260df920fd3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 23:36:45 +0300 Subject: [PATCH 1431/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 03793b9eb..b60ffaef5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -408,6 +408,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(clonestr("{\"error\":\"cant find alice utxopair\"}")); } price = 0.; + qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 97fad7b84..a53c1ef6e 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -623,7 +623,7 @@ char *LP_uitem_recv(cJSON *argjson) //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); if ( strcmp(coin->smartaddr,coinaddr) != 0 ) LP_address_utxoadd("LP_uitem,recv",coin,coinaddr,txid,vout,value,height,-1); - else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); + //else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); } return(clonestr("{\"result\":\"success\"}")); } From 5e4d6beeba5742fbd25a23327720230b9746257b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 Oct 2017 23:42:56 +0300 Subject: [PATCH 1432/2732] Test --- iguana/exchanges/LP_utxo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 89ac0aa72..f8e20742a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -153,7 +153,18 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a if ( coin->electrum == 0 ) { if ( (txout= LP_gettxout(coin->symbol,coinaddr,up->U.txid,up->U.vout)) != 0 ) + { + if ( LP_value_extract(txout,0) == 0 ) + { + printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); + free_json(txout); + up->spendheight = 1; + if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) + tx->outpoints[up->U.vout].spendheight = 1; + continue; + } free_json(txout); + } else { printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); @@ -168,6 +179,9 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a if ( up->SPV <= 0 || up->U.height == 0 ) { printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); + if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) + tx->outpoints[up->U.vout].spendheight = 1; + continue; } } if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) From 03007dfbe1f1bb94f64fd40cf72573969c2ee36c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:25:33 +0300 Subject: [PATCH 1433/2732] Test --- iguana/exchanges/LP_socket.c | 4 +--- iguana/exchanges/LP_utxo.c | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f00d83a07..cd7a89620 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -519,9 +519,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); - if ( ep->heightp == 0 ) - height = coin->longestchain; - else height = *(ep->heightp); + height = coin->longestchain; if ( (ap= LP_address(coin,addr)) != 0 ) { if ( ap->unspenttime == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f8e20742a..22d8142a1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -191,6 +191,11 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a break; } } + else + { + if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) + tx->outpoints[up->U.vout].spendheight = 1; + } } portable_mutex_unlock(&LP_utxomutex); //printf("return n.%d\n",n); @@ -276,8 +281,8 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( value == 0 ) - printf("%s null? ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + //if ( value == 0 ) + printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); From ccc69318a008d8d7e2338e3d6cb763a7deb8cee9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:27:19 +0300 Subject: [PATCH 1434/2732] Test --- iguana/exchanges/LP_socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cd7a89620..6585b8fe1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -519,7 +519,9 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); - height = coin->longestchain; + if ( ep->heightp == 0 ) + height = coin->longestchain; + else height = *(ep->heightp); if ( (ap= LP_address(coin,addr)) != 0 ) { if ( ap->unspenttime == 0 ) @@ -807,7 +809,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { if ( (height= jint(resultjson,"block_height")) > 0 && ep->heightp != 0 && ep->heighttimep != 0 ) { - *(ep->heightp) = height; + if ( height > *(ep->heightp) ) + *(ep->heightp) = height; *(ep->heighttimep) = (uint32_t)time(NULL); if ( (coin= LP_coinfind(ep->symbol)) != 0 ) coin->updaterate = (uint32_t)time(NULL); From 7caebb999477d95600363eca2700a21a87733d7f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:32:52 +0300 Subject: [PATCH 1435/2732] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 3874991b7..3ab402856 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3561,7 +3561,7 @@ cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t if ( n != len ) { int32_t i; - for (i=0; i<=len; i++) + for (i=0; i<=len&&i<200; i++) printf("%02x",serialized[i]); printf(" data2json n.%d vs len.%d\n",n,len); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6585b8fe1..5ac39bc15 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -575,7 +575,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se free(extraspace); if ( bits256_cmp(txid,checktxid) != 0 ) { - printf("LP_transaction_fromdata mismatched txid %s vs %s\n",bits256_str(str,txid),bits256_str(str2,checktxid)); + printf("%s LP_transaction_fromdata mismatched txid %s vs %s\n",coin->symbol,bits256_str(str,txid),bits256_str(str2,checktxid)); free_json(txobj); txobj = 0; } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 22d8142a1..a17e9445c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -281,7 +281,7 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - //if ( value == 0 ) + if ( value == 0 ) printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From c5e455d56c5a82cb195c558832bcc4c56e7e47e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:38:55 +0300 Subject: [PATCH 1436/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4f3084b4e..97d214400 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -345,7 +345,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) { if ( tx->outpoints[vout].spendheight > 0 ) return(0); - return(LP_gettxout_json(txid,vout,tx->height,tx->outpoints[vout].coinaddr,tx->outpoints[vout].value)); + //return(LP_gettxout_json(txid,vout,tx->height,tx->outpoints[vout].coinaddr,tx->outpoints[vout].value)); } if ( coinaddr[0] == 0 ) { @@ -362,7 +362,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) { if ( up->spendheight > 0 ) return(0); - return(LP_gettxout_json(txid,vout,up->U.height,coinaddr,up->U.value)); + //return(LP_gettxout_json(txid,vout,up->U.height,coinaddr,up->U.value)); } if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr,1)) != 0 ) { From 7f252fcd49ec99207683f486d6e7b394c1a83c42 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:43:58 +0300 Subject: [PATCH 1437/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ iguana/exchanges/LP_utxo.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 089150cd8..ae01c92f3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,9 @@ // LP_nativeDEX.c // marketmaker // +// ZEC LP_transaction_fromdata mismatched txid e2a3eebcf5bef6fe63296f53ce35d2f2c6e3b29c7c907da4171a580f50c93c74 vs 1ed5c15bbf991ff42c73b1492d1bb50e91d1d731c86cb3058405cff95cd9bd70 +//0200000000018c343500000000001976a9141462c3dd3f936d595c9af55978003b27c250441f88ac000000000100000000000000009c5b3500000000005a6c707fc604699d0166b2a750c8a2ff21c8aed0b6e6fe160f651da8cf865c2aa079a7f71f7782604785e1f9a7300cd6c89ca50b5d91f6c0ae5f293ea5a72e62bb0f05da84510e6431c5d4be7a372221265fd98dbccee11f5ed064c5afaa19eff27fd12c30a7a5205f70c99f22b7090c00048c1c9767eea1c79e54ed60c08c138758ad73d43f2692fcb05f data2json n.44 vs len. + // process stats.log local file -> map of realtime activity! // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // select oldest utxo first diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a17e9445c..77d8cadfa 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -388,7 +388,11 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 } else printf("couldnt get header for ht.%d\n",height); } if ( SPV < 0 ) + { printf("MERKLE DIDNT VERIFY.(%s)\n",jprint(merkobj,0)); + if ( jobj(merkobj,"error") != 0 ) + SPV = 0; // try again later + } free_json(merkobj); } return(SPV); From c63460f15b8f3b12bb7a94aa34495df8184fcab9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:49:34 +0300 Subject: [PATCH 1438/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5ac39bc15..5b0b5b549 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -519,7 +519,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); - if ( ep->heightp == 0 ) + if ( ep == 0 || ep->heightp == 0 ) height = coin->longestchain; else height = *(ep->heightp); if ( (ap= LP_address(coin,addr)) != 0 ) From cee6f90ef0177d94a031c654579e593269596edf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 00:53:47 +0300 Subject: [PATCH 1439/2732] Test --- iguana/exchanges/LP_include.h | 8 +++++--- iguana/exchanges/LP_socket.c | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ab48099b2..4abb60065 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,6 +23,11 @@ //#define LP_STRICTPEERS +#define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) +#define LP_AUTOTRADE_TIMEOUT 10 +#define ELECTRUM_TIMEOUT 15 +#define LP_MEMPOOL_TIMEINCR 10 + #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL @@ -34,17 +39,14 @@ #define MAINLOOP_PERSEC 100 #define MAX_PSOCK_PORT 60000 #define MIN_PSOCK_PORT 10000 -#define LP_MEMPOOL_TIMEINCR 10 #define LP_GETINFO_INCR 30 #define LP_ORDERBOOK_DURATION 120 -#define LP_HTTP_TIMEOUT 2 // 1 is too small due to edge cases of time(NULL) #define LP_MAXPEER_ERRORS 3 #define LP_MINPEER_GOOD 20 #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 30 -#define LP_AUTOTRADE_TIMEOUT 10 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 50 diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5b0b5b549..8f0283812 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -26,8 +26,6 @@ #include #endif -#define ELECTRUM_TIMEOUT 10 - int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) { int32_t opt,sock,result; char ipaddr[64],checkipaddr[64]; struct timeval timeout; @@ -652,7 +650,7 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso free_json(hexjson); //printf("return from electrum_transaction\n"); return(*retjsonp); - } else printf("non-hex tx.(%s)\n",jprint(hexjson,0)); + } else printf("%s %s non-hex tx.(%s)\n",coin->symbol,bits256_str(str,txid),jprint(hexjson,0)); free(hexstr); free_json(hexjson); } From ed1f1c072dc0d2c54c18c5db0eda33eec6ab6114 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 01:12:01 +0300 Subject: [PATCH 1440/2732] Test --- iguana/exchanges/LP_remember.c | 60 ++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 669d55102..c5dfc1c56 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -931,9 +931,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.paymentspent) == 0 ) { - if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) - free_json(txoutobj), flag = 0; - else flag = -1, rswap.paymentspent = deadtxid; + flag = 0; + if ( bob->electrum == 0 ) + { + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1, rswap.paymentspent = deadtxid; + } if ( flag == 0 ) { if ( bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 ) @@ -967,9 +971,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { if ( time(NULL) > rswap.expiration ) { - if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) - free_json(txoutobj), flag = 0; - else flag = -1, rswap.depositspent = deadtxid; + flag = 0; + if ( bob->electrum == 0 ) + { + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1, rswap.depositspent = deadtxid; + } if ( flag == 0 ) { if ( rswap.Dredeemlen != 0 ) @@ -992,9 +1000,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( rswap.sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(rswap.Apaymentspent) == 0 && rswap.sentflags[BASILISK_ALICECLAIM] == 0 ) { - if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) - free_json(txoutobj), flag = 0; - else flag = -1, rswap.Apaymentspent = deadtxid; + flag = 0; + if ( alice->electrum == 0 ) + { + if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1, rswap.Apaymentspent = deadtxid; + } if ( flag == 0 ) { rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn); @@ -1014,9 +1026,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti //printf("try to bobspend aspend.%s have privAm.%d\n",bits256_str(str,rswap.txids[BASILISK_ALICESPEND]),bits256_nonz(rswap.privAm)); if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 || bits256_nonz(rswap.privAm) != 0 ) { - if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) - free_json(txoutobj), flag = 0; - else flag = -1, rswap.Apaymentspent = deadtxid; + flag = 0; + if ( alice->electrum == 0 ) + { + if ( (txoutobj= LP_gettxout(rswap.alicecoin,rswap.alicepaymentaddr,rswap.txids[BASILISK_ALICEPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1, rswap.Apaymentspent = deadtxid; + } if ( flag == 0 ) { if ( bits256_nonz(rswap.privAm) == 0 ) @@ -1035,9 +1051,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && bits256_nonz(rswap.paymentspent) == 0 ) { - if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) - free_json(txoutobj), flag = 0; - else flag = -1, rswap.paymentspent = deadtxid; + flag = 0; + if ( bob->electrum == 0 ) + { + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobpaymentaddr,rswap.txids[BASILISK_BOBPAYMENT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1, rswap.paymentspent = deadtxid; + } if ( flag == 0 && time(NULL) > rswap.expiration ) { // bobreclaim @@ -1060,9 +1080,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 ) { - if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) - free_json(txoutobj), flag = 0; - else flag = -1, rswap.depositspent = deadtxid; + flag = 0; + if ( bob->electrum == 0 ) + { + if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 ) + free_json(txoutobj), flag = 0; + else flag = -1, rswap.depositspent = deadtxid; + } if ( flag == 0 && (bits256_nonz(rswap.Apaymentspent) != 0 || time(NULL) > rswap.expiration) ) { printf("do the refund! paymentspent.%s now.%u vs expiration.%u\n",bits256_str(str,rswap.paymentspent),(uint32_t)time(NULL),rswap.expiration); From 0f02571e88c44632f6d71767ccb4a3888aa6c1de Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 01:16:44 +0300 Subject: [PATCH 1441/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 97d214400..a039e6a70 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -290,7 +290,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) { if ( (retjson= electrum_transaction(symbol,coin->electrum,&retjson,txid)) != 0 ) return(retjson); - else printf("failed blockchain.transaction.get %s %s\n",coin->symbol,buf); + else printf("failed blockchain.transaction.get %s %s\n",coin->symbol,bits256_str(str,txid)); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); } } From 07ebe8aa2030b8db6c63b4a9032447c50999c414 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 01:22:42 +0300 Subject: [PATCH 1442/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 676ae391c..2666c1abb 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -270,7 +270,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { - char str[65],str2[65]; printf("REJECT %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); + char str[65],str2[65]; printf("REJECT %s iambob.%d %s utxoadd.(%.8f %.8f) %s/v%d %s/v%d\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); printf("session.%u addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } From 27d0f23921c6f7d6cb4f848bbb7222cb214b8eee Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 01:27:41 +0300 Subject: [PATCH 1443/2732] Test --- iguana/exchanges/LP_ordermatch.c | 25 +++++-------------------- iguana/exchanges/LP_statemachine.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b60ffaef5..912242c36 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -475,26 +475,6 @@ char *LP_connectedalice(cJSON *argjson) // alice butxo = &B; memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(0,butxo,&Q); - /*if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) - { - value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); - if ( value == 0 || value2 == 0 ) - { - printf("zero value %.8f or value2 %.8f\n",dstr(value),dstr(value2)); - return(clonestr("{\"error\":\"spent txid or txid2 for bob?\"}")); - } - if ( (butxo= LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0)) == 0 ) - { - printf("cant find or create butxo\n"); - return(clonestr("{\"error\":\"cant find or create butxo\"}")); - } - if ( value < Q.satoshis ) - { - printf("butxo value %.8f less satoshis %.8f\n",dstr(value),dstr(Q.satoshis)); - return(clonestr("{\"error\":\"butxo value less than satoshis\"}")); - } - }*/ if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); @@ -652,6 +632,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("{\"error\":\"GAME can only be alice coin\"}\n"); return(retval); } + if ( strcmp(Q.coinaddr,coin->smartaddr) != 0 ) + { + printf("bob is patching Q.coinaddr %s mismatch != %s\n",Q.coinaddr,coin->smartaddr); + strcpy(Q.coinaddr,coin->smartaddr); + } price = ask; autxo = &A; butxo = &B; diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 5db3f3c40..b84c79843 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1433,6 +1433,27 @@ int32_t bitcoin_coinptrs(bits256 pubkey,struct iguana_info **bobcoinp,struct igu } return(-1); }*/ +/*if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) + { + value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + if ( value == 0 || value2 == 0 ) + { + printf("zero value %.8f or value2 %.8f\n",dstr(value),dstr(value2)); + return(clonestr("{\"error\":\"spent txid or txid2 for bob?\"}")); + } + if ( (butxo= LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0)) == 0 ) + { + printf("cant find or create butxo\n"); + return(clonestr("{\"error\":\"cant find or create butxo\"}")); + } + if ( value < Q.satoshis ) + { + printf("butxo value %.8f less satoshis %.8f\n",dstr(value),dstr(Q.satoshis)); + return(clonestr("{\"error\":\"butxo value less than satoshis\"}")); + } + }*/ + /*if ( addflag != 0 && LP_utxofind(1,Q.txid,Q.vout) == 0 ) { LP_utxoadd(1,-1,Q.srccoin,Q.txid,Q.vout,Q.value,Q.txid2,Q.vout2,Q.value2,"",Q.srcaddr,Q.srchash,0.); From 001ee87cf3a5492c396cd4184aea2debe0c10205 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 01:30:33 +0300 Subject: [PATCH 1444/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 912242c36..91a8a6530 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -680,7 +680,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 || bits256_cmp(Q.txid,butxo->payment.txid) != 0 || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 ) { - printf("null butxo.%p case\n",butxo); + printf("%s %s null butxo.%p case\n",Q.srccoin,Q.coinaddr,butxo); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); From 11a61816eaa44c6c2bedc35df1cc302e8dad36a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 01:51:24 +0300 Subject: [PATCH 1445/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/m_js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/m_js diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 77d8cadfa..6d5daecb4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -389,7 +389,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 } if ( SPV < 0 ) { - printf("MERKLE DIDNT VERIFY.(%s)\n",jprint(merkobj,0)); + printf("MERKLE DIDNT VERIFY.%s %s ht.%d (%s)\n",coin->symbol,bits256_str(str,txid),height,jprint(merkobj,0)); if ( jobj(merkobj,"error") != 0 ) SPV = 0; // try again later } diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js new file mode 100755 index 000000000..69a39ea70 --- /dev/null +++ b/iguana/exchanges/m_js @@ -0,0 +1 @@ +emcc -DFROM_JS -O2 -I../../includes -I../../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/bartderDEX.html mm.c ../../crypto777/*.c ../../crypto777/jpeg/*.c ../../crypto777/jpeg/unix/*.c ../mini-gmp.c ../secp256k1/src/secp256k1.c -lm -lcurl.js From 9ee6baf20bce4232d799b2a255f37bdaf2053d64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 11:39:22 +0300 Subject: [PATCH 1446/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++++++--- iguana/exchanges/install | 2 +- iguana/exchanges/m_js | 3 ++- iguana/exchanges/mm.c | 8 ++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ae01c92f3..08946729d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -789,6 +789,11 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) return(n); } +void LP_fromjs_iter(void *arg) +{ + printf("LP_fromjs_iter got arg.%p\n",arg); +} + 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; long filesize,n; int32_t 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(); @@ -851,7 +856,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_butxomutex); portable_mutex_init(&LP_reservedmutex); portable_mutex_init(&LP_nanorecvsmutex); + myipaddr = clonestr("127.0.0.1"); #ifndef _WIN32 +#ifndef FROM_JS if ( system("curl -s4 checkip.amazonaws.com > myipaddr") == 0 ) { char ipfname[64]; @@ -865,7 +872,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } else printf("error getting myipaddr\n"); } else printf("error issuing curl\n"); #else - myipaddr = clonestr("127.0.0.1"); + IAMLP = 0; +#endif #endif if ( IAMLP != 0 ) { @@ -982,8 +990,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) - // free(retstr); +#ifndef FROM_JS int32_t nonz; printf("start mainloop\n"); while ( 1 ) @@ -1002,6 +1009,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu else if ( IAMLP == 0 ) usleep(1000); } +#endif } diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 561a3063e..92842953c 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 69a39ea70..75da7febd 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1 +1,2 @@ -emcc -DFROM_JS -O2 -I../../includes -I../../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/bartderDEX.html mm.c ../../crypto777/*.c ../../crypto777/jpeg/*.c ../../crypto777/jpeg/unix/*.c ../mini-gmp.c ../secp256k1/src/secp256k1.c -lm -lcurl.js +~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../../includes -I../../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html mm.c ../../crypto777/*.c ../../crypto777/jpeg/*.c ../../crypto777/jpeg/unix/*.c ../mini-gmp.c ../secp256k1/src/secp256k1.c -lm libnanomsg.so + diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 73d998990..582518ac8 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -878,6 +878,13 @@ int main(int argc, const char * argv[]) sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); +#ifdef FROM_JS + argc = 2; + retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); + printf("calling LP_main(%s)\n",jprint(retjson,0)); + LP_main(retjson); + emscripten_set_main_loop(LP_mainiter,0,0); +#else if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { if ( (passphrase= jstr(retjson,"passphrase")) == 0 ) @@ -949,5 +956,6 @@ int main(int argc, const char * argv[]) } free_json(retjson); } +#endif return 0; } From bbab493208bd99161ee207777a319e358604ba41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 11:52:06 +0300 Subject: [PATCH 1447/2732] Test --- iguana/exchanges/m_js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 75da7febd..da426889e 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,2 +1,3 @@ -~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../../includes -I../../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html mm.c ../../crypto777/*.c ../../crypto777/jpeg/*.c ../../crypto777/jpeg/unix/*.c ../mini-gmp.c ../secp256k1/src/secp256k1.c -lm libnanomsg.so +cd .. +~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 57d7999aceb00c897947e27853daecdaa74580cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 11:53:50 +0300 Subject: [PATCH 1448/2732] Test --- OSlibs/js/libnanomsg.so | Bin 0 -> 335660 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 OSlibs/js/libnanomsg.so diff --git a/OSlibs/js/libnanomsg.so b/OSlibs/js/libnanomsg.so new file mode 100644 index 0000000000000000000000000000000000000000..a8f7ea8ef5c7c3da83b1d159fbcd2d5d6ec8b864 GIT binary patch literal 335660 zcmeFa2~<-_*EV`Gkc1eL009F6CV&Wz0Z~y=5(Y&YAt2gLXaEOrL_ic&ObnwFK^#yK z10ta9fQs`#5JVIeR9bNcL`202uv--MuY}~BI`8}1-}n9Zu7BNi@6AfnBz0;(dwBM) zs(nt=?jEXV!#N0|hagBOLtr~``enQK_r?wOBsi(RLih{>DVsn*dadUnMDW=d{6m%5 zWQeNB6De$`QCkU#jDC7FGb{4OQ0X8qqWjif?sE;DI4(5qZ*->&trV*0mRJ7 zz1f?o$mmxg76r&QHOgOZAWt7p3E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5^V>{j(hUD6Z7w9RL!-8#V)B_b-bH^V4o>I#VXvf@1VMSj4WZ~}=3wKr(z{d*cg zC=8;Z5gh=PCqK?7`yJO!D|ol7+L#Jm~-+|G`zenkjTVeX^DYT%7PT9=5b|PY`8$6RvWP)5UYe#~e1VWpB zdWmGA|6of=Qx(tCFWygiSB(G6LCG4f*UbSLe*wuu%A#8i}{i_kdZ;8coS zKhDTnq8)pPb>V=!4;u_u;c57sZZger#F91U`^lH3u+F3HuA~BdXX>)+s5pQ}Arsdn z&a!hJTTQab$rmt2D*W?gn~t~#=mlro_ut{bKdjfOaGyhi+0QSK1(Tr+;$pPqwt&&9 zC9K$IHkjO(Mytd-^!qwD`k5X_qpVdrP|oWe%x&K3+Xq3L6at{=)r4!_5{392Do5ct zQK*;mv#uDpbc0VoYcDjnlUB!kgPdo=(E=(KJ{FLWRH0B8&USKSGd@7`y-?h7K?Dv? ztSPH^3j3ZB1`@h%;2z76uLxhRR4B`TBR%dR>Y{(hC~J3Xf5YYrH81`J3&V5fA0@Us zk3W5qo}FO?NDX~bMA|H(u8o5GBhnBavzqz1X4WtQ@6ig)*Cem$k(cEDV)DHOQ;`t%l()_WreQ|s-m%#DkFl&0nHFN0q{_S7Cdd%!Lue#~^&O>U&1?N78#g=f zzRf^%3s3i%3psJ^VU{fxcSwkY-irRno4N=X8*QySQ>rMuv$VrzyFF4S^wpChoVCSj zivHQGq>k)Bn~5@3>pDJviEq6 Date: Wed, 25 Oct 2017 11:55:01 +0300 Subject: [PATCH 1449/2732] Test --- iguana/exchanges/m_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index da426889e..00b5d32e5 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,3 +1,3 @@ cd .. -~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 7666d3d493bd9f37dad2dce42faa89765c5bc552 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 11:56:11 +0300 Subject: [PATCH 1450/2732] Test --- iguana/exchanges/m_js | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 00b5d32e5..a4ee63f0b 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,3 +1,4 @@ cd .. +echo building... ~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 0defb999c71641f20467404cb75d56da6c59bf19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:04:43 +0300 Subject: [PATCH 1451/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/m_js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8f0283812..c56c15323 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -534,7 +534,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%ld)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,strlen(jprint(retjson,0))); + printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr); if ( ap != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 96dcfa42a..20db0afd0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -917,7 +917,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf *txobjp = 0; if ( sizeof(utxos)/sizeof(*utxos) != max ) { - printf("LP_createrawtransaction: internal error %ld != max.%d\n",sizeof(utxos)/sizeof(*utxos),max); + printf("LP_createrawtransaction: internal error %d != max.%d\n",(int32_t)(sizeof(utxos)/sizeof(*utxos)),max); return(0); } if ( coin == 0 || outputs == 0 || (numvouts= cJSON_GetArraySize(outputs)) <= 0 ) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index a4ee63f0b..b536383df 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -~/emsdk/emscripten/1.37.21/emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 2c43e79971ffaf8e6de806636c29e4103886359f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:05:50 +0300 Subject: [PATCH 1452/2732] Test --- iguana/exchanges/LP_include.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4abb60065..b64a072f3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,6 +21,9 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H +#ifdef FROM_JS +#include +#endif //#define LP_STRICTPEERS #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) From b29057c6371f316c7c2bff93ac9f0b3eb060c916 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:06:32 +0300 Subject: [PATCH 1453/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 582518ac8..acacfa4d2 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -883,7 +883,7 @@ int main(int argc, const char * argv[]) retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); printf("calling LP_main(%s)\n",jprint(retjson,0)); LP_main(retjson); - emscripten_set_main_loop(LP_mainiter,0,0); + emscripten_set_main_loop(LP_fromjs_iter,0,0); #else if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { From 8c62fb2041ed1eeb566cdff4d901dfea950db164 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:06:48 +0300 Subject: [PATCH 1454/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index acacfa4d2..a84c15c5d 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -883,7 +883,7 @@ int main(int argc, const char * argv[]) retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); printf("calling LP_main(%s)\n",jprint(retjson,0)); LP_main(retjson); - emscripten_set_main_loop(LP_fromjs_iter,0,0); + emscripten_set_main_loop(LP_fromjs_iter,5,0); #else if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { From ed92f0bb8240371f5e54fd084acbddde7479d74f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:07:56 +0300 Subject: [PATCH 1455/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 08946729d..b3a1751f4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -789,11 +789,6 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) return(n); } -void LP_fromjs_iter(void *arg) -{ - printf("LP_fromjs_iter got arg.%p\n",arg); -} - 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; long filesize,n; int32_t 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(); @@ -1012,5 +1007,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu #endif } +#ifdef FROM_JS + +em_callback_func LP_fromjs_iter(void *arg) +{ + printf("LP_fromjs_iter got arg.%p\n",arg); +} +#endif From a95139fe33fbda051ffac8c50b3db33235eab512 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:09:49 +0300 Subject: [PATCH 1456/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b3a1751f4..19d7bd071 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1009,9 +1009,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu #ifdef FROM_JS -em_callback_func LP_fromjs_iter(void *arg) +uint32_t LP_counter; +void LP_fromjs_iter() { - printf("LP_fromjs_iter got arg.%p\n",arg); + printf("LP_fromjs_iter got called LP_counter.%d\n",LP_counter); + LP_counter++; } #endif From bf559d6f5f81ce7f2d9789083e8d0cac3950b9df Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:13:29 +0300 Subject: [PATCH 1457/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 19d7bd071..e5a425d3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1015,6 +1015,12 @@ void LP_fromjs_iter() printf("LP_fromjs_iter got called LP_counter.%d\n",LP_counter); LP_counter++; } + +char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params) +{ + return(clonestr("{\"error\":\"curl is disabled\"}")); +} + #endif From 16a3909619799e64df7c8b05dab217626d24c9d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:14:16 +0300 Subject: [PATCH 1458/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e5a425d3e..6fa621f60 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1016,7 +1016,7 @@ void LP_fromjs_iter() LP_counter++; } -char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params) +char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { return(clonestr("{\"error\":\"curl is disabled\"}")); } From 0d80000c2a32d0f2a9a8b4d2e4ecd82fe208d84a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:22:03 +0300 Subject: [PATCH 1459/2732] Test --- iguana/exchanges/m_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index b536383df..9b17a5011 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc --preload-file coins -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 068d234686dc31b096525868a69427c587ee8091 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:22:25 +0300 Subject: [PATCH 1460/2732] Test --- iguana/exchanges/m_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 9b17a5011..90da10472 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc --preload-file coins -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc --preload-file exchanges/coins -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From c9c34f4cd64db1d608c37ee13e9891dabcb09bbc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:24:54 +0300 Subject: [PATCH 1461/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/m_js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6fa621f60..34cedb5bd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -903,7 +903,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); if ( (coinsjson= jobj(argjson,"coins")) == 0 ) { - if ( (coins_str= OS_filestr(&filesize,"coins.json")) != 0 ) + if ( (coins_str= OS_filestr(&filesize,"coins.json")) != 0 || (coins_str= OS_filestr(&filesize,"exchanges/coins.json")) != 0 ) { unstringify(coins_str); printf("UNSTRINGIFIED.(%s)\n",coins_str); diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 90da10472..c302eeae5 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc --preload-file exchanges/coins -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 026392431a7e95f2d4264891c180800554ea2043 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:26:14 +0300 Subject: [PATCH 1462/2732] Test --- iguana/exchanges/coins.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/coins.json b/iguana/exchanges/coins.json index 576547207..cadc82f08 100644 --- a/iguana/exchanges/coins.json +++ b/iguana/exchanges/coins.json @@ -1,3 +1,2 @@ -[{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000},{\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}] -#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" - +[{\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}] From 15790df94e7420ba87f85c5fea2c9d4fbd64f104 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:29:57 +0300 Subject: [PATCH 1463/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/m_js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 34cedb5bd..cf4f2e78e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -914,7 +914,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } if ( coinsjson == 0 ) { - printf("no coins object or coins file, must abort\n"); + printf("no coins object or coins.json file, must abort\n"); exit(-1); } LP_initcoins(ctx,pubsock,coinsjson); diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index c302eeae5..7377c2ed0 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc -s TOTAL_MEMORY=1000000000 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 68e187a126c6366e17634b76c1cc3b826967e5eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:31:41 +0300 Subject: [PATCH 1464/2732] Test --- iguana/exchanges/m_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 7377c2ed0..92d80067c 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc -s TOTAL_MEMORY=1000000000 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 0d1ed642640ba2a04b47a960f68d8e2a4c5b65f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:49:38 +0300 Subject: [PATCH 1465/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 +++++++++++++++++- iguana/exchanges/mm.c | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cf4f2e78e..d69c6ec47 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -713,6 +713,7 @@ void LP_pubkeysloop(void *ctx) sleep(10); while ( 1 ) { + printf("LP_pubkeysloop\n"); LP_notify_pubkeys(ctx,LP_mypubsock); sleep(60); } @@ -723,6 +724,7 @@ void LP_privkeysloop(void *ctx) sleep(20); while ( 1 ) { + printf("LP_privkeysloop\n"); LP_privkey_updates(ctx,LP_mypubsock,0); sleep(60); } @@ -734,6 +736,7 @@ void LP_swapsloop(void *ignore) sleep(50); while ( 1 ) { + printf("LP_swapsloop\n"); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); sleep(600); @@ -1010,14 +1013,27 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu #ifdef FROM_JS uint32_t LP_counter; + void LP_fromjs_iter() { - printf("LP_fromjs_iter got called LP_counter.%d\n",LP_counter); + static void *ctx; + if ( G.initializing != 0 ) + { + printf("LP_fromjs_iter during G.initializing, skip\n"); + return; + } + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); + LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); LP_counter++; } char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { + char fullurl[512]; + sprintf(fullurl,"%s@%s",userpass,url); + printf("bitcoind_RPC(%s)\n",fullurl); return(clonestr("{\"error\":\"curl is disabled\"}")); } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index a84c15c5d..2a7415d2c 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -883,7 +883,7 @@ int main(int argc, const char * argv[]) retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); printf("calling LP_main(%s)\n",jprint(retjson,0)); LP_main(retjson); - emscripten_set_main_loop(LP_fromjs_iter,5,0); + emscripten_set_main_loop(LP_fromjs_iter,1,0); #else if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { From e6f17dd4a8875d0c6782f7321ddecc21af260bd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 12:58:40 +0300 Subject: [PATCH 1466/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d69c6ec47..833117b9e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -50,7 +50,7 @@ char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.25 //uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; -uint32_t LP_lastnonce; +uint32_t LP_lastnonce,LP_counter; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; @@ -481,6 +481,7 @@ void LP_coinsloop(void *_coins) struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; while ( 1 ) { + printf("coinsloop\n"); nonz = 0; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -713,7 +714,8 @@ void LP_pubkeysloop(void *ctx) sleep(10); while ( 1 ) { - printf("LP_pubkeysloop\n"); + LP_counter += 100; + printf("LP_pubkeysloop %d\n",LP_counter); LP_notify_pubkeys(ctx,LP_mypubsock); sleep(60); } @@ -724,7 +726,8 @@ void LP_privkeysloop(void *ctx) sleep(20); while ( 1 ) { - printf("LP_privkeysloop\n"); + LP_counter += 1000; + printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); sleep(60); } @@ -736,7 +739,8 @@ void LP_swapsloop(void *ignore) sleep(50); while ( 1 ) { - printf("LP_swapsloop\n"); + LP_counter += 10000; + printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); sleep(600); @@ -1012,7 +1016,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu #ifdef FROM_JS -uint32_t LP_counter; void LP_fromjs_iter() { @@ -1024,7 +1027,8 @@ void LP_fromjs_iter() } if ( ctx == 0 ) ctx = bitcoin_ctx(); - printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); + if ( (LP_counter % 100) == 0 ) + printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); LP_counter++; } From 91b05c755c6bf5f0c7ed837fc03491e023fcaf6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:00:38 +0300 Subject: [PATCH 1467/2732] Test --- iguana/exchanges/LP_coins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 5ef612669..53ef70c1f 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -326,7 +326,9 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); } +#ifndef FROM_JS port = LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath,port); +#endif sprintf(coin->serverport,"127.0.0.1:%u",port); return(port); } From 0a4f35a22ee777b65d0804d7bfc7f10ad3f79621 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:08:12 +0300 Subject: [PATCH 1468/2732] Test --- iguana/exchanges/LP_coins.c | 4 ++-- iguana/exchanges/LP_include.h | 2 ++ iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/m_js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 53ef70c1f..0495c8a38 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -315,7 +315,7 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->ctx = bitcoin_ctx(); if ( assetname != 0 && strcmp(name,assetname) == 0 ) { - printf("%s is assetchain\n",symbol); + //printf("%s is assetchain\n",symbol); coin->isassetchain = 1; } if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) @@ -436,7 +436,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } } else coin->inactive = 0; } - if ( coin != 0 && coin->inactive != 0 ) + if ( 0 && coin != 0 && coin->inactive != 0 ) printf("LPnode.%d %s inactive.%u %p vs %p\n",IAMLP,coin->symbol,coin->inactive,assetname,name); return(0); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b64a072f3..426b9453b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,6 +23,8 @@ #ifdef FROM_JS #include +#define sleep(x) emscripten_sleep(x) + #endif //#define LP_STRICTPEERS diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 833117b9e..b41574868 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1035,9 +1035,9 @@ void LP_fromjs_iter() char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { - char fullurl[512]; - sprintf(fullurl,"%s@%s",userpass,url); - printf("bitcoind_RPC(%s)\n",fullurl); + //char fullurl[512]; + //sprintf(fullurl,"%s@%s",userpass,url); + printf("bitcoind_RPC(%s)\n",url); return(clonestr("{\"error\":\"curl is disabled\"}")); } diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 92d80067c..0cf198f34 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so From 720f9dd2b6313a38a304f3e9d27f62dea1e7f7f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:16:47 +0300 Subject: [PATCH 1469/2732] Test --- iguana/exchanges/LP_coins.c | 4 +++- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 11 +++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 0495c8a38..706016806 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -397,6 +397,7 @@ struct iguana_info *LP_coinfind(char *symbol) struct iguana_info *LP_coincreate(cJSON *item) { struct iguana_info cdata,*coin=0; int32_t isPoS,longestchain = 1; uint16_t port; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name=0,*symbol,*assetname=0; + printf("LP_coincreate\n"); if ( (symbol= jstr(item,"coin")) != 0 && symbol[0] != 0 && strlen(symbol) < 16 && LP_coinfind(symbol) == 0 && (port= juint(item,"rpcport")) != 0 ) { isPoS = jint(item,"isPoS"); @@ -415,6 +416,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } else if ( (name= jstr(item,"name")) == 0 ) name = symbol; + printf("LP_coininit\n"); if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"confpath")) < 0 ) { coin = LP_coinadd(&cdata); @@ -436,7 +438,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } } else coin->inactive = 0; } - if ( 0 && coin != 0 && coin->inactive != 0 ) + if ( coin != 0 && coin->inactive != 0 ) printf("LPnode.%d %s inactive.%u %p vs %p\n",IAMLP,coin->symbol,coin->inactive,assetname,name); return(0); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 426b9453b..dd9df70f1 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -24,6 +24,7 @@ #ifdef FROM_JS #include #define sleep(x) emscripten_sleep(x) +#define usleep #endif //#define LP_STRICTPEERS diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b41574868..d0d6c61fd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1035,10 +1035,13 @@ void LP_fromjs_iter() char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { - //char fullurl[512]; - //sprintf(fullurl,"%s@%s",userpass,url); - printf("bitcoind_RPC(%s)\n",url); - return(clonestr("{\"error\":\"curl is disabled\"}")); + static uint32_t counter; char fname[512],retstr; long fsize; + sprintf(fname,"bitcoind_RPC/req.%u",counter); + counter++; + emscripten_wget(url,fname); + retstr = OS_filestr(&fsize,fname); + printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr); + return(retstr); } #endif From 39399e61a67b93fabf10e7e8e833d221f34e2543 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:18:05 +0300 Subject: [PATCH 1470/2732] Test --- iguana/exchanges/LP_include.h | 3 ++- iguana/exchanges/LP_nativeDEX.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index dd9df70f1..7c10880f2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -24,7 +24,8 @@ #ifdef FROM_JS #include #define sleep(x) emscripten_sleep(x) -#define usleep +void emscripten_usleep(int32_t x); +#define usleep(x) emscripten_usleep(x) #endif //#define LP_STRICTPEERS diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d0d6c61fd..fc1cda7d0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1016,6 +1016,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu #ifdef FROM_JS +void emscripten_usleep(int32_t x) +{ +} void LP_fromjs_iter() { @@ -1035,7 +1038,7 @@ void LP_fromjs_iter() char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { - static uint32_t counter; char fname[512],retstr; long fsize; + static uint32_t counter; char fname[512],*retstr; long fsize; sprintf(fname,"bitcoind_RPC/req.%u",counter); counter++; emscripten_wget(url,fname); From 19c11e2ee42b05eb8414e884dfced585eae4a3e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:29:05 +0300 Subject: [PATCH 1471/2732] Test --- iguana/exchanges/m_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 0cf198f34..cf3fcf757 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so +emcc -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so -lc -lpthread From 295ea7807e7e4da5ab3a9dea716fd3025d02933c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:31:06 +0300 Subject: [PATCH 1472/2732] Test --- iguana/exchanges/m_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index cf3fcf757..11e57fce0 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so -lc -lpthread +emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.so -lc -lpthread From 54124e0160452c9245ab7421ef7921b621cdceaf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 13:51:00 +0300 Subject: [PATCH 1473/2732] Test --- OSlibs/js/libnanomsg.a | Bin 0 -> 590614 bytes iguana/exchanges/m_js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 OSlibs/js/libnanomsg.a diff --git a/OSlibs/js/libnanomsg.a b/OSlibs/js/libnanomsg.a new file mode 100644 index 0000000000000000000000000000000000000000..fb2a83981c4c5e8500b0027f5c957539e4b076b6 GIT binary patch literal 590614 zcmeFaeOy#k{y2VS<}x$DFx&yOK>_ao8XDCM3{Q%AhZz(Vb0{lqEoWc`p%6wuMSB{C z;mNQDBcsP1%ZhE=qO{hmEkH6dGg2#a+d@;<_4)E@gnoj0|I0_R;v@?Btojj2x~j*Y9W#;S?>&RJAj!Yu z8QFy-|IBl~07>{qD&K`JdQz@H(*N$sdH{gt);Uw<)>;RI5dcFi+{0im&#f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 Subject: [PATCH 1474/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/m_js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7c10880f2..a306dde6b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #ifdef FROM_JS #include -#define sleep(x) emscripten_sleep(x) +#define sleep(x) emscripten_sleep((x) * 1000) void emscripten_usleep(int32_t x); #define usleep(x) emscripten_usleep(x) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index c173788af..fb99a2126 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,4 @@ cd .. echo building... -emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=2 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread +emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread From b28f665679767b601a75ae4a5468034a7e2ccfa6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:10:50 +0300 Subject: [PATCH 1475/2732] Test --- iguana/exchanges/LP_include.h | 6 +++++- iguana/exchanges/LP_nativeDEX.c | 8 +++----- iguana/exchanges/LP_peers.c | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a306dde6b..69944e7b4 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -26,7 +26,11 @@ #define sleep(x) emscripten_sleep((x) * 1000) void emscripten_usleep(int32_t x); #define usleep(x) emscripten_usleep(x) - +// ./autogen.sh +// emconfigure ./configure CFLAGS="-s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1" +// Edit src/core/sock.c and add here #include for INT_MAX support +// emmake make +// cp .libs/libnanomsg.a ~/SuperNET/OSlibs/js #endif //#define LP_STRICTPEERS diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fc1cda7d0..0952f5679 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -481,7 +481,6 @@ void LP_coinsloop(void *_coins) struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; while ( 1 ) { - printf("coinsloop\n"); nonz = 0; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -715,7 +714,7 @@ void LP_pubkeysloop(void *ctx) while ( 1 ) { LP_counter += 100; - printf("LP_pubkeysloop %d\n",LP_counter); + //printf("LP_pubkeysloop %d\n",LP_counter); LP_notify_pubkeys(ctx,LP_mypubsock); sleep(60); } @@ -727,7 +726,7 @@ void LP_privkeysloop(void *ctx) while ( 1 ) { LP_counter += 1000; - printf("LP_privkeysloop %u\n",LP_counter); + //printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); sleep(60); } @@ -740,7 +739,7 @@ void LP_swapsloop(void *ignore) while ( 1 ) { LP_counter += 10000; - printf("LP_swapsloop %u\n",LP_counter); + //printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); sleep(600); @@ -994,7 +993,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #ifndef FROM_JS int32_t nonz; - printf("start mainloop\n"); while ( 1 ) { nonz = 0; diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index a7ffdf846..1da51a464 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -83,6 +83,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char else peer->sessionid = sessionid; peer->pushsock = peer->subsock = pushsock = subsock = -1; strcpy(peer->ipaddr,ipaddr); +#ifndef FROM_JS if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) { nanomsg_transportname(0,pushaddr,peer->ipaddr,pushport); @@ -114,6 +115,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char printf("error connecting to push.(%s)\n",pushaddr); } } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); +#endif //peer->profitmargin = profitmargin; peer->ipbits = ipbits; peer->port = port; From 1ffe9e6b48f9ffaf7341153a3fe92e5363e72e18 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:20:38 +0300 Subject: [PATCH 1476/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_peers.c | 48 +++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 69944e7b4..01872157f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -27,7 +27,7 @@ void emscripten_usleep(int32_t x); #define usleep(x) emscripten_usleep(x) // ./autogen.sh -// emconfigure ./configure CFLAGS="-s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1" +// emconfigure ./configure CFLAGS="-s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -O2" // Edit src/core/sock.c and add here #include for INT_MAX support // emmake make // cp .libs/libnanomsg.a ~/SuperNET/OSlibs/js diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 1da51a464..92b56cb74 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -83,6 +83,11 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char else peer->sessionid = sessionid; peer->pushsock = peer->subsock = pushsock = subsock = -1; strcpy(peer->ipaddr,ipaddr); + //peer->profitmargin = profitmargin; + peer->ipbits = ipbits; + peer->port = port; + peer->ip_port = ((uint64_t)port << 32) | ipbits; + printf("allocated peer\n"); #ifndef FROM_JS if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) { @@ -116,32 +121,31 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char } } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); #endif - //peer->profitmargin = profitmargin; - peer->ipbits = ipbits; - peer->port = port; - peer->ip_port = ((uint64_t)port << 32) | ipbits; - portable_mutex_lock(&LP_peermutex); - HASH_ADD(hh,LP_peerinfos,ip_port,sizeof(peer->ip_port),peer); - if ( mypeer != 0 ) + if ( peer->pushsock >= 0 && peer->subsock >= 0 ) { - mypeer->numpeers++; - printf("_LPaddpeer %s -> numpeers.%d mypubsock.%d other.(%d %d)\n",ipaddr,mypeer->numpeers,mypubsock,numpeers,numutxos); - } else peer->numpeers = 1; // will become mypeer - portable_mutex_unlock(&LP_peermutex); - if ( IAMLP != 0 && mypubsock >= 0 ) - { - struct iguana_info *coin,*ctmp; bits256 zero; char busaddr[64]; - memset(zero.bytes,0,sizeof(zero)); - //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); - LP_reserved_msg("","",zero,jprint(LP_peerjson(peer),1)); - if ( 0 ) + portable_mutex_lock(&LP_peermutex); + HASH_ADD(hh,LP_peerinfos,ip_port,sizeof(peer->ip_port),peer); + if ( mypeer != 0 ) + { + mypeer->numpeers++; + printf("_LPaddpeer %s -> numpeers.%d mypubsock.%d other.(%d %d)\n",ipaddr,mypeer->numpeers,mypubsock,numpeers,numutxos); + } else peer->numpeers = 1; // will become mypeer + portable_mutex_unlock(&LP_peermutex); + if ( IAMLP != 0 && mypubsock >= 0 ) { - HASH_ITER(hh,LP_coins,coin,ctmp) + struct iguana_info *coin,*ctmp; bits256 zero; char busaddr[64]; + memset(zero.bytes,0,sizeof(zero)); + //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); + LP_reserved_msg("","",zero,jprint(LP_peerjson(peer),1)); + if ( 0 ) { - if ( coin->bussock >= 0 ) + HASH_ITER(hh,LP_coins,coin,ctmp) { - nanomsg_transportname(0,busaddr,peer->ipaddr,coin->busport); - nn_connect(coin->bussock,busaddr); + if ( coin->bussock >= 0 ) + { + nanomsg_transportname(0,busaddr,peer->ipaddr,coin->busport); + nn_connect(coin->bussock,busaddr); + } } } } From 100313889c80bd3aa509d6f1aecb4ba4f9593b56 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:26:02 +0300 Subject: [PATCH 1477/2732] Test --- iguana/exchanges/LP_coins.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 706016806..9f00cbaff 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -285,13 +285,16 @@ struct iguana_info *LP_coinsearch(char *symbol) struct iguana_info *LP_coinadd(struct iguana_info *cdata) { struct iguana_info *coin = calloc(1,sizeof(*coin)); - //printf("%s: (%s) (%s)\n",symbol,cdata.serverport,cdata.userpass); *coin = *cdata; portable_mutex_init(&coin->txmutex); portable_mutex_init(&coin->addrmutex); + printf("mutexlock\n"); portable_mutex_lock(&LP_coinmutex); + printf("mutexlocked\n"); HASH_ADD_KEYPTR(hh,LP_coins,coin->symbol,strlen(coin->symbol),coin); + printf("mutexunlock\n"); portable_mutex_unlock(&LP_coinmutex); + printf("mutexunlocked\n"); return(coin); } @@ -419,11 +422,18 @@ struct iguana_info *LP_coincreate(cJSON *item) printf("LP_coininit\n"); if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"confpath")) < 0 ) { + printf("LP_coinadd\n"); coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); - } else coin = LP_coinadd(&cdata); + } + else + { + printf("LP_coinadd\n"); + coin = LP_coinadd(&cdata); + } } else if ( symbol != 0 && jobj(item,"rpcport") == 0 ) printf("SKIP %s, missing rpcport field in coins array\n",symbol); + printf("end of coininit\n"); if ( coin != 0 && item != 0 ) { if ( strcmp("KMD",coin->symbol) != 0 ) From 1e4991a9817d1f3d0f0e8d296e4477b7f7263ba0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:30:08 +0300 Subject: [PATCH 1478/2732] Test --- iguana/exchanges/LP_coins.c | 4 ++++ iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 9f00cbaff..1bc94d905 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -301,6 +301,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *confpath) { char *name2; + printf("clear coin\n"); memset(coin,0,sizeof(*coin)); safecopy(coin->symbol,symbol,sizeof(coin->symbol)); coin->updaterate = (uint32_t)time(NULL); @@ -314,8 +315,11 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->p2shtype = p2shtype; coin->wiftype = wiftype; coin->inactive = (uint32_t)time(NULL); + printf("call coinbus\n"); coin->bussock = LP_coinbus(busport); + printf("call bitcoin_ctx\n"); coin->ctx = bitcoin_ctx(); + printf("back from bitcoin_ctx\n"); if ( assetname != 0 && strcmp(name,assetname) == 0 ) { //printf("%s is assetchain\n",symbol); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0952f5679..74cd98855 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1039,6 +1039,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * static uint32_t counter; char fname[512],*retstr; long fsize; sprintf(fname,"bitcoind_RPC/req.%u",counter); counter++; + printf("issue.(%s)\n",url); emscripten_wget(url,fname); retstr = OS_filestr(&fsize,fname); printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr); From e5067302a8c70cee981d3d714f739efd12b46698 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:31:47 +0300 Subject: [PATCH 1479/2732] Test --- iguana/exchanges/LP_coins.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 1bc94d905..11c89ae74 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -300,6 +300,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *confpath) { + static void *ctx; char *name2; printf("clear coin\n"); memset(coin,0,sizeof(*coin)); @@ -318,7 +319,9 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse printf("call coinbus\n"); coin->bussock = LP_coinbus(busport); printf("call bitcoin_ctx\n"); - coin->ctx = bitcoin_ctx(); + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + coin->ctx = ctx; printf("back from bitcoin_ctx\n"); if ( assetname != 0 && strcmp(name,assetname) == 0 ) { From 1da066e988dedbe9829b45bf5c10fce03265d6c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:36:46 +0300 Subject: [PATCH 1480/2732] Test --- iguana/exchanges/LP_coins.c | 18 +----------------- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 11c89ae74..15b8f5ea0 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -288,13 +288,9 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) *coin = *cdata; portable_mutex_init(&coin->txmutex); portable_mutex_init(&coin->addrmutex); - printf("mutexlock\n"); portable_mutex_lock(&LP_coinmutex); - printf("mutexlocked\n"); HASH_ADD_KEYPTR(hh,LP_coins,coin->symbol,strlen(coin->symbol),coin); - printf("mutexunlock\n"); portable_mutex_unlock(&LP_coinmutex); - printf("mutexunlocked\n"); return(coin); } @@ -316,13 +312,10 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->p2shtype = p2shtype; coin->wiftype = wiftype; coin->inactive = (uint32_t)time(NULL); - printf("call coinbus\n"); coin->bussock = LP_coinbus(busport); - printf("call bitcoin_ctx\n"); if ( ctx == 0 ) ctx = bitcoin_ctx(); coin->ctx = ctx; - printf("back from bitcoin_ctx\n"); if ( assetname != 0 && strcmp(name,assetname) == 0 ) { //printf("%s is assetchain\n",symbol); @@ -407,7 +400,6 @@ struct iguana_info *LP_coinfind(char *symbol) struct iguana_info *LP_coincreate(cJSON *item) { struct iguana_info cdata,*coin=0; int32_t isPoS,longestchain = 1; uint16_t port; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name=0,*symbol,*assetname=0; - printf("LP_coincreate\n"); if ( (symbol= jstr(item,"coin")) != 0 && symbol[0] != 0 && strlen(symbol) < 16 && LP_coinfind(symbol) == 0 && (port= juint(item,"rpcport")) != 0 ) { isPoS = jint(item,"isPoS"); @@ -426,21 +418,13 @@ struct iguana_info *LP_coincreate(cJSON *item) } else if ( (name= jstr(item,"name")) == 0 ) name = symbol; - printf("LP_coininit\n"); if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"confpath")) < 0 ) { - printf("LP_coinadd\n"); coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); - } - else - { - printf("LP_coinadd\n"); - coin = LP_coinadd(&cdata); - } + } else coin = LP_coinadd(&cdata); } else if ( symbol != 0 && jobj(item,"rpcport") == 0 ) printf("SKIP %s, missing rpcport field in coins array\n",symbol); - printf("end of coininit\n"); if ( coin != 0 && item != 0 ) { if ( strcmp("KMD",coin->symbol) != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 74cd98855..e56ad0a0a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -926,6 +926,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu LP_initcoins(ctx,pubsock,coinsjson); G.waiting = 1; LP_passphrase_init(passphrase,jstr(argjson,"gui")); +#ifndef FROM_JS if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)myipaddr) != 0 ) { printf("error launching LP_psockloop for (%s)\n",myipaddr); @@ -991,7 +992,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } -#ifndef FROM_JS int32_t nonz; while ( 1 ) { From 27e17866e460d3989788b16b910281f9bdb273bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:40:18 +0300 Subject: [PATCH 1481/2732] Test --- iguana/exchanges/LP_coins.c | 3 +-- iguana/exchanges/LP_nativeDEX.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 15b8f5ea0..0d97c0f81 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -298,7 +298,6 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse { static void *ctx; char *name2; - printf("clear coin\n"); memset(coin,0,sizeof(*coin)); safecopy(coin->symbol,symbol,sizeof(coin->symbol)); coin->updaterate = (uint32_t)time(NULL); @@ -439,7 +438,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } } else coin->inactive = 0; } - if ( coin != 0 && coin->inactive != 0 ) + if ( 0 && coin != 0 && coin->inactive != 0 ) printf("LPnode.%d %s inactive.%u %p vs %p\n",IAMLP,coin->symbol,coin->inactive,assetname,name); return(0); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e56ad0a0a..9200abb34 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1037,6 +1037,8 @@ void LP_fromjs_iter() char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { static uint32_t counter; char fname[512],*retstr; long fsize; + if ( strncmp("http://",url,strlen("http://")) != 0 ) + return(clonestr("{\"error\":\"only http allowed\"}")); sprintf(fname,"bitcoind_RPC/req.%u",counter); counter++; printf("issue.(%s)\n",url); From 40b5a52175a76d7010f39e8fd1d10cd987d9ea98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:43:06 +0300 Subject: [PATCH 1482/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9200abb34..7f745d099 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -798,6 +798,12 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) 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; long filesize,n; int32_t 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(); + { + int32_t sock; + printf("call nn_socket\n"); + sock = nn_socket(AF_SP,NN_PAIR); + printf("nn_socket(PAIR) %d\n",sock); + } LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { From 5aee2dfd6a23b31ac364c07496d2f27f60db1b30 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:45:40 +0300 Subject: [PATCH 1483/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_peers.c | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7f745d099..2f1e14e5d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -801,8 +801,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu { int32_t sock; printf("call nn_socket\n"); - sock = nn_socket(AF_SP,NN_PAIR); - printf("nn_socket(PAIR) %d\n",sock); + sock = nn_socket(AF_SP,NN_PUSH); + printf("nn_socket(NN_PUSH) %d\n",sock); } LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 92b56cb74..c922d981d 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -57,7 +57,7 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; - printf("addpeer (%s:%u)\n",ipaddr,port); + printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) return(0); @@ -87,8 +87,6 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char peer->ipbits = ipbits; peer->port = port; peer->ip_port = ((uint64_t)port << 32) | ipbits; - printf("allocated peer\n"); -#ifndef FROM_JS if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) { nanomsg_transportname(0,pushaddr,peer->ipaddr,pushport); @@ -120,7 +118,6 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char printf("error connecting to push.(%s)\n",pushaddr); } } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); -#endif if ( peer->pushsock >= 0 && peer->subsock >= 0 ) { portable_mutex_lock(&LP_peermutex); From 4b8c79a66fcd919ea4107b86ca07bfb5a81f8f4d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:48:39 +0300 Subject: [PATCH 1484/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2f1e14e5d..9364d43bd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -799,10 +799,17 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu { char *myipaddr=0; long filesize,n; int32_t 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(); { - int32_t sock; + int32_t sock,timeout,val; printf("call nn_socket\n"); sock = nn_socket(AF_SP,NN_PUSH); printf("nn_socket(NN_PUSH) %d\n",sock); + if ( nn_connect(sock,pushaddr) >= 0 ) + { + timeout = 1; + printf("call setsockopt\n"); + val = nn_setsockopt(sock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); + printf("nn_setsockopt val.%d\n",val); + } else printf("nn_connect error\n"); } LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) From c759b5cc16fb886d13899777b7d02e9fed62a266 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:50:31 +0300 Subject: [PATCH 1485/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9364d43bd..a64f4478e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -803,7 +803,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("call nn_socket\n"); sock = nn_socket(AF_SP,NN_PUSH); printf("nn_socket(NN_PUSH) %d\n",sock); - if ( nn_connect(sock,pushaddr) >= 0 ) + if ( nn_connect(sock,"tcp://5.9.253.199:7784") >= 0 ) { timeout = 1; printf("call setsockopt\n"); From 37c75e7f86977d5095ccc1fb3c4a25deb76dab30 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:57:21 +0300 Subject: [PATCH 1486/2732] Test --- iguana/exchanges/m_js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index fb99a2126..fff063e89 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,4 +1,7 @@ cd .. -echo building... -emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread +source ../crypto777/crypto777.sources +echo building... $(CRYPTO777_SRCS) + +#emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread +#emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm From c57e0ede2fc10802691b31cde4c8b56b8d7dba54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 14:59:15 +0300 Subject: [PATCH 1487/2732] Test --- crypto777/crypto777.sources | 46 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/crypto777/crypto777.sources b/crypto777/crypto777.sources index 7c30d39d4..a539f95e7 100755 --- a/crypto777/crypto777.sources +++ b/crypto777/crypto777.sources @@ -1,46 +1,46 @@ -NANOSRC = ../crypto777/nanosrc +export NANOSRC = ../crypto777/nanosrc -NANOMSG_CORE = $(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c +export NANOMSG_CORE = $(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c -NANOMSG_DEVICES = $(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c +export NANOMSG_DEVICES = $(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c -NANOMSG_AIO = $(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c +export NANOMSG_AIO = $(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c -NANOMSG_UTILS = $(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c +export NANOMSG_UTILS = $(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c -PROTOCOLS_UTILS = $(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c +export PROTOCOLS_UTILS = $(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c -PROTOCOLS_BUS = $(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c +export PROTOCOLS_BUS = $(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c -PROTOCOLS_PIPELINE = $(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c +export PROTOCOLS_PIPELINE = $(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c -PROTOCOLS_PUBSUB = $(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c +export PROTOCOLS_PUBSUB = $(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c -PROTOCOLS_PAIR = $(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c +export PROTOCOLS_PAIR = $(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c -PROTOCOLS_REQREP = $(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c +export PROTOCOLS_REQREP = $(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c -PROTOCOLS_SURVEY = $(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c +export PROTOCOLS_SURVEY = $(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c -TRANSPORTS_UTILS = $(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c +export TRANSPORTS_UTILS = $(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c -TRANSPORTS_IPC = $(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c +export TRANSPORTS_IPC = $(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c -TRANSPORTS_TCP = $(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c +export TRANSPORTS_TCP = $(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c -TRANSPORTS_INPROC = $(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c +export TRANSPORTS_INPROC = $(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c -TRANSPORTS_WS = $(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c +export TRANSPORTS_WS = $(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c -TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c +export TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c -NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) +export NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) -NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) +export NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) -NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) +export NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) -JPEG_SRCS := ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c +export JPEG_SRCS := ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c -CRYPTO777_SRCS := ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) +export CRYPTO777_SRCS := ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) From c89c0f5a8db8514f7636cef734b2b2a13652b378 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:02:03 +0300 Subject: [PATCH 1488/2732] Test --- crypto777/crypto777.sources | 46 +++++++++++++++++------------------ iguana/exchanges/m_js | 48 ++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/crypto777/crypto777.sources b/crypto777/crypto777.sources index a539f95e7..7c30d39d4 100755 --- a/crypto777/crypto777.sources +++ b/crypto777/crypto777.sources @@ -1,46 +1,46 @@ -export NANOSRC = ../crypto777/nanosrc +NANOSRC = ../crypto777/nanosrc -export NANOMSG_CORE = $(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c +NANOMSG_CORE = $(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c -export NANOMSG_DEVICES = $(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c +NANOMSG_DEVICES = $(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c -export NANOMSG_AIO = $(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c +NANOMSG_AIO = $(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c -export NANOMSG_UTILS = $(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c +NANOMSG_UTILS = $(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c -export PROTOCOLS_UTILS = $(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c +PROTOCOLS_UTILS = $(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c -export PROTOCOLS_BUS = $(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c +PROTOCOLS_BUS = $(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c -export PROTOCOLS_PIPELINE = $(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c +PROTOCOLS_PIPELINE = $(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c -export PROTOCOLS_PUBSUB = $(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c +PROTOCOLS_PUBSUB = $(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c -export PROTOCOLS_PAIR = $(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c +PROTOCOLS_PAIR = $(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c -export PROTOCOLS_REQREP = $(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c +PROTOCOLS_REQREP = $(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c -export PROTOCOLS_SURVEY = $(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c +PROTOCOLS_SURVEY = $(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c -export TRANSPORTS_UTILS = $(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c +TRANSPORTS_UTILS = $(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c -export TRANSPORTS_IPC = $(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c +TRANSPORTS_IPC = $(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c -export TRANSPORTS_TCP = $(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c +TRANSPORTS_TCP = $(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c -export TRANSPORTS_INPROC = $(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c +TRANSPORTS_INPROC = $(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c -export TRANSPORTS_WS = $(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c +TRANSPORTS_WS = $(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c -export TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c +TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c -export NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) +NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) -export NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) +NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) -export NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) +NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) -export JPEG_SRCS := ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c +JPEG_SRCS := ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c -export CRYPTO777_SRCS := ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) +CRYPTO777_SRCS := ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index fff063e89..1b42bfe3c 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,5 +1,51 @@ +#!/bin/sh cd .. -source ../crypto777/crypto777.sources +NANOSRC = ../crypto777/nanosrc + +NANOMSG_CORE = $(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c + +NANOMSG_DEVICES = $(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c + +NANOMSG_AIO = $(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c + +NANOMSG_UTILS = $(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c + +PROTOCOLS_UTILS = $(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c + +PROTOCOLS_BUS = $(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c + +PROTOCOLS_PIPELINE = $(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c + +PROTOCOLS_PUBSUB = $(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c + +PROTOCOLS_PAIR = $(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c + +PROTOCOLS_REQREP = $(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c + +PROTOCOLS_SURVEY = $(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c + +TRANSPORTS_UTILS = $(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c + +TRANSPORTS_IPC = $(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c + +TRANSPORTS_TCP = $(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c + +TRANSPORTS_INPROC = $(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c + +TRANSPORTS_WS = $(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c + +TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c + +NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) + +NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) + +NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) + +JPEG_SRCS = ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c + +CRYPTO777_SRCS = ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) + echo building... $(CRYPTO777_SRCS) #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread From 3c194d7de3da264eb66f7c960bb346318662ed45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:03:56 +0300 Subject: [PATCH 1489/2732] Test --- iguana/exchanges/m_js | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 1b42bfe3c..8deb66e8f 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,50 +1,50 @@ #!/bin/sh cd .. -NANOSRC = ../crypto777/nanosrc +NANOSRC=../crypto777/nanosrc -NANOMSG_CORE = $(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c +NANOMSG_CORE=$(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c -NANOMSG_DEVICES = $(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c +NANOMSG_DEVICES=$(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c -NANOMSG_AIO = $(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c +NANOMSG_AIO=$(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c -NANOMSG_UTILS = $(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c +NANOMSG_UTILS=$(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c -PROTOCOLS_UTILS = $(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c +PROTOCOLS_UTILS=$(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c -PROTOCOLS_BUS = $(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c +PROTOCOLS_BUS=$(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c -PROTOCOLS_PIPELINE = $(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c +PROTOCOLS_PIPELINE=$(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c -PROTOCOLS_PUBSUB = $(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c +PROTOCOLS_PUBSUB=$(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c -PROTOCOLS_PAIR = $(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c +PROTOCOLS_PAIR=$(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c -PROTOCOLS_REQREP = $(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c +PROTOCOLS_REQREP=$(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c -PROTOCOLS_SURVEY = $(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c +PROTOCOLS_SURVEY=$(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c -TRANSPORTS_UTILS = $(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c +TRANSPORTS_UTILS=$(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c -TRANSPORTS_IPC = $(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c +TRANSPORTS_IPC=$(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c -TRANSPORTS_TCP = $(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c +TRANSPORTS_TCP=$(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c -TRANSPORTS_INPROC = $(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c +TRANSPORTS_INPROC=$(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c -TRANSPORTS_WS = $(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c +TRANSPORTS_WS=$(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c -TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c +TRANSPORTS_TCPMUX=$(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c -NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) +NANOMSG_PROTOCOLS=$(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) -NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) +NANOMSG_TRANSPORTS= $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) -NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) +NANOMSG=$(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) -JPEG_SRCS = ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c +JPEG_SRCS=../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c -CRYPTO777_SRCS = ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) +CRYPTO777_SRCS=../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) echo building... $(CRYPTO777_SRCS) From f04ec00f9fbcbfdf4a6bed528aec960233784d63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:09:29 +0300 Subject: [PATCH 1490/2732] Test --- crypto777/crypto777.sources | 4 +-- iguana/exchanges/Makefile | 9 +++++++ iguana/exchanges/m_js | 51 +------------------------------------ 3 files changed, 12 insertions(+), 52 deletions(-) create mode 100644 iguana/exchanges/Makefile diff --git a/crypto777/crypto777.sources b/crypto777/crypto777.sources index 7c30d39d4..f7bcd6bcc 100755 --- a/crypto777/crypto777.sources +++ b/crypto777/crypto777.sources @@ -40,7 +40,7 @@ NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $( NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) -JPEG_SRCS := ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c +JPEG_SRCS = ../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c -CRYPTO777_SRCS := ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) +CRYPTO777_SRCS = ../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile new file mode 100644 index 000000000..0b70a94bf --- /dev/null +++ b/iguana/exchanges/Makefile @@ -0,0 +1,9 @@ +#cd .. +#emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread + +include ../crypto777/crypto777.sources + +all: + echo building... $(CRYPTO777_SRCS) + emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm + diff --git a/iguana/exchanges/m_js b/iguana/exchanges/m_js index 8deb66e8f..37e18a0c5 100755 --- a/iguana/exchanges/m_js +++ b/iguana/exchanges/m_js @@ -1,53 +1,4 @@ #!/bin/sh cd .. -NANOSRC=../crypto777/nanosrc - -NANOMSG_CORE=$(NANOSRC)/core/global.c $(NANOSRC)/core/ep.c $(NANOSRC)/core/epbase.c $(NANOSRC)/core/pipe.c $(NANOSRC)/core/poll.c $(NANOSRC)/core/sock.c $(NANOSRC)/core/sockbase.c $(NANOSRC)/core/symbol.c - -NANOMSG_DEVICES=$(NANOSRC)/devices/device.c $(NANOSRC)/devices/tcpmuxd.c - -NANOMSG_AIO=$(NANOSRC)/aio/ctx.c $(NANOSRC)/aio/fsm.c $(NANOSRC)/aio/poller.c $(NANOSRC)/aio/pool.c $(NANOSRC)/aio/timer.c $(NANOSRC)/aio/usock.c $(NANOSRC)/aio/timerset.c $(NANOSRC)/aio/worker.c - -NANOMSG_UTILS=$(NANOSRC)/utils/alloc.c $(NANOSRC)/utils/atomic.c $(NANOSRC)/utils/chunk.c $(NANOSRC)/utils/chunkref.c $(NANOSRC)/utils/clock.c $(NANOSRC)/utils/closefd.c $(NANOSRC)/utils/efd.c $(NANOSRC)/utils/err.c $(NANOSRC)/utils/glock.c $(NANOSRC)/utils/hash.c $(NANOSRC)/utils/list.c $(NANOSRC)/utils/msg.c $(NANOSRC)/utils/mutex.c $(NANOSRC)/utils/queue.c $(NANOSRC)/utils/random.c $(NANOSRC)/utils/sem.c $(NANOSRC)/utils/sleep.c $(NANOSRC)/utils/stopwatch.c $(NANOSRC)/utils/thread.c $(NANOSRC)/utils/wire.c - -PROTOCOLS_UTILS=$(NANOSRC)/protocols/utils/dist.c $(NANOSRC)/protocols/utils/excl.c $(NANOSRC)/protocols/utils/fq.c $(NANOSRC)/protocols/utils/lb.c $(NANOSRC)/protocols/utils/priolist.c - -PROTOCOLS_BUS=$(NANOSRC)/protocols/bus/bus.c $(NANOSRC)/protocols/bus/xbus.c - -PROTOCOLS_PIPELINE=$(NANOSRC)/protocols/pipeline/push.c $(NANOSRC)/protocols/pipeline/pull.c $(NANOSRC)/protocols/pipeline/xpull.c $(NANOSRC)/protocols/pipeline/xpush.c - -PROTOCOLS_PUBSUB=$(NANOSRC)/protocols/pubsub/pub.c $(NANOSRC)/protocols/pubsub/sub.c $(NANOSRC)/protocols/pubsub/trie.c $(NANOSRC)/protocols/pubsub/xpub.c $(NANOSRC)/protocols/pubsub/xsub.c - -PROTOCOLS_PAIR=$(NANOSRC)/protocols/pair/pair.c $(NANOSRC)/protocols/pair/xpair.c - -PROTOCOLS_REQREP=$(NANOSRC)/protocols/reqrep/req.c $(NANOSRC)/protocols/reqrep/rep.c $(NANOSRC)/protocols/reqrep/task.c $(NANOSRC)/protocols/reqrep/xrep.c $(NANOSRC)/protocols/reqrep/xreq.c - -PROTOCOLS_SURVEY=$(NANOSRC)/protocols/survey/respondent.c $(NANOSRC)/protocols/survey/surveyor.c $(NANOSRC)/protocols/survey/xrespondent.c $(NANOSRC)/protocols/survey/xsurveyor.c - -TRANSPORTS_UTILS=$(NANOSRC)/transports/utils/backoff.c $(NANOSRC)/transports/utils/dns.c $(NANOSRC)/transports/utils/iface.c $(NANOSRC)/transports/utils/literal.c $(NANOSRC)/transports/utils/port.c $(NANOSRC)/transports/utils/streamhdr.c $(NANOSRC)/transports/utils/base64.c - -TRANSPORTS_IPC=$(NANOSRC)/transports/ipc/aipc.c $(NANOSRC)/transports/ipc/bipc.c $(NANOSRC)/transports/ipc/cipc.c $(NANOSRC)/transports/ipc/ipc.c $(NANOSRC)/transports/ipc/sipc.c - -TRANSPORTS_TCP=$(NANOSRC)/transports/tcp/atcp.c $(NANOSRC)/transports/tcp/btcp.c $(NANOSRC)/transports/tcp/ctcp.c $(NANOSRC)/transports/tcp/stcp.c $(NANOSRC)/transports/tcp/tcp.c - -TRANSPORTS_INPROC=$(NANOSRC)/transports/inproc/binproc.c $(NANOSRC)/transports/inproc/cinproc.c $(NANOSRC)/transports/inproc/inproc.c $(NANOSRC)/transports/inproc/ins.c $(NANOSRC)/transports/inproc/msgqueue.c $(NANOSRC)/transports/inproc/sinproc.c - -TRANSPORTS_WS=$(NANOSRC)/transports/ws/aws.c $(NANOSRC)/transports/ws/bws.c $(NANOSRC)/transports/ws/cws.c $(NANOSRC)/transports/ws/sws.c $(NANOSRC)/transports/ws/ws.c $(NANOSRC)/transports/ws/ws_handshake.c $(NANOSRC)/transports/ws/sha1.c - -TRANSPORTS_TCPMUX=$(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports/tcpmux/btcpmux.c $(NANOSRC)/transports/tcpmux/ctcpmux.c $(NANOSRC)/transports/tcpmux/stcpmux.c $(NANOSRC)/transports/tcpmux/tcpmux.c - -NANOMSG_PROTOCOLS=$(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) - -NANOMSG_TRANSPORTS= $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) - -NANOMSG=$(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) - -JPEG_SRCS=../crypto777/jpeg/jaricom.c ../crypto777/jpeg/jcapimin.c ../crypto777/jpeg/jcapistd.c ../crypto777/jpeg/jcarith.c ../crypto777/jpeg/jccoefct.c ../crypto777/jpeg/jccolor.c ../crypto777/jpeg/jcdctmgr.c ../crypto777/jpeg/jchuff.c ../crypto777/jpeg/jcinit.c ../crypto777/jpeg/jcmainct.c ../crypto777/jpeg/jcmarker.c ../crypto777/jpeg/jcmaster.c ../crypto777/jpeg/jcomapi.c ../crypto777/jpeg/jcparam.c ../crypto777/jpeg/jcprepct.c ../crypto777/jpeg/jcsample.c ../crypto777/jpeg/jctrans.c ../crypto777/jpeg/jdapimin.c ../crypto777/jpeg/jdapistd.c ../crypto777/jpeg/jdarith.c ../crypto777/jpeg/jdatadst.c ../crypto777/jpeg/jdatasrc.c ../crypto777/jpeg/jdcoefct.c ../crypto777/jpeg/jdcolor.c ../crypto777/jpeg/jddctmgr.c ../crypto777/jpeg/jdhuff.c ../crypto777/jpeg/jdinput.c ../crypto777/jpeg/jdmainct.c ../crypto777/jpeg/jdmarker.c ../crypto777/jpeg/jdmaster.c ../crypto777/jpeg/jdmerge.c ../crypto777/jpeg/jdpostct.c ../crypto777/jpeg/jdsample.c ../crypto777/jpeg/jdtrans.c ../crypto777/jpeg/jerror.c ../crypto777/jpeg/jfdctflt.c ../crypto777/jpeg/jfdctfst.c ../crypto777/jpeg/jfdctint.c ../crypto777/jpeg/jidctflt.c ../crypto777/jpeg/jidctfst.c ../crypto777/jpeg/jidctint.c ../crypto777/jpeg/jquant1.c ../crypto777/jpeg/jquant2.c ../crypto777/jpeg/jutils.c ../crypto777/jpeg/misc/jmemnobs.c ../crypto777/jpeg/jmemmgr.c - -CRYPTO777_SRCS=../crypto777/tweetnacl.c ../crypto777/scrypt.c ../crypto777/bitcoind_RPC.c ../crypto777/cJSON.c ../crypto777/iguana_utils.c ../crypto777/OS_nonportable.c ../crypto777/curve25519-donna.c ../crypto777/inet.c ../crypto777/OS_portable.c ../crypto777/curve25519.c ../crypto777/OS_time.c ../crypto777/hmac_sha512.c ../crypto777/ramcoder.c ../crypto777/SaM.c ../crypto777/iguana_OS.c ../crypto777/iguana_serdes.c $(JPEG_SRCS) $(NANOMSG) - -echo building... $(CRYPTO777_SRCS) - -#emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread -#emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm +make -f exchanges/Makefile From 471f732cf747713927c96ee33068d4b7f9d22ae5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:10:47 +0300 Subject: [PATCH 1491/2732] Test --- crypto777/nanosrc/nn.h | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto777/nanosrc/nn.h b/crypto777/nanosrc/nn.h index 3d6e7c598..0127338f3 100755 --- a/crypto777/nanosrc/nn.h +++ b/crypto777/nanosrc/nn.h @@ -30,6 +30,7 @@ extern "C" { #include #include +#include #include "nn_config.h" /* Handle DSO symbol visibility */ From b917c0a3fdccfcc412ca82d8cc5967dfe0e60168 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:13:10 +0300 Subject: [PATCH 1492/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 0b70a94bf..6d629ce54 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -5,5 +5,5 @@ include ../crypto777/crypto777.sources all: echo building... $(CRYPTO777_SRCS) - emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm From ceb6df9d3103a8e4f2ca0f2ea034e4dd605c4fbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:14:24 +0300 Subject: [PATCH 1493/2732] Test --- crypto777/nanosrc/nn_config.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index d9e9c6468..f25bb74f7 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -50,9 +50,12 @@ #ifdef __PNACL //#define FD_CLOEXEC 1 -void PNACL_message(const char* format, ...); -#include -#include +#define PNACL_message printf +//void PNACL_message(const char* format, ...); +#include +#include +//#include +//#include #else #if !defined(WIN32) //#define NN_ENABLE_EXTRA 1 From d62e8e2ba6f5eeef95da8e5cbc4a07829912ec9c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:19:04 +0300 Subject: [PATCH 1494/2732] Test --- crypto777/nanosrc/aio/usock_posix.c_dev | 8 ++++---- crypto777/nanosrc/aio/usock_posix.h | 6 +++--- crypto777/nanosrc/devices/tcpmuxd.c | 10 +++++----- crypto777/nanosrc/transports/ipc/bipc.c | 8 ++++---- crypto777/nanosrc/transports/ipc/cipc.c | 10 +++++----- crypto777/nanosrc/transports/ipc/ipc.c | 8 ++++---- crypto777/nanosrc/transports/tcpmux/btcpmux.c | 8 ++++---- crypto777/nanosrc/transports/utils/tcpmux.c | 8 ++++---- iguana/exchanges/stats.c | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c_dev b/crypto777/nanosrc/aio/usock_posix.c_dev index 954b3045f..1d000ee3b 100755 --- a/crypto777/nanosrc/aio/usock_posix.c_dev +++ b/crypto777/nanosrc/aio/usock_posix.c_dev @@ -31,11 +31,11 @@ #include #include #include -#ifndef __PNACL +//#ifndef __PNACL #include -#else -#include -#endif +//#else +//#include +//#endif #define NN_USOCK_STATE_IDLE 1 #define NN_USOCK_STATE_STARTING 2 diff --git a/crypto777/nanosrc/aio/usock_posix.h b/crypto777/nanosrc/aio/usock_posix.h index 4a189a2bb..de3095f20 100755 --- a/crypto777/nanosrc/aio/usock_posix.h +++ b/crypto777/nanosrc/aio/usock_posix.h @@ -25,10 +25,10 @@ #include #include -#ifndef __PNACL +//#ifndef __PNACL #include -#else -#include +//#else +//#include #endif struct nn_usock { diff --git a/crypto777/nanosrc/devices/tcpmuxd.c b/crypto777/nanosrc/devices/tcpmuxd.c index c95c2a899..aea9c5139 100755 --- a/crypto777/nanosrc/devices/tcpmuxd.c +++ b/crypto777/nanosrc/devices/tcpmuxd.c @@ -53,12 +53,12 @@ int nn_tcpmuxd (int port) #include #include #include -#ifndef __PNACL +//#ifndef __PNACL #include -#else -#include -#include -#endif +//#else +//#include +//#include +//#endif #include #include #include diff --git a/crypto777/nanosrc/transports/ipc/bipc.c b/crypto777/nanosrc/transports/ipc/bipc.c index 76a6f9256..6dac6eae1 100755 --- a/crypto777/nanosrc/transports/ipc/bipc.c +++ b/crypto777/nanosrc/transports/ipc/bipc.c @@ -39,12 +39,12 @@ #include "../../utils/win.h" #else #include -#ifndef __PNACL +//#ifndef __PNACL #include #include -#else -#include -#endif +//#else +//#include +//#endif #include #endif diff --git a/crypto777/nanosrc/transports/ipc/cipc.c b/crypto777/nanosrc/transports/ipc/cipc.c index 56dcbc83d..95dbea034 100755 --- a/crypto777/nanosrc/transports/ipc/cipc.c +++ b/crypto777/nanosrc/transports/ipc/cipc.c @@ -39,13 +39,13 @@ #include "../../utils/win.h" #else #include -#ifndef __PNACL +//#ifndef __PNACL #include #include -#else -#include -#include -#endif +//#else +//#include +//#include +//#endif #endif #define NN_CIPC_STATE_IDLE 1 diff --git a/crypto777/nanosrc/transports/ipc/ipc.c b/crypto777/nanosrc/transports/ipc/ipc.c index 1421ec276..444db69fb 100755 --- a/crypto777/nanosrc/transports/ipc/ipc.c +++ b/crypto777/nanosrc/transports/ipc/ipc.c @@ -37,11 +37,11 @@ #include "../../utils/win.h" #else #include -#ifndef __PNACL +//#ifndef __PNACL #include -#else -#include -#endif +//#else +//#include +//#endif #include #endif diff --git a/crypto777/nanosrc/transports/tcpmux/btcpmux.c b/crypto777/nanosrc/transports/tcpmux/btcpmux.c index 51fd16a64..8093b611b 100755 --- a/crypto777/nanosrc/transports/tcpmux/btcpmux.c +++ b/crypto777/nanosrc/transports/tcpmux/btcpmux.c @@ -44,12 +44,12 @@ #include "../../utils/win.h" #else #include -#ifndef __PNACL +//#ifndef __PNACL #include #include -#else -#include -#endif +//#else +//#include +//#endif #include #endif diff --git a/crypto777/nanosrc/transports/utils/tcpmux.c b/crypto777/nanosrc/transports/utils/tcpmux.c index b4f7f0105..1b8b03942 100755 --- a/crypto777/nanosrc/transports/utils/tcpmux.c +++ b/crypto777/nanosrc/transports/utils/tcpmux.c @@ -28,11 +28,11 @@ #else #include #include -#ifndef __PNACL +//#ifndef __PNACL #include -#else -#include -#endif +//#else +//#include +//#endif #endif #include "tcpmux.h" diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 83f837c54..4a0ef48ec 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -328,7 +328,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po j = i = 0; filetype[0] = 0; //printf("url.(%s) method.(%s)\n",&url[i],urlmethod); -#ifdef __PNACL__ +#ifdef __PNACL snprintf(furl,sizeof(furl),"%s/%s",GLOBAL_DBDIR,url+1); #else snprintf(furl,sizeof(furl),"%s",url+1); From 92b1db4fe112b7b374d059fcaf1fafe4ece69a1a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:19:47 +0300 Subject: [PATCH 1495/2732] Test --- iguana/exchanges/stats.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 4a0ef48ec..3a76f3e48 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -328,11 +328,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po j = i = 0; filetype[0] = 0; //printf("url.(%s) method.(%s)\n",&url[i],urlmethod); -#ifdef __PNACL - snprintf(furl,sizeof(furl),"%s/%s",GLOBAL_DBDIR,url+1); -#else snprintf(furl,sizeof(furl),"%s",url+1); -#endif if ( strcmp(&url[i],"/") == 0 && strcmp(urlmethod,"GET") == 0 ) { *jsonflagp = 1; From 98bb859eed9f61934f2782d80cddece4ca5fa735 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:22:22 +0300 Subject: [PATCH 1496/2732] Test --- crypto777/nanosrc/aio/usock_posix.h | 4 ---- crypto777/nanosrc/devices/tcpmuxd.c | 5 ----- crypto777/nanosrc/nn_config.h | 11 ----------- crypto777/nanosrc/tests/testutil.h | 6 +++--- crypto777/nanosrc/transports/ipc/bipc.c | 4 ---- crypto777/nanosrc/transports/ipc/cipc.c | 5 ----- crypto777/nanosrc/transports/ipc/ipc.c | 4 ---- crypto777/nanosrc/transports/tcpmux/btcpmux.c | 4 ---- crypto777/nanosrc/transports/utils/tcpmux.c | 4 ---- 9 files changed, 3 insertions(+), 44 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.h b/crypto777/nanosrc/aio/usock_posix.h index de3095f20..9286dcf24 100755 --- a/crypto777/nanosrc/aio/usock_posix.h +++ b/crypto777/nanosrc/aio/usock_posix.h @@ -25,11 +25,7 @@ #include #include -//#ifndef __PNACL #include -//#else -//#include -#endif struct nn_usock { diff --git a/crypto777/nanosrc/devices/tcpmuxd.c b/crypto777/nanosrc/devices/tcpmuxd.c index aea9c5139..ba2ba3a23 100755 --- a/crypto777/nanosrc/devices/tcpmuxd.c +++ b/crypto777/nanosrc/devices/tcpmuxd.c @@ -53,12 +53,7 @@ int nn_tcpmuxd (int port) #include #include #include -//#ifndef __PNACL #include -//#else -//#include -//#include -//#endif #include #include #include diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index f25bb74f7..52c9107c4 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -47,23 +47,12 @@ #define NN_HAVE_MSG_CONTROL 0 //#define STANDALONE 1 -#ifdef __PNACL -//#define FD_CLOEXEC 1 - -#define PNACL_message printf -//void PNACL_message(const char* format, ...); -#include -#include -//#include -//#include -#else #if !defined(WIN32) //#define NN_ENABLE_EXTRA 1 #define PNACL_message printf #include #include #endif -#endif /* Size of the buffer used for batch-reads of inbound data. To keep the performance optimal make sure that this value is larger than network MTU. */ diff --git a/crypto777/nanosrc/tests/testutil.h b/crypto777/nanosrc/tests/testutil.h index fd3d5b68c..04d26edbb 100755 --- a/crypto777/nanosrc/tests/testutil.h +++ b/crypto777/nanosrc/tests/testutil.h @@ -26,9 +26,9 @@ #include #include -#ifdef __PNACL -#define printf PostMessage -#endif +//#ifdef __PNACL +//#define printf PostMessage +//#endif #include "../utils/attr.h" #include "../utils/err.h" diff --git a/crypto777/nanosrc/transports/ipc/bipc.c b/crypto777/nanosrc/transports/ipc/bipc.c index 6dac6eae1..8527e45a6 100755 --- a/crypto777/nanosrc/transports/ipc/bipc.c +++ b/crypto777/nanosrc/transports/ipc/bipc.c @@ -39,12 +39,8 @@ #include "../../utils/win.h" #else #include -//#ifndef __PNACL #include #include -//#else -//#include -//#endif #include #endif diff --git a/crypto777/nanosrc/transports/ipc/cipc.c b/crypto777/nanosrc/transports/ipc/cipc.c index 95dbea034..1f6c3b7de 100755 --- a/crypto777/nanosrc/transports/ipc/cipc.c +++ b/crypto777/nanosrc/transports/ipc/cipc.c @@ -39,13 +39,8 @@ #include "../../utils/win.h" #else #include -//#ifndef __PNACL #include #include -//#else -//#include -//#include -//#endif #endif #define NN_CIPC_STATE_IDLE 1 diff --git a/crypto777/nanosrc/transports/ipc/ipc.c b/crypto777/nanosrc/transports/ipc/ipc.c index 444db69fb..45d3851ce 100755 --- a/crypto777/nanosrc/transports/ipc/ipc.c +++ b/crypto777/nanosrc/transports/ipc/ipc.c @@ -37,11 +37,7 @@ #include "../../utils/win.h" #else #include -//#ifndef __PNACL #include -//#else -//#include -//#endif #include #endif diff --git a/crypto777/nanosrc/transports/tcpmux/btcpmux.c b/crypto777/nanosrc/transports/tcpmux/btcpmux.c index 8093b611b..2dd554272 100755 --- a/crypto777/nanosrc/transports/tcpmux/btcpmux.c +++ b/crypto777/nanosrc/transports/tcpmux/btcpmux.c @@ -44,12 +44,8 @@ #include "../../utils/win.h" #else #include -//#ifndef __PNACL #include #include -//#else -//#include -//#endif #include #endif diff --git a/crypto777/nanosrc/transports/utils/tcpmux.c b/crypto777/nanosrc/transports/utils/tcpmux.c index 1b8b03942..b6cd7c24b 100755 --- a/crypto777/nanosrc/transports/utils/tcpmux.c +++ b/crypto777/nanosrc/transports/utils/tcpmux.c @@ -28,11 +28,7 @@ #else #include #include -//#ifndef __PNACL #include -//#else -//#include -//#endif #endif #include "tcpmux.h" From 8dc560162f832f06eda5172e29693b9067ef81da Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:24:44 +0300 Subject: [PATCH 1497/2732] Test --- crypto777/nanosrc/nn_config.h | 2 +- crypto777/nanosrc/utils/err.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 52c9107c4..6326a0f72 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -46,10 +46,10 @@ #define NN_HAVE_MSG_CONTROL 0 //#define STANDALONE 1 +#define PNACL_message printf #if !defined(WIN32) //#define NN_ENABLE_EXTRA 1 -#define PNACL_message printf #include #include #endif diff --git a/crypto777/nanosrc/utils/err.h b/crypto777/nanosrc/utils/err.h index a9485549e..e57e57c02 100755 --- a/crypto777/nanosrc/utils/err.h +++ b/crypto777/nanosrc/utils/err.h @@ -26,6 +26,7 @@ #include #include #include +#define PNACL_message printf /* Include nn.h header to define nanomsg-specific error codes. */ #include "../nn.h" From 10c7c8f6ea31513a5c5f4ecef6f353580aa86ebb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:27:38 +0300 Subject: [PATCH 1498/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a64f4478e..25354a4c6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1061,6 +1061,11 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * return(retstr); } +void PNACL_message(...) +{ + +} + #endif From 3d380c646a7fb090ef588960e21a139751d780dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:28:21 +0300 Subject: [PATCH 1499/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 25354a4c6..7d41836f6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1061,7 +1061,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * return(retstr); } -void PNACL_message(...) +void PNACL_message(char *fmt,...) { } From 3829b2f5580f24cf94aabdf4ba2d7f651caafcdf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:33:01 +0300 Subject: [PATCH 1500/2732] Test --- crypto777/nanosrc/aio/worker_posix.c | 1 - crypto777/nanosrc/utils/efd_eventfd.c | 4 ++-- crypto777/nanosrc/utils/efd_socketpair.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto777/nanosrc/aio/worker_posix.c b/crypto777/nanosrc/aio/worker_posix.c index 070a87a86..73dd81955 100755 --- a/crypto777/nanosrc/aio/worker_posix.c +++ b/crypto777/nanosrc/aio/worker_posix.c @@ -103,7 +103,6 @@ int nn_worker_init(struct nn_worker *self) { int32_t rc; PNACL_message("nn_worker_init %p\n",self); - //sleep(1); rc = nn_efd_init(&self->efd); PNACL_message("efd init: rc.%d\n",rc); if ( rc < 0 ) diff --git a/crypto777/nanosrc/utils/efd_eventfd.c b/crypto777/nanosrc/utils/efd_eventfd.c index ae3449c15..f659296e7 100755 --- a/crypto777/nanosrc/utils/efd_eventfd.c +++ b/crypto777/nanosrc/utils/efd_eventfd.c @@ -32,9 +32,9 @@ int nn_efd_init(struct nn_efd *self) { int rc; int flags; - //PostMessage("inside efd_init eventfd\n"); + PNACL_msg("inside efd_init eventfd\n"); self->efd = eventfd(0, EFD_CLOEXEC); - //PostMessage("self->efd: %d\n",self->efd); + PNACL_msg("self->efd: %d\n",self->efd); if (self->efd == -1 && (errno == EMFILE || errno == ENFILE)) return -EMFILE; errno_assert(self->efd != -1); diff --git a/crypto777/nanosrc/utils/efd_socketpair.c b/crypto777/nanosrc/utils/efd_socketpair.c index aba164fa7..e04a4935e 100755 --- a/crypto777/nanosrc/utils/efd_socketpair.c +++ b/crypto777/nanosrc/utils/efd_socketpair.c @@ -35,7 +35,7 @@ int nn_efd_init (struct nn_efd *self) int rc; int flags; int sp [2]; - + PNACL_msg("socketpair efdinit\n"); #if defined SOCK_CLOEXEC rc = socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sp); #else From 83c73c3fbe9fb499f637656743cdbf77a3648a68 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:33:54 +0300 Subject: [PATCH 1501/2732] Test --- crypto777/nanosrc/utils/efd_eventfd.c | 4 ++-- crypto777/nanosrc/utils/efd_socketpair.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto777/nanosrc/utils/efd_eventfd.c b/crypto777/nanosrc/utils/efd_eventfd.c index f659296e7..abbb904f1 100755 --- a/crypto777/nanosrc/utils/efd_eventfd.c +++ b/crypto777/nanosrc/utils/efd_eventfd.c @@ -32,9 +32,9 @@ int nn_efd_init(struct nn_efd *self) { int rc; int flags; - PNACL_msg("inside efd_init eventfd\n"); + PNACL_message("inside efd_init eventfd\n"); self->efd = eventfd(0, EFD_CLOEXEC); - PNACL_msg("self->efd: %d\n",self->efd); + PNACL_message("self->efd: %d\n",self->efd); if (self->efd == -1 && (errno == EMFILE || errno == ENFILE)) return -EMFILE; errno_assert(self->efd != -1); diff --git a/crypto777/nanosrc/utils/efd_socketpair.c b/crypto777/nanosrc/utils/efd_socketpair.c index e04a4935e..6221aef4c 100755 --- a/crypto777/nanosrc/utils/efd_socketpair.c +++ b/crypto777/nanosrc/utils/efd_socketpair.c @@ -35,7 +35,7 @@ int nn_efd_init (struct nn_efd *self) int rc; int flags; int sp [2]; - PNACL_msg("socketpair efdinit\n"); + PNACL_message("socketpair efdinit\n"); #if defined SOCK_CLOEXEC rc = socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sp); #else From a3b000cbfb87fcf59e963280cde29fd34e42658e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:35:50 +0300 Subject: [PATCH 1502/2732] Test --- crypto777/nanosrc/nn_config.h | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 6326a0f72..f8646becb 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -31,9 +31,9 @@ #define NN_HAVE_SEMAPHORE 1 // must have // need one of following 3, listed in order of precedence, used by efd* -//#define NN_HAVE_EVENTFD 1 +#define NN_HAVE_EVENTFD 1 //#define NN_HAVE_PIPE 1 -#define NN_HAVE_SOCKETPAIR 1 +//#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* #define NN_USE_POLL 1 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7d41836f6..0da118036 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1063,7 +1063,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * void PNACL_message(char *fmt,...) { - + printf(fmt); } #endif diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 6d629ce54..a7b10c035 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -4,6 +4,6 @@ include ../crypto777/crypto777.sources all: - echo building... $(CRYPTO777_SRCS) + #echo building... $(CRYPTO777_SRCS) emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm From 879f4a0669b61efa56a6d8f69455494f424d2bd9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:36:42 +0300 Subject: [PATCH 1503/2732] Test --- crypto777/nanosrc/nn_config.h | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index f8646becb..4b085c748 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -31,8 +31,8 @@ #define NN_HAVE_SEMAPHORE 1 // must have // need one of following 3, listed in order of precedence, used by efd* -#define NN_HAVE_EVENTFD 1 -//#define NN_HAVE_PIPE 1 +//#define NN_HAVE_EVENTFD 1 +#define NN_HAVE_PIPE 1 //#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0da118036..293cd6a49 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1063,7 +1063,6 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * void PNACL_message(char *fmt,...) { - printf(fmt); } #endif From b12fcd8967305561c41c788d5d19b44c6af2bf63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:46:37 +0300 Subject: [PATCH 1504/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 4 +++- crypto777/nanosrc/aio/usock_win.c | 2 +- crypto777/nanosrc/aio/worker_posix.c | 22 +++++++++++----------- crypto777/nanosrc/core/global.c | 8 ++++---- iguana/exchanges/mm.c | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index 44a8acb65..f58345031 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -286,11 +286,13 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* Allow re-using the address. */ opt = 1; + printf("call setsockopt in nn_usock_bind\n"); rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); + printf("called setsockopt in nn_usock_bind returns %d\n",rc); errno_assert (rc == 0); rc = bind (self->s, addr, (socklen_t) addrlen); - //printf("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); + printf("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); if (nn_slow (rc != 0)) return -errno; diff --git a/crypto777/nanosrc/aio/usock_win.c b/crypto777/nanosrc/aio/usock_win.c index 5eedfb60f..6e9f92427 100755 --- a/crypto777/nanosrc/aio/usock_win.c +++ b/crypto777/nanosrc/aio/usock_win.c @@ -126,7 +126,7 @@ int nn_usock_start (struct nn_usock *self, int domain, int type, int protocol) #if defined HANDLE_FLAG_INHERIT BOOL brc; #endif - +printf("nn_usock_start protocol %d\n",protocol); /* NamedPipes aren't sockets. They don't need all the socket initialisation stuff. */ if (domain != AF_UNIX) { diff --git a/crypto777/nanosrc/aio/worker_posix.c b/crypto777/nanosrc/aio/worker_posix.c index 73dd81955..5e8ada54c 100755 --- a/crypto777/nanosrc/aio/worker_posix.c +++ b/crypto777/nanosrc/aio/worker_posix.c @@ -102,28 +102,28 @@ void nn_worker_task_term (struct nn_worker_task *self) int nn_worker_init(struct nn_worker *self) { int32_t rc; - PNACL_message("nn_worker_init %p\n",self); + //PNACL_message("nn_worker_init %p\n",self); rc = nn_efd_init(&self->efd); - PNACL_message("efd init: rc.%d\n",rc); + //PNACL_message("efd init: rc.%d\n",rc); if ( rc < 0 ) return rc; - PNACL_message("nn_mutex_init\n"); + //PNACL_message("nn_mutex_init\n"); nn_mutex_init(&self->sync); - PNACL_message("nn_queue_init\n"); + //PNACL_message("nn_queue_init\n"); nn_queue_init(&self->tasks); - PNACL_message("nn_queue_item_init\n"); + //PNACL_message("nn_queue_item_init\n"); nn_queue_item_init(&self->stop); - PNACL_message("nn_poller_init\n"); + //PNACL_message("nn_poller_init\n"); nn_poller_init(&self->poller); - PNACL_message("nn_poller_add\n"); + //PNACL_message("nn_poller_add\n"); nn_poller_add(&self->poller,nn_efd_getfd(&self->efd),&self->efd_hndl); - PNACL_message("nn_poller_set_in\n"); + //PNACL_message("nn_poller_set_in\n"); nn_poller_set_in(&self->poller, &self->efd_hndl); - PNACL_message("nn_timerset_init\n"); + //PNACL_message("nn_timerset_init\n"); nn_timerset_init(&self->timerset); - PNACL_message("nn_thread_init\n"); + //PNACL_message("nn_thread_init\n"); nn_thread_init(&self->thread,nn_worker_routine, self); - PNACL_message("finished nn_worker_init\n"); + //PNACL_message("finished nn_worker_init\n"); return 0; } diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index e8f750f88..31db0c38d 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -243,11 +243,11 @@ PNACL_message("list init\n"); //sleep(1); PNACL_message("transports init\n"); // Plug in individual transports. - //nn_global_add_transport(nn_ipc); +nn_global_add_transport(nn_ipc); nn_global_add_transport(nn_tcp); - //nn_global_add_transport(nn_inproc); - //nn_global_add_transport(nn_ws); - //nn_global_add_transport(nn_tcpmux); +nn_global_add_transport(nn_inproc); +nn_global_add_transport(nn_ws); +nn_global_add_transport(nn_tcpmux); //sleep(1); PNACL_message("socktypes init\n"); // Plug in individual socktypes diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 2a7415d2c..72bc7a5ad 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -35,7 +35,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]); //defined(__APPLE__) || -#if defined(WIN32) || defined(USE_STATIC_NANOMSG) +#ifdef FROM_JS // defined(WIN32) || defined(USE_STATIC_NANOMSG) #include "../../crypto777/nanosrc/nn.h" #include "../../crypto777/nanosrc/bus.h" #include "../../crypto777/nanosrc/pubsub.h" From 1ea700cf882f3248d794fa399643758c809f9908 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:47:35 +0300 Subject: [PATCH 1505/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 293cd6a49..a64f4478e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1061,10 +1061,6 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * return(retstr); } -void PNACL_message(char *fmt,...) -{ -} - #endif From 6578d99aeb08a4d118fc55d7ce7f6c919667f719 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:51:10 +0300 Subject: [PATCH 1506/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 54 ++++++++++---------- crypto777/nanosrc/aio/worker_posix.c | 42 ++++++++-------- crypto777/nanosrc/core/global.c | 64 ++++++++++++------------ crypto777/nanosrc/core/pipe.c | 8 +-- crypto777/nanosrc/core/sock.c | 8 +-- crypto777/nanosrc/nn_config.h | 2 +- crypto777/nanosrc/utils/efd_eventfd.c | 4 +- crypto777/nanosrc/utils/efd_pipe.c | 12 ++--- crypto777/nanosrc/utils/efd_socketpair.c | 2 +- crypto777/nanosrc/utils/err.c | 4 +- crypto777/nanosrc/utils/err.h | 14 +++--- crypto777/nanosrc/utils/thread_posix.c | 4 +- iguana/exchanges/Makefile | 1 - 13 files changed, 109 insertions(+), 110 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index f58345031..fd3ab0332 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -167,7 +167,7 @@ int nn_usock_start (struct nn_usock *self, int domain, int type, int protocol) s = socket (domain, type, protocol); if (nn_slow (s < 0)) return -errno; - //PNACL_message("got socket s.%d\n",s); + //PNACL_msg("got socket s.%d\n",s); nn_usock_init_from_fd (self, s); /* Start the state machine. */ @@ -368,7 +368,7 @@ void nn_usock_accept (struct nn_usock *self, struct nn_usock *listener) and allow processing other events in the meantime */ if (nn_slow (errno != EAGAIN && errno != EWOULDBLOCK && errno != ECONNABORTED && errno != listener->errnum)) { - PNACL_message("listen errno.%d\n",errno); + PNACL_msg("listen errno.%d\n",errno); listener->errnum = errno; listener->state = NN_USOCK_STATE_ACCEPTING_ERROR; nn_fsm_raise (&listener->fsm, @@ -406,7 +406,7 @@ void nn_usock_connect (struct nn_usock *self, const struct sockaddr *addr, if ( nn_slow(errno != EINPROGRESS) ) { self->errnum = errno; - PNACL_message("error.%d not EINPROGRESS\n",errno); + PNACL_msg("error.%d not EINPROGRESS\n",errno); nn_fsm_action (&self->fsm, NN_USOCK_ACTION_ERROR); return; } @@ -435,9 +435,9 @@ void nn_usock_send (struct nn_usock *self, const struct nn_iovec *iov, self->out.iov [out].iov_base = iov [i].iov_base; self->out.iov [out].iov_len = iov [i].iov_len; out++; - //PNACL_message("{%d} ",(int)iov [i].iov_len); + //PNACL_msg("{%d} ",(int)iov [i].iov_len); } - //PNACL_message("iov[%d]\n",out); + //PNACL_msg("iov[%d]\n",out); self->out.hdr.msg_iovlen = out; /* Try to send the data immediately. */ @@ -474,17 +474,17 @@ void nn_usock_recv (struct nn_usock *self, void *buf, size_t len, int *fd) rc = nn_usock_recv_raw (self, buf, &nbytes); if (nn_slow (rc < 0)) { errnum_assert (rc == -ECONNRESET, -rc); - //PNACL_message("rc.%d vs ECONNRESET\n",rc,ECONNRESET); + //PNACL_msg("rc.%d vs ECONNRESET\n",rc,ECONNRESET); nn_fsm_action (&self->fsm, NN_USOCK_ACTION_ERROR); return; } //int i; //for (i=0; i<16&&ifsm, &self->event_received, NN_USOCK_RECEIVED); return; } @@ -1023,19 +1023,19 @@ int32_t nn_getiovec_size(uint8_t *buf,int32_t maxlen,struct msghdr *hdr) if ( nn_slow(iov->iov_len == NN_MSG) ) { errno = EINVAL; - PNACL_message("ERROR: iov->iov_len == NN_MSG\n"); + PNACL_msg("ERROR: iov->iov_len == NN_MSG\n"); return(-1); } if ( nn_slow(!iov->iov_base && iov->iov_len) ) { errno = EFAULT; - PNACL_message("ERROR: !iov->iov_base && iov->iov_len\n"); + PNACL_msg("ERROR: !iov->iov_base && iov->iov_len\n"); return(-1); } if ( maxlen > 0 && nn_slow(size + iov->iov_len > maxlen) ) { errno = EINVAL; - PNACL_message("ERROR: sz.%d + iov->iov_len.%d < maxlen.%d\n",(int32_t)size,(int32_t)iov->iov_len,maxlen); + PNACL_msg("ERROR: sz.%d + iov->iov_len.%d < maxlen.%d\n",(int32_t)size,(int32_t)iov->iov_len,maxlen); return(-1); } if ( iov->iov_len > 0 ) @@ -1071,10 +1071,10 @@ ssize_t mysendmsg(int32_t usock,struct msghdr *hdr,int32_t flags) if ( nn_getiovec_size(&buf[offset],veclen,hdr) == veclen ) { nbytes = send(usock,buf,offset + veclen,0); - //PNACL_message(">>>>>>>>> send.[%d %d %d %d] (n.%d v.%d c.%d)-> usock.%d nbytes.%d\n",buf[offset],buf[offset+1],buf[offset+2],buf[offset+3],(int32_t)offset+veclen,veclen,clen,usock,(int32_t)nbytes); + //PNACL_msg(">>>>>>>>> send.[%d %d %d %d] (n.%d v.%d c.%d)-> usock.%d nbytes.%d\n",buf[offset],buf[offset+1],buf[offset+2],buf[offset+3],(int32_t)offset+veclen,veclen,clen,usock,(int32_t)nbytes); if ( nbytes != offset + veclen ) { - //PNACL_message("nbytes.%d != offset.%d veclen.%d errno.%d usock.%d\n",(int32_t)nbytes,(int32_t)offset,veclen,errno,usock); + //PNACL_msg("nbytes.%d != offset.%d veclen.%d errno.%d usock.%d\n",(int32_t)nbytes,(int32_t)offset,veclen,errno,usock); } if ( nbytes >= offset ) nbytes -= offset; @@ -1082,19 +1082,19 @@ ssize_t mysendmsg(int32_t usock,struct msghdr *hdr,int32_t flags) else { err = -errno; - PNACL_message("mysendmsg: unexpected nn_getiovec_size error %d\n",err); + PNACL_msg("mysendmsg: unexpected nn_getiovec_size error %d\n",err); } if ( buf != _buf ) free(buf); if ( err != 0 ) { - PNACL_message("nn_usock_send_raw errno.%d err.%d\n",errno,err); + PNACL_msg("nn_usock_send_raw errno.%d err.%d\n",errno,err); return(-errno); } } else { - PNACL_message("nn_usock_send_raw errno.%d invalid iovec size\n",errno); + PNACL_msg("nn_usock_send_raw errno.%d invalid iovec size\n",errno); return(-errno); } return(nbytes); @@ -1106,32 +1106,32 @@ ssize_t myrecvmsg(int32_t usock,struct msghdr *hdr,int32_t flags,int32_t len) iov = hdr->msg_iov; /*if ( (n= (int32_t)recv(usock,lens,sizeof(lens),0)) != sizeof(lens) ) { - PNACL_message("error getting veclen/clen n.%d vs %d from usock.%d\n",n,(int32_t)sizeof(lens),usock); + PNACL_msg("error getting veclen/clen n.%d vs %d from usock.%d\n",n,(int32_t)sizeof(lens),usock); return(0); - } else PNACL_message("GOT %d bytes from usock.%d\n",n,usock); + } else PNACL_msg("GOT %d bytes from usock.%d\n",n,usock); offset = 0; veclen = lens[offset++]; veclen |= ((int32_t)lens[offset++] << 8); veclen |= ((int32_t)lens[offset++] << 16); clen = lens[offset++]; clen |= ((int32_t)lens[offset++] << 8); - PNACL_message("veclen.%d clen.%d waiting in usock.%d\n",veclen,clen,usock); + PNACL_msg("veclen.%d clen.%d waiting in usock.%d\n",veclen,clen,usock); if ( clen > 0 ) { if ( (cbytes= (int32_t)recv(usock,hdr->msg_control,clen,0)) != clen ) { - PNACL_message("myrecvmsg: unexpected cbytes.%d vs clen.%d\n",cbytes,clen); + PNACL_msg("myrecvmsg: unexpected cbytes.%d vs clen.%d\n",cbytes,clen); } } else cbytes = 0;*/ hdr->msg_controllen = 0; if ( (nbytes= (int32_t)recv(usock,iov->iov_base,len,0)) != len ) { - //PNACL_message("myrecvmsg: partial nbytes.%d vs veclen.%d\n",(int32_t)nbytes,len); + //PNACL_msg("myrecvmsg: partial nbytes.%d vs veclen.%d\n",(int32_t)nbytes,len); } - //PNACL_message("GOT nbytes.%d of len.%d from usock.%d\n",(int32_t)nbytes,len,usock); + //PNACL_msg("GOT nbytes.%d of len.%d from usock.%d\n",(int32_t)nbytes,len,usock); if ( 0 && nbytes > 0 ) { - PNACL_message("got nbytes.%d from usock.%d [%d %d %d %d]\n",(int32_t)nbytes,usock,((uint8_t *)iov->iov_base)[0],((uint8_t *)iov->iov_base)[1],((uint8_t *)iov->iov_base)[2],((uint8_t *)iov->iov_base)[3]); + PNACL_msg("got nbytes.%d from usock.%d [%d %d %d %d]\n",(int32_t)nbytes,usock,((uint8_t *)iov->iov_base)[0],((uint8_t *)iov->iov_base)[1],((uint8_t *)iov->iov_base)[2],((uint8_t *)iov->iov_base)[3]); } return(nbytes); } @@ -1201,13 +1201,13 @@ int32_t nn_process_cmsg(struct nn_usock *self,struct msghdr *hdr) memcpy(&retval,(int32_t *)CMSG_DATA(cmsg),sizeof(int32_t)); if ( self->in.pfd ) { - PNACL_message("CMSG set self->in.pfd (%d)\n",retval); + PNACL_msg("CMSG set self->in.pfd (%d)\n",retval); *self->in.pfd = retval; self->in.pfd = NULL; } else { - PNACL_message("CMSG nn_closefd(%d)\n",retval); + PNACL_msg("CMSG nn_closefd(%d)\n",retval); nn_closefd(retval); } break; @@ -1312,7 +1312,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) } } else if ( hdr.msg_controllen > 0 ) nn_process_cmsg(self,&hdr); - //PNACL_message("nbytes.%d length.%d *len %d\n",(int)nbytes,(int)length,(int)*len); + //PNACL_msg("nbytes.%d length.%d *len %d\n",(int)nbytes,(int)length,(int)*len); // If the data were received directly into the place we can return straight away if ( usebuf != 0 ) diff --git a/crypto777/nanosrc/aio/worker_posix.c b/crypto777/nanosrc/aio/worker_posix.c index 5e8ada54c..8d3ed2a46 100755 --- a/crypto777/nanosrc/aio/worker_posix.c +++ b/crypto777/nanosrc/aio/worker_posix.c @@ -102,28 +102,28 @@ void nn_worker_task_term (struct nn_worker_task *self) int nn_worker_init(struct nn_worker *self) { int32_t rc; - //PNACL_message("nn_worker_init %p\n",self); + //PNACL_msg("nn_worker_init %p\n",self); rc = nn_efd_init(&self->efd); - //PNACL_message("efd init: rc.%d\n",rc); + //PNACL_msg("efd init: rc.%d\n",rc); if ( rc < 0 ) return rc; - //PNACL_message("nn_mutex_init\n"); + //PNACL_msg("nn_mutex_init\n"); nn_mutex_init(&self->sync); - //PNACL_message("nn_queue_init\n"); + //PNACL_msg("nn_queue_init\n"); nn_queue_init(&self->tasks); - //PNACL_message("nn_queue_item_init\n"); + //PNACL_msg("nn_queue_item_init\n"); nn_queue_item_init(&self->stop); - //PNACL_message("nn_poller_init\n"); + //PNACL_msg("nn_poller_init\n"); nn_poller_init(&self->poller); - //PNACL_message("nn_poller_add\n"); + //PNACL_msg("nn_poller_add\n"); nn_poller_add(&self->poller,nn_efd_getfd(&self->efd),&self->efd_hndl); - //PNACL_message("nn_poller_set_in\n"); + //PNACL_msg("nn_poller_set_in\n"); nn_poller_set_in(&self->poller, &self->efd_hndl); - //PNACL_message("nn_timerset_init\n"); + //PNACL_msg("nn_timerset_init\n"); nn_timerset_init(&self->timerset); - //PNACL_message("nn_thread_init\n"); + //PNACL_msg("nn_thread_init\n"); nn_thread_init(&self->thread,nn_worker_routine, self); - //PNACL_message("finished nn_worker_init\n"); + //PNACL_msg("finished nn_worker_init\n"); return 0; } @@ -173,7 +173,7 @@ static void nn_worker_routine (void *arg) struct nn_worker_task *task; struct nn_worker_fd *fd; struct nn_worker_timer *timer; - PNACL_message("nn_worker_routine started\n"); + PNACL_msg("nn_worker_routine started\n"); self = (struct nn_worker*) arg; while ( 1 ) // Infinite loop. It will be interrupted only when the object is shut down. { @@ -185,7 +185,7 @@ static void nn_worker_routine (void *arg) rc = nn_timerset_event(&self->timerset, &thndl); if ( rc == -EAGAIN ) break; - PNACL_message("nn_worker process expired user\n"); + PNACL_msg("nn_worker process expired user\n"); errnum_assert(rc == 0, -rc); timer = nn_cont(thndl, struct nn_worker_timer, hndl); nn_ctx_enter(timer->owner->ctx); @@ -197,7 +197,7 @@ static void nn_worker_routine (void *arg) rc = nn_poller_event(&self->poller,&pevent,&phndl); // Get next poller event, such as IN or OUT if ( nn_slow(rc == -EAGAIN) ) break; - PNACL_message("nn_worker process all events from the poller\n"); + PNACL_msg("nn_worker process all events from the poller\n"); if ( phndl == &self->efd_hndl ) // If there are any new incoming worker tasks, process them { nn_assert (pevent == NN_POLLER_IN); @@ -212,14 +212,14 @@ static void nn_worker_routine (void *arg) item = nn_queue_pop(&tasks); // Next worker task if ( nn_slow(!item) ) break; - PNACL_message("nn_worker next worker task\n"); + PNACL_msg("nn_worker next worker task\n"); if ( nn_slow(item == &self->stop) ) // If the worker thread is asked to stop, do so { nn_queue_term(&tasks); return; } // It's a user-defined task. Notify the user that it has arrived in the worker thread - PNACL_message("nn_worker user defined task\n"); + PNACL_msg("nn_worker user defined task\n"); task = nn_cont(item,struct nn_worker_task,item); nn_ctx_enter(task->owner->ctx); nn_fsm_feed(task->owner,task->src,NN_WORKER_TASK_EXECUTE,task); @@ -228,15 +228,15 @@ static void nn_worker_routine (void *arg) nn_queue_term (&tasks); continue; } - PNACL_message("nn_worker true i/o, invoke handler\n"); + PNACL_msg("nn_worker true i/o, invoke handler\n"); fd = nn_cont(phndl,struct nn_worker_fd,hndl); // It's a true I/O event. Invoke the handler - PNACL_message("nn_worker true i/o, fd.%p\n",fd); + PNACL_msg("nn_worker true i/o, fd.%p\n",fd); nn_ctx_enter(fd->owner->ctx); - PNACL_message("nn_worker true i/o, after nn_ctx_enter\n"); + PNACL_msg("nn_worker true i/o, after nn_ctx_enter\n"); nn_fsm_feed(fd->owner,fd->src,pevent,fd); - PNACL_message("nn_worker true i/o, after nn_fsm_feed leave.%p\n",fd->owner->ctx); + PNACL_msg("nn_worker true i/o, after nn_fsm_feed leave.%p\n",fd->owner->ctx); nn_ctx_leave(fd->owner->ctx); - PNACL_message("nn_worker true i/o, after nn_ctx_leave\n"); + PNACL_msg("nn_worker true i/o, after nn_ctx_leave\n"); } } } diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 31db0c38d..00a5c48d3 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -201,9 +201,9 @@ static void nn_global_add_transport (struct nn_transport *transport) static void nn_global_add_socktype (struct nn_socktype *socktype) { - PNACL_message("add socktype %p -> %p\n",socktype,&SELF.socktypes); + PNACL_msg("add socktype %p -> %p\n",socktype,&SELF.socktypes); nn_list_insert (&SELF.socktypes, &socktype->item,nn_list_end (&SELF.socktypes)); - PNACL_message("added socktype %p -> %p\n",socktype,&SELF.socktypes); + PNACL_msg("added socktype %p -> %p\n",socktype,&SELF.socktypes); } void nn_global_init (void) { @@ -218,7 +218,7 @@ void nn_global_init (void) nn_assert (LOBYTE (data.wVersion) == 2 && HIBYTE (data.wVersion) == 2); #endif - PNACL_message("nn_global_init\n"); + PNACL_msg("nn_global_init\n"); nn_alloc_init(); // Initialise the memory allocation subsystem nn_random_seed(); // Seed the pseudo-random number generator // Allocate the global table of SP sockets. @@ -227,7 +227,7 @@ void nn_global_init (void) for (i=0; imsg_iov[0].iov_base) = chunk; sz = nn_chunk_size(chunk); - //PNACL_message("got message -> iov_base.%p sz.%d\n",msghdr->msg_iov[0].iov_base,(int32_t)sz); + //PNACL_msg("got message -> iov_base.%p sz.%d\n",msghdr->msg_iov[0].iov_base,(int32_t)sz); } else // Copy the message content into the supplied gather array { data = nn_chunkref_data(&msg.body); sz = nn_chunkref_size(&msg.body); - //PNACL_message("got message -> data.%p sz.%d\n",data,(int32_t)sz); + //PNACL_msg("got message -> data.%p sz.%d\n",data,(int32_t)sz); for (i=0; i!=msghdr->msg_iovlen; i++) { iov = &msghdr->msg_iov[i]; @@ -809,7 +809,7 @@ int32_t nn_recvmsg(int32_t s,struct nn_msghdr *msghdr,int32_t flags) int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) { int32_t rc,i,nnmsg; size_t sz,spsz; struct nn_iovec *iov; struct nn_msg msg; void *chunk; struct nn_cmsghdr *cmsg; - //PNACL_message("nn_sendmsg.(%d) \n",s); + //PNACL_msg("nn_sendmsg.(%d) \n",s); NN_BASIC_CHECKS; if ( nn_slow(!msghdr) ) { @@ -928,7 +928,7 @@ int32_t nn_recvmsg(int32_t s,struct nn_msghdr *msghdr,int32_t flags) { struct nn_msg msg; uint8_t *data; struct nn_iovec *iov; void *chunk,*ctrl; struct nn_cmsghdr *chdr; int32_t i,rc; size_t sz,hdrssz,ctrlsz,spsz,sptotalsz; - //PNACL_message("nn_recvmsg.(%d) \n",s); + //PNACL_msg("nn_recvmsg.(%d) \n",s); NN_BASIC_CHECKS; if ( nn_slow(!msghdr) ) { @@ -940,7 +940,7 @@ int32_t nn_recvmsg(int32_t s,struct nn_msghdr *msghdr,int32_t flags) errno = EMSGSIZE; return -1; } - //PNACL_message("get a message from sock.%d\n",s); + //PNACL_msg("get a message from sock.%d\n",s); rc = nn_sock_recv(SELF.socks[s],&msg,flags); // Get a message if ( nn_slow(rc < 0) ) { @@ -952,13 +952,13 @@ int32_t nn_recvmsg(int32_t s,struct nn_msghdr *msghdr,int32_t flags) chunk = nn_chunkref_getchunk(&msg.body); *(void **)(msghdr->msg_iov[0].iov_base) = chunk; sz = nn_chunk_size(chunk); - //PNACL_message("got message -> iov_base.%p sz.%d\n",msghdr->msg_iov[0].iov_base,(int32_t)sz); + //PNACL_msg("got message -> iov_base.%p sz.%d\n",msghdr->msg_iov[0].iov_base,(int32_t)sz); } else // Copy the message content into the supplied gather array { data = nn_chunkref_data(&msg.body); sz = nn_chunkref_size (&msg.body); - //PNACL_message("got message -> data.%p sz.%d\n",data,(int32_t)sz); + //PNACL_msg("got message -> data.%p sz.%d\n",data,(int32_t)sz); for (i=0; i!=msghdr->msg_iovlen; i++) { iov = &msghdr->msg_iov[i]; @@ -1150,7 +1150,7 @@ static void nn_global_submit_errors (int i, struct nn_sock *s, len = snprintf (curbuf, buf_left, " nanomsg: Endpoint %d [%s] error: %s\n", ep->eid, nn_ep_getaddr (ep), nn_strerror (ep->last_errno)); - PNACL_message("%s\n",curbuf); + PNACL_msg("%s\n",curbuf); #endif if (buf_left < len) break; @@ -1247,7 +1247,7 @@ static int nn_global_create_ep (int s, const char *addr, int bind) #ifdef NN_USE_MYMSG if ( strncmp("inproc",proto,strlen("inproc")) != 0 && strncmp("ipc",proto,strlen("ipc")) != 0 && strncmp("tcp",proto,strlen("tcp")) != 0 ) { - PNACL_message("only ipc, inproc and tcp transport is supported\n"); + PNACL_msg("only ipc, inproc and tcp transport is supported\n"); printf("only ipc, inproc and tcp transport is supported\n"); fprintf(stderr,"only ipc, inproc and tcp transport is supported\n"); exit(-1); @@ -1324,12 +1324,12 @@ static void nn_global_handler (struct nn_fsm *myself,int src, int type, NN_UNUSE nn_timer_start (&global->stat_timer, 10000); // Start statistics collection timer return; default: - PNACL_message("bad action %d type %d\n",src,type); + PNACL_msg("bad action %d type %d\n",src,type); nn_fsm_bad_action(global->state, src, type); } default: - PNACL_message("bad source %d\n",src); + PNACL_msg("bad source %d\n",src); nn_fsm_bad_source(global->state, src, type); } diff --git a/crypto777/nanosrc/core/pipe.c b/crypto777/nanosrc/core/pipe.c index 2b674db44..a025d1f00 100755 --- a/crypto777/nanosrc/core/pipe.c +++ b/crypto777/nanosrc/core/pipe.c @@ -58,7 +58,7 @@ void nn_pipebase_init(struct nn_pipebase *self,const struct nn_pipebase_vfptr *v memcpy(&self->options,&epbase->ep->options,sizeof(struct nn_ep_options)); nn_fsm_event_init(&self->in); nn_fsm_event_init(&self->out); - PNACL_message("pipebase_init vfptr.%p recv.%p rcvprio.%d\n",vfptr,vfptr->recv,self->options.rcvprio); + PNACL_msg("pipebase_init vfptr.%p recv.%p rcvprio.%d\n",vfptr,vfptr->recv,self->options.rcvprio); } void nn_pipebase_term (struct nn_pipebase *self) @@ -78,7 +78,7 @@ int nn_pipebase_start (struct nn_pipebase *self) self->instate = NN_PIPEBASE_INSTATE_ASYNC; self->outstate = NN_PIPEBASE_OUTSTATE_IDLE; rc = nn_sock_add(self->sock,(struct nn_pipe *)self); - PNACL_message("nn_pipebase_start self.%p rc.%d\n",self,rc); + PNACL_msg("nn_pipebase_start self.%p rc.%d\n",self,rc); if ( nn_slow(rc < 0) ) { self->state = NN_PIPEBASE_STATE_FAILED; @@ -98,7 +98,7 @@ void nn_pipebase_stop(struct nn_pipebase *self) void nn_pipebase_received(struct nn_pipebase *self) { - PNACL_message("nn_pipebase_received\n"); + PNACL_msg("nn_pipebase_received\n"); if ( nn_fast(self->instate == NN_PIPEBASE_INSTATE_RECEIVING) ) { self->instate = NN_PIPEBASE_INSTATE_RECEIVED; @@ -196,7 +196,7 @@ int nn_pipe_recv(struct nn_pipe *self,struct nn_msg *msg) pipebase = (struct nn_pipebase*) self; nn_assert (pipebase->instate == NN_PIPEBASE_INSTATE_IDLE); pipebase->instate = NN_PIPEBASE_INSTATE_RECEIVING; - PNACL_message("call pipebase recv\n"); + PNACL_msg("call pipebase recv\n"); rc = pipebase->vfptr->recv (pipebase,msg); errnum_assert (rc >= 0, -rc); if ( nn_fast(pipebase->instate == NN_PIPEBASE_INSTATE_RECEIVED) ) diff --git a/crypto777/nanosrc/core/sock.c b/crypto777/nanosrc/core/sock.c index 6ba4bf5b1..83e8afce7 100755 --- a/crypto777/nanosrc/core/sock.c +++ b/crypto777/nanosrc/core/sock.c @@ -489,11 +489,11 @@ int nn_sock_add_ep(struct nn_sock *self,struct nn_transport *transport,int32_t b return rc; } nn_ep_start(ep); - PNACL_message("ep sock.(%s) started %s://(%s) bind.%d\n",self->socket_name,transport->name,addr,bind); + PNACL_msg("ep sock.(%s) started %s://(%s) bind.%d\n",self->socket_name,transport->name,addr,bind); eid = self->eid++; // Increase the endpoint ID for the next endpoint nn_list_insert(&self->eps,&ep->item,nn_list_end(&self->eps)); // Add to the list of active endpoints nn_ctx_leave (&self->ctx); - } else PNACL_message("self->sock.(%s) %p already has (%s)\n",self->socket_name,self->sockbase->sock,addr); + } else PNACL_msg("self->sock.(%s) %p already has (%s)\n",self->socket_name,self->sockbase->sock,addr); return(ep->eid); } @@ -973,12 +973,12 @@ void nn_sock_report_error(struct nn_sock *self,struct nn_ep *ep,int32_t errnum,c if ( ep != 0 ) { fprintf(stderr,"nanomsg: socket.%s[%s]: Error: %s\n",self->socket_name,nn_ep_getaddr(ep),nn_strerror(errnum)); - PNACL_message("nanomsg: socket.%s[%s]: [%s:%d] Error: %s\n",self->socket_name,nn_ep_getaddr(ep),fname,linenum,nn_strerror(errnum)); + PNACL_msg("nanomsg: socket.%s[%s]: [%s:%d] Error: %s\n",self->socket_name,nn_ep_getaddr(ep),fname,linenum,nn_strerror(errnum)); } else { fprintf(stderr,"nanomsg: socket.%s: Error: %s\n",self->socket_name, nn_strerror(errnum)); - PNACL_message("nanomsg: socket.%s: [%s:%d] Error: %s\n",self->socket_name,fname,linenum,nn_strerror(errnum)); + PNACL_msg("nanomsg: socket.%s: [%s:%d] Error: %s\n",self->socket_name,fname,linenum,nn_strerror(errnum)); } } diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 4b085c748..39ac68eb1 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -46,7 +46,7 @@ #define NN_HAVE_MSG_CONTROL 0 //#define STANDALONE 1 -#define PNACL_message printf +#define PNACL_msg printf #if !defined(WIN32) //#define NN_ENABLE_EXTRA 1 diff --git a/crypto777/nanosrc/utils/efd_eventfd.c b/crypto777/nanosrc/utils/efd_eventfd.c index abbb904f1..f659296e7 100755 --- a/crypto777/nanosrc/utils/efd_eventfd.c +++ b/crypto777/nanosrc/utils/efd_eventfd.c @@ -32,9 +32,9 @@ int nn_efd_init(struct nn_efd *self) { int rc; int flags; - PNACL_message("inside efd_init eventfd\n"); + PNACL_msg("inside efd_init eventfd\n"); self->efd = eventfd(0, EFD_CLOEXEC); - PNACL_message("self->efd: %d\n",self->efd); + PNACL_msg("self->efd: %d\n",self->efd); if (self->efd == -1 && (errno == EMFILE || errno == ENFILE)) return -EMFILE; errno_assert(self->efd != -1); diff --git a/crypto777/nanosrc/utils/efd_pipe.c b/crypto777/nanosrc/utils/efd_pipe.c index 4df5fd3b3..59472d5d8 100755 --- a/crypto777/nanosrc/utils/efd_pipe.c +++ b/crypto777/nanosrc/utils/efd_pipe.c @@ -33,14 +33,14 @@ int nn_efd_init(struct nn_efd *self) { int rc,flags,p[2]; - PNACL_message("inside efd_init: pipe\n"); + PNACL_msg("inside efd_init: pipe\n"); //sleep(1); #if defined NN_HAVE_PIPE2 rc = pipe2(p, O_NONBLOCK | O_CLOEXEC); #else rc = pipe(p); #endif - PNACL_message("rc efd_init: %d\n",rc); + PNACL_msg("rc efd_init: %d\n",rc); //sleep(1); if (rc != 0 && (errno == EMFILE || errno == ENFILE)) return -EMFILE; @@ -50,20 +50,20 @@ int nn_efd_init(struct nn_efd *self) #if !defined NN_HAVE_PIPE2 && defined FD_CLOEXEC rc = fcntl (self->r, F_SETFD, FD_CLOEXEC); - PNACL_message("pipe efd_init: F_SETFDr rc %d\n",rc); + PNACL_msg("pipe efd_init: F_SETFDr rc %d\n",rc); errno_assert(rc != -1); rc = fcntl(self->w, F_SETFD, FD_CLOEXEC); - PNACL_message("pipe efd_init: F_SETFDw rc %d\n",rc); + PNACL_msg("pipe efd_init: F_SETFDw rc %d\n",rc); errno_assert(rc != -1); #endif #if !defined NN_HAVE_PIPE2 flags = fcntl(self->r, F_GETFL, 0); - PNACL_message("pipe efd_init: flags %d\n",flags); + PNACL_msg("pipe efd_init: flags %d\n",flags); if ( flags == -1 ) flags = 0; rc = fcntl(self->r, F_SETFL, flags | O_NONBLOCK); - PNACL_message("pipe efd_init: rc %d flags.%d\n",rc,flags); + PNACL_msg("pipe efd_init: rc %d flags.%d\n",rc,flags); errno_assert (rc != -1); #endif diff --git a/crypto777/nanosrc/utils/efd_socketpair.c b/crypto777/nanosrc/utils/efd_socketpair.c index 6221aef4c..e04a4935e 100755 --- a/crypto777/nanosrc/utils/efd_socketpair.c +++ b/crypto777/nanosrc/utils/efd_socketpair.c @@ -35,7 +35,7 @@ int nn_efd_init (struct nn_efd *self) int rc; int flags; int sp [2]; - PNACL_message("socketpair efdinit\n"); + PNACL_msg("socketpair efdinit\n"); #if defined SOCK_CLOEXEC rc = socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sp); #else diff --git a/crypto777/nanosrc/utils/err.c b/crypto777/nanosrc/utils/err.c index 6f5bc42a6..afca3471b 100755 --- a/crypto777/nanosrc/utils/err.c +++ b/crypto777/nanosrc/utils/err.c @@ -30,7 +30,7 @@ void nn_err_abort(void) { - PNACL_message("nn_err_abort\n"); + PNACL_msg("nn_err_abort\n"); while ( 1 ) { printf("exit due to error\n"); @@ -111,7 +111,7 @@ const char *nn_err_strerror(int32_t errnum) #pragma warning (push) #pragma warning (disable:4996) #endif - PNACL_message("nanomsg: errno.%d (%s)\n",errnum,strerror(errnum)); + PNACL_msg("nanomsg: errno.%d (%s)\n",errnum,strerror(errnum)); getchar(); return strerror (errnum); #if defined _MSC_VER diff --git a/crypto777/nanosrc/utils/err.h b/crypto777/nanosrc/utils/err.h index e57e57c02..be9f94204 100755 --- a/crypto777/nanosrc/utils/err.h +++ b/crypto777/nanosrc/utils/err.h @@ -26,7 +26,7 @@ #include #include #include -#define PNACL_message printf +#define PNACL_msg printf /* Include nn.h header to define nanomsg-specific error codes. */ #include "../nn.h" @@ -45,7 +45,7 @@ #define nn_assert(x) \ do {\ if (nn_slow (!(x))) {\ - PNACL_message("Assertion failed: %s (%s:%d)\n", #x, \ + PNACL_msg("Assertion failed: %s (%s:%d)\n", #x, \ __FILE__, __LINE__);\ fflush (stderr);\ nn_err_abort ();\ @@ -55,7 +55,7 @@ #define nn_assert_state(obj, state_name) \ do {\ if (nn_slow ((obj)->state != state_name)) {\ - PNACL_message( \ + PNACL_msg( \ "Assertion failed: %d == %s (%s:%d)\n", \ (obj)->state, #state_name, \ __FILE__, __LINE__);\ @@ -67,7 +67,7 @@ #define alloc_assert(x) \ do {\ if (nn_slow (!x)) {\ - PNACL_message("Out of memory (%s:%d)\n",\ + PNACL_msg("Out of memory (%s:%d)\n",\ __FILE__, __LINE__);\ nn_err_abort ();\ }\ @@ -77,7 +77,7 @@ #define errno_assert(x) \ do {\ if (nn_slow (!(x))) {\ - PNACL_message("%s [%d] (%s:%d)\n", nn_err_strerror (errno),\ + PNACL_msg("%s [%d] (%s:%d)\n", nn_err_strerror (errno),\ (int) errno, __FILE__, __LINE__);\ nn_err_abort ();\ }\ @@ -87,7 +87,7 @@ #define errnum_assert(cond, err) \ do {\ if (nn_slow (!(cond))) {\ - PNACL_message("%s [%d] (%s:%d)\n", nn_err_strerror (err),(int) (err), __FILE__, __LINE__);\ + PNACL_msg("%s [%d] (%s:%d)\n", nn_err_strerror (err),(int) (err), __FILE__, __LINE__);\ nn_err_abort ();\ }\ } while (0) @@ -119,7 +119,7 @@ /* Assertion-like macros for easier fsm debugging. */ #define nn_fsm_error(message, state, src, type) \ do {\ - PNACL_message("%s: state=%d source=%d action=%d (%s:%d)\n", \ + PNACL_msg("%s: state=%d source=%d action=%d (%s:%d)\n", \ message, state, src, type, __FILE__, __LINE__);\ nn_err_abort ();\ } while (0) diff --git a/crypto777/nanosrc/utils/thread_posix.c b/crypto777/nanosrc/utils/thread_posix.c index 93c81b6cb..32c8428e4 100755 --- a/crypto777/nanosrc/utils/thread_posix.c +++ b/crypto777/nanosrc/utils/thread_posix.c @@ -30,7 +30,7 @@ static void *nn_thread_main_routine(void *arg) { struct nn_thread *self; self = (struct nn_thread *)arg; - PNACL_message("nn_thread_main_routine arg.%p self->routine(%p) at %p\n",arg,self->arg,self->routine); + PNACL_msg("nn_thread_main_routine arg.%p self->routine(%p) at %p\n",arg,self->arg,self->routine); self->routine(self->arg); // Run the thread routine return NULL; } @@ -47,7 +47,7 @@ void nn_thread_init(struct nn_thread *self,nn_thread_routine *routine,void *arg) { int32_t rc; // No signals should be processed by this thread. The library doesn't use signals and thus all the signals should be delivered to application threads, not to worker threads. - PNACL_message("nn_thread_init routine.%p arg.%p\n",routine,arg); + PNACL_msg("nn_thread_init routine.%p arg.%p\n",routine,arg); self->routine = routine; self->arg = arg; rc = pthread_create(&self->handle,NULL,nn_thread_main_routine,(void *)self); diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index a7b10c035..0048287e2 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -4,6 +4,5 @@ include ../crypto777/crypto777.sources all: - #echo building... $(CRYPTO777_SRCS) emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm From 5d7288e9b3cde6028b11f2229c23b51c7215b7bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:56:16 +0300 Subject: [PATCH 1507/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a64f4478e..c6ee2ecbc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -29,6 +29,10 @@ // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs +void PNACL_msg(char *arg,...) +{ + +} #include #include "LP_include.h" portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex; From b1e87908b997e31fb2400cca0329839d8130922e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:57:03 +0300 Subject: [PATCH 1508/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ---- iguana/exchanges/mm.c | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c6ee2ecbc..a64f4478e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -29,10 +29,6 @@ // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs -void PNACL_msg(char *arg,...) -{ - -} #include #include "LP_include.h" portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex; diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 72bc7a5ad..1e91b621a 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -19,13 +19,17 @@ // Copyright © 2017 SuperNET. All rights reserved. // +void PNACL_msg(char *arg,...) +{ + +} #define FROM_MARKETMAKER #include #include #ifndef NATIVE_WINDOWS - #include "OS_portable.h" +#include "OS_portable.h" #else - #include "../../crypto777/OS_portable.h" +#include "../../crypto777/OS_portable.h" #endif // !_WIN_32 From 45e7d1aeb82b167d38c93ffb405de5fd54248b6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 15:57:50 +0300 Subject: [PATCH 1509/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 1e91b621a..296e25647 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -19,7 +19,7 @@ // Copyright © 2017 SuperNET. All rights reserved. // -void PNACL_msg(char *arg,...) +void PNACL_message(char *arg,...) { } From 22b2bcb311724ba0afa3c706bc40ce7369568674 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:04:27 +0300 Subject: [PATCH 1510/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index fd3ab0332..ef088eb88 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -286,7 +286,7 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* Allow re-using the address. */ opt = 1; - printf("call setsockopt in nn_usock_bind\n"); + printf("call setsockopt %s SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); printf("called setsockopt in nn_usock_bind returns %d\n",rc); errno_assert (rc == 0); From be141e771c327133d62307fe2932fc4326b5d592 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:05:12 +0300 Subject: [PATCH 1511/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index ef088eb88..be8103dc5 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -286,7 +286,7 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* Allow re-using the address. */ opt = 1; - printf("call setsockopt %s SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); + printf("call setsockopt %d SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); printf("called setsockopt in nn_usock_bind returns %d\n",rc); errno_assert (rc == 0); From 28441bfb0e7ea545d0137ee69ea8116c6c764a47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:05:42 +0300 Subject: [PATCH 1512/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index be8103dc5..202a9c920 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -286,13 +286,13 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* Allow re-using the address. */ opt = 1; - printf("call setsockopt %d SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); + PNACL_msg("call setsockopt %d SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); - printf("called setsockopt in nn_usock_bind returns %d\n",rc); + PNACL_msg("called setsockopt in nn_usock_bind returns %d\n",rc); errno_assert (rc == 0); rc = bind (self->s, addr, (socklen_t) addrlen); - printf("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); + PNACL_msg("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); if (nn_slow (rc != 0)) return -errno; @@ -308,7 +308,7 @@ int nn_usock_listen (struct nn_usock *self, int backlog) /* Start listening for incoming connections. */ rc = listen (self->s, backlog); - //printf("usock.%d -> listen rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); + //PNACL_msg("usock.%d -> listen rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); if (nn_slow (rc != 0)) return -errno; @@ -335,7 +335,7 @@ void nn_usock_accept (struct nn_usock *self, struct nn_usock *listener) #else s = accept (listener->s, NULL, NULL); #endif - //printf("usock.%d -> accept errno.%d s.%d %s\n",self->s,errno,s,nn_strerror(errno)); + //PNACL_msg("usock.%d -> accept errno.%d s.%d %s\n",self->s,errno,s,nn_strerror(errno)); /* Immediate success. */ if (nn_fast (s >= 0)) { @@ -395,7 +395,7 @@ void nn_usock_connect (struct nn_usock *self, const struct sockaddr *addr, /* Do the connect itself. */ rc = connect(self->s,addr,(socklen_t)addrlen); - //printf("usock.%d <- connect (%llx) rc.%d errno.%d %s\n",self->s,*(long long *)addr,rc,errno,nn_strerror(errno)); + //PNACL_msg("usock.%d <- connect (%llx) rc.%d errno.%d %s\n",self->s,*(long long *)addr,rc,errno,nn_strerror(errno)); /* Immediate success. */ if ( nn_fast(rc == 0) ) { @@ -1146,7 +1146,7 @@ static int nn_usock_send_raw (struct nn_usock *self, struct msghdr *hdr) nbytes = sendmsg(self->s,hdr,MSG_NOSIGNAL); #else nbytes = sendmsg(self->s,hdr,0); - //printf("sendmsg nbytes.%d\n",(int32_t)nbytes); + //PNACL_msg("sendmsg nbytes.%d\n",(int32_t)nbytes); #endif #endif /* Handle errors. */ @@ -1288,7 +1288,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) #if NN_USE_MYMSG nbytes = myrecvmsg(self->s,&hdr,0,(int32_t)iov.iov_len); - //printf("got nbytes.%d from recvmsg errno.%d %s\n",(int32_t)nbytes,errno,nn_strerror(errno)); + //PNACL_msg("got nbytes.%d from recvmsg errno.%d %s\n",(int32_t)nbytes,errno,nn_strerror(errno)); #else nbytes = recvmsg (self->s, &hdr, 0); #endif @@ -1300,7 +1300,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) nbytes = 0; else { - printf("recvraw errno.%d %s\n",errno,nn_strerror(errno)); + PNACL_msg("recvraw errno.%d %s\n",errno,nn_strerror(errno)); // If the peer closes the connection, return ECONNRESET errno_assert(errno == ECONNRESET || errno == ENOTCONN || errno == ECONNREFUSED || errno == ETIMEDOUT || errno == EHOSTUNREACH #if NN_USE_MYMSG From bccd17943ad0fbc8fff16402cad957caef11685e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:22:30 +0300 Subject: [PATCH 1513/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 3 ++- crypto777/nanosrc/aio/usock_posix.c_dev | 3 ++- crypto777/nanosrc/devices/tcpmuxd.c | 3 ++- crypto777/nanosrc/utils/efd_win.c | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index 202a9c920..3989d3a22 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -289,7 +289,8 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, PNACL_msg("call setsockopt %d SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); PNACL_msg("called setsockopt in nn_usock_bind returns %d\n",rc); - errno_assert (rc == 0); + // ignore SO_REUSEADDR failures + //errno_assert (rc == 0); rc = bind (self->s, addr, (socklen_t) addrlen); PNACL_msg("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); diff --git a/crypto777/nanosrc/aio/usock_posix.c_dev b/crypto777/nanosrc/aio/usock_posix.c_dev index 1d000ee3b..e5b8a1c35 100755 --- a/crypto777/nanosrc/aio/usock_posix.c_dev +++ b/crypto777/nanosrc/aio/usock_posix.c_dev @@ -287,7 +287,8 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* Allow re-using the address. */ opt = 1; rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); - errno_assert (rc == 0); + // ignore SO_REUSEADDR failures + //errno_assert (rc == 0); rc = bind (self->s, addr, (socklen_t) addrlen); if (nn_slow (rc != 0)) diff --git a/crypto777/nanosrc/devices/tcpmuxd.c b/crypto777/nanosrc/devices/tcpmuxd.c index ba2ba3a23..abd3b7706 100755 --- a/crypto777/nanosrc/devices/tcpmuxd.c +++ b/crypto777/nanosrc/devices/tcpmuxd.c @@ -96,7 +96,8 @@ int nn_tcpmuxd (int port) opt = 1; rc = setsockopt (tcp_listener, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); - if (rc != 0) { return -1; } + // ignore SO_REUSEADDR failures + //if (rc != 0) { return -1; } memset (&tcp_addr, 0, sizeof (tcp_addr)); tcp_addr.sin_family = AF_INET; tcp_addr.sin_port = htons (port); diff --git a/crypto777/nanosrc/utils/efd_win.c b/crypto777/nanosrc/utils/efd_win.c index 8d253408f..5678ba7d5 100755 --- a/crypto777/nanosrc/utils/efd_win.c +++ b/crypto777/nanosrc/utils/efd_win.c @@ -84,8 +84,9 @@ int nn_efd_init (struct nn_efd *self) reuseaddr = 1; rc = setsockopt (listener, SOL_SOCKET, SO_REUSEADDR, (char*) &reuseaddr, sizeof (reuseaddr)); - if (nn_slow (rc == SOCKET_ERROR)) - goto wsafail; + // ignore SO_REUSEADDR failures + // if (nn_slow (rc == SOCKET_ERROR)) + // goto wsafail; /* Bind the listening socket to the local port. */ memset (&addr, 0, sizeof (addr)); From e4e2ce534efeb90b6df340605dade78e13897f43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:29:21 +0300 Subject: [PATCH 1514/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a64f4478e..7824b2ad3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1041,7 +1041,7 @@ void LP_fromjs_iter() } if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( (LP_counter % 100) == 0 ) + if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); LP_counter++; @@ -1054,10 +1054,10 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * return(clonestr("{\"error\":\"only http allowed\"}")); sprintf(fname,"bitcoind_RPC/req.%u",counter); counter++; - printf("issue.(%s)\n",url); + //printf("issue.(%s)\n",url); emscripten_wget(url,fname); retstr = OS_filestr(&fsize,fname); - printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr); + //printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr); return(retstr); } From f4bf243ea8efee3d7d1d706fc307573f8ba09ff5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:32:06 +0300 Subject: [PATCH 1515/2732] Test --- crypto777/nanosrc/nn_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 39ac68eb1..98ec95121 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -46,7 +46,7 @@ #define NN_HAVE_MSG_CONTROL 0 //#define STANDALONE 1 -#define PNACL_msg printf +#define PNACL_msg #if !defined(WIN32) //#define NN_ENABLE_EXTRA 1 From 3fb1d8e1328f99ad8be911a9295f468cfa51f173 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:32:59 +0300 Subject: [PATCH 1516/2732] Test --- crypto777/nanosrc/utils/err.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/utils/err.h b/crypto777/nanosrc/utils/err.h index be9f94204..dd3972a86 100755 --- a/crypto777/nanosrc/utils/err.h +++ b/crypto777/nanosrc/utils/err.h @@ -26,7 +26,7 @@ #include #include #include -#define PNACL_msg printf +#define PNACL_msg /* Include nn.h header to define nanomsg-specific error codes. */ #include "../nn.h" From 79decf2aeea07c8ba1f63e012cd951ff775633f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:34:06 +0300 Subject: [PATCH 1517/2732] test --- crypto777/nanosrc/nn_config.h | 2 +- crypto777/nanosrc/utils/err.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 98ec95121..74edc6229 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -46,7 +46,7 @@ #define NN_HAVE_MSG_CONTROL 0 //#define STANDALONE 1 -#define PNACL_msg +#define PNACL_msg(...) #if !defined(WIN32) //#define NN_ENABLE_EXTRA 1 diff --git a/crypto777/nanosrc/utils/err.h b/crypto777/nanosrc/utils/err.h index dd3972a86..e932766e1 100755 --- a/crypto777/nanosrc/utils/err.h +++ b/crypto777/nanosrc/utils/err.h @@ -26,7 +26,7 @@ #include #include #include -#define PNACL_msg +#define PNACL_msg(...) /* Include nn.h header to define nanomsg-specific error codes. */ #include "../nn.h" From 7aa01538435f7c61ad44f9e75dd940d726b4580e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:37:32 +0300 Subject: [PATCH 1518/2732] Test --- crypto777/crypto777.sources | 2 +- iguana/exchanges/LP_nativeDEX.c | 13 ------------- iguana/exchanges/LP_network.c | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/crypto777/crypto777.sources b/crypto777/crypto777.sources index f7bcd6bcc..3d5142a01 100755 --- a/crypto777/crypto777.sources +++ b/crypto777/crypto777.sources @@ -36,7 +36,7 @@ TRANSPORTS_TCPMUX = $(NANOSRC)/transports/tcpmux/atcpmux.c $(NANOSRC)/transports NANOMSG_PROTOCOLS = $(PROTOCOLS_UTILS) $(PROTOCOLS_PUBSUB) $(PROTOCOLS_PAIR) $(PROTOCOLS_REQREP) $(PROTOCOLS_BUS) $(PROTOCOLS_PIPELINE) $(PROTOCOLS_SURVEY) -NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) +NANOMSG_TRANSPORTS = $(TRANSPORTS_UTILS) $(TRANSPORTS_TCP) $(TRANSPORTS_IPC) $(TRANSPORTS_INPROC) $(TRANSPORTS_WS) NANOMSG = $(NANOMSG_CORE) $(NANOMSG_AIO) $(NANOMSG_UTILS) $(NANOMSG_DEVICES) $(NANOMSG_TRANSPORTS) $(NANOMSG_PROTOCOLS) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7824b2ad3..87e222656 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -798,19 +798,6 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) 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; long filesize,n; int32_t 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(); - { - int32_t sock,timeout,val; - printf("call nn_socket\n"); - sock = nn_socket(AF_SP,NN_PUSH); - printf("nn_socket(NN_PUSH) %d\n",sock); - if ( nn_connect(sock,"tcp://5.9.253.199:7784") >= 0 ) - { - timeout = 1; - printf("call setsockopt\n"); - val = nn_setsockopt(sock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - printf("nn_setsockopt val.%d\n",val); - } else printf("nn_connect error\n"); - } LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f947b9f03..8fb8e4743 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,7 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse + sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse return(str); } From f13d393b91267c924c7e45542eba91388c168566 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:40:09 +0300 Subject: [PATCH 1519/2732] Test --- crypto777/nanosrc/transports/ws/ws_handshake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/transports/ws/ws_handshake.c b/crypto777/nanosrc/transports/ws/ws_handshake.c index 52b8e3f40..eca21d44a 100755 --- a/crypto777/nanosrc/transports/ws/ws_handshake.c +++ b/crypto777/nanosrc/transports/ws/ws_handshake.c @@ -1213,7 +1213,7 @@ static void nn_ws_handshake_client_request (struct nn_ws_handshake *self) nn_random_generate (rand_key, sizeof (rand_key)); - rc = nn_base64_encode (rand_key, sizeof (rand_key), + rc = _nn_base64_encode (rand_key, sizeof (rand_key), encoded_key, sizeof (encoded_key)); encoded_key_len = strlen (encoded_key); @@ -1355,7 +1355,7 @@ static int nn_ws_handshake_hash_key (const char *key, size_t key_len, for (i = 0; i < strlen (NN_WS_HANDSHAKE_MAGIC_GUID); i++) nn_sha1_hashbyte (&hash, NN_WS_HANDSHAKE_MAGIC_GUID [i]); - rc = nn_base64_encode (nn_sha1_result (&hash), + rc = _nn_base64_encode (nn_sha1_result (&hash), sizeof (hash.state), hashed, hashed_len); return rc; From 1b37018f37734b683a63cf6bc3953548aab39e5d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:42:59 +0300 Subject: [PATCH 1520/2732] Test --- crypto777/nanosrc/core/global.c | 2 +- crypto777/nanosrc/transports/ws/sws.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 00a5c48d3..0a11f17cf 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -246,7 +246,7 @@ PNACL_msg("transports init\n"); nn_global_add_transport(nn_ipc); nn_global_add_transport(nn_tcp); nn_global_add_transport(nn_inproc); -//nn_global_add_transport(nn_ws); +nn_global_add_transport(nn_ws); //nn_global_add_transport(nn_tcpmux); //sleep(1); PNACL_msg("socktypes init\n"); diff --git a/crypto777/nanosrc/transports/ws/sws.h b/crypto777/nanosrc/transports/ws/sws.h index d83f3f0fd..b482d1f19 100755 --- a/crypto777/nanosrc/transports/ws/sws.h +++ b/crypto777/nanosrc/transports/ws/sws.h @@ -152,7 +152,7 @@ struct nn_sws { uint8_t inmsg_control [NN_SWS_PAYLOAD_MAX_LENGTH]; /* Reason this connection is closing to send as closing handshake. */ - char fail_msg [NN_SWS_PAYLOAD_MAX_LENGTH]; + uint8_t fail_msg [NN_SWS_PAYLOAD_MAX_LENGTH]; size_t fail_msg_len; /* State of the outbound state machine. */ From fa7708468c7b6380bfef8871f29d9eeabb629450 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:44:34 +0300 Subject: [PATCH 1521/2732] Test --- crypto777/nanosrc/core/global.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 0a11f17cf..9435442ba 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -1245,11 +1245,11 @@ static int nn_global_create_ep (int s, const char *addr, int bind) protosz = delim - addr; addr += protosz + 3; #ifdef NN_USE_MYMSG - if ( strncmp("inproc",proto,strlen("inproc")) != 0 && strncmp("ipc",proto,strlen("ipc")) != 0 && strncmp("tcp",proto,strlen("tcp")) != 0 ) + if ( strncmp("inproc",proto,strlen("inproc")) != 0 && strncmp("ipc",proto,strlen("ipc")) != 0 && strncmp("tcp",proto,strlen("tcp") && strncmp("ws",proto,strlen("ws")) != 0 ) { - PNACL_msg("only ipc, inproc and tcp transport is supported\n"); - printf("only ipc, inproc and tcp transport is supported\n"); - fprintf(stderr,"only ipc, inproc and tcp transport is supported\n"); + PNACL_msg("only ipc, inproc, ws and tcp transport is supported\n"); + printf("only ipc, inproc, ws and tcp transport is supported\n"); + fprintf(stderr,"only ipc, inproc, ws and tcp transport is supported\n"); exit(-1); return -EPROTONOSUPPORT; } From 8a6eb3753d3ffb2b92f69f5153499be8286e4d04 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:45:27 +0300 Subject: [PATCH 1522/2732] Test --- crypto777/nanosrc/core/global.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 9435442ba..324b266f7 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -1245,7 +1245,7 @@ static int nn_global_create_ep (int s, const char *addr, int bind) protosz = delim - addr; addr += protosz + 3; #ifdef NN_USE_MYMSG - if ( strncmp("inproc",proto,strlen("inproc")) != 0 && strncmp("ipc",proto,strlen("ipc")) != 0 && strncmp("tcp",proto,strlen("tcp") && strncmp("ws",proto,strlen("ws")) != 0 ) + if ( strncmp("inproc",proto,strlen("inproc")) != 0 && strncmp("ipc",proto,strlen("ipc")) != 0 && strncmp("tcp",proto,strlen("tcp")) && strncmp("ws",proto,strlen("ws")) != 0 ) { PNACL_msg("only ipc, inproc, ws and tcp transport is supported\n"); printf("only ipc, inproc, ws and tcp transport is supported\n"); From 68dc6444819636103096db3593aff37e3010f301 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:53:28 +0300 Subject: [PATCH 1523/2732] Test --- iguana/exchanges/LP_peers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index c922d981d..064086a03 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -120,6 +120,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); if ( peer->pushsock >= 0 && peer->subsock >= 0 ) { + printf("add peer %s\n",peer->ipaddr); portable_mutex_lock(&LP_peermutex); HASH_ADD(hh,LP_peerinfos,ip_port,sizeof(peer->ip_port),peer); if ( mypeer != 0 ) @@ -146,7 +147,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char } } } - } + } else printf("%s invalid pushsock.%d or subsock.%d\n",peer->ipaddr,peer->pushsock,peer->subsock); } } else printf("LP_addpeer: checkip.(%s) vs (%s)\n",checkip,ipaddr); return(peer); From 32ac594da34f7fdb5b31ff221b8183d43291e1b1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 16:56:06 +0300 Subject: [PATCH 1524/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 87e222656..9bbee8b59 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -288,6 +288,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int cJSON *recvjson; //char *mstr,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { + printf("%s RECV.(%s)\n",typestr,(char *)ptr); /*if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { From 41292f2cc2e7e45cc5e1c44b7364eb6490f2e69e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:07:30 +0300 Subject: [PATCH 1525/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9bbee8b59..adb64ea4d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1031,6 +1031,7 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); + LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); LP_counter++; } From f99dcf0a0c95ade37626f2d2294a7dcad67a073d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:10:24 +0300 Subject: [PATCH 1526/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index adb64ea4d..9f9ac3ae7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -288,7 +288,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int cJSON *recvjson; //char *mstr,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { - printf("%s RECV.(%s)\n",typestr,(char *)ptr); /*if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { From 057ed4c396287ec1df1e57fc8420f49eebcba772 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:21:50 +0300 Subject: [PATCH 1527/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 17 ++++++++++++++++- iguana/exchanges/LP_network.c | 3 +++ iguana/exchanges/mm.c | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9f9ac3ae7..5f7bfff7e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -275,16 +275,21 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int while ( nonz < maxdepth && recvlen > 0 ) { nonz++; +#ifndef FROM_JS memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) break; +#endif if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { methodstr[0] = 0; if ( 1 ) { +#ifdef FROM_JS + printf("%s RECV.(%s)\n",typestr,(char *)ptr); +#endif cJSON *recvjson; //char *mstr,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { @@ -297,6 +302,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } +#ifdef FROM_JS + else printf("%s got recv.%d\n",typestr,recvlen); +#endif double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -767,12 +775,16 @@ void LP_reserved_msgs(void *ignore) { portable_mutex_lock(&LP_reservedmutex); num_Reserved_msgs--; - //printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); +#ifdef FROM_JS + printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); +#endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); } } + if ( ignore == 0 ) + break; usleep(3000); } } @@ -1030,6 +1042,9 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); + LP_pubkeys_query(); + LP_utxosQ_process(); + LP_reserved_msgs(0); LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); LP_counter++; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 8fb8e4743..0b4c875e2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -157,6 +157,9 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); +#ifdef FROM_JS + else printf("sent %d bytes of %d to sock.%d\n",sentbytes,ptr->msglen,ptr->sock); +#endif ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 296e25647..ed9683eb3 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -887,7 +887,7 @@ int main(int argc, const char * argv[]) retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); printf("calling LP_main(%s)\n",jprint(retjson,0)); LP_main(retjson); - emscripten_set_main_loop(LP_fromjs_iter,1,0); + emscripten_set_main_loop(LP_fromjs_iter,10,0); #else if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { From 95848e89d70558238185d34036d70667730d1bae Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:27:00 +0300 Subject: [PATCH 1528/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_prices.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5f7bfff7e..657235bb3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -612,7 +612,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; +#ifndef FROM_JS LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); +#endif peer->diduquery = 0; LP_peer_pricesquery(peer); LP_utxos_sync(peer); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ae42cd6c8..f1dae8cde 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -344,6 +344,9 @@ void LP_peer_pricesquery(struct LP_peerinfo *peer) peer->needping = (uint32_t)time(NULL); if ( (retstr= issue_LP_getprices(peer->ipaddr,peer->port)) != 0 ) { +#ifdef FROM_JS + printf("%s\n",retstr); +#endif if ( (array= cJSON_Parse(retstr)) != 0 ) { if ( is_cJSON_Array(array) && (n= cJSON_GetArraySize(array)) > 0 ) From 9fcb13501e717f4fe8f9b3eb3a66c08e903d8c24 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:32:33 +0300 Subject: [PATCH 1529/2732] Test --- iguana/exchanges/LP_commands.c | 8 ++++---- iguana/exchanges/LP_nativeDEX.c | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f2c641d94..32c84a180 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -450,13 +450,13 @@ stop()\n\ } // received response if ( strcmp(method,"postprice") == 0 ) - retstr = LP_postprice_recv(argjson); + return(LP_postprice_recv(argjson)); else if ( strcmp(method,"postutxos") == 0 ) - retstr = LP_postutxos_recv(argjson); + return(LP_postutxos_recv(argjson)); else if ( strcmp(method,"uitem") == 0 ) - retstr = LP_uitem_recv(argjson); + return(LP_uitem_recv(argjson)); else if ( strcmp(method,"notify") == 0 ) - retstr = LP_notify_recv(argjson); + return(LP_notify_recv(argjson)); // end received response // public access, even from http diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 657235bb3..157979314 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -794,6 +794,7 @@ void LP_reserved_msgs(void *ignore) int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) { int32_t n = 0; +#ifndef FROM_JS portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) { @@ -801,6 +802,9 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) n = num_Reserved_msgs; } else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); portable_mutex_unlock(&LP_reservedmutex); +#else + LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); +#endif if ( num_Reserved_msgs > max_Reserved_msgs ) { max_Reserved_msgs = num_Reserved_msgs; @@ -1046,7 +1050,6 @@ void LP_fromjs_iter() printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); LP_pubkeys_query(); LP_utxosQ_process(); - LP_reserved_msgs(0); LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); LP_counter++; From b752274a38b63436899ed083636d8b0f66bc5760 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:38:14 +0300 Subject: [PATCH 1530/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 157979314..03dd4f25a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -626,8 +626,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { peer->diduquery = now; nonz++; +#ifndef FROM_JS if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); +#endif peer->needping = 0; needpings++; } From 050700fcbd843c060c7d09a0f2ca6358d9481b39 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:51:02 +0300 Subject: [PATCH 1531/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +--- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 03dd4f25a..3840a913d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -779,9 +779,6 @@ void LP_reserved_msgs(void *ignore) { portable_mutex_lock(&LP_reservedmutex); num_Reserved_msgs--; -#ifdef FROM_JS - printf("%d BROADCASTING RESERVED.(%s)\n",num_Reserved_msgs,Reserved_msgs[num_Reserved_msgs]); -#endif LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); Reserved_msgs[num_Reserved_msgs] = 0; portable_mutex_unlock(&LP_reservedmutex); @@ -806,6 +803,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) portable_mutex_unlock(&LP_reservedmutex); #else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); + printf("reserved_msg.(%s)\n",msg); #endif if ( num_Reserved_msgs > max_Reserved_msgs ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f1dae8cde..4b4113f42 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -685,7 +685,7 @@ void LP_pubkeys_query() reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); - //printf("%s\n",jprint(reqjson,0)); + printf("LP_pubkeys_query %s\n",jprint(reqjson,0)); LP_reserved_msg("","",zero,jprint(reqjson,1)); } } From 6b82dbc9f9e9241eb894af10c5f030d76f1b3ecf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 17:54:03 +0300 Subject: [PATCH 1532/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3840a913d..aceba1ffd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -802,8 +802,8 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) } else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); portable_mutex_unlock(&LP_reservedmutex); #else - LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); printf("reserved_msg.(%s)\n",msg); + LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); #endif if ( num_Reserved_msgs > max_Reserved_msgs ) { From fdf17a70ec5c18680dcb9b07757aa92d299e8e24 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 18:00:03 +0300 Subject: [PATCH 1533/2732] Test --- iguana/exchanges/LP_network.c | 19 +++++++++++++++---- iguana/exchanges/mm.c | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0b4c875e2..a7d516a7f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -157,9 +157,6 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); -#ifdef FROM_JS - else printf("sent %d bytes of %d to sock.%d\n",sentbytes,ptr->msglen,ptr->sock); -#endif ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -290,7 +287,21 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON // add signature here msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; +#ifdef FROM_JS + int32_t sentbytes,sock,peerind,maxind; + if ( (maxind= LP_numpeers()) > 0 ) + peerind = (rand() % maxind) + 1; + else peerind = 1; + sock = LP_peerindsock(&peerind); + if ( sock >= 0 ) + { + if ( (sentbytes= nn_send(sock,msg,msglen,0)) != msglen ) + printf("%d LP_send sent %d instead of %d\n",n,sentbytes,msglen); + else printf("sent %d bytes of %d to sock.%d\n",sentbytes,msglen,sock); + } else printf("couldnt get valid sock\n"); +#else LP_queuesend(crc32,-1,base,rel,msg,msglen); +#endif } else LP_queuesend(crc32,pubsock,base,rel,msg,msglen); free(msg); } @@ -335,7 +346,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 // printf("finished %u\n",crc32); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); - } else printf("couldnt parse (%s)\n",msgstr); + } else printf("couldnt parse %p (%s)\n",msgstr,msgstr); } else { diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index ed9683eb3..296e25647 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -887,7 +887,7 @@ int main(int argc, const char * argv[]) retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); printf("calling LP_main(%s)\n",jprint(retjson,0)); LP_main(retjson); - emscripten_set_main_loop(LP_fromjs_iter,10,0); + emscripten_set_main_loop(LP_fromjs_iter,1,0); #else if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { From 46a3031b77312c4402ed7b02209577b0e792156d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 18:00:49 +0300 Subject: [PATCH 1534/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a7d516a7f..eeb23603f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -296,7 +296,7 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON if ( sock >= 0 ) { if ( (sentbytes= nn_send(sock,msg,msglen,0)) != msglen ) - printf("%d LP_send sent %d instead of %d\n",n,sentbytes,msglen); + printf("LP_send sent %d instead of %d\n",sentbytes,msglen); else printf("sent %d bytes of %d to sock.%d\n",sentbytes,msglen,sock); } else printf("couldnt get valid sock\n"); #else From 1fd97e7c5b0ac22a1e5e9a02d4fca89c66d3af2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 18:05:57 +0300 Subject: [PATCH 1535/2732] Test --- crypto777/nanosrc/core/global.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 324b266f7..4edab59f8 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -809,15 +809,17 @@ int32_t nn_recvmsg(int32_t s,struct nn_msghdr *msghdr,int32_t flags) int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) { int32_t rc,i,nnmsg; size_t sz,spsz; struct nn_iovec *iov; struct nn_msg msg; void *chunk; struct nn_cmsghdr *cmsg; - //PNACL_msg("nn_sendmsg.(%d) \n",s); + printf("nn_sendmsg.(%d) \n",s); NN_BASIC_CHECKS; if ( nn_slow(!msghdr) ) { + printf("nn_sendmsg.EINVAL\n"); errno = EINVAL; return -1; } if ( nn_slow(msghdr->msg_iovlen < 0) ) { + printf("nn_sendmsg.EMSGSIZE\n"); errno = EMSGSIZE; return -1; } @@ -827,6 +829,7 @@ int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) if ( nn_slow(chunk == NULL) ) { errno = EFAULT; + printf("nn_sendmsg.EFAULT\n"); return -1; } sz = nn_chunk_size(chunk); @@ -905,6 +908,7 @@ int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) /* Send it further down the stack. */ rc = nn_sock_send (SELF.socks [s], &msg, flags); + printf("nn_sock_send rc.%d\n",rc); if (nn_slow (rc < 0)) { /* If we are dealing with user-supplied buffer, detach it from From c079c4ccc353b33ab4edebb5a568de3540a54b0c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 18:08:32 +0300 Subject: [PATCH 1536/2732] Test --- crypto777/nanosrc/core/global.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 4edab59f8..6a276cc8a 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -652,6 +652,7 @@ int32_t nn_send(int32_t s,const void *buf,size_t len,int32_t flags) hdr.msg_iovlen = 1; hdr.msg_control = NULL; hdr.msg_controllen = 0; + printf("nn_send calling nn_sendmsg\n"); return nn_sendmsg(s,&hdr,flags); } From c5d47328135bf806ec666c430928b51126102225 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 18:11:25 +0300 Subject: [PATCH 1537/2732] Test --- crypto777/nanosrc/core/global.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 6a276cc8a..3c6f07011 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -673,15 +673,17 @@ int32_t nn_recv(int32_t s,void *buf,size_t len,int32_t flags) int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) { int32_t rc,i,nnmsg; size_t sz; struct nn_iovec *iov; struct nn_msg msg; void *chunk; - //PNACL_msg("nn_sendmsg.(%d) \n",s); + printf("nn_sendmsg.(%d) \n",s); NN_BASIC_CHECKS; if ( nn_slow(!msghdr) ) { + printf("nn_sendmsg.(%d) einval\n",s); errno = EINVAL; return -1; } if ( nn_slow(msghdr->msg_iovlen < 0) ) { + printf("nn_sendmsg.(%d) emsgsize\n",s); errno = EMSGSIZE; return -1; } @@ -690,6 +692,7 @@ int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) chunk = *(void **)msghdr->msg_iov[0].iov_base; if ( nn_slow(chunk == NULL) ) { + printf("nn_sendmsg.(%d) efault\n",s); errno = EFAULT; return -1; } @@ -732,6 +735,7 @@ int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) } nn_assert(msghdr->msg_control == 0); // cant support msgs until sendmsg()/recvmsg() native to pnacl rc = nn_sock_send(SELF.socks[s],&msg,flags); // Send it further down the stack + printf("rc from nn_socksend.%d\n",rc); if ( nn_slow(rc < 0) ) { // If we are dealing with user-supplied buffer, detach it from the message object From ee03fa567e14dccd8106b11b44a118e322c3807a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 23:29:26 +0300 Subject: [PATCH 1538/2732] Test --- crypto777/nanosrc/aio/usock_posix.c | 76 ++++++++++----------- crypto777/nanosrc/core/global.c | 4 +- crypto777/nanosrc/core/sock.c | 4 +- crypto777/nanosrc/nn_config.h | 4 +- crypto777/nanosrc/transports/utils/tcpmux.c | 2 +- crypto777/nanosrc/transports/ws/sws.c | 2 +- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c b/crypto777/nanosrc/aio/usock_posix.c index 3989d3a22..2f85e559c 100755 --- a/crypto777/nanosrc/aio/usock_posix.c +++ b/crypto777/nanosrc/aio/usock_posix.c @@ -167,7 +167,7 @@ int nn_usock_start (struct nn_usock *self, int domain, int type, int protocol) s = socket (domain, type, protocol); if (nn_slow (s < 0)) return -errno; - //PNACL_msg("got socket s.%d\n",s); + //printf("got socket s.%d\n",s); nn_usock_init_from_fd (self, s); /* Start the state machine. */ @@ -286,14 +286,14 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* Allow re-using the address. */ opt = 1; - PNACL_msg("call setsockopt %d SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); + printf("call setsockopt %d SOL_SOCKET.%d SO_REUSEADDR.%d in nn_usock_bind\n",self->s,SOL_SOCKET,SO_REUSEADDR); rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); - PNACL_msg("called setsockopt in nn_usock_bind returns %d\n",rc); + printf("called setsockopt in nn_usock_bind returns %d\n",rc); // ignore SO_REUSEADDR failures //errno_assert (rc == 0); rc = bind (self->s, addr, (socklen_t) addrlen); - PNACL_msg("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); + printf("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); if (nn_slow (rc != 0)) return -errno; @@ -309,7 +309,7 @@ int nn_usock_listen (struct nn_usock *self, int backlog) /* Start listening for incoming connections. */ rc = listen (self->s, backlog); - //PNACL_msg("usock.%d -> listen rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); + printf("usock.%d -> listen rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); if (nn_slow (rc != 0)) return -errno; @@ -336,7 +336,7 @@ void nn_usock_accept (struct nn_usock *self, struct nn_usock *listener) #else s = accept (listener->s, NULL, NULL); #endif - //PNACL_msg("usock.%d -> accept errno.%d s.%d %s\n",self->s,errno,s,nn_strerror(errno)); + printf("usock.%d -> accept errno.%d s.%d %s\n",self->s,errno,s,nn_strerror(errno)); /* Immediate success. */ if (nn_fast (s >= 0)) { @@ -369,7 +369,7 @@ void nn_usock_accept (struct nn_usock *self, struct nn_usock *listener) and allow processing other events in the meantime */ if (nn_slow (errno != EAGAIN && errno != EWOULDBLOCK && errno != ECONNABORTED && errno != listener->errnum)) { - PNACL_msg("listen errno.%d\n",errno); + printf("listen errno.%d\n",errno); listener->errnum = errno; listener->state = NN_USOCK_STATE_ACCEPTING_ERROR; nn_fsm_raise (&listener->fsm, @@ -396,7 +396,7 @@ void nn_usock_connect (struct nn_usock *self, const struct sockaddr *addr, /* Do the connect itself. */ rc = connect(self->s,addr,(socklen_t)addrlen); - //PNACL_msg("usock.%d <- connect (%llx) rc.%d errno.%d %s\n",self->s,*(long long *)addr,rc,errno,nn_strerror(errno)); + printf("usock.%d <- connect (%llx) rc.%d errno.%d %s\n",self->s,*(long long *)addr,rc,errno,nn_strerror(errno)); /* Immediate success. */ if ( nn_fast(rc == 0) ) { @@ -407,7 +407,7 @@ void nn_usock_connect (struct nn_usock *self, const struct sockaddr *addr, if ( nn_slow(errno != EINPROGRESS) ) { self->errnum = errno; - PNACL_msg("error.%d not EINPROGRESS\n",errno); + printf("error.%d not EINPROGRESS\n",errno); nn_fsm_action (&self->fsm, NN_USOCK_ACTION_ERROR); return; } @@ -436,13 +436,13 @@ void nn_usock_send (struct nn_usock *self, const struct nn_iovec *iov, self->out.iov [out].iov_base = iov [i].iov_base; self->out.iov [out].iov_len = iov [i].iov_len; out++; - //PNACL_msg("{%d} ",(int)iov [i].iov_len); + printf("{%d} ",(int)iov [i].iov_len); } - //PNACL_msg("iov[%d]\n",out); self->out.hdr.msg_iovlen = out; /* Try to send the data immediately. */ rc = nn_usock_send_raw (self, &self->out.hdr); + printf("iov[%d] nn_usock_send_raw -> rc.%d\n",out,rc); /* Success. */ if (nn_fast (rc == 0)) { @@ -475,17 +475,17 @@ void nn_usock_recv (struct nn_usock *self, void *buf, size_t len, int *fd) rc = nn_usock_recv_raw (self, buf, &nbytes); if (nn_slow (rc < 0)) { errnum_assert (rc == -ECONNRESET, -rc); - //PNACL_msg("rc.%d vs ECONNRESET\n",rc,ECONNRESET); + //printf("rc.%d vs ECONNRESET\n",rc,ECONNRESET); nn_fsm_action (&self->fsm, NN_USOCK_ACTION_ERROR); return; } //int i; //for (i=0; i<16&&ifsm, &self->event_received, NN_USOCK_RECEIVED); return; } @@ -1024,19 +1024,19 @@ int32_t nn_getiovec_size(uint8_t *buf,int32_t maxlen,struct msghdr *hdr) if ( nn_slow(iov->iov_len == NN_MSG) ) { errno = EINVAL; - PNACL_msg("ERROR: iov->iov_len == NN_MSG\n"); + printf("ERROR: iov->iov_len == NN_MSG\n"); return(-1); } if ( nn_slow(!iov->iov_base && iov->iov_len) ) { errno = EFAULT; - PNACL_msg("ERROR: !iov->iov_base && iov->iov_len\n"); + printf("ERROR: !iov->iov_base && iov->iov_len\n"); return(-1); } if ( maxlen > 0 && nn_slow(size + iov->iov_len > maxlen) ) { errno = EINVAL; - PNACL_msg("ERROR: sz.%d + iov->iov_len.%d < maxlen.%d\n",(int32_t)size,(int32_t)iov->iov_len,maxlen); + printf("ERROR: sz.%d + iov->iov_len.%d < maxlen.%d\n",(int32_t)size,(int32_t)iov->iov_len,maxlen); return(-1); } if ( iov->iov_len > 0 ) @@ -1057,7 +1057,7 @@ ssize_t mysendmsg(int32_t usock,struct msghdr *hdr,int32_t flags) clen = hdr->msg_controllen; if ( hdr->msg_control == 0 ) clen = 0; - nn_assert(clen == 0); // no supporty control messagies + nn_assert(clen == 0); // no support control messagies if ( veclen > sizeof(_buf) ) // - clen - 5) ) buf = malloc(veclen);// + clen + 5); else buf = _buf; @@ -1072,10 +1072,10 @@ ssize_t mysendmsg(int32_t usock,struct msghdr *hdr,int32_t flags) if ( nn_getiovec_size(&buf[offset],veclen,hdr) == veclen ) { nbytes = send(usock,buf,offset + veclen,0); - //PNACL_msg(">>>>>>>>> send.[%d %d %d %d] (n.%d v.%d c.%d)-> usock.%d nbytes.%d\n",buf[offset],buf[offset+1],buf[offset+2],buf[offset+3],(int32_t)offset+veclen,veclen,clen,usock,(int32_t)nbytes); + printf(">>>>>>>>> send.[%d %d %d %d] (n.%d v.%d c.%d)-> usock.%d nbytes.%d\n",buf[offset],buf[offset+1],buf[offset+2],buf[offset+3],(int32_t)offset+veclen,veclen,clen,usock,(int32_t)nbytes); if ( nbytes != offset + veclen ) { - //PNACL_msg("nbytes.%d != offset.%d veclen.%d errno.%d usock.%d\n",(int32_t)nbytes,(int32_t)offset,veclen,errno,usock); + printf("nbytes.%d != offset.%d veclen.%d errno.%d usock.%d\n",(int32_t)nbytes,(int32_t)offset,veclen,errno,usock); } if ( nbytes >= offset ) nbytes -= offset; @@ -1083,19 +1083,19 @@ ssize_t mysendmsg(int32_t usock,struct msghdr *hdr,int32_t flags) else { err = -errno; - PNACL_msg("mysendmsg: unexpected nn_getiovec_size error %d\n",err); + printf("mysendmsg: unexpected nn_getiovec_size error %d\n",err); } if ( buf != _buf ) free(buf); if ( err != 0 ) { - PNACL_msg("nn_usock_send_raw errno.%d err.%d\n",errno,err); + printf("nn_usock_send_raw errno.%d err.%d\n",errno,err); return(-errno); } } else { - PNACL_msg("nn_usock_send_raw errno.%d invalid iovec size\n",errno); + printf("nn_usock_send_raw errno.%d invalid iovec size\n",errno); return(-errno); } return(nbytes); @@ -1107,32 +1107,32 @@ ssize_t myrecvmsg(int32_t usock,struct msghdr *hdr,int32_t flags,int32_t len) iov = hdr->msg_iov; /*if ( (n= (int32_t)recv(usock,lens,sizeof(lens),0)) != sizeof(lens) ) { - PNACL_msg("error getting veclen/clen n.%d vs %d from usock.%d\n",n,(int32_t)sizeof(lens),usock); + printf("error getting veclen/clen n.%d vs %d from usock.%d\n",n,(int32_t)sizeof(lens),usock); return(0); - } else PNACL_msg("GOT %d bytes from usock.%d\n",n,usock); + } else printf("GOT %d bytes from usock.%d\n",n,usock); offset = 0; veclen = lens[offset++]; veclen |= ((int32_t)lens[offset++] << 8); veclen |= ((int32_t)lens[offset++] << 16); clen = lens[offset++]; clen |= ((int32_t)lens[offset++] << 8); - PNACL_msg("veclen.%d clen.%d waiting in usock.%d\n",veclen,clen,usock); + printf("veclen.%d clen.%d waiting in usock.%d\n",veclen,clen,usock); if ( clen > 0 ) { if ( (cbytes= (int32_t)recv(usock,hdr->msg_control,clen,0)) != clen ) { - PNACL_msg("myrecvmsg: unexpected cbytes.%d vs clen.%d\n",cbytes,clen); + printf("myrecvmsg: unexpected cbytes.%d vs clen.%d\n",cbytes,clen); } } else cbytes = 0;*/ hdr->msg_controllen = 0; if ( (nbytes= (int32_t)recv(usock,iov->iov_base,len,0)) != len ) { - //PNACL_msg("myrecvmsg: partial nbytes.%d vs veclen.%d\n",(int32_t)nbytes,len); + //printf("myrecvmsg: partial nbytes.%d vs veclen.%d\n",(int32_t)nbytes,len); } - //PNACL_msg("GOT nbytes.%d of len.%d from usock.%d\n",(int32_t)nbytes,len,usock); + //printf("GOT nbytes.%d of len.%d from usock.%d\n",(int32_t)nbytes,len,usock); if ( 0 && nbytes > 0 ) { - PNACL_msg("got nbytes.%d from usock.%d [%d %d %d %d]\n",(int32_t)nbytes,usock,((uint8_t *)iov->iov_base)[0],((uint8_t *)iov->iov_base)[1],((uint8_t *)iov->iov_base)[2],((uint8_t *)iov->iov_base)[3]); + printf("got nbytes.%d from usock.%d [%d %d %d %d]\n",(int32_t)nbytes,usock,((uint8_t *)iov->iov_base)[0],((uint8_t *)iov->iov_base)[1],((uint8_t *)iov->iov_base)[2],((uint8_t *)iov->iov_base)[3]); } return(nbytes); } @@ -1147,7 +1147,7 @@ static int nn_usock_send_raw (struct nn_usock *self, struct msghdr *hdr) nbytes = sendmsg(self->s,hdr,MSG_NOSIGNAL); #else nbytes = sendmsg(self->s,hdr,0); - //PNACL_msg("sendmsg nbytes.%d\n",(int32_t)nbytes); + printf("nn_usock_send_raw nbytes.%d\n",(int32_t)nbytes); #endif #endif /* Handle errors. */ @@ -1202,13 +1202,13 @@ int32_t nn_process_cmsg(struct nn_usock *self,struct msghdr *hdr) memcpy(&retval,(int32_t *)CMSG_DATA(cmsg),sizeof(int32_t)); if ( self->in.pfd ) { - PNACL_msg("CMSG set self->in.pfd (%d)\n",retval); + printf("CMSG set self->in.pfd (%d)\n",retval); *self->in.pfd = retval; self->in.pfd = NULL; } else { - PNACL_msg("CMSG nn_closefd(%d)\n",retval); + printf("CMSG nn_closefd(%d)\n",retval); nn_closefd(retval); } break; @@ -1260,7 +1260,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) if (!length) return 0; } -#ifdef NN_USE_MYMSG +#if NN_USE_MYMSG usebuf = (length >= NN_USOCK_BATCH_SIZE); #else usebuf = (length >= NN_USOCK_BATCH_SIZE); @@ -1289,7 +1289,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) #if NN_USE_MYMSG nbytes = myrecvmsg(self->s,&hdr,0,(int32_t)iov.iov_len); - //PNACL_msg("got nbytes.%d from recvmsg errno.%d %s\n",(int32_t)nbytes,errno,nn_strerror(errno)); + printf("got nbytes.%d from recvmsg errno.%d %s\n",(int32_t)nbytes,errno,nn_strerror(errno)); #else nbytes = recvmsg (self->s, &hdr, 0); #endif @@ -1301,7 +1301,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) nbytes = 0; else { - PNACL_msg("recvraw errno.%d %s\n",errno,nn_strerror(errno)); + printf("recvraw errno.%d %s\n",errno,nn_strerror(errno)); // If the peer closes the connection, return ECONNRESET errno_assert(errno == ECONNRESET || errno == ENOTCONN || errno == ECONNREFUSED || errno == ETIMEDOUT || errno == EHOSTUNREACH #if NN_USE_MYMSG @@ -1313,7 +1313,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len) } } else if ( hdr.msg_controllen > 0 ) nn_process_cmsg(self,&hdr); - //PNACL_msg("nbytes.%d length.%d *len %d\n",(int)nbytes,(int)length,(int)*len); + printf("nbytes.%d length.%d *len %d\n",(int)nbytes,(int)length,(int)*len); // If the data were received directly into the place we can return straight away if ( usebuf != 0 ) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index 3c6f07011..c654753fd 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -668,7 +668,7 @@ int32_t nn_recv(int32_t s,void *buf,size_t len,int32_t flags) return nn_recvmsg(s,&hdr,flags); } -#ifdef NN_USE_MYMSG +#if NN_USE_MYMSG int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) { @@ -1253,7 +1253,7 @@ static int nn_global_create_ep (int s, const char *addr, int bind) return -EINVAL; protosz = delim - addr; addr += protosz + 3; -#ifdef NN_USE_MYMSG +#if NN_USE_MYMSG if ( strncmp("inproc",proto,strlen("inproc")) != 0 && strncmp("ipc",proto,strlen("ipc")) != 0 && strncmp("tcp",proto,strlen("tcp")) && strncmp("ws",proto,strlen("ws")) != 0 ) { PNACL_msg("only ipc, inproc, ws and tcp transport is supported\n"); diff --git a/crypto777/nanosrc/core/sock.c b/crypto777/nanosrc/core/sock.c index 83e8afce7..7427a5fc4 100755 --- a/crypto777/nanosrc/core/sock.c +++ b/crypto777/nanosrc/core/sock.c @@ -548,6 +548,7 @@ int nn_sock_send(struct nn_sock *self, struct nn_msg *msg, int flags) /* Try to send the message in a non-blocking way. */ rc = self->sockbase->vfptr->send (self->sockbase, msg); +printf("sockbase send rc.%d\n",rc); if (nn_fast (rc == 0)) { nn_ctx_leave (&self->ctx); return 0; @@ -560,8 +561,7 @@ int nn_sock_send(struct nn_sock *self, struct nn_msg *msg, int flags) return rc; } - /* If the message cannot be sent at the moment and the send call - is non-blocking, return immediately. */ + // If the message cannot be sent at the moment and the send call is non-blocking, return immediately. if (nn_fast (flags & NN_DONTWAIT)) { nn_ctx_leave (&self->ctx); return -EAGAIN; diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 74edc6229..d98b64038 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -58,10 +58,10 @@ performance optimal make sure that this value is larger than network MTU. */ #define NN_USOCK_BATCH_SIZE (2048) //#define NN_USOCK_BATCH_SIZE (_NN_USOCK_BATCH_SIZE - 5 - 256 - 16) // adjust for veclen/clen + sizeof(ctrl) -#define NN_USE_MYMSG 1 +#define NN_USE_MYMSG 0 #if defined __PNACL || defined __APPLE__ -#define NN_USE_MYMSG 1 +#define NN_USE_MYMSG 0 #endif #define nn_errstr() nn_strerror(nn_errno()) diff --git a/crypto777/nanosrc/transports/utils/tcpmux.c b/crypto777/nanosrc/transports/utils/tcpmux.c index b6cd7c24b..9f2cc3a60 100755 --- a/crypto777/nanosrc/transports/utils/tcpmux.c +++ b/crypto777/nanosrc/transports/utils/tcpmux.c @@ -83,7 +83,7 @@ int tcpmux_accept (int s) memset (&hdr, 0, sizeof (hdr)); hdr.msg_iov = &iov; hdr.msg_iovlen = 1; -#ifndef NN_USE_MYMSG +#if !NN_USE_MYMSG unsigned char buf [256]; hdr.msg_control = buf; hdr.msg_controllen = sizeof (buf); diff --git a/crypto777/nanosrc/transports/ws/sws.c b/crypto777/nanosrc/transports/ws/sws.c index 45f5430cc..65c1bb384 100755 --- a/crypto777/nanosrc/transports/ws/sws.c +++ b/crypto777/nanosrc/transports/ws/sws.c @@ -370,7 +370,7 @@ static int nn_sws_send (struct nn_pipebase *self, struct nn_msg *msg) struct nn_cmsghdr *cmsg; struct nn_msghdr msghdr; uint8_t rand_mask [NN_SWS_FRAME_SIZE_MASK]; - +printf("nn_sws_send\n"); sws = nn_cont (self, struct nn_sws, pipebase); nn_assert_state (sws, NN_SWS_STATE_ACTIVE); From 2fc37f4310e653d4065c760f4eb53ef69fc47495 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 23:36:38 +0300 Subject: [PATCH 1539/2732] Test --- crypto777/nanosrc/nn_config.h | 4 ++-- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index d98b64038..74edc6229 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -58,10 +58,10 @@ performance optimal make sure that this value is larger than network MTU. */ #define NN_USOCK_BATCH_SIZE (2048) //#define NN_USOCK_BATCH_SIZE (_NN_USOCK_BATCH_SIZE - 5 - 256 - 16) // adjust for veclen/clen + sizeof(ctrl) -#define NN_USE_MYMSG 0 +#define NN_USE_MYMSG 1 #if defined __PNACL || defined __APPLE__ -#define NN_USE_MYMSG 0 +#define NN_USE_MYMSG 1 #endif #define nn_errstr() nn_strerror(nn_errno()) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 4b4113f42..fdc14779c 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -685,7 +685,7 @@ void LP_pubkeys_query() reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); - printf("LP_pubkeys_query %s\n",jprint(reqjson,0)); + //printf("LP_pubkeys_query %s\n",jprint(reqjson,0)); LP_reserved_msg("","",zero,jprint(reqjson,1)); } } From 06f9b1794a782a92ca0b555fee922f5e68b80452 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Oct 2017 23:51:57 +0300 Subject: [PATCH 1540/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eeb23603f..27b437469 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,7 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse + sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse return(str); } From 87e78ef35908b430c36efc3af320ed04a991fb86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 00:05:50 +0300 Subject: [PATCH 1541/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 27b437469..eeb23603f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,7 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse + sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse return(str); } From fdf629ed08331e0d84d502a547f05339beab8767 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 00:14:43 +0300 Subject: [PATCH 1542/2732] Test --- crypto777/nanosrc/aio/usock_posix.c_dev | 2 +- crypto777/nanosrc/protocols/pipeline/xpush.c | 1 + crypto777/nanosrc/protocols/utils/lb.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/aio/usock_posix.c_dev b/crypto777/nanosrc/aio/usock_posix.c_dev index e5b8a1c35..244b0753c 100755 --- a/crypto777/nanosrc/aio/usock_posix.c_dev +++ b/crypto777/nanosrc/aio/usock_posix.c_dev @@ -1000,7 +1000,7 @@ static int32_t nn_usock_send_raw(struct nn_usock *self,struct msghdr *hdr) #else nbytes = sendmsg(self->s,hdr,0); #endif - PostMessage("nn_usock_send_raw nbytes.%d for sock.%d\n",(int32_t)nbytes,self->s); + printf("nn_usock_send_raw nbytes.%d for sock.%d\n",(int32_t)nbytes,self->s); if ( nn_slow(nbytes < 0) ) // Handle errors { if ( nn_fast(errno == EAGAIN || errno == EWOULDBLOCK) ) diff --git a/crypto777/nanosrc/protocols/pipeline/xpush.c b/crypto777/nanosrc/protocols/pipeline/xpush.c index 2d938bd1f..75f4ba610 100755 --- a/crypto777/nanosrc/protocols/pipeline/xpush.c +++ b/crypto777/nanosrc/protocols/pipeline/xpush.c @@ -160,6 +160,7 @@ static int nn_xpush_events (struct nn_sockbase *self) static int nn_xpush_send (struct nn_sockbase *self, struct nn_msg *msg) { + printf("nn_xpush_send\n"); return nn_lb_send (&nn_cont (self, struct nn_xpush, sockbase)->lb, msg, NULL); } diff --git a/crypto777/nanosrc/protocols/utils/lb.c b/crypto777/nanosrc/protocols/utils/lb.c index f0e2e88e3..90e31b92d 100755 --- a/crypto777/nanosrc/protocols/utils/lb.c +++ b/crypto777/nanosrc/protocols/utils/lb.c @@ -68,14 +68,16 @@ int nn_lb_send (struct nn_lb *self, struct nn_msg *msg, struct nn_pipe **to) { int rc; struct nn_pipe *pipe; - + printf("nn_lb_send\n"); /* Pipe is NULL only when there are no avialable pipes. */ pipe = nn_priolist_getpipe (&self->priolist); + printf("nn_lb_send pipe.%p\n",pipe); if (nn_slow (!pipe)) return -EAGAIN; /* Send the messsage. */ rc = nn_pipe_send (pipe, msg); + printf("nn_pipe_send rc.%d\n",rc); errnum_assert (rc >= 0, -rc); /* Move to the next pipe. */ From 7d7f4898274a45f7cd0aab7707dac9638143929b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 00:24:22 +0300 Subject: [PATCH 1543/2732] Test --- crypto777/nanosrc/protocols/pipeline/xpush.c | 2 +- crypto777/nanosrc/protocols/reqrep/xreq.c | 2 +- crypto777/nanosrc/protocols/utils/lb.c | 3 +-- crypto777/nanosrc/protocols/utils/priolist.c | 6 +++--- crypto777/nanosrc/protocols/utils/priolist.h | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crypto777/nanosrc/protocols/pipeline/xpush.c b/crypto777/nanosrc/protocols/pipeline/xpush.c index 75f4ba610..10c5cf480 100755 --- a/crypto777/nanosrc/protocols/pipeline/xpush.c +++ b/crypto777/nanosrc/protocols/pipeline/xpush.c @@ -115,7 +115,7 @@ static int nn_xpush_add (struct nn_sockbase *self, struct nn_pipe *pipe) alloc_assert (data); nn_pipe_setdata (pipe, data); nn_lb_add (&xpush->lb, &data->lb, pipe, sndprio); - + printf("nn_xpush_add\n"); return 0; } diff --git a/crypto777/nanosrc/protocols/reqrep/xreq.c b/crypto777/nanosrc/protocols/reqrep/xreq.c index 7b96ba744..7ab93d201 100755 --- a/crypto777/nanosrc/protocols/reqrep/xreq.c +++ b/crypto777/nanosrc/protocols/reqrep/xreq.c @@ -101,7 +101,7 @@ int nn_xreq_add(struct nn_sockbase *self, struct nn_pipe *pipe) nn_pipe_setdata(pipe,data); nn_lb_add(&xreq->lb,&data->lb,pipe,sndprio); nn_fq_add(&xreq->fq,&data->fq,pipe,rcvprio); - + printf("nn_xreq_add\n"); return 0; } diff --git a/crypto777/nanosrc/protocols/utils/lb.c b/crypto777/nanosrc/protocols/utils/lb.c index 90e31b92d..cbff61f2f 100755 --- a/crypto777/nanosrc/protocols/utils/lb.c +++ b/crypto777/nanosrc/protocols/utils/lb.c @@ -37,8 +37,7 @@ void nn_lb_term (struct nn_lb *self) nn_priolist_term (&self->priolist); } -void nn_lb_add (struct nn_lb *self, struct nn_lb_data *data, - struct nn_pipe *pipe, int priority) +void nn_lb_add (struct nn_lb *self, struct nn_lb_data *data,struct nn_pipe *pipe, int priority) { nn_priolist_add (&self->priolist, &data->priodata, pipe, priority); } diff --git a/crypto777/nanosrc/protocols/utils/priolist.c b/crypto777/nanosrc/protocols/utils/priolist.c index a72b5d535..5d5560229 100755 --- a/crypto777/nanosrc/protocols/utils/priolist.c +++ b/crypto777/nanosrc/protocols/utils/priolist.c @@ -54,7 +54,7 @@ void nn_priolist_add(struct nn_priolist *self,struct nn_priolist_data *data, str { data->pipe = pipe; data->priority = priority; - //printf("nn_priolist_add.%p data.%p priority.%d\n",self,data,priority); + printf("nn_priolist_add.%p data.%p priority.%d\n",self,data,priority); nn_list_item_init (&data->item); } @@ -136,10 +136,10 @@ struct nn_pipe *nn_priolist_getpipe(struct nn_priolist *self) { if ( nn_slow(self->current == -1) ) { - //printf("nn_priolist_getpipe.%p -1 current it is\n",self); + printf("nn_priolist_getpipe.%p -1 current it is\n",self); return NULL; } - //printf("nn_priolist_getpipe.%p current.%d slot.%p\n",self,self->current,self->slots[self->current - 1].current->pipe); + printf("nn_priolist_getpipe.%p current.%d slot.%p\n",self,self->current,self->slots[self->current - 1].current->pipe); return self->slots[self->current - 1].current->pipe; } diff --git a/crypto777/nanosrc/protocols/utils/priolist.h b/crypto777/nanosrc/protocols/utils/priolist.h index 9d4a9cad7..358faae79 100755 --- a/crypto777/nanosrc/protocols/utils/priolist.h +++ b/crypto777/nanosrc/protocols/utils/priolist.h @@ -86,8 +86,7 @@ void nn_priolist_activate (struct nn_priolist *self, struct nn_priolist_data *da 0 otherwise. */ int nn_priolist_is_active (struct nn_priolist *self); -/* Get the pointer to the current pipe. If there's no pipe in the list, - NULL is returned. */ +// Get the pointer to the current pipe. If there's no pipe in the list, NULL is returned. struct nn_pipe *nn_priolist_getpipe (struct nn_priolist *self); /* Moves to the next pipe in the list. If 'release' is set to 1, the current From 0918e5da8c8ca70debafe0459943e8d5fde584ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 00:32:14 +0300 Subject: [PATCH 1544/2732] Test --- crypto777/nanosrc/transports/ws/cws.c | 4 +++- crypto777/nanosrc/transports/ws/ws.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/transports/ws/cws.c b/crypto777/nanosrc/transports/ws/cws.c index 57e66c91a..905e90405 100755 --- a/crypto777/nanosrc/transports/ws/cws.c +++ b/crypto777/nanosrc/transports/ws/cws.c @@ -329,7 +329,7 @@ static void nn_cws_handler (struct nn_fsm *self, int src, int type, struct nn_cws *cws; cws = nn_cont (self, struct nn_cws, fsm); - + printf("cws_handler src.%d type.%d state.%d\n",src,type,cws->state); switch (cws->state) { /******************************************************************************/ @@ -409,6 +409,7 @@ static void nn_cws_handler (struct nn_fsm *self, int src, int type, case NN_CWS_SRC_USOCK: switch (type) { case NN_USOCK_CONNECTED: + printf("cws connected\n"); nn_sws_start (&cws->sws, &cws->usock, NN_WS_CLIENT, nn_chunkref_data (&cws->resource), nn_chunkref_data (&cws->remote_host)); @@ -421,6 +422,7 @@ static void nn_cws_handler (struct nn_fsm *self, int src, int type, nn_epbase_clear_error (&cws->epbase); return; case NN_USOCK_ERROR: + printf("cws NN_USOCK_ERROR\n"); nn_epbase_set_error (&cws->epbase,nn_usock_geterrno (&cws->usock),__FILE__,__LINE__); nn_usock_stop(&cws->usock); cws->state = NN_CWS_STATE_STOPPING_USOCK; diff --git a/crypto777/nanosrc/transports/ws/ws.c b/crypto777/nanosrc/transports/ws/ws.c index 0e91e9474..3a9288284 100755 --- a/crypto777/nanosrc/transports/ws/ws.c +++ b/crypto777/nanosrc/transports/ws/ws.c @@ -156,7 +156,7 @@ int nn_ws_send (int s, const void *msg, size_t len, uint8_t msg_type, int flags) struct nn_msghdr hdr; struct nn_cmsghdr *cmsg; size_t cmsgsz; - +printf("nn_ws_send\n"); iov.iov_base = (void*) msg; iov.iov_len = len; From 6a192e19bcf54e3a46cf89f38ff89843cc3bf457 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 00:37:51 +0300 Subject: [PATCH 1545/2732] Test --- crypto777/nanosrc/utils/thread_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/utils/thread_posix.c b/crypto777/nanosrc/utils/thread_posix.c index 32c8428e4..eeaf30aed 100755 --- a/crypto777/nanosrc/utils/thread_posix.c +++ b/crypto777/nanosrc/utils/thread_posix.c @@ -30,7 +30,7 @@ static void *nn_thread_main_routine(void *arg) { struct nn_thread *self; self = (struct nn_thread *)arg; - PNACL_msg("nn_thread_main_routine arg.%p self->routine(%p) at %p\n",arg,self->arg,self->routine); + printf("nn_thread_main_routine arg.%p self->routine(%p) at %p\n",arg,self->arg,self->routine); self->routine(self->arg); // Run the thread routine return NULL; } @@ -47,7 +47,7 @@ void nn_thread_init(struct nn_thread *self,nn_thread_routine *routine,void *arg) { int32_t rc; // No signals should be processed by this thread. The library doesn't use signals and thus all the signals should be delivered to application threads, not to worker threads. - PNACL_msg("nn_thread_init routine.%p arg.%p\n",routine,arg); + printf("nn_thread_init routine.%p arg.%p\n",routine,arg); self->routine = routine; self->arg = arg; rc = pthread_create(&self->handle,NULL,nn_thread_main_routine,(void *)self); From a1a0c2dc8b1f8fbffc085eccdef5fcdf7c13e7e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 00:40:36 +0300 Subject: [PATCH 1546/2732] Test --- crypto777/nanosrc/aio/worker_posix.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crypto777/nanosrc/aio/worker_posix.c b/crypto777/nanosrc/aio/worker_posix.c index 8d3ed2a46..48ee252a5 100755 --- a/crypto777/nanosrc/aio/worker_posix.c +++ b/crypto777/nanosrc/aio/worker_posix.c @@ -173,7 +173,7 @@ static void nn_worker_routine (void *arg) struct nn_worker_task *task; struct nn_worker_fd *fd; struct nn_worker_timer *timer; - PNACL_msg("nn_worker_routine started\n"); + printf("nn_worker_routine started\n"); self = (struct nn_worker*) arg; while ( 1 ) // Infinite loop. It will be interrupted only when the object is shut down. { @@ -185,7 +185,7 @@ static void nn_worker_routine (void *arg) rc = nn_timerset_event(&self->timerset, &thndl); if ( rc == -EAGAIN ) break; - PNACL_msg("nn_worker process expired user\n"); + printf("nn_worker process expired user\n"); errnum_assert(rc == 0, -rc); timer = nn_cont(thndl, struct nn_worker_timer, hndl); nn_ctx_enter(timer->owner->ctx); @@ -197,7 +197,7 @@ static void nn_worker_routine (void *arg) rc = nn_poller_event(&self->poller,&pevent,&phndl); // Get next poller event, such as IN or OUT if ( nn_slow(rc == -EAGAIN) ) break; - PNACL_msg("nn_worker process all events from the poller\n"); + printf("nn_worker process all events from the poller\n"); if ( phndl == &self->efd_hndl ) // If there are any new incoming worker tasks, process them { nn_assert (pevent == NN_POLLER_IN); @@ -212,14 +212,14 @@ static void nn_worker_routine (void *arg) item = nn_queue_pop(&tasks); // Next worker task if ( nn_slow(!item) ) break; - PNACL_msg("nn_worker next worker task\n"); + printf("nn_worker next worker task\n"); if ( nn_slow(item == &self->stop) ) // If the worker thread is asked to stop, do so { nn_queue_term(&tasks); return; } // It's a user-defined task. Notify the user that it has arrived in the worker thread - PNACL_msg("nn_worker user defined task\n"); + printf("nn_worker user defined task\n"); task = nn_cont(item,struct nn_worker_task,item); nn_ctx_enter(task->owner->ctx); nn_fsm_feed(task->owner,task->src,NN_WORKER_TASK_EXECUTE,task); @@ -228,15 +228,15 @@ static void nn_worker_routine (void *arg) nn_queue_term (&tasks); continue; } - PNACL_msg("nn_worker true i/o, invoke handler\n"); + printf("nn_worker true i/o, invoke handler\n"); fd = nn_cont(phndl,struct nn_worker_fd,hndl); // It's a true I/O event. Invoke the handler - PNACL_msg("nn_worker true i/o, fd.%p\n",fd); + printf("nn_worker true i/o, fd.%p\n",fd); nn_ctx_enter(fd->owner->ctx); - PNACL_msg("nn_worker true i/o, after nn_ctx_enter\n"); + printf("nn_worker true i/o, after nn_ctx_enter\n"); nn_fsm_feed(fd->owner,fd->src,pevent,fd); - PNACL_msg("nn_worker true i/o, after nn_fsm_feed leave.%p\n",fd->owner->ctx); + printf("nn_worker true i/o, after nn_fsm_feed leave.%p\n",fd->owner->ctx); nn_ctx_leave(fd->owner->ctx); - PNACL_msg("nn_worker true i/o, after nn_ctx_leave\n"); + printf("nn_worker true i/o, after nn_ctx_leave\n"); } } } From 5c40e6118f42d663ce31d8cc05fcaeb249539f9b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:00:12 +0300 Subject: [PATCH 1547/2732] Test --- crypto777/nanosrc/aio/worker_posix.c | 7 ++++++ crypto777/nanosrc/utils/thread_posix.c | 6 +++++ iguana/exchanges/LP_nativeDEX.c | 31 ++++++++++++++------------ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/crypto777/nanosrc/aio/worker_posix.c b/crypto777/nanosrc/aio/worker_posix.c index 48ee252a5..550aa31f4 100755 --- a/crypto777/nanosrc/aio/worker_posix.c +++ b/crypto777/nanosrc/aio/worker_posix.c @@ -175,7 +175,9 @@ static void nn_worker_routine (void *arg) struct nn_worker_timer *timer; printf("nn_worker_routine started\n"); self = (struct nn_worker*) arg; +#ifndef FROM_JS while ( 1 ) // Infinite loop. It will be interrupted only when the object is shut down. +#endif { // Wait for new events and/or timeouts. rc = nn_poller_wait(&self->poller,nn_timerset_timeout (&self->timerset)); @@ -226,7 +228,12 @@ static void nn_worker_routine (void *arg) nn_ctx_leave (task->owner->ctx); } nn_queue_term (&tasks); +#ifdef FROM_JS + printf("done worker ITER\n"); + return; +#else continue; +#endif } printf("nn_worker true i/o, invoke handler\n"); fd = nn_cont(phndl,struct nn_worker_fd,hndl); // It's a true I/O event. Invoke the handler diff --git a/crypto777/nanosrc/utils/thread_posix.c b/crypto777/nanosrc/utils/thread_posix.c index eeaf30aed..fc27a6711 100755 --- a/crypto777/nanosrc/utils/thread_posix.c +++ b/crypto777/nanosrc/utils/thread_posix.c @@ -42,6 +42,8 @@ void nn_thread_term(struct nn_thread *self) errnum_assert(rc == 0,rc); } +void *Nanomsg_threadarg; + #ifdef __PNACL void nn_thread_init(struct nn_thread *self,nn_thread_routine *routine,void *arg) { @@ -50,8 +52,12 @@ void nn_thread_init(struct nn_thread *self,nn_thread_routine *routine,void *arg) printf("nn_thread_init routine.%p arg.%p\n",routine,arg); self->routine = routine; self->arg = arg; +#ifdef FROM_JS + Nanomsg_threadarg = self; +#else rc = pthread_create(&self->handle,NULL,nn_thread_main_routine,(void *)self); errnum_assert (rc == 0, rc); +#endif } #else diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index aceba1ffd..7f342af44 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1031,11 +1031,26 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #ifdef FROM_JS +extern void *Nanomsg_threadarg; void emscripten_usleep(int32_t x) { } +char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) +{ + static uint32_t counter; char fname[512],*retstr; long fsize; + if ( strncmp("http://",url,strlen("http://")) != 0 ) + return(clonestr("{\"error\":\"only http allowed\"}")); + sprintf(fname,"bitcoind_RPC/req.%u",counter); + counter++; + //printf("issue.(%s)\n",url); + emscripten_wget(url,fname); + retstr = OS_filestr(&fsize,fname); + //printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr); + return(retstr); +} + void LP_fromjs_iter() { static void *ctx; @@ -1048,6 +1063,8 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); + if ( Nanomsg_threadarg != 0 ) + nn_thread_main_routine(Nanomsg_threadarg); LP_pubkeys_query(); LP_utxosQ_process(); LP_nanomsg_recvs(ctx); @@ -1055,20 +1072,6 @@ void LP_fromjs_iter() LP_counter++; } -char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) -{ - static uint32_t counter; char fname[512],*retstr; long fsize; - if ( strncmp("http://",url,strlen("http://")) != 0 ) - return(clonestr("{\"error\":\"only http allowed\"}")); - sprintf(fname,"bitcoind_RPC/req.%u",counter); - counter++; - //printf("issue.(%s)\n",url); - emscripten_wget(url,fname); - retstr = OS_filestr(&fsize,fname); - //printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr); - return(retstr); -} - #endif From fa5944a7f4b89d3a84e36a498b7f6e4463a221d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:01:59 +0300 Subject: [PATCH 1548/2732] Test --- crypto777/nanosrc/utils/thread_posix.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto777/nanosrc/utils/thread_posix.c b/crypto777/nanosrc/utils/thread_posix.c index fc27a6711..df005eee3 100755 --- a/crypto777/nanosrc/utils/thread_posix.c +++ b/crypto777/nanosrc/utils/thread_posix.c @@ -26,7 +26,7 @@ #include #include -static void *nn_thread_main_routine(void *arg) +void *nn_thread_main_routine(void *arg) { struct nn_thread *self; self = (struct nn_thread *)arg; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7f342af44..8f7bcf9a6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1032,6 +1032,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu #ifdef FROM_JS extern void *Nanomsg_threadarg; +void *nn_thread_main_routine(void *arg); void emscripten_usleep(int32_t x) { From c35f95d7303bd7cfbf22e13b5aa74180dfcf02a2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:08:30 +0300 Subject: [PATCH 1549/2732] Test --- crypto777/nanosrc/core/pipe.c | 1 + crypto777/nanosrc/nn_config.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/core/pipe.c b/crypto777/nanosrc/core/pipe.c index a025d1f00..1b1cd1dc6 100755 --- a/crypto777/nanosrc/core/pipe.c +++ b/crypto777/nanosrc/core/pipe.c @@ -176,6 +176,7 @@ int nn_pipe_send(struct nn_pipe *self,struct nn_msg *msg) int rc; struct nn_pipebase *pipebase; pipebase = (struct nn_pipebase *)self; + printf("pipesend\n"); nn_assert (pipebase->outstate == NN_PIPEBASE_OUTSTATE_IDLE); pipebase->outstate = NN_PIPEBASE_OUTSTATE_SENDING; rc = pipebase->vfptr->send(pipebase,msg); diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 74edc6229..dc864bfbd 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -31,8 +31,8 @@ #define NN_HAVE_SEMAPHORE 1 // must have // need one of following 3, listed in order of precedence, used by efd* -//#define NN_HAVE_EVENTFD 1 -#define NN_HAVE_PIPE 1 +#define NN_HAVE_EVENTFD 1 +//#define NN_HAVE_PIPE 1 //#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* From c377215d5b7835f4d71b541669e35185343af366 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:09:50 +0300 Subject: [PATCH 1550/2732] Test --- crypto777/nanosrc/nn_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index dc864bfbd..0d4d15c2c 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -31,9 +31,9 @@ #define NN_HAVE_SEMAPHORE 1 // must have // need one of following 3, listed in order of precedence, used by efd* -#define NN_HAVE_EVENTFD 1 +//#define NN_HAVE_EVENTFD 1 //#define NN_HAVE_PIPE 1 -//#define NN_HAVE_SOCKETPAIR 1 +#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* #define NN_USE_POLL 1 From d1bb5fbcebfd71785af3bb5ecd98f081dd3d7e8e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:12:28 +0300 Subject: [PATCH 1551/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 0048287e2..f12cccf2e 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -4,5 +4,5 @@ include ../crypto777/crypto777.sources all: - emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc From 6eb96d54dcefbf3ff59f74cdc7432678e284807d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:14:42 +0300 Subject: [PATCH 1552/2732] Test --- crypto777/nanosrc/nn_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 0d4d15c2c..dc864bfbd 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -31,9 +31,9 @@ #define NN_HAVE_SEMAPHORE 1 // must have // need one of following 3, listed in order of precedence, used by efd* -//#define NN_HAVE_EVENTFD 1 +#define NN_HAVE_EVENTFD 1 //#define NN_HAVE_PIPE 1 -#define NN_HAVE_SOCKETPAIR 1 +//#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* #define NN_USE_POLL 1 From c8c945c3ccdf554c88b0bcb6b3b549b10e69cb1e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:16:47 +0300 Subject: [PATCH 1553/2732] test --- crypto777/nanosrc/nn_config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index dc864bfbd..2a781e8c1 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -31,13 +31,13 @@ #define NN_HAVE_SEMAPHORE 1 // must have // need one of following 3, listed in order of precedence, used by efd* -#define NN_HAVE_EVENTFD 1 -//#define NN_HAVE_PIPE 1 +//#define NN_HAVE_EVENTFD 1 +#define NN_HAVE_PIPE 1 //#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* -#define NN_USE_POLL 1 -//#define NN_USE_EPOLL 1 +//#define NN_USE_POLL 1 +#define NN_USE_EPOLL 1 //#define NN_USE_KQUEUE 1 #define NN_DISABLE_GETADDRINFO_A 1 From ee9b679045447c069880c750729a30c18cfe24a7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:17:19 +0300 Subject: [PATCH 1554/2732] Test --- crypto777/nanosrc/nn_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/nanosrc/nn_config.h b/crypto777/nanosrc/nn_config.h index 2a781e8c1..74edc6229 100755 --- a/crypto777/nanosrc/nn_config.h +++ b/crypto777/nanosrc/nn_config.h @@ -36,8 +36,8 @@ //#define NN_HAVE_SOCKETPAIR 1 // need one of following 3, listed in order of precedence, used by poller* -//#define NN_USE_POLL 1 -#define NN_USE_EPOLL 1 +#define NN_USE_POLL 1 +//#define NN_USE_EPOLL 1 //#define NN_USE_KQUEUE 1 #define NN_DISABLE_GETADDRINFO_A 1 From 54d1ad3ba2adaed906a461150ea0b2631aa8f5b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:26:36 +0300 Subject: [PATCH 1555/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8f7bcf9a6..72f7fa84f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1031,8 +1031,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #ifdef FROM_JS -extern void *Nanomsg_threadarg; -void *nn_thread_main_routine(void *arg); +//extern void *Nanomsg_threadarg; +//void *nn_thread_main_routine(void *arg); void emscripten_usleep(int32_t x) { @@ -1064,8 +1064,8 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); - if ( Nanomsg_threadarg != 0 ) - nn_thread_main_routine(Nanomsg_threadarg); + //if ( Nanomsg_threadarg != 0 ) + // nn_thread_main_routine(Nanomsg_threadarg); LP_pubkeys_query(); LP_utxosQ_process(); LP_nanomsg_recvs(ctx); From 14c7a7b8ad2657960ef3c16dfec6eb238accbd15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:36:41 +0300 Subject: [PATCH 1556/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 72f7fa84f..8f7bcf9a6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1031,8 +1031,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #ifdef FROM_JS -//extern void *Nanomsg_threadarg; -//void *nn_thread_main_routine(void *arg); +extern void *Nanomsg_threadarg; +void *nn_thread_main_routine(void *arg); void emscripten_usleep(int32_t x) { @@ -1064,8 +1064,8 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); - //if ( Nanomsg_threadarg != 0 ) - // nn_thread_main_routine(Nanomsg_threadarg); + if ( Nanomsg_threadarg != 0 ) + nn_thread_main_routine(Nanomsg_threadarg); LP_pubkeys_query(); LP_utxosQ_process(); LP_nanomsg_recvs(ctx); From a91e379e688266d61e6a5a0fb7f19bb42c1a569f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:39:13 +0300 Subject: [PATCH 1557/2732] Test --- iguana/exchanges/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index f12cccf2e..7d315ff5f 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -1,8 +1,10 @@ #cd .. #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm ../OSlibs/js/libnanomsg.a -lc -lpthread +#emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc + include ../crypto777/crypto777.sources all: - emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc + emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc From 0762b303cf3d6dff844262f5631e9d11d1b4bc0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:50:13 +0300 Subject: [PATCH 1558/2732] Test --- crypto777/nanosrc/core/global.c | 3 +++ crypto777/nanosrc/core/sock.c | 7 +++++-- crypto777/nanosrc/transports/ws/sws.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crypto777/nanosrc/core/global.c b/crypto777/nanosrc/core/global.c index c654753fd..83b8e63d0 100755 --- a/crypto777/nanosrc/core/global.c +++ b/crypto777/nanosrc/core/global.c @@ -1276,7 +1276,10 @@ static int nn_global_create_ep (int s, const char *addr, int bind) tp = NULL; } if ( !tp ) // The protocol specified doesn't match any known protocol + { + printf("unknown protocol\n"); return -EPROTONOSUPPORT; + } rc = nn_sock_add_ep (SELF.socks [s], tp, bind, addr); // Ask the socket to create the endpoint return rc; } diff --git a/crypto777/nanosrc/core/sock.c b/crypto777/nanosrc/core/sock.c index 7427a5fc4..ee95034a8 100755 --- a/crypto777/nanosrc/core/sock.c +++ b/crypto777/nanosrc/core/sock.c @@ -477,6 +477,7 @@ struct nn_ep *nn_find_ep(struct nn_sock *self,int32_t eid,const char *addr,struc int nn_sock_add_ep(struct nn_sock *self,struct nn_transport *transport,int32_t bind,const char *addr) { int rc,eid; struct nn_ep *ep; + printf("nn_sock_add_ep\n"); nn_ctx_enter (&self->ctx); if ( (ep= nn_find_ep(self,0,addr,transport,bind)) == NULL ) // The endpoint doesn't exist { @@ -484,16 +485,17 @@ int nn_sock_add_ep(struct nn_sock *self,struct nn_transport *transport,int32_t b rc = nn_ep_init(ep,NN_SOCK_SRC_EP,self,self->eid,transport,bind,addr); if ( nn_slow(rc < 0) ) { + printf("nn_sock_add_ep nn_ep_init rc.%d\n",rc); nn_free(ep); nn_ctx_leave(&self->ctx); return rc; } nn_ep_start(ep); - PNACL_msg("ep sock.(%s) started %s://(%s) bind.%d\n",self->socket_name,transport->name,addr,bind); + printf("ep sock.(%s) started %s://(%s) bind.%d\n",self->socket_name,transport->name,addr,bind); eid = self->eid++; // Increase the endpoint ID for the next endpoint nn_list_insert(&self->eps,&ep->item,nn_list_end(&self->eps)); // Add to the list of active endpoints nn_ctx_leave (&self->ctx); - } else PNACL_msg("self->sock.(%s) %p already has (%s)\n",self->socket_name,self->sockbase->sock,addr); + } else printf("self->sock.(%s) %p already has (%s)\n",self->socket_name,self->sockbase->sock,addr); return(ep->eid); } @@ -673,6 +675,7 @@ int nn_sock_add(struct nn_sock *self, struct nn_pipe *pipe) { int rc; rc = self->sockbase->vfptr->add(self->sockbase,pipe); + printf("nn_sock_add rc.%d\n",rc); if (nn_slow (rc >= 0)) { nn_sock_stat_increment (self, NN_STAT_CURRENT_CONNECTIONS, 1); } diff --git a/crypto777/nanosrc/transports/ws/sws.c b/crypto777/nanosrc/transports/ws/sws.c index 65c1bb384..627c5590f 100755 --- a/crypto777/nanosrc/transports/ws/sws.c +++ b/crypto777/nanosrc/transports/ws/sws.c @@ -884,7 +884,7 @@ static void nn_sws_handler (struct nn_fsm *self, int src, int type, int rc; sws = nn_cont (self, struct nn_sws, fsm); - + printf("sws src.%d type.%d state.%d\n",src,type,sws->state); switch (sws->state) { /******************************************************************************/ From 95e64aa9c4ce856449047c996afb9f620f4b7c91 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:54:42 +0300 Subject: [PATCH 1559/2732] Test --- crypto777/nanosrc/transports/ws/cws.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto777/nanosrc/transports/ws/cws.c b/crypto777/nanosrc/transports/ws/cws.c index 905e90405..9de4ea5b4 100755 --- a/crypto777/nanosrc/transports/ws/cws.c +++ b/crypto777/nanosrc/transports/ws/cws.c @@ -329,7 +329,11 @@ static void nn_cws_handler (struct nn_fsm *self, int src, int type, struct nn_cws *cws; cws = nn_cont (self, struct nn_cws, fsm); - printf("cws_handler src.%d type.%d state.%d\n",src,type,cws->state); + int32_t rc = 0; + if ( type == 2 && cws->state == 3 ) + rc = nn_pipebase_start (&sws->pipebase); + printf("cws_handler src.%d type.%d state.%d rc.%d\n",src,type,cws->state,rc); + switch (cws->state) { /******************************************************************************/ From b7e0b668be4ee24b07faf6359b252d99b0f99648 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:55:19 +0300 Subject: [PATCH 1560/2732] Test --- crypto777/nanosrc/transports/ws/cws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/transports/ws/cws.c b/crypto777/nanosrc/transports/ws/cws.c index 9de4ea5b4..3d5363969 100755 --- a/crypto777/nanosrc/transports/ws/cws.c +++ b/crypto777/nanosrc/transports/ws/cws.c @@ -331,7 +331,7 @@ static void nn_cws_handler (struct nn_fsm *self, int src, int type, cws = nn_cont (self, struct nn_cws, fsm); int32_t rc = 0; if ( type == 2 && cws->state == 3 ) - rc = nn_pipebase_start (&sws->pipebase); + rc = nn_pipebase_start (&cws->pipebase); printf("cws_handler src.%d type.%d state.%d rc.%d\n",src,type,cws->state,rc); switch (cws->state) { From a341b860e559b01f694c514049992aea29aef1f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 01:56:15 +0300 Subject: [PATCH 1561/2732] Test --- crypto777/nanosrc/transports/ws/cws.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crypto777/nanosrc/transports/ws/cws.c b/crypto777/nanosrc/transports/ws/cws.c index 3d5363969..905e90405 100755 --- a/crypto777/nanosrc/transports/ws/cws.c +++ b/crypto777/nanosrc/transports/ws/cws.c @@ -329,11 +329,7 @@ static void nn_cws_handler (struct nn_fsm *self, int src, int type, struct nn_cws *cws; cws = nn_cont (self, struct nn_cws, fsm); - int32_t rc = 0; - if ( type == 2 && cws->state == 3 ) - rc = nn_pipebase_start (&cws->pipebase); - printf("cws_handler src.%d type.%d state.%d rc.%d\n",src,type,cws->state,rc); - + printf("cws_handler src.%d type.%d state.%d\n",src,type,cws->state); switch (cws->state) { /******************************************************************************/ From 45e68b3e251bb96c8c56d3d5b63f9779ef600ae7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 15:51:40 +0300 Subject: [PATCH 1562/2732] Complete JS main iter --- iguana/exchanges/LP_nativeDEX.c | 47 +++++++++++++++++++++------------ iguana/exchanges/LP_network.c | 4 ++- iguana/exchanges/LP_portfolio.c | 6 ++++- iguana/exchanges/LP_stats.c | 8 ++++-- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8f7bcf9a6..29f7ba595 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -492,15 +492,18 @@ void LP_coinsloop(void *_coins) nonz = 0; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coins[0] != 0 ) + if ( coins != 0 ) { - if ( strcmp(coins,coin->symbol) != 0 ) - continue; - } - else // avoid hardcode special case LP_coinsloop - { - if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) - continue; + if ( coins[0] != 0 ) + { + if ( strcmp(coins,coin->symbol) != 0 ) + continue; + } + else // avoid hardcode special case LP_coinsloop + { + if ( strcmp("BTC",coin->symbol) == 0 || strcmp("KMD",coin->symbol) == 0 ) + continue; + } } memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) @@ -578,6 +581,8 @@ void LP_coinsloop(void *_coins) break; } } + if ( coins == 0 ) + return; if ( nonz == 0 ) usleep(1000); } @@ -793,7 +798,6 @@ void LP_reserved_msgs(void *ignore) int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) { int32_t n = 0; -#ifndef FROM_JS portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) { @@ -801,10 +805,6 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) n = num_Reserved_msgs; } else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); portable_mutex_unlock(&LP_reservedmutex); -#else - printf("reserved_msg.(%s)\n",msg); - LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); -#endif if ( num_Reserved_msgs > max_Reserved_msgs ) { max_Reserved_msgs = num_Reserved_msgs; @@ -1054,7 +1054,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * void LP_fromjs_iter() { - static void *ctx; + static void *ctx; char *retstr; if ( G.initializing != 0 ) { printf("LP_fromjs_iter during G.initializing, skip\n"); @@ -1064,12 +1064,25 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); - if ( Nanomsg_threadarg != 0 ) - nn_thread_main_routine(Nanomsg_threadarg); - LP_pubkeys_query(); + //if ( Nanomsg_threadarg != 0 ) + // nn_thread_main_routine(Nanomsg_threadarg); + //LP_pubkeys_query(); LP_utxosQ_process(); LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); + queue_loop(0); + if ( (LP_counter % 10) == 0 ) + { + LP_coinsloop(0); + if ( (LP_counter % 100) == 0 ) + { + LP_notify_pubkeys(ctx,LP_mypubsock); + LP_privkey_updates(ctx,LP_mypubsock,0); + prices_loop(0); + if ( (retstr= basilisk_swapentry(0,0)) != 0 ) + free(retstr); + } + } LP_counter++; } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eeb23603f..09d387f37 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -139,7 +139,7 @@ int32_t LP_peerindsock(int32_t *peerindp) return(-1); } -void queue_loop(void *ignore) +void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; while ( 1 ) @@ -195,6 +195,8 @@ void queue_loop(void *ignore) ptr = 0; } } + if ( arg == 0 ) + break; //if ( n != 0 ) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index f3492daf6..dce7e3f99 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -595,13 +595,15 @@ int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *a return(n); } -void prices_loop(void *ignore) +void prices_loop(void *arg) { char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) { + if ( arg == 0 ) + return; sleep(60); continue; } @@ -635,6 +637,8 @@ void prices_loop(void *ignore) } free(retstr); } + if ( arg == 0 ) + return; sleep(60); } } diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index f5b244822..994292e17 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,8 +38,12 @@ void LP_tradecommand_log(cJSON *argjson) } } -uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; -uint64_t Ridqids[128]; +static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; + +struct LP_swapstats +{ + uint64_t aliceid; +}; uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32_t feevout) { From 02be7bf6205d1cda524636da0ddfe1bc95791b1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 15:52:18 +0300 Subject: [PATCH 1563/2732] Test --- iguana/exchanges/LP_stats.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 994292e17..21228ef9c 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -44,6 +44,7 @@ struct LP_swapstats { uint64_t aliceid; }; +uint64_t Ridqids[128]; uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32_t feevout) { From b6b8dbbe1a1a28394f476d3091a60ab8a733b570 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 15:55:16 +0300 Subject: [PATCH 1564/2732] Test --- crypto777/nanosrc/protocols/utils/priolist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/nanosrc/protocols/utils/priolist.c b/crypto777/nanosrc/protocols/utils/priolist.c index 5d5560229..5b6cb5401 100755 --- a/crypto777/nanosrc/protocols/utils/priolist.c +++ b/crypto777/nanosrc/protocols/utils/priolist.c @@ -136,7 +136,7 @@ struct nn_pipe *nn_priolist_getpipe(struct nn_priolist *self) { if ( nn_slow(self->current == -1) ) { - printf("nn_priolist_getpipe.%p -1 current it is\n",self); + //printf("nn_priolist_getpipe.%p -1 current it is\n",self); return NULL; } printf("nn_priolist_getpipe.%p current.%d slot.%p\n",self,self->current,self->slots[self->current - 1].current->pipe); From 33b8a3931e2375d65923433f6ebbb64e976d49c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 16:19:17 +0300 Subject: [PATCH 1565/2732] Test --- iguana/exchanges/LP_stats.c | 70 ++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 21228ef9c..62125740f 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -38,22 +38,50 @@ void LP_tradecommand_log(cJSON *argjson) } } -static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_numridqids; +static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_aliceids; struct LP_swapstats { + UT_hash_handle hh; + struct LP_quoteinfo Q; + double qprice; uint64_t aliceid; -}; -uint64_t Ridqids[128]; + char method[16]; +} *LP_swapstats; + +struct LP_swapstats *LP_swapstats_find(uint64_t aliceid) +{ + struct LP_swapstats *sp; + HASH_FIND(hh,LP_swapstats,&aliceid,sizeof(aliceid),sp); + return(sp); +} + +struct LP_swapstats *LP_swapstats_add(uint64_t aliceid) +{ + struct LP_swapstats *sp; + if ( (sp= LP_swapstats_find(aliceid)) == 0 ) + { + sp = calloc(1,sizeof(*sp)); + sp->aliceid = aliceid; + HASH_ADD(hh,LP_swapstats,aliceid,sizeof(aliceid),sp); + } + return(LP_swapstats_find(aliceid)); +} uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32_t feevout) { return((((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout)); } +void LP_swapstats_line(char *line,struct LP_swapstats *sp) +{ + char tstr[64]; + printf("%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,LP_aliceids,sp->method,(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice); +} + int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - double qprice; uint32_t timestamp; int32_t i,destvout,feevout,duplicate=0; char *gui,*base,*rel,tstr[128]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t aliceid; + struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t aliceid; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -83,20 +111,21 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) qprice = ((double)destsatoshis / (satoshis - txfee)); //printf("%s/v%d %s/v%d\n",bits256_str(str,desttxid),destvout,bits256_str(str2,feetxid),feevout); aliceid = LP_aliceid_calc(desttxid,destvout,feetxid,feevout); - for (i=0; i (%.8f %5s) qprice %.8f\n",utc_str(tstr,timestamp),gui!=0?gui:"",LP_numridqids,method,(long long)aliceid,dstr(satoshis),base,dstr(destsatoshis),rel,qprice); - LP_numridqids++; + if ( (sp= LP_swapstats_add(aliceid)) != 0 ) + { + sp->Q = Q; + sp->qprice = qprice; + LP_swapstats_line(line,sp); + printf("%s\n",line); + LP_aliceids++; + } else printf("unexpected LP_swapstats_add failure\n"); } } return(duplicate == 0); @@ -135,7 +164,7 @@ void LP_statslog_parseline(cJSON *lineobj) char *LP_statslog_disp(int32_t n) { - cJSON *retjson; + cJSON *retjson,*array; struct LP_swapstats *sp,*tmp; char line[1024]; retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddnum(retjson,"newlines",n); @@ -145,9 +174,16 @@ char *LP_statslog_disp(int32_t n) jaddnum(retjson,"connected",LP_connecteds); jaddnum(retjson,"duplicates",LP_duplicates); jaddnum(retjson,"parse_errors",LP_parse_errors); - jaddnum(retjson,"uniques",LP_numridqids); + jaddnum(retjson,"uniques",LP_aliceids); jaddnum(retjson,"tradestatus",LP_tradestatuses); jaddnum(retjson,"unknown",LP_unknowns); + array = cJSON_CreateArray(); + HASH_ITER(hh,LP_swapstats,sp,tmp) + { + LP_swapstats_line(line,sp); + jaddistr(array,line); + } + jadd(retjson,"swaps",array); return(jprint(retjson,1)); } From 26133c53b493b3c7b6ea274ae5eb90342012ef37 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 16:57:55 +0300 Subject: [PATCH 1566/2732] Test --- iguana/exchanges/LP_stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 62125740f..700b04c26 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -46,6 +46,7 @@ struct LP_swapstats struct LP_quoteinfo Q; double qprice; uint64_t aliceid; + uint32_t ind; char method[16]; } *LP_swapstats; @@ -76,7 +77,7 @@ uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32 void LP_swapstats_line(char *line,struct LP_swapstats *sp) { char tstr[64]; - printf("%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,LP_aliceids,sp->method,(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice); + sprintf(line,"%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,sp->method,(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice); } int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) @@ -122,9 +123,9 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { sp->Q = Q; sp->qprice = qprice; + sp->ind = LP_aliceids++; LP_swapstats_line(line,sp); printf("%s\n",line); - LP_aliceids++; } else printf("unexpected LP_swapstats_add failure\n"); } } From 4bca125831c5b0e8ce2c79e0b7fcca1cb600f357 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 17:27:36 +0300 Subject: [PATCH 1567/2732] Test --- iguana/exchanges/LP_stats.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 700b04c26..fdf875cf4 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -20,6 +20,8 @@ #define LP_STATSLOG_FNAME "stats.log" +char *LP_stats_methods[] = { "unknown", "request", "reserved", "connect", "connected", "tradestatus" }; + void LP_tradecommand_log(cJSON *argjson) { static FILE *logfp; char *jsonstr; @@ -46,8 +48,7 @@ struct LP_swapstats struct LP_quoteinfo Q; double qprice; uint64_t aliceid; - uint32_t ind; - char method[16]; + uint32_t ind,methodind; } *LP_swapstats; struct LP_swapstats *LP_swapstats_find(uint64_t aliceid) @@ -77,12 +78,17 @@ uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32 void LP_swapstats_line(char *line,struct LP_swapstats *sp) { char tstr[64]; - sprintf(line,"%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,sp->method,(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice); + sprintf(line,"%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice); +} + +void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) +{ + } int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t aliceid; + struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t i,methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -92,6 +98,12 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { + for (i=methodind=0; i sp->methodind || strcmp(method,"tradestatus") == 0 ) + { + sp->methodind = methodind; + LP_swapstats_update(sp,&Q,lineobj); + } duplicate = 1; LP_duplicates++; } @@ -123,6 +140,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { sp->Q = Q; sp->qprice = qprice; + sp->methodind = methodind; sp->ind = LP_aliceids++; LP_swapstats_line(line,sp); printf("%s\n",line); From 388ca5a875652d5bb549661aa395433f0a89d004 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 18:40:58 +0300 Subject: [PATCH 1568/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_prices.c | 15 +++++++ iguana/exchanges/LP_stats.c | 78 +++++++++++++++++++++++++++++++---- 3 files changed, 85 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 01872157f..95a827003 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -290,7 +290,7 @@ struct basilisk_swap }; -#define LP_MAXPRICEINFOS 256 +#define LP_MAXPRICEINFOS 1024 struct LP_pubkeyinfo { UT_hash_handle hh; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index fdc14779c..68125fbfa 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -47,6 +47,13 @@ struct LP_cacheinfo uint32_t timestamp; } *LP_cacheinfos; +char *LP_priceinfostr(int32_t ind) +{ + if ( ind < 0 || ind >= LP_MAXPRICEINFOS ) + return("UNKNOWN"); + else return(LP_priceinfos[ind].symbol); +} + int32_t LP_pricevalid(double price) { if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) @@ -70,6 +77,14 @@ struct LP_priceinfo *LP_priceinfofind(char *symbol) return(0); } +int32_t LP_priceinfoind(char *symbol) +{ + struct LP_priceinfo *pp; + if ( (pp= LP_priceinfofind(symbol)) != 0 ) + return(pp->ind); + else return(-1); +} + struct LP_priceinfo *LP_priceinfoptr(int32_t *indp,char *base,char *rel) { struct LP_priceinfo *basepp,*relpp; diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index fdf875cf4..ee53a6d22 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -46,9 +46,10 @@ struct LP_swapstats { UT_hash_handle hh; struct LP_quoteinfo Q; + bits256 bobdeposit,alicepayment,bobpayment,paymentspent,Apaymentspent,depositspent; double qprice; uint64_t aliceid; - uint32_t ind,methodind; + uint32_t ind,methodind,finished; } *LP_swapstats; struct LP_swapstats *LP_swapstats_find(uint64_t aliceid) @@ -75,20 +76,63 @@ uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32 return((((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout)); } -void LP_swapstats_line(char *line,struct LP_swapstats *sp) +void LP_swapstats_line(uint64_t *basevols,uint64_t *relvols,char *line,struct LP_swapstats *sp) { - char tstr[64]; - sprintf(line,"%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice); + char tstr[64]; int32_t baseind,relind; + if ( (baseind= LP_priceinfoind(sp->Q.srccoin)) >= 0 ) + basevols[baseind] += sp->Q.satoshis; + if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) + relvols[relind] += sp->Q.destsatoshis; + sprintf(line,"%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f finished.%d",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished); +} + +bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) +{ + bits256 txid,deadtxid; + decode_hex(deadtxid.bytes,32,"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + txid = jbits256(argjson,name); + if ( bits256_nonz(txid) != 0 ) + { + if ( bits256_cmp(deadtxid,txid) == 0 ) + { + if ( bits256_nonz(oldtxid) == 0 ) + return(deadtxid); + else return(oldtxid); + } else return(txid); + } else return(oldtxid); } void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) { - + char *statusstr,*base,*rel; uint32_t requestid,quoteid; uint64_t satoshis,destsatoshis; + if ( strcmp(LP_stats_methods[sp->methodind],"tradestatus") == 0 ) + { + base = jstr(lineobj,"bob"); + rel = jstr(lineobj,"alice"); + requestid = juint(lineobj,"requestid"); + quoteid = juint(lineobj,"quoteid"); + satoshis = jdouble(lineobj,"srcamount") * SATOSHIDEN; + destsatoshis = jdouble(lineobj,"destamount") * SATOSHIDEN; + if ( base != 0 && strcmp(base,sp->Q.srccoin) == 0 && rel != 0 && strcmp(rel,sp->Q.destcoin) == 0 && requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid && satoshis == sp->Q.satoshis && destsatoshis == sp->Q.destsatoshis ) + { + sp->bobdeposit = LP_swapstats_txid(lineobj,"bobdeposit",sp->bobdeposit); + sp->alicepayment = LP_swapstats_txid(lineobj,"alicepayment",sp->alicepayment); + sp->bobpayment = LP_swapstats_txid(lineobj,"bobpayment",sp->bobpayment); + sp->paymentspent = LP_swapstats_txid(lineobj,"paymentspent",sp->paymentspent); + sp->Apaymentspent = LP_swapstats_txid(lineobj,"Apaymentspent",sp->Apaymentspent); + sp->depositspent = LP_swapstats_txid(lineobj,"depositspent",sp->depositspent); + if ( (statusstr= jstr(lineobj,"status")) != 0 && strcmp(statusstr,"finished") == 0 ) + sp->finished = juint(lineobj,"timestamp"); + } else printf("mismatched tradestatus aliceid.%016llx\n",(long long)sp->aliceid); + + } else sp->Q = *qp; } int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { - struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t i,methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; + struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t i,methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + memset(basevols,0,sizeof(basevols)); + memset(relvols,0,sizeof(relvols)); memset(&Q,0,sizeof(Q)); if ( LP_quoteparse(&Q,lineobj) < 0 ) { @@ -142,7 +186,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) sp->qprice = qprice; sp->methodind = methodind; sp->ind = LP_aliceids++; - LP_swapstats_line(line,sp); + LP_swapstats_line(basevols,relvols,line,sp); printf("%s\n",line); } else printf("unexpected LP_swapstats_add failure\n"); } @@ -183,7 +227,9 @@ void LP_statslog_parseline(cJSON *lineobj) char *LP_statslog_disp(int32_t n) { - cJSON *retjson,*array; struct LP_swapstats *sp,*tmp; char line[1024]; + cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + memset(basevols,0,sizeof(basevols)); + memset(relvols,0,sizeof(relvols)); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddnum(retjson,"newlines",n); @@ -199,10 +245,24 @@ char *LP_statslog_disp(int32_t n) array = cJSON_CreateArray(); HASH_ITER(hh,LP_swapstats,sp,tmp) { - LP_swapstats_line(line,sp); + LP_swapstats_line(basevols,relvols,line,sp); jaddistr(array,line); } jadd(retjson,"swaps",array); + array = cJSON_CreateArray(); + for (i=0; i Date: Thu, 26 Oct 2017 18:49:08 +0300 Subject: [PATCH 1569/2732] Test --- iguana/exchanges/LP_stats.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index ee53a6d22..79a88ce3b 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -20,8 +20,20 @@ #define LP_STATSLOG_FNAME "stats.log" +struct LP_swapstats +{ + UT_hash_handle hh; + struct LP_quoteinfo Q; + bits256 bobdeposit,alicepayment,bobpayment,paymentspent,Apaymentspent,depositspent; + double qprice; + uint64_t aliceid; + uint32_t ind,methodind,finished,expired; +} *LP_swapstats; + char *LP_stats_methods[] = { "unknown", "request", "reserved", "connect", "connected", "tradestatus" }; +static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_aliceids; + void LP_tradecommand_log(cJSON *argjson) { static FILE *logfp; char *jsonstr; @@ -40,18 +52,6 @@ void LP_tradecommand_log(cJSON *argjson) } } -static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_aliceids; - -struct LP_swapstats -{ - UT_hash_handle hh; - struct LP_quoteinfo Q; - bits256 bobdeposit,alicepayment,bobpayment,paymentspent,Apaymentspent,depositspent; - double qprice; - uint64_t aliceid; - uint32_t ind,methodind,finished; -} *LP_swapstats; - struct LP_swapstats *LP_swapstats_find(uint64_t aliceid) { struct LP_swapstats *sp; @@ -83,7 +83,7 @@ void LP_swapstats_line(uint64_t *basevols,uint64_t *relvols,char *line,struct LP basevols[baseind] += sp->Q.satoshis; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) relvols[relind] += sp->Q.destsatoshis; - sprintf(line,"%s %8s %-4d %9s swap.%016llx: (%.8f %5s) -> (%.8f %5s) qprice %.8f finished.%d",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished); + sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); } bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) @@ -105,6 +105,8 @@ bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) { char *statusstr,*base,*rel; uint32_t requestid,quoteid; uint64_t satoshis,destsatoshis; + if ( time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) + sp->expired = (uint32_t)time(NULL); if ( strcmp(LP_stats_methods[sp->methodind],"tradestatus") == 0 ) { base = jstr(lineobj,"bob"); @@ -216,7 +218,10 @@ void LP_statslog_parseline(cJSON *lineobj) LP_connecteds++; } else if ( strcmp(method,"tradestatus") == 0 ) + { + LP_statslog_parsequote(method,lineobj); LP_tradestatuses++; + } else { LP_unknowns++; From f3ebbd249b488671ab0a160a42d9e9235fe158e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 18:52:07 +0300 Subject: [PATCH 1570/2732] Test --- iguana/exchanges/LP_stats.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 79a88ce3b..3ad264852 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -136,7 +136,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); memset(&Q,0,sizeof(Q)); - if ( LP_quoteparse(&Q,lineobj) < 0 ) + if ( strcmp(method,"tradestatus") != 0 && LP_quoteparse(&Q,lineobj) < 0 ) { printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); LP_parse_errors++; @@ -238,15 +238,6 @@ char *LP_statslog_disp(int32_t n) retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddnum(retjson,"newlines",n); - jaddnum(retjson,"request",LP_requests); - jaddnum(retjson,"reserved",LP_reserveds); - jaddnum(retjson,"connect",LP_connects); - jaddnum(retjson,"connected",LP_connecteds); - jaddnum(retjson,"duplicates",LP_duplicates); - jaddnum(retjson,"parse_errors",LP_parse_errors); - jaddnum(retjson,"uniques",LP_aliceids); - jaddnum(retjson,"tradestatus",LP_tradestatuses); - jaddnum(retjson,"unknown",LP_unknowns); array = cJSON_CreateArray(); HASH_ITER(hh,LP_swapstats,sp,tmp) { @@ -268,6 +259,15 @@ char *LP_statslog_disp(int32_t n) } } jadd(retjson,"volumes",array); + jaddnum(retjson,"request",LP_requests); + jaddnum(retjson,"reserved",LP_reserveds); + jaddnum(retjson,"connect",LP_connects); + jaddnum(retjson,"connected",LP_connecteds); + jaddnum(retjson,"duplicates",LP_duplicates); + jaddnum(retjson,"parse_errors",LP_parse_errors); + jaddnum(retjson,"uniques",LP_aliceids); + jaddnum(retjson,"tradestatus",LP_tradestatuses); + jaddnum(retjson,"unknown",LP_unknowns); return(jprint(retjson,1)); } From ab8cbfa81a633e690ccac07b805fdc62693a7da5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 18:52:19 +0300 Subject: [PATCH 1571/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 3ad264852..d2a22f0a3 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -189,7 +189,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) sp->methodind = methodind; sp->ind = LP_aliceids++; LP_swapstats_line(basevols,relvols,line,sp); - printf("%s\n",line); + //printf("%s\n",line); } else printf("unexpected LP_swapstats_add failure\n"); } } From c0a2160cb73acbc3f3b2bc2103eaaa07a2fc15e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 18:57:15 +0300 Subject: [PATCH 1572/2732] Test --- iguana/exchanges/LP_stats.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index d2a22f0a3..c29c6fa45 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -136,7 +136,23 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); memset(&Q,0,sizeof(Q)); - if ( strcmp(method,"tradestatus") != 0 && LP_quoteparse(&Q,lineobj) < 0 ) + for (i=methodind=0; imethodind = methodind; + LP_swapstats_update(sp,&Q,lineobj); + } else printf("unexpected tradestatus.(%s)\n",jprint(lineobj,0)); + return(0); + } + if ( LP_quoteparse(&Q,lineobj) < 0 ) { printf("quoteparse_error.(%s)\n",jprint(lineobj,0)); LP_parse_errors++; @@ -144,12 +160,6 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { - for (i=methodind=0; i sp->methodind || strcmp(method,"tradestatus") == 0 ) + if ( methodind > sp->methodind ) { sp->methodind = methodind; LP_swapstats_update(sp,&Q,lineobj); From 50d253a08f504818b1ed2f2dd85fc3e533df24b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 18:59:40 +0300 Subject: [PATCH 1573/2732] Test --- iguana/exchanges/LP_signatures.c | 9 +++++++-- iguana/exchanges/LP_statemachine.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index a53c1ef6e..7a94a08c6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -271,10 +271,11 @@ bits256 LP_utxos_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,bits int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,bits256 utxoshash) { - static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; char str[65]; + static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; char str[65]; struct LP_pubkeyinfo *pubp; if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + pubp = LP_pubkeyfind(pubkey); + if ( pubp->numerrors < LP_MAXPUBKEY_ERRORS && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) { decode_hex(sig,65,sigstr); decode_hex(pubsecp,33,pubsecpstr); @@ -284,7 +285,11 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { static uint32_t counter; if ( counter++ < 100 ) + { + if ( pubp != 0 ) + pubp->numerrors++; printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey)); + } retval = -1; } else retval = 0; } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index b84c79843..61396e280 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2305,7 +2305,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, { numrestraints++; butxo->T.bestflag = 0; - pubp->numerrors = 0; + //pubp->numerrors = 0; } } } From 237209fbaa1ff0004ba97beab2c64b43f759e9f0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 19:06:22 +0300 Subject: [PATCH 1574/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index c29c6fa45..9137b0c44 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -125,7 +125,7 @@ void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON * sp->depositspent = LP_swapstats_txid(lineobj,"depositspent",sp->depositspent); if ( (statusstr= jstr(lineobj,"status")) != 0 && strcmp(statusstr,"finished") == 0 ) sp->finished = juint(lineobj,"timestamp"); - } else printf("mismatched tradestatus aliceid.%016llx\n",(long long)sp->aliceid); + } else printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis),dstr(sp->Q.satoshis),dstr(destsatoshis),dstr(sp->Q.destsatoshis)); } else sp->Q = *qp; } From 552833943d67afd0401d361ece50618a9ab4d938 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 19:33:50 +0300 Subject: [PATCH 1575/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_signatures.c | 4 ++-- iguana/exchanges/LP_stats.c | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 32c84a180..32c30f0e0 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -106,7 +106,7 @@ enable(coin)\n\ disable(coin)\n\ notarizations(coin)\n\ parselog()\n\ -statsdisp()\n\ +statsdisp(starttime=0, endtime=0)\n\ getrawtransaction(coin, txid)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ @@ -220,7 +220,7 @@ stop()\n\ else if ( strcmp(method,"parselog") == 0 ) return(LP_statslog_parse()); else if ( strcmp(method,"statsdisp") == 0 ) - return(LP_statslog_disp(0)); + return(LP_statslog_disp(0,juint(argjson,"starttime"),juint(argjson,"endtime"))); else if ( strcmp(method,"secretaddresses") == 0 ) { uint8_t taddr,pubtype; diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 7a94a08c6..5cca3f372 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -275,7 +275,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 if ( ctx == 0 ) ctx = bitcoin_ctx(); pubp = LP_pubkeyfind(pubkey); - if ( pubp->numerrors < LP_MAXPUBKEY_ERRORS && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + if ( (pubp == 0|| pubp->numerrors < LP_MAXPUBKEY_ERRORS) && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) { decode_hex(sig,65,sigstr); decode_hex(pubsecp,33,pubsecpstr); @@ -288,7 +288,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { if ( pubp != 0 ) pubp->numerrors++; - printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey)); + printf("LP_utxos_sigcheck failure.%d, probably from %s with older version\n",pubp!=0?pubp->numerrors:-1,bits256_str(str,pubkey)); } retval = -1; } else retval = 0; diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 9137b0c44..f1f6703b4 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -240,9 +240,11 @@ void LP_statslog_parseline(cJSON *lineobj) } else printf("parseline no method.(%s)\n",jprint(lineobj,0)); } -char *LP_statslog_disp(int32_t n) +char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) { cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + if ( starttime > endtime ) + starttime = endtime; memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); retjson = cJSON_CreateObject(); @@ -251,6 +253,7 @@ char *LP_statslog_disp(int32_t n) array = cJSON_CreateArray(); HASH_ITER(hh,LP_swapstats,sp,tmp) { + if ( (starttime == 0 && endtime == 0) || (sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime) ) LP_swapstats_line(basevols,relvols,line,sp); jaddistr(array,line); } From d25dfd5b5e67f062a945f1153267000f27cefee0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 19:34:25 +0300 Subject: [PATCH 1576/2732] Test --- iguana/exchanges/statsdisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/statsdisp b/iguana/exchanges/statsdisp index d322235a2..768c4e8b2 100755 --- a/iguana/exchanges/statsdisp +++ b/iguana/exchanges/statsdisp @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\",\"starttime\":0,\"endtime\":0}" From db5dfd05f239ef1709ec5e94e9ba33c956a46ec5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 19:39:25 +0300 Subject: [PATCH 1577/2732] Test --- iguana/exchanges/LP_stats.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index f1f6703b4..cbef208b4 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -115,7 +115,7 @@ void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON * quoteid = juint(lineobj,"quoteid"); satoshis = jdouble(lineobj,"srcamount") * SATOSHIDEN; destsatoshis = jdouble(lineobj,"destamount") * SATOSHIDEN; - if ( base != 0 && strcmp(base,sp->Q.srccoin) == 0 && rel != 0 && strcmp(rel,sp->Q.destcoin) == 0 && requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid && satoshis == sp->Q.satoshis && destsatoshis == sp->Q.destsatoshis ) + if ( base != 0 && strcmp(base,sp->Q.srccoin) == 0 && rel != 0 && strcmp(rel,sp->Q.destcoin) == 0 && requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid && satoshis+2*sp->Q.txfee == sp->Q.satoshis && destsatoshis+2*sp->Q.desttxfee == sp->Q.destsatoshis ) { sp->bobdeposit = LP_swapstats_txid(lineobj,"bobdeposit",sp->bobdeposit); sp->alicepayment = LP_swapstats_txid(lineobj,"alicepayment",sp->alicepayment); @@ -125,13 +125,14 @@ void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON * sp->depositspent = LP_swapstats_txid(lineobj,"depositspent",sp->depositspent); if ( (statusstr= jstr(lineobj,"status")) != 0 && strcmp(statusstr,"finished") == 0 ) sp->finished = juint(lineobj,"timestamp"); - } else printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis),dstr(sp->Q.satoshis),dstr(destsatoshis),dstr(sp->Q.destsatoshis)); + } else printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); } else sp->Q = *qp; } int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { + static uint32_t unexpected; struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t i,methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); @@ -149,7 +150,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { sp->methodind = methodind; LP_swapstats_update(sp,&Q,lineobj); - } else printf("unexpected tradestatus.(%s)\n",jprint(lineobj,0)); + } else printf("unexpected.%d tradestatus.(%s)\n",unexpected++,jprint(lineobj,0)); return(0); } if ( LP_quoteparse(&Q,lineobj) < 0 ) @@ -313,7 +314,7 @@ char *LP_statslog_parse() } fclose(fp); } - return(LP_statslog_disp(n)); + return(LP_statslog_disp(n,0,0)); } From ece4ac2b99174e452d0f21bde0f15850b8a992c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 19:45:52 +0300 Subject: [PATCH 1578/2732] Test --- iguana/exchanges/LP_stats.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index cbef208b4..b2f8b9b0a 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -76,13 +76,13 @@ uint64_t LP_aliceid_calc(bits256 desttxid,int32_t destvout,bits256 feetxid,int32 return((((uint64_t)desttxid.uints[0] << 48) | ((uint64_t)destvout << 32) | ((uint64_t)feetxid.uints[0] << 16) | (uint32_t)feevout)); } -void LP_swapstats_line(uint64_t *basevols,uint64_t *relvols,char *line,struct LP_swapstats *sp) +void LP_swapstats_line(int32_t *numtrades,uint64_t *basevols,uint64_t *relvols,char *line,struct LP_swapstats *sp) { char tstr[64]; int32_t baseind,relind; if ( (baseind= LP_priceinfoind(sp->Q.srccoin)) >= 0 ) - basevols[baseind] += sp->Q.satoshis; + basevols[baseind] += sp->Q.satoshis, numtrades[baseind]++; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) - relvols[relind] += sp->Q.destsatoshis; + relvols[relind] += sp->Q.destsatoshis, numtrades[relind]++; sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); } @@ -133,7 +133,8 @@ void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON * int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { static uint32_t unexpected; - struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t i,methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + struct LP_swapstats *sp; double qprice; uint32_t timestamp; int32_t i,numtrades[LP_MAXPRICEINFOS],methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + memset(numtrades,0,sizeof(numtrades)); memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); memset(&Q,0,sizeof(Q)); @@ -199,7 +200,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) sp->qprice = qprice; sp->methodind = methodind; sp->ind = LP_aliceids++; - LP_swapstats_line(basevols,relvols,line,sp); + LP_swapstats_line(numtrades,basevols,relvols,line,sp); //printf("%s\n",line); } else printf("unexpected LP_swapstats_add failure\n"); } @@ -243,11 +244,12 @@ void LP_statslog_parseline(cJSON *lineobj) char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) { - cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i,numtrades[LP_MAXPRICEINFOS]; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; if ( starttime > endtime ) starttime = endtime; memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); + memset(numtrades,0,sizeof(numtrades)); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddnum(retjson,"newlines",n); @@ -255,7 +257,7 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) HASH_ITER(hh,LP_swapstats,sp,tmp) { if ( (starttime == 0 && endtime == 0) || (sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime) ) - LP_swapstats_line(basevols,relvols,line,sp); + LP_swapstats_line(numtrades,basevols,relvols,line,sp); jaddistr(array,line); } jadd(retjson,"swaps",array); @@ -268,6 +270,7 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) jaddstr(item,"coin",LP_priceinfostr(i)); jaddnum(item,"srcvol",dstr(basevols[i])); jaddnum(item,"destvol",dstr(relvols[i])); + jaddnum(item,"numtrades",numtrades[i]); jaddnum(item,"total",dstr(basevols[i] + relvols[i])); jaddi(array,item); } From 954b6b09872e4024f70e9f0ca0eef15416060a11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:01:18 +0300 Subject: [PATCH 1579/2732] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- iguana/exchanges/LP_stats.c | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 3ab402856..fb8e1f69e 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2031,7 +2031,7 @@ int32_t bitcoin_addr2rmd160(uint8_t taddr,uint8_t *addrtypep,uint8_t rmd160[20], } for (i=0; imethodind = methodind; LP_swapstats_update(sp,&Q,lineobj); - } else printf("unexpected.%d tradestatus.(%s)\n",unexpected++,jprint(lineobj,0)); + } + else + { + HASH_ITER(hh,LP_swapstats,sp,tmp) + { + if ( sp->Q.R.requestid == requestid && sp->Q.R.quoteid == quoteid ) + { + sp->methodind = methodind; + LP_swapstats_update(sp,&Q,lineobj); + flag = 1; + break; + } + } + } + if ( flag == 0 ) + printf("unexpected.%d tradestatus.(%s)\n",unexpected++,jprint(lineobj,0)); return(0); } if ( LP_quoteparse(&Q,lineobj) < 0 ) From 4c9c2b23d7e904a19cf33b12b911e6f9c7cfbb8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:06:19 +0300 Subject: [PATCH 1580/2732] Test --- iguana/exchanges/LP_stats.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 7fe012647..1e3b1879d 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -102,7 +102,7 @@ bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) } else return(oldtxid); } -void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) +int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) { char *statusstr,*base,*rel; uint32_t requestid,quoteid; uint64_t satoshis,destsatoshis; if ( time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) @@ -125,9 +125,16 @@ void LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON * sp->depositspent = LP_swapstats_txid(lineobj,"depositspent",sp->depositspent); if ( (statusstr= jstr(lineobj,"status")) != 0 && strcmp(statusstr,"finished") == 0 ) sp->finished = juint(lineobj,"timestamp"); - } else printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); + return(0); + } + else + { + printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); + return(-1); + } } else sp->Q = *qp; + return(0); } int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) @@ -154,9 +161,10 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { flag = 1; sp->methodind = methodind; - LP_swapstats_update(sp,&Q,lineobj); + if ( LP_swapstats_update(sp,&Q,lineobj) == 0 ) + flag = 1; } - else + if ( flag == 0 ) { HASH_ITER(hh,LP_swapstats,sp,tmp) { From 7520c9254282f7a8bd6728393228032ceb60d499 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:16:32 +0300 Subject: [PATCH 1581/2732] Test --- iguana/exchanges/LP_stats.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 1e3b1879d..18ba31fbf 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -105,8 +105,6 @@ bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) { char *statusstr,*base,*rel; uint32_t requestid,quoteid; uint64_t satoshis,destsatoshis; - if ( time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) - sp->expired = (uint32_t)time(NULL); if ( strcmp(LP_stats_methods[sp->methodind],"tradestatus") == 0 ) { base = jstr(lineobj,"bob"); @@ -125,6 +123,8 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO sp->depositspent = LP_swapstats_txid(lineobj,"depositspent",sp->depositspent); if ( (statusstr= jstr(lineobj,"status")) != 0 && strcmp(statusstr,"finished") == 0 ) sp->finished = juint(lineobj,"timestamp"); + if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) + sp->expired = (uint32_t)time(NULL); return(0); } else @@ -171,8 +171,9 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) if ( sp->Q.R.requestid == requestid && sp->Q.R.quoteid == quoteid ) { sp->methodind = methodind; - LP_swapstats_update(sp,&Q,lineobj); - flag = 1; + if ( LP_swapstats_update(sp,&Q,lineobj) == 0 ) + flag = 1; + else printf("error after delayed match\n"); break; } } @@ -271,7 +272,7 @@ void LP_statslog_parseline(cJSON *lineobj) char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) { - cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i,numtrades[LP_MAXPRICEINFOS]; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i,dispflag,numtrades[LP_MAXPRICEINFOS]; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; if ( starttime > endtime ) starttime = endtime; memset(basevols,0,sizeof(basevols)); @@ -283,8 +284,17 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) array = cJSON_CreateArray(); HASH_ITER(hh,LP_swapstats,sp,tmp) { - if ( (starttime == 0 && endtime == 0) || (sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime) ) - LP_swapstats_line(numtrades,basevols,relvols,line,sp); + if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) + sp->expired = (uint32_t)time(NULL); + dispflag = 0; + if ( starttime == 0 && endtime == 0 ) + dispflag = 1; + else if ( starttime > time(NULL) && endtime == starttime && sp->finished == 0 && sp->expired == 0 ) + dispflag = 1; + else if ( sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime ) + dispflag = 1; + if ( dispflag != 0 ) + LP_swapstats_line(numtrades,basevols,relvols,line,sp); jaddistr(array,line); } jadd(retjson,"swaps",array); From 5ab884ce7877bde79d51021fe8bbbd0d77db3a85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:24:51 +0300 Subject: [PATCH 1582/2732] Test --- iguana/exchanges/LP_signatures.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 5cca3f372..efbfa6438 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -275,7 +275,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 if ( ctx == 0 ) ctx = bitcoin_ctx(); pubp = LP_pubkeyfind(pubkey); - if ( (pubp == 0|| pubp->numerrors < LP_MAXPUBKEY_ERRORS) && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + if ( (pubp == 0 || pubp->numerrors < LP_MAXPUBKEY_ERRORS) && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) { decode_hex(sig,65,sigstr); decode_hex(pubsecp,33,pubsecpstr); @@ -355,7 +355,11 @@ struct LP_utxos_qitem { struct queueitem DL; cJSON *argjson; }; char *LP_postutxos_recv(cJSON *argjson) { - struct LP_utxos_qitem *uitem; struct iguana_info *coin; char *coinaddr,*symbol; bits256 utxoshash; cJSON *obj; + struct LP_utxos_qitem *uitem; struct iguana_info *coin; char *coinaddr,*symbol; bits256 utxoshash,pubkey; cJSON *obj; struct LP_pubkeyinfo *pubp; + pubkey = jbits256(argjson,"pubkey"); + pubp = LP_pubkeyfind(pubkey); + if ( pubp->numerrors > LP_MAXPUBKEY_ERRORS ) + return(clonestr("{\"error\":\"blacklisted\"}")); if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( strcmp(coinaddr,coin->smartaddr) == 0 ) @@ -368,7 +372,7 @@ char *LP_postutxos_recv(cJSON *argjson) { utxoshash = LP_utxoshash_calc(obj); //char str[65]; printf("got utxoshash %s\n",bits256_str(str,utxoshash)); - if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),jbits256(argjson,"pubkey"),utxoshash) == 0 ) + if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,utxoshash) == 0 ) { uitem = calloc(1,sizeof(*uitem)); uitem->argjson = jduplicate(argjson); @@ -404,10 +408,11 @@ int32_t LP_utxosQ_process() int32_t LP_price_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,char *base,char *rel,uint64_t price64) { - static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; + static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; struct LP_pubkeyinfo *pubp; if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + pubp = LP_pubkeyfind(pubkey); + if ( (pubp == 0 || pubp->numerrors < LP_MAXPUBKEY_ERRORS) && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) { decode_hex(sig,65,sigstr); decode_hex(pubsecp,33,pubsecpstr); @@ -415,6 +420,8 @@ int32_t LP_price_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 retval = bitcoin_recoververify(ctx,"price",sig,sighash,pub33,0); if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) { + if ( pubp != 0 ) + pubp->numerrors++; printf("LP_price_sigcheck failure\n"); retval = -1; } @@ -525,7 +532,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); retval = 0; pubp->timestamp = (uint32_t)time(NULL); - } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + } else pubp->numerrors++; } } else @@ -627,7 +634,7 @@ char *LP_uitem_recv(cJSON *argjson) { //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); if ( strcmp(coin->smartaddr,coinaddr) != 0 ) - LP_address_utxoadd("LP_uitem,recv",coin,coinaddr,txid,vout,value,height,-1); + LP_address_utxoadd("LP_uitem_recv",coin,coinaddr,txid,vout,value,height,-1); //else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); } return(clonestr("{\"result\":\"success\"}")); From ca35f1aeff9548300744f2035433ec36d25f31b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:29:34 +0300 Subject: [PATCH 1583/2732] Test --- iguana/exchanges/LP_stats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 18ba31fbf..29fa64b7f 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -294,8 +294,10 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) else if ( sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime ) dispflag = 1; if ( dispflag != 0 ) + { LP_swapstats_line(numtrades,basevols,relvols,line,sp); - jaddistr(array,line); + jaddistr(array,line); + } } jadd(retjson,"swaps",array); array = cJSON_CreateArray(); From 098e6a1a2312c81c485cc00cbec9deb064118fc0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:33:49 +0300 Subject: [PATCH 1584/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 29fa64b7f..93d848191 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -83,7 +83,7 @@ void LP_swapstats_line(int32_t *numtrades,uint64_t *basevols,uint64_t *relvols,c basevols[baseind] += sp->Q.satoshis, numtrades[baseind]++; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) relvols[relind] += sp->Q.destsatoshis, numtrades[relind]++; - sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); + sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u %s",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired,LP_stats_methods[sp->methodind]); } bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) From f942cee980982c2699b46e6db4b4135b7d332182 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:45:20 +0300 Subject: [PATCH 1585/2732] Test --- iguana/exchanges/LP_stats.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 93d848191..0c88512cc 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -83,7 +83,7 @@ void LP_swapstats_line(int32_t *numtrades,uint64_t *basevols,uint64_t *relvols,c basevols[baseind] += sp->Q.satoshis, numtrades[baseind]++; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) relvols[relind] += sp->Q.destsatoshis, numtrades[relind]++; - sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u %s",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired,LP_stats_methods[sp->methodind]); + sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); } bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) @@ -296,7 +296,12 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) if ( dispflag != 0 ) { LP_swapstats_line(numtrades,basevols,relvols,line,sp); - jaddistr(array,line); + item = cJSON_CreateObject(); + jadd64bits(item,"aliceid",sp->aliceid); + jaddnum(item,"requestid",sp->Q.R.requestid); + jaddnum(item,"quoteid",sp->Q.R.quoteid); + jaddstr(item,"line",line); + jaddi(array,item); } } jadd(retjson,"swaps",array); From bbb5e233ab818c5ad1392a185cbe1b4aa298bea5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:47:32 +0300 Subject: [PATCH 1586/2732] Test --- iguana/exchanges/LP_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 0c88512cc..7773fb757 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -83,7 +83,7 @@ void LP_swapstats_line(int32_t *numtrades,uint64_t *basevols,uint64_t *relvols,c basevols[baseind] += sp->Q.satoshis, numtrades[baseind]++; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) relvols[relind] += sp->Q.destsatoshis, numtrades[relind]++; - sprintf(line,"%s %8s %-4d %9s %016llx: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); + sprintf(line,"%s %8s %-4d %9s %22llu: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); } bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) From fec6d2799616bce1d9c4405033524bc0a1e07971 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:53:47 +0300 Subject: [PATCH 1587/2732] Test --- iguana/exchanges/LP_stats.c | 7 +++++++ iguana/exchanges/pendings | 3 +++ 2 files changed, 10 insertions(+) create mode 100755 iguana/exchanges/pendings diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 7773fb757..8fb5af5f9 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -298,6 +298,13 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) LP_swapstats_line(numtrades,basevols,relvols,line,sp); item = cJSON_CreateObject(); jadd64bits(item,"aliceid",sp->aliceid); + jaddbits256(item,"src",sp->Q.srchash); + jaddstr(item,"base",sp->Q.srccoin); + jaddnum(item,"basevol",dstr(sp->Q.satoshis)); + jaddbits256(item,"dest",sp->Q.desthash); + jaddstr(item,"rel",sp->Q.destcoin); + jaddnum(item,"relvol",dstr(sp->Q.destsatoshis)); + jaddnum(item,"price",sp->qprice); jaddnum(item,"requestid",sp->Q.R.requestid); jaddnum(item,"quoteid",sp->Q.R.quoteid); jaddstr(item,"line",line); diff --git a/iguana/exchanges/pendings b/iguana/exchanges/pendings new file mode 100755 index 000000000..a2aa46c83 --- /dev/null +++ b/iguana/exchanges/pendings @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\",\"starttime\":2000000000,\"endtime\":2000000000}" From 13cb45b249fd5a5dbbe2ab2ab2cf95e757ecde3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 20:59:19 +0300 Subject: [PATCH 1588/2732] Test --- iguana/exchanges/LP_commands.c | 10 ++- iguana/exchanges/LP_stats.c | 133 +++++++++++++++++---------------- 2 files changed, 75 insertions(+), 68 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 32c30f0e0..c632adbb6 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -218,9 +218,15 @@ stop()\n\ return(LP_portfolio()); } else if ( strcmp(method,"parselog") == 0 ) - return(LP_statslog_parse()); + { + int32_t n = LP_statslog_parse(); + return(LP_statslog_disp(n,2000000000,2000000000)); + } else if ( strcmp(method,"statsdisp") == 0 ) - return(LP_statslog_disp(0,juint(argjson,"starttime"),juint(argjson,"endtime"))); + { + int32_t n = LP_statslog_parse(); + return(LP_statslog_disp(n,juint(argjson,"starttime"),juint(argjson,"endtime"))); + } else if ( strcmp(method,"secretaddresses") == 0 ) { uint8_t taddr,pubtype; diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 8fb5af5f9..ee5c656c8 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -29,6 +29,7 @@ struct LP_swapstats uint64_t aliceid; uint32_t ind,methodind,finished,expired; } *LP_swapstats; +int32_t LP_statslog_parsequote(char *method,cJSON *lineobj); char *LP_stats_methods[] = { "unknown", "request", "reserved", "connect", "connected", "tradestatus" }; @@ -52,6 +53,72 @@ void LP_tradecommand_log(cJSON *argjson) } } +void LP_statslog_parseline(cJSON *lineobj) +{ + char *method; cJSON *obj; + if ( (method= jstr(lineobj,"method")) != 0 ) + { + if ( strcmp(method,"request") == 0 ) + LP_requests++; + else if ( strcmp(method,"reserved") == 0 ) + LP_reserveds++; + else if ( strcmp(method,"connect") == 0 ) + { + if ( (obj= jobj(lineobj,"trade")) == 0 ) + obj = lineobj; + LP_statslog_parsequote(method,obj); + LP_connects++; + } + else if ( strcmp(method,"connected") == 0 ) + { + LP_statslog_parsequote(method,lineobj); + LP_connecteds++; + } + else if ( strcmp(method,"tradestatus") == 0 ) + { + LP_statslog_parsequote(method,lineobj); + LP_tradestatuses++; + } + else + { + LP_unknowns++; + printf("parseline unknown method.(%s) (%s)\n",method,jprint(lineobj,0)); + } + } else printf("parseline no method.(%s)\n",jprint(lineobj,0)); +} + +int32_t LP_statslog_parse() +{ + static long lastpos; FILE *fp; char line[8192]; cJSON *lineobj; int32_t n = 0; + if ( (fp= fopen(LP_STATSLOG_FNAME,"rb")) != 0 ) + { + if ( lastpos > 0 ) + { + fseek(fp,0,SEEK_END); + if ( ftell(fp) > lastpos ) + fseek(fp,lastpos,SEEK_SET); + else + { + fclose(fp); + return(0); + } + } + while ( fgets(line,sizeof(line),fp) > 0 ) + { + lastpos = ftell(fp); + if ( (lineobj= cJSON_Parse(line)) != 0 ) + { + n++; + LP_statslog_parseline(lineobj); + //printf("%s\n",jprint(lineobj,0)); + free_json(lineobj); + } + } + fclose(fp); + } + return(n); +} + struct LP_swapstats *LP_swapstats_find(uint64_t aliceid) { struct LP_swapstats *sp; @@ -236,40 +303,6 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) return(duplicate == 0); } -void LP_statslog_parseline(cJSON *lineobj) -{ - char *method; cJSON *obj; - if ( (method= jstr(lineobj,"method")) != 0 ) - { - if ( strcmp(method,"request") == 0 ) - LP_requests++; - else if ( strcmp(method,"reserved") == 0 ) - LP_reserveds++; - else if ( strcmp(method,"connect") == 0 ) - { - if ( (obj= jobj(lineobj,"trade")) == 0 ) - obj = lineobj; - LP_statslog_parsequote(method,obj); - LP_connects++; - } - else if ( strcmp(method,"connected") == 0 ) - { - LP_statslog_parsequote(method,lineobj); - LP_connecteds++; - } - else if ( strcmp(method,"tradestatus") == 0 ) - { - LP_statslog_parsequote(method,lineobj); - LP_tradestatuses++; - } - else - { - LP_unknowns++; - printf("parseline unknown method.(%s) (%s)\n",method,jprint(lineobj,0)); - } - } else printf("parseline no method.(%s)\n",jprint(lineobj,0)); -} - char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) { cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i,dispflag,numtrades[LP_MAXPRICEINFOS]; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; @@ -339,36 +372,4 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) return(jprint(retjson,1)); } -char *LP_statslog_parse() -{ - static long lastpos; FILE *fp; char line[8192]; cJSON *lineobj; int32_t n = 0; - if ( (fp= fopen(LP_STATSLOG_FNAME,"rb")) != 0 ) - { - if ( lastpos > 0 ) - { - fseek(fp,0,SEEK_END); - if ( ftell(fp) > lastpos ) - fseek(fp,lastpos,SEEK_SET); - else - { - fclose(fp); - return(clonestr("{\"result\":\"success\",\"newlines\":0}")); - } - } - while ( fgets(line,sizeof(line),fp) > 0 ) - { - lastpos = ftell(fp); - if ( (lineobj= cJSON_Parse(line)) != 0 ) - { - n++; - LP_statslog_parseline(lineobj); - //printf("%s\n",jprint(lineobj,0)); - free_json(lineobj); - } - } - fclose(fp); - } - return(LP_statslog_disp(n,0,0)); -} - From 6d43bb444148ea09f0bdc0a76bf65649a820649d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 21:33:07 +0300 Subject: [PATCH 1589/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 12 +++++++++++- iguana/exchanges/LP_network.c | 8 +++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c632adbb6..f549526d9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -97,7 +97,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ available localhost RPC commands: \n \ -pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ +pricearray(base, rel, starttime=0, endtime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ setprice(base, rel, price)\n\ autoprice(base, rel, minprice, margin, refbase, refrel, factor, offset)*\n\ goal(coin=*, val=)\n\ @@ -259,7 +259,7 @@ stop()\n\ } else if ( strcmp(method,"pricearray") == 0 ) { - return(jprint(LP_pricearray(base,rel,juint(argjson,"firsttime"),juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); + return(jprint(LP_pricearray(base,rel,juint(argjson,"starttime"),juint(argjson,"endtime"),jint(argjson,"timescale")),1)); } else if ( strcmp(method,"myprice") == 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 29f7ba595..d355bbb2a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -815,7 +815,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) 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; long filesize,n; int32_t 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; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],bindaddr2[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { @@ -899,6 +899,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu pubsock = -1; nanomsg_transportname(0,subaddr,myipaddr,mypubport); nanomsg_transportname(1,bindaddr,myipaddr,mypubport); + nanomsg_transportname2(1,bindaddr2,myipaddr,mypubport+10); if ( (pubsock= nn_socket(AF_SP,NN_PUB)) >= 0 ) { if ( nn_bind(pubsock,bindaddr) >= 0 ) @@ -912,6 +913,15 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( pubsock >= 0 ) nn_close(pubsock), pubsock = -1; } + if ( nn_bind(pubsock,bindaddr2) >= 0 ) + { + timeout = 1; + nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); + } + else + { + printf("error binding2 to (%s)\n",bindaddr2); + } } else printf("error getting pubsock %d\n",pubsock); printf(">>>>>>>>> myipaddr.%s (%s) pullsock.%d\n",myipaddr,subaddr,pubsock); LP_mypubsock = pubsock; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 09d387f37..221d6175c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,13 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse + sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); + return(str); +} + +char *nanomsg_transportname2(int32_t bindflag,char *str,char *ipaddr,uint16_t port) +{ + sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); return(str); } From 73a4aa89cd44cb916b98eaf4868b75f7c66b1f19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 21:55:25 +0300 Subject: [PATCH 1590/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 20 ++++++++------------ iguana/exchanges/LP_network.c | 21 ++++++++++++++++----- iguana/exchanges/LP_peers.c | 18 +++++++++++++++--- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 95a827003..965062623 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -325,7 +325,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); -uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); +uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d355bbb2a..d29d53c86 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -815,7 +815,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) 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; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],bindaddr2[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); + char *myipaddr=0; long filesize,n; int32_t valid,timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],bindaddr2[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { @@ -899,10 +899,15 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu pubsock = -1; nanomsg_transportname(0,subaddr,myipaddr,mypubport); nanomsg_transportname(1,bindaddr,myipaddr,mypubport); - nanomsg_transportname2(1,bindaddr2,myipaddr,mypubport+10); + nanomsg_transportname2(1,bindaddr2,myipaddr,mypubport); if ( (pubsock= nn_socket(AF_SP,NN_PUB)) >= 0 ) { + valid = 0; if ( nn_bind(pubsock,bindaddr) >= 0 ) + valid++; + if ( nn_bind(pubsock,bindaddr2) >= 0 ) + valid++; + if ( valid > 0 ) { timeout = 1; nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); @@ -913,17 +918,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( pubsock >= 0 ) nn_close(pubsock), pubsock = -1; } - if ( nn_bind(pubsock,bindaddr2) >= 0 ) - { - timeout = 1; - nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - } - else - { - printf("error binding2 to (%s)\n",bindaddr2); - } } else printf("error getting pubsock %d\n",pubsock); - printf(">>>>>>>>> myipaddr.%s (%s) pullsock.%d\n",myipaddr,subaddr,pubsock); + printf(">>>>>>>>> myipaddr.(%s %s) (%s) pullsock.%d valid.%d\n",bindaddr,bindaddr2,subaddr,pubsock,valid); LP_mypubsock = pubsock; } printf("got %s, initpeers\n",myipaddr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 221d6175c..f826b4750 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -36,7 +36,7 @@ char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t por char *nanomsg_transportname2(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); + sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port+10); return(str); } @@ -660,7 +660,7 @@ char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) return(retstr); } -uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) +uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int32_t ispaired) { uint16_t publicport = 0; char *retstr,*addr; cJSON *retjson; struct LP_peerinfo *peer,*tmp; HASH_ITER(hh,LP_peerinfos,peer,tmp) @@ -675,6 +675,8 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) safecopy(publicaddr,addr,128); if ( (addr= jstr(retjson,"connectaddr")) != 0 ) safecopy(connectaddr,addr,128); + if ( (addr= jstr(retjson,"connectaddr2")) != 0 ) + safecopy(connectaddr2,addr,128); if ( publicaddr[0] != 0 && connectaddr[0] != 0 ) publicport = juint(retjson,"publicport"); free_json(retjson); @@ -690,8 +692,9 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char *myipaddr,uint16_t mypullport,int32_t ispaired) { - int32_t nntype,pullsock,timeout; char bindaddr[128],connectaddr[128]; + int32_t nntype,pullsock,timeout; char bindaddr[128],bindaddr2[128],connectaddr[128],connectaddr2[128]; *mypullportp = mypullport; + connectaddr2[0] = 0; if ( ispaired == 0 ) { if ( LP_canbind != 0 ) @@ -702,6 +705,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char { nanomsg_transportname(0,publicaddr,myipaddr,mypullport); nanomsg_transportname(1,bindaddr,myipaddr,mypullport); + nanomsg_transportname2(1,bindaddr2,myipaddr,mypullport); } else { @@ -713,7 +717,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } while ( *mypullportp == 0 ) { - if ( (*mypullportp= LP_psock_get(connectaddr,publicaddr,ispaired)) != 0 ) + if ( (*mypullportp= LP_psock_get(connectaddr,connectaddr2,publicaddr,ispaired)) != 0 ) break; sleep(10); printf("try to get publicaddr again\n"); @@ -729,7 +733,13 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char { printf("bind to %s error for %s: %s\n",connectaddr,publicaddr,nn_strerror(nn_errno())); exit(-1); - } else printf("nntype.%d NN_PAIR.%d connect to %s connectsock.%d\n",nntype,NN_PAIR,connectaddr,pullsock); + } + else + { + if ( connectaddr2[0] != 0 && nn_connect(pullsock,connectaddr2) > 0 ) + printf("%s ",connectaddr2); + printf("nntype.%d NN_PAIR.%d connect to %s connectsock.%d\n",nntype,NN_PAIR,connectaddr,pullsock); + } } else { @@ -738,6 +748,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char printf("bind to %s error for %s: %s\n",bindaddr,publicaddr,nn_strerror(nn_errno())); exit(-1); } + nn_bind(pullsock,bindaddr2); } timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 064086a03..5f9fabe8e 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -56,7 +56,7 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { - uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; + uint32_t ipbits; int32_t valid,pushsock,subsock,timeout; char checkip[64],subaddr2[64],pushaddr[64],pushaddr2[64],subaddr[64]; struct LP_peerinfo *peer = 0; printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) @@ -90,13 +90,19 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) { nanomsg_transportname(0,pushaddr,peer->ipaddr,pushport); + nanomsg_transportname(0,pushaddr2,peer->ipaddr,pushport); + valid = 0; if ( nn_connect(pushsock,pushaddr) >= 0 ) + valid++; + if ( nn_connect(pushsock,pushaddr2) >= 0 ) + valid++; + if ( valid > 0 ) { timeout = 1; nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; //nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); - printf("connected to push.(%s) %d\n",pushaddr,pushsock); + printf("connected to push.(%s $s) pushsock.%d valid.%d\n",pushaddr,pushsock,valid); peer->connected = (uint32_t)time(NULL); peer->pushsock = pushsock; if ( (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 ) @@ -105,10 +111,16 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char nn_setsockopt(subsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(subsock,NN_SUB,NN_SUB_SUBSCRIBE,"",0); nanomsg_transportname(0,subaddr,peer->ipaddr,subport); + nanomsg_transportname2(0,subaddr2,peer->ipaddr,subport); + valid = 0; if ( nn_connect(subsock,subaddr) >= 0 ) + valid++; + if ( nn_connect(subsock,subaddr2) >= 0 ) + valid++; + if ( valid > 0 ) { peer->subsock = subsock; - printf("connected to sub.(%s) %d\n",subaddr,peer->subsock); + printf("connected to sub.(%s %s) subsock.%d valid.%d\n",subaddr,subaddr2,peer->subsock,valie); } else nn_close(subsock); } } From 90ffcf8e180838ad48d46342015f0c4d43338499 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 21:56:39 +0300 Subject: [PATCH 1591/2732] Test --- iguana/exchanges/LP_peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 5f9fabe8e..dfe18ac6f 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -120,7 +120,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char if ( valid > 0 ) { peer->subsock = subsock; - printf("connected to sub.(%s %s) subsock.%d valid.%d\n",subaddr,subaddr2,peer->subsock,valie); + printf("connected to sub.(%s %s) subsock.%d valid.%d\n",subaddr,subaddr2,peer->subsock,valid); } else nn_close(subsock); } } From ce0c7cea5abe9448c0b352ada39ad2bbd6b4768d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:00:09 +0300 Subject: [PATCH 1592/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_peers.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d29d53c86..f92770639 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -900,13 +900,14 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu nanomsg_transportname(0,subaddr,myipaddr,mypubport); nanomsg_transportname(1,bindaddr,myipaddr,mypubport); nanomsg_transportname2(1,bindaddr2,myipaddr,mypubport); + valid = 0; if ( (pubsock= nn_socket(AF_SP,NN_PUB)) >= 0 ) { valid = 0; if ( nn_bind(pubsock,bindaddr) >= 0 ) valid++; - if ( nn_bind(pubsock,bindaddr2) >= 0 ) - valid++; + if ( nn_bind(pubsock,bindaddr2) >= 0 ) + valid++; if ( valid > 0 ) { timeout = 1; diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index dfe18ac6f..bc69f25f7 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -102,7 +102,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; //nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); - printf("connected to push.(%s $s) pushsock.%d valid.%d\n",pushaddr,pushsock,valid); + printf("connected to push.(%s %s) pushsock.%d valid.%d\n",pushaddr,pushsock,valid); peer->connected = (uint32_t)time(NULL); peer->pushsock = pushsock; if ( (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 ) From 0c3545ddadd839dfced2a4fa550a15fd70ddaf26 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:01:17 +0300 Subject: [PATCH 1593/2732] Test --- iguana/exchanges/LP_peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index bc69f25f7..59ffed9bd 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -102,7 +102,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; //nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); - printf("connected to push.(%s %s) pushsock.%d valid.%d\n",pushaddr,pushsock,valid); + printf("connected to push.(%s %s) pushsock.%d valid.%d\n",pushaddr,pushaddr2,pushsock,valid); peer->connected = (uint32_t)time(NULL); peer->pushsock = pushsock; if ( (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 ) From 632e055659c022a24c070c5f82d48a388637abd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:10:32 +0300 Subject: [PATCH 1594/2732] Test --- iguana/exchanges/LP_network.c | 3 ++- iguana/exchanges/LP_peers.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f826b4750..723da5980 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -748,7 +748,8 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char printf("bind to %s error for %s: %s\n",bindaddr,publicaddr,nn_strerror(nn_errno())); exit(-1); } - nn_bind(pullsock,bindaddr2); + if ( nn_bind(pullsock,bindaddr2) >= 0 ) + printf("bound to %s\n",bindaddr2); } timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 59ffed9bd..87b03d2ad 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -121,13 +121,20 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { peer->subsock = subsock; printf("connected to sub.(%s %s) subsock.%d valid.%d\n",subaddr,subaddr2,peer->subsock,valid); - } else nn_close(subsock); + } + else + { + printf("error connecting to subsock.%d (%s %s)\n",subsock,subaddr,subaddr2); + nn_close(subsock); + subsock = -1; + } } } else { nn_close(pushsock); - printf("error connecting to push.(%s)\n",pushaddr); + pushsock = -1; + printf("error connecting to push.(%s %s)\n",pushaddr,pushaddr2); } } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); if ( peer->pushsock >= 0 && peer->subsock >= 0 ) From 1c1f9b99411812960947f3b4fc1ed7a31e29f437 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:27:07 +0300 Subject: [PATCH 1595/2732] Test --- iguana/exchanges/LP_stats.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index ee5c656c8..c665b5a99 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -171,7 +171,8 @@ bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSON *lineobj) { - char *statusstr,*base,*rel; uint32_t requestid,quoteid; uint64_t satoshis,destsatoshis; + char *statusstr,*base,*rel,gui[64]; uint32_t requestid,quoteid; uint64_t satoshis,destsatoshis; + safecopy(gui,sp->Q.gui,sizeof(gui)); if ( strcmp(LP_stats_methods[sp->methodind],"tradestatus") == 0 ) { base = jstr(lineobj,"bob"); @@ -201,6 +202,8 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO } } else sp->Q = *qp; + if ( sp->Q.gui[0] == 0 || strcmp(sp->Q.gui,"nogui") == 0 ) + strcpy(sp->Q.gui,gui); return(0); } @@ -257,6 +260,9 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) } else { + gui = jstr(lineobj,"gui"); + if ( gui == 0 || gui[0] == 0 ) + gui = "nogui"; base = jstr(lineobj,"base"); rel = jstr(lineobj,"rel"); gui = jstr(lineobj,"gui"); From 63b0e72bf66e8876370d96d44d0cb0669e9bebb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:34:28 +0300 Subject: [PATCH 1596/2732] Test --- iguana/exchanges/LP_stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index c665b5a99..040599693 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -181,7 +181,7 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO quoteid = juint(lineobj,"quoteid"); satoshis = jdouble(lineobj,"srcamount") * SATOSHIDEN; destsatoshis = jdouble(lineobj,"destamount") * SATOSHIDEN; - if ( base != 0 && strcmp(base,sp->Q.srccoin) == 0 && rel != 0 && strcmp(rel,sp->Q.destcoin) == 0 && requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid && satoshis+2*sp->Q.txfee == sp->Q.satoshis && destsatoshis+2*sp->Q.desttxfee == sp->Q.destsatoshis ) + if ( base != 0 && strcmp(base,sp->Q.srccoin) == 0 && rel != 0 && strcmp(rel,sp->Q.destcoin) == 0 && requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid && ((satoshis+2*sp->Q.txfee)|1) == (sp->Q.satoshis|1) && ((destsatoshis+2*sp->Q.desttxfee)|1) == (sp->Q.destsatoshis|1) ) { sp->bobdeposit = LP_swapstats_txid(lineobj,"bobdeposit",sp->bobdeposit); sp->alicepayment = LP_swapstats_txid(lineobj,"alicepayment",sp->alicepayment); @@ -197,7 +197,8 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO } else { - printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); + if ( requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid ) + printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); return(-1); } @@ -263,6 +264,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) gui = jstr(lineobj,"gui"); if ( gui == 0 || gui[0] == 0 ) gui = "nogui"; + printf("%s\n",gui); base = jstr(lineobj,"base"); rel = jstr(lineobj,"rel"); gui = jstr(lineobj,"gui"); From 091fec3e9c853f50df753bb39e3cb7d75f05dfe3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:39:09 +0300 Subject: [PATCH 1597/2732] Test --- iguana/exchanges/LP_stats.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 040599693..5f5068774 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -28,6 +28,7 @@ struct LP_swapstats double qprice; uint64_t aliceid; uint32_t ind,methodind,finished,expired; + char alicegui[32],bobgui[32]; } *LP_swapstats; int32_t LP_statslog_parsequote(char *method,cJSON *lineobj); @@ -150,7 +151,7 @@ void LP_swapstats_line(int32_t *numtrades,uint64_t *basevols,uint64_t *relvols,c basevols[baseind] += sp->Q.satoshis, numtrades[baseind]++; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) relvols[relind] += sp->Q.destsatoshis, numtrades[relind]++; - sprintf(line,"%s %8s %-4d %9s %22llu: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->Q.gui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); + sprintf(line,"%s %8s/%8s %-4d %9s %22llu: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->alicegui,sp->bobgui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); } bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) @@ -264,7 +265,9 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) gui = jstr(lineobj,"gui"); if ( gui == 0 || gui[0] == 0 ) gui = "nogui"; - printf("%s\n",gui); + if ( jint(lineobj,"iambob") != 0 ) + strcpy(sp->bobgui,gui); + else strcpy(sp->alicegui,gui); base = jstr(lineobj,"base"); rel = jstr(lineobj,"rel"); gui = jstr(lineobj,"gui"); From 95689b1e6b0dfa5692b1d777f37cabdd5a199401 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:40:29 +0300 Subject: [PATCH 1598/2732] Test --- iguana/exchanges/LP_stats.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 5f5068774..a4c734671 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -265,9 +265,6 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) gui = jstr(lineobj,"gui"); if ( gui == 0 || gui[0] == 0 ) gui = "nogui"; - if ( jint(lineobj,"iambob") != 0 ) - strcpy(sp->bobgui,gui); - else strcpy(sp->alicegui,gui); base = jstr(lineobj,"base"); rel = jstr(lineobj,"rel"); gui = jstr(lineobj,"gui"); @@ -310,6 +307,15 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) //printf("%s\n",line); } else printf("unexpected LP_swapstats_add failure\n"); } + if ( sp != 0 ) + { + if ( strcmp(gui,"nogui") != 0 ) + { + if ( jint(lineobj,"iambob") != 0 ) + strcpy(sp->bobgui,gui); + else strcpy(sp->alicegui,gui); + } + } } return(duplicate == 0); } From 952405aa386dd50525b96fbd7f4d0993619f7efa Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:45:28 +0300 Subject: [PATCH 1599/2732] Test --- iguana/exchanges/LP_stats.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index a4c734671..9314987e5 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -267,7 +267,6 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) gui = "nogui"; base = jstr(lineobj,"base"); rel = jstr(lineobj,"rel"); - gui = jstr(lineobj,"gui"); satoshis = j64bits(lineobj,"satoshis"); if ( base == 0 || rel == 0 || satoshis == 0 ) { From 1af9908cd8d3cbb9e0676a6104fa4a9bae6b7698 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 22:48:53 +0300 Subject: [PATCH 1600/2732] Test --- iguana/exchanges/LP_stats.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 9314987e5..89919ef3f 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -151,7 +151,7 @@ void LP_swapstats_line(int32_t *numtrades,uint64_t *basevols,uint64_t *relvols,c basevols[baseind] += sp->Q.satoshis, numtrades[baseind]++; if ( (relind= LP_priceinfoind(sp->Q.destcoin)) >= 0 ) relvols[relind] += sp->Q.destsatoshis, numtrades[relind]++; - sprintf(line,"%s %8s/%8s %-4d %9s %22llu: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->alicegui,sp->bobgui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); + sprintf(line,"%s (%s).(%s) %-4d %9s %22llu: (%.8f %5s) -> (%.8f %5s) %.8f finished.%u expired.%u",utc_str(tstr,sp->Q.timestamp),sp->alicegui,sp->bobgui,sp->ind,LP_stats_methods[sp->methodind],(long long)sp->aliceid,dstr(sp->Q.satoshis),sp->Q.srccoin,dstr(sp->Q.destsatoshis),sp->Q.destcoin,sp->qprice,sp->finished,sp->expired); } bits256 LP_swapstats_txid(cJSON *argjson,char *name,bits256 oldtxid) @@ -212,7 +212,7 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) { static uint32_t unexpected; - struct LP_swapstats *sp,*tmp; double qprice; uint32_t requestid,quoteid,timestamp; int32_t i,flag,numtrades[LP_MAXPRICEINFOS],methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel,line[1024]; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; + struct LP_swapstats *sp,*tmp; double qprice; uint32_t requestid,quoteid,timestamp; int32_t i,flag,numtrades[LP_MAXPRICEINFOS],methodind,destvout,feevout,duplicate=0; char *gui,*base,*rel; uint64_t aliceid,txfee,satoshis,destsatoshis; bits256 desttxid,feetxid; struct LP_quoteinfo Q; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; memset(numtrades,0,sizeof(numtrades)); memset(basevols,0,sizeof(basevols)); memset(relvols,0,sizeof(relvols)); @@ -302,7 +302,9 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) sp->qprice = qprice; sp->methodind = methodind; sp->ind = LP_aliceids++; - LP_swapstats_line(numtrades,basevols,relvols,line,sp); + strcpy(sp->bobgui,"nogui"); + strcpy(sp->alicegui,"nogui"); + //LP_swapstats_line(numtrades,basevols,relvols,line,sp); //printf("%s\n",line); } else printf("unexpected LP_swapstats_add failure\n"); } From 90a9c1f17a824cffdb54c7a4a38a9971c0c0fd47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 10:38:06 +0300 Subject: [PATCH 1601/2732] Allow 0.1% auto --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 965062623..3770948dd 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -60,7 +60,7 @@ void emscripten_usleep(int32_t x); #define LP_SWAPSTEP_TIMEOUT 30 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 -#define LP_MINCLIENTVOL 50 +#define LP_MINCLIENTVOL 1000 #define LP_MINSIZE_TXFEEMULT 10 #define LP_REQUIRED_TXFEE 0.8 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f92770639..4c30bbab9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,10 +21,16 @@ // ZEC LP_transaction_fromdata mismatched txid e2a3eebcf5bef6fe63296f53ce35d2f2c6e3b29c7c907da4171a580f50c93c74 vs 1ed5c15bbf991ff42c73b1492d1bb50e91d1d731c86cb3058405cff95cd9bd70 //0200000000018c343500000000001976a9141462c3dd3f936d595c9af55978003b27c250441f88ac000000000100000000000000009c5b3500000000005a6c707fc604699d0166b2a750c8a2ff21c8aed0b6e6fe160f651da8cf865c2aa079a7f71f7782604785e1f9a7300cd6c89ca50b5d91f6c0ae5f293ea5a72e62bb0f05da84510e6431c5d4be7a372221265fd98dbccee11f5ed064c5afaa19eff27fd12c30a7a5205f70c99f22b7090c00048c1c9767eea1c79e54ed60c08c138758ad73d43f2692fcb05f data2json n.44 vs len. -// process stats.log local file -> map of realtime activity! -// handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. -// select oldest utxo first +//.53/100 ordermatch 0.16600749 best satoshis 0.52354320 destsatoshis 0.08687889 txfees (0.00010000 0.00010000) +//LP_txfees(0.00010000 0.00010000) +//>>>>>>> quote satoshis.(0.52354320 0.08687889) MNZ 0.52354320 -> KMD 0.08687889 +//LP_txfees(0.00010000 0.00010000) +//qprice 0.16597577 <- 0.08687889/0.52354320 txfees.(0.00010000 0.00010000) vs (0.00010000 0.00010000) +//destsatoshis 0.08687889 is -> why quote validate error -13 for alice +// select oldest utxo first +// handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. +// depth and trade to pubkey // verify portfolio, pricearray, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs From 4e04b93f112085d1e33861182540f9aad81635a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 10:47:18 +0300 Subject: [PATCH 1602/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ------- iguana/exchanges/LP_ordermatch.c | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4c30bbab9..4e11914ec 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,13 +21,6 @@ // ZEC LP_transaction_fromdata mismatched txid e2a3eebcf5bef6fe63296f53ce35d2f2c6e3b29c7c907da4171a580f50c93c74 vs 1ed5c15bbf991ff42c73b1492d1bb50e91d1d731c86cb3058405cff95cd9bd70 //0200000000018c343500000000001976a9141462c3dd3f936d595c9af55978003b27c250441f88ac000000000100000000000000009c5b3500000000005a6c707fc604699d0166b2a750c8a2ff21c8aed0b6e6fe160f651da8cf865c2aa079a7f71f7782604785e1f9a7300cd6c89ca50b5d91f6c0ae5f293ea5a72e62bb0f05da84510e6431c5d4be7a372221265fd98dbccee11f5ed064c5afaa19eff27fd12c30a7a5205f70c99f22b7090c00048c1c9767eea1c79e54ed60c08c138758ad73d43f2692fcb05f data2json n.44 vs len. -//.53/100 ordermatch 0.16600749 best satoshis 0.52354320 destsatoshis 0.08687889 txfees (0.00010000 0.00010000) -//LP_txfees(0.00010000 0.00010000) -//>>>>>>> quote satoshis.(0.52354320 0.08687889) MNZ 0.52354320 -> KMD 0.08687889 -//LP_txfees(0.00010000 0.00010000) -//qprice 0.16597577 <- 0.08687889/0.52354320 txfees.(0.00010000 0.00010000) vs (0.00010000 0.00010000) -//destsatoshis 0.08687889 is -> why quote validate error -13 for alice - // select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. // depth and trade to pubkey diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 91a8a6530..748605348 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -897,6 +897,11 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis; + if ( destsatoshis < (autxo->payment.value / LP_MINCLIENTVOL) || autxo->payment.value < desttxfee*LP_MINSIZE_TXFEEMULT ) + { + printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); + return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); + } while ( 1 ) { if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) From 8cf64bdde25581276ba1e275e4074c18aec84a58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 12:24:19 +0300 Subject: [PATCH 1603/2732] Destpubkey --- iguana/exchanges/LP_commands.c | 10 ++--- iguana/exchanges/LP_nativeDEX.c | 38 +++++++++++++++--- iguana/exchanges/LP_ordermatch.c | 63 +++++++++++++++--------------- iguana/exchanges/LP_portfolio.c | 5 ++- iguana/exchanges/LP_prices.c | 31 ++++----------- iguana/exchanges/LP_rpc.c | 7 +++- iguana/exchanges/LP_statemachine.c | 25 ++++++++++++ iguana/exchanges/setpassphrase | 3 ++ 8 files changed, 111 insertions(+), 71 deletions(-) create mode 100755 iguana/exchanges/setpassphrase diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f549526d9..312d97813 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -106,13 +106,13 @@ enable(coin)\n\ disable(coin)\n\ notarizations(coin)\n\ parselog()\n\ -statsdisp(starttime=0, endtime=0)\n\ +statsdisp(starttime=0, endtime=0, gui="", pubkey="")\n\ getrawtransaction(coin, txid)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ -buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ -sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ +buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce, pubkey="")\n\ +sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce, pubkey="")\n\ withdraw(coin, outputs[])\n\ sendrawtransaction(coin, signedtx)\n\ swapstatus()\n\ @@ -278,7 +278,7 @@ stop()\n\ //* if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"))); + return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"))); } else return(clonestr("{\"error\":\"no price set\"}")); } else if ( strcmp(method,"sell") == 0 ) @@ -286,7 +286,7 @@ stop()\n\ //* if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4e11914ec..0c5684d7b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,10 +23,11 @@ // select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. -// depth and trade to pubkey -// verify portfolio, pricearray, interest to KMD withdraw +// depth +// verify portfolio, pricearray, interest to KMD withdraw, pricebroadcast loop, trade to pubkey // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs +//statsdisp(starttime=0, endtime=0, gui="", pubkey="")\n\ #include #include "LP_include.h" @@ -736,6 +737,26 @@ void LP_pubkeysloop(void *ctx) } } +void LP_price_broadcastloop(void *ctx) +{ + struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; + sleep(30); + while ( 1 ) + { + for (baseind=0; baseindmyprices[relpp->ind]) > SMALLVAL) + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } + } + sleep(60); + } +} + void LP_privkeysloop(void *ctx) { sleep(20); @@ -1006,12 +1027,17 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)&myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + { + printf("error launching LP_swapsloop for port.%u\n",myport); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_price_broadcastloop,(void *)ctx) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); @@ -1077,10 +1103,10 @@ void LP_fromjs_iter() LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); queue_loop(0); - if ( (LP_counter % 10) == 0 ) + if ( (LP_counter % 10) == 0 ) // 10 seconds { LP_coinsloop(0); - if ( (LP_counter % 100) == 0 ) + if ( (LP_counter % 100) == 0 ) // 100 seconds { LP_notify_pubkeys(ctx,LP_mypubsock); LP_privkey_updates(ctx,LP_mypubsock,0); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 748605348..13e39b9c8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -531,7 +531,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) { - int32_t i,v,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); + int32_t i,v,numconfs,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); if ( coin != 0 )//&& (IAMLP != 0 || coin->inactive == 0) ) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) @@ -543,8 +543,11 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) } else { + if ( strcmp(symbol,"BTC") == 0 ) + numconfs = 0; + else numconfs = 1; //printf("my coin electrum.%p\n",coin->electrum); - sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); + sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) @@ -761,7 +764,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma return(0); } -struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids) +struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids,bits256 destpubkey) { bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; maxiters = 100; @@ -790,41 +793,36 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i price = jdouble(item,"price"); price *= 1.005; pubkey = jbits256(item,"pubkey"); + if ( bits256_nonz(destpubkey) != 0 && bits256_cmp(destpubkey,pubkey) != 0 ) + continue; //printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { - for (j=0; jtaddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); asatoshis = autxo->S.satoshis; - /*if ( basecoin->electrum != 0 ) - { - price *= 1.01; - *ordermatchpricep = price; - *bestsatoshisp = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); - *bestdestsatoshisp = asatoshis; - } - else*/ - { LP_listunspent_query(base,coinaddr); LP_listunspent_both(base,coinaddr,1); - for (j=0; jpubkey,gui)) != 0 ) { - if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) - { - printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); - break; - } - asatoshis = (asatoshis / 64) * 63; - } - if ( j < maxiters ) + printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; + } + asatoshis = (asatoshis / 64) * 63; } + if ( j < maxiters ) + break; } else printf("self trading or blacklisted peer\n"); } else @@ -847,7 +845,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(bestutxo); } -char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce) +char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey) { uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; basecoin = LP_coinfind(base); @@ -904,7 +902,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel } while ( 1 ) { - if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs,destpubkey)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo, need to change relvolume to be closer to available\"}")); @@ -934,12 +932,13 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( i == maxiters || qprice > maxprice ) { printf("i.%d maxiters.%d qprice %.8f vs maxprice %.8f, no acceptable quote for this pubkey\n",i,maxiters,dstr(qprice),dstr(maxprice)); - continue; + if ( bits256_nonz(destpubkey) == 0 ) + continue; + else return(clonestr("{\"error\":\"cant ordermatch to destpubkey\"}")); } - break; + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } - //printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); + return(clonestr("{\"error\":\"cant get here\"}")); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index dce7e3f99..16f1d65fe 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -484,7 +484,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,struct iguana_info *buy,struct iguana_info *sell,double relvolume,int32_t setbaserel,char *gui) { - char *retstr2; double bid,ask,maxprice; uint32_t requestid,quoteid,iter,i; cJSON *retjson2; + char *retstr2; double bid,ask,maxprice; bits256 zero; uint32_t requestid,quoteid,iter,i; cJSON *retjson2; requestid = quoteid = 0; LP_myprice(&bid,&ask,buy->symbol,sell->symbol); maxprice = ask; @@ -504,7 +504,8 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str break; if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) { - if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1)) != 0 ) + memset(zero.bytes,0,sizeof(zero)); + if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1,zero)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 68125fbfa..167e08236 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -47,6 +47,13 @@ struct LP_cacheinfo uint32_t timestamp; } *LP_cacheinfos; +struct LP_priceinfo *LP_priceinfo(int32_t ind) +{ + if ( ind < 0 || ind >= LP_MAXPRICEINFOS ) + return(0); + else return(&LP_priceinfos[ind]); +} + char *LP_priceinfostr(int32_t ind) { if ( ind < 0 || ind >= LP_MAXPRICEINFOS ) @@ -875,30 +882,6 @@ uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance) return(KMDvalue); } -/*char *LP_pricestr(char *base,char *rel,double origprice) -{ - cJSON *retjson; double price = 0.; - if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) - { - price = LP_price(base,rel); - if ( origprice > SMALLVAL && origprice < price ) - price = origprice; - } - if ( LP_pricevalid(price) > 0 ) - { - retjson = cJSON_CreateObject(); - jaddstr(retjson,"result","success"); - jaddstr(retjson,"method","postprice"); - jaddbits256(retjson,"pubkey",G.LP_mypub25519); - jaddstr(retjson,"base",base); - jaddstr(retjson,"rel",rel); - jaddnum(retjson,"price",price); - jadd(retjson,"theoretical",LP_priceinfomatrix(0)); - jadd(retjson,"quotes",LP_priceinfomatrix(1)); - return(jprint(retjson,1)); - } else return(clonestr("{\"error\":\"cant find baserel pair\"}")); -}*/ - void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]) { LP_priceinfoupdate(base,rel,price); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a039e6a70..991685332 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -477,7 +477,7 @@ int32_t LP_address_isvalid(char *symbol,char *address) cJSON *LP_listunspent(char *symbol,char *coinaddr) { - char buf[128]; cJSON *retjson; struct iguana_info *coin; + char buf[128]; cJSON *retjson; int32_t numconfs; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); @@ -488,7 +488,10 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) { if ( LP_address_ismine(symbol,coinaddr) > 0 ) { - sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); + if ( strcmp(symbol,"BTC") == 0 ) + numconfs = 0; + else numconfs = 1; + sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } else return(LP_address_utxos(coin,coinaddr,0)); } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 61396e280..d369f5f24 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1882,6 +1882,31 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) return(clonestr("{\"result\":\"marked as spent\"}")); return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); }*/ + + +/*char *LP_pricestr(char *base,char *rel,double origprice) + { + cJSON *retjson; double price = 0.; + if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) + { + price = LP_price(base,rel); + if ( origprice > SMALLVAL && origprice < price ) + price = origprice; + } + if ( LP_pricevalid(price) > 0 ) + { + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddstr(retjson,"method","postprice"); + jaddbits256(retjson,"pubkey",G.LP_mypub25519); + jaddstr(retjson,"base",base); + jaddstr(retjson,"rel",rel); + jaddnum(retjson,"price",price); + jadd(retjson,"theoretical",LP_priceinfomatrix(0)); + jadd(retjson,"quotes",LP_priceinfomatrix(1)); + return(jprint(retjson,1)); + } else return(clonestr("{\"error\":\"cant find baserel pair\"}")); + }*/ void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; struct iguana_info *coin; char str[65]; uint32_t now = (uint32_t)time(NULL); diff --git a/iguana/exchanges/setpassphrase b/iguana/exchanges/setpassphrase new file mode 100755 index 000000000..eec8bc5b1 --- /dev/null +++ b/iguana/exchanges/setpassphrase @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"passphrase\",\"passphrase\":\"put the passphrase here\",\"gui\":\"buildog\"}" From 978d8fc999a8ec07b6278f1ef6be1eb51b1e106e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 12:31:25 +0300 Subject: [PATCH 1604/2732] setprice 0 added a destpubkey field to the buy/sell trade api, this allows to ordermatch to a specific entry in the orderbook. I will also be adding a "depth" field to the orderbook, which will just be the sum of the max size utxo from each orderbook entry. alternatively I could sum the total balance at each orderbook entry, though at any given time you can only buy one utxo. i guess it should be easy enough for the GUI to sum the max utxo size, so I will make the depth the theoretical max depth, summing the entire balances I also now added automated broadcast of any setprices, which will occur automatically when you do a buy/sell for the coin you are buying with, as long as you are not using electrum. to be a bob, you need the native coin. with the pruning of the orderbook to most recent 2 minutes, it required the setprice to be called regularly. I have internalized that so a single setprice is all that is needed. If you want to "cancel" it you can setprice to 0 --- iguana/exchanges/LP_commands.c | 13 +++++-------- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 312d97813..731b0a835 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -242,14 +242,11 @@ stop()\n\ price = jdouble(argjson,"price"); if ( strcmp(method,"setprice") == 0 ) { - if ( price > SMALLVAL ) - { - if ( LP_mypriceset(&changed,base,rel,price) < 0 ) - return(clonestr("{\"error\":\"couldnt set price\"}")); - //else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) - // return(clonestr("{\"error\":\"couldnt set price\"}")); - else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); - } else return(clonestr("{\"error\":\"no price\"}")); + if ( LP_mypriceset(&changed,base,rel,price) < 0 ) + return(clonestr("{\"error\":\"couldnt set price\"}")); + //else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) + // return(clonestr("{\"error\":\"couldnt set price\"}")); + else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else if ( strcmp(method,"autoprice") == 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 167e08236..cf9679bf3 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -485,7 +485,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; *changedp = 0; - if ( base != 0 && rel != 0 && LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + if ( base != 0 && rel != 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) From c1ad31fa13b8b1d543578285ed6baf70f9e86703 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 12:35:12 +0300 Subject: [PATCH 1605/2732] passphrase exception for user pass --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 731b0a835..fa0d3f1e7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -156,7 +156,7 @@ stop()\n\ jadd(retjson,"coins",LP_coinsjson(LP_showwif)); return(jprint(retjson,1)); } - if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,G.USERPASS) != 0 ) + if ( strcmp(method,"passphrase") != 0 && ((userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,G.USERPASS) != 0) ) return(clonestr("{\"error\":\"authentication error you need to make sure userpass is set\"}")); jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) From 49759e31ba9dff5bf498fc0a6284fd507f9bfd55 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 12:44:51 +0300 Subject: [PATCH 1606/2732] Orderbook depth field --- iguana/exchanges/LP_commands.c | 26 +++++++++++++------------- iguana/exchanges/LP_prices.c | 15 ++++++++++----- iguana/exchanges/LP_utxo.c | 5 +++-- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index fa0d3f1e7..dcd987aee 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -159,7 +159,19 @@ stop()\n\ if ( strcmp(method,"passphrase") != 0 && ((userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,G.USERPASS) != 0) ) return(clonestr("{\"error\":\"authentication error you need to make sure userpass is set\"}")); jdelete(argjson,"userpass"); - if ( strcmp(method,"sendmessage") == 0 ) + if ( strcmp(method,"passphrase") == 0 ) + { + if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 ) + return(clonestr("{\"error\":\"couldnt change passphrase\"}")); + { + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddstr(retjson,"userpass",G.USERPASS); + jaddbits256(retjson,"mypubkey",G.LP_mypub25519); + return(jprint(retjson,1)); + } + } + else if ( strcmp(method,"sendmessage") == 0 ) { if ( jobj(argjson,"method2") == 0 ) { @@ -187,18 +199,6 @@ stop()\n\ LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); return(clonestr("{\"result\":\"success\"}")); } - else if ( strcmp(method,"passphrase") == 0 ) - { - if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 ) - return(clonestr("{\"error\":\"couldnt change passphrase\"}")); - { - retjson = cJSON_CreateObject(); - jaddstr(retjson,"result","success"); - jaddstr(retjson,"userpass",G.USERPASS); - jaddbits256(retjson,"mypubkey",G.LP_mypub25519); - return(jprint(retjson,1)); - } - } else if ( strcmp(method,"notarizations") == 0 ) { int32_t height,bestheight; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index cf9679bf3..2f8d0a456 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -18,7 +18,7 @@ // marketmaker // -struct LP_orderbookentry { bits256 pubkey; double price; uint64_t minsatoshis,maxsatoshis; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; +struct LP_orderbookentry { bits256 pubkey; double price; uint64_t minsatoshis,maxsatoshis,depth; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; struct LP_priceinfo { @@ -673,13 +673,14 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddnum(item,"numutxos",op->numutxos); jaddnum(item,"minvolume",dstr(op->minsatoshis)*0.8); jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8); + jaddnum(item,"depth",dstr(op->depth)*0.8); jaddbits256(item,"pubkey",op->pubkey); jaddnum(item,"age",time(NULL)-op->timestamp); } return(item); } -struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t minsatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp) +struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t minsatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp,uint64_t depth) { struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) @@ -691,6 +692,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d op->maxsatoshis = maxsatoshis; op->pubkey = pubkey; op->timestamp = timestamp; + op->depth = depth; } return(op); } @@ -715,7 +717,7 @@ void LP_pubkeys_query() int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis; + char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis,balance,depth; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); @@ -724,6 +726,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * now = (uint32_t)time(NULL); oldest = now - duration; memset(zeroes,0,sizeof(zeroes)); + depth = 0; HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) @@ -740,15 +743,17 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * { if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { - n = LP_address_minmax(&minsatoshis,&maxsatoshis,ap); + n = LP_address_minmax(&balance,&minsatoshis,&maxsatoshis,ap); if ( polarity > 0 ) { + balance *= price; minsatoshis *= price; maxsatoshis *= price; } + depth += balance; //printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,depth)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6d5daecb4..b031eeec2 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -92,10 +92,10 @@ struct LP_address *LP_address(struct iguana_info *coin,char *coinaddr) return(ap); } -int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) +int32_t LP_address_minmax(uint64_t *balancep,uint64_t *minp,uint64_t *maxp,struct LP_address *ap) { struct LP_address_utxo *up,*tmp; int32_t n = 0; - *minp = *maxp = 0; + *minp = *maxp = *balancep = 0; DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->spendheight <= 0 ) @@ -104,6 +104,7 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) *maxp = up->U.value; if ( *minp == 0 || up->U.value < *minp ) *minp = up->U.value; + *balancep += up->U.value; n++; } } From 518ab483ae866892bc1fddc84a3f4ec96dc07e33 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 12:58:34 +0300 Subject: [PATCH 1607/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++++++- iguana/exchanges/LP_remember.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index dcd987aee..0dbb60c1c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -116,8 +116,10 @@ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce, pubkey="")\ withdraw(coin, outputs[])\n\ sendrawtransaction(coin, signedtx)\n\ swapstatus()\n\ -recentswaps(limit=3)\n\ +swapstatus(coin)\n\ +swapstatus(base, rel)\n\ swapstatus(requestid, quoteid)\n\ +recentswaps(limit=3)\n\ public API:\n \ getcoins()\n\ getcoin(coin)\n\ @@ -422,6 +424,10 @@ stop()\n\ uint32_t requestid,quoteid; if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) return(basilisk_swapentry(requestid,quoteid)); + else if ( coin != 0 && coin[0] != 0 ) + return(basilisk_swapentries(coin,0)); + else if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) + return(basilisk_swapentries(base,rel)); else return(basilisk_swaplist(0,0)); } else if ( strcmp(method,"lastnonce") == 0 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c5dfc1c56..b0738f0c6 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1256,6 +1256,38 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) return(retstr); } +char *basilisk_swapentries(char *refbase,char *refrel) +{ + char *liststr,*base,*rel; cJSON *retjson,*array,*item,*retarray; int32_t i,n; + retarray = cJSON_CreateArray(); + if ( (liststr= basilisk_swaplist(0,0)) != 0 ) + { + //printf("swapentry.(%s)\n",liststr); + if ( (retjson= cJSON_Parse(liststr)) != 0 ) + { + if ( (array= jarray(&n,retjson,"swaps")) != 0 ) + { + for (i=0; i Date: Fri, 27 Oct 2017 13:09:37 +0300 Subject: [PATCH 1608/2732] Test --- iguana/exchanges/LP_remember.c | 71 +++++++++++++++++++--------------- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b0738f0c6..db3aa4c10 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1256,38 +1256,6 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) return(retstr); } -char *basilisk_swapentries(char *refbase,char *refrel) -{ - char *liststr,*base,*rel; cJSON *retjson,*array,*item,*retarray; int32_t i,n; - retarray = cJSON_CreateArray(); - if ( (liststr= basilisk_swaplist(0,0)) != 0 ) - { - //printf("swapentry.(%s)\n",liststr); - if ( (retjson= cJSON_Parse(liststr)) != 0 ) - { - if ( (array= jarray(&n,retjson,"swaps")) != 0 ) - { - for (i=0; i Date: Fri, 27 Oct 2017 13:10:55 +0300 Subject: [PATCH 1609/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index debf345d0..b9888782c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -790,7 +790,7 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) HASH_ITER(hh,G.LP_utxoinfos2[iambob],utxo,tmp) { HASH_DELETE(hh,G.LP_utxoinfos2[iambob],utxo); - free(utxo); + //free(utxo); } } } From 85dcb374c885e013ae42ddbd6af70575b6d5f09d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:12:24 +0300 Subject: [PATCH 1610/2732] Test --- iguana/exchanges/LP_utxos.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b9888782c..c91088ca2 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -787,11 +787,12 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) } if ( G.LP_utxoinfos2[iambob] != 0 ) { - HASH_ITER(hh,G.LP_utxoinfos2[iambob],utxo,tmp) + G.LP_utxoinfos2[iambob] = 0; + /*HASH_ITER(hh,G.LP_utxoinfos2[iambob],utxo,tmp) { HASH_DELETE(hh,G.LP_utxoinfos2[iambob],utxo); - //free(utxo); - } + free(utxo); + }*/ } } memset(&G,0,sizeof(G)); From 6ba830222673b3c39010cdd74e7889bf876f19bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:28:18 +0300 Subject: [PATCH 1611/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++--- iguana/exchanges/LP_remember.c | 52 ++++++++++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0dbb60c1c..5489d673a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -116,8 +116,8 @@ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce, pubkey="")\ withdraw(coin, outputs[])\n\ sendrawtransaction(coin, signedtx)\n\ swapstatus()\n\ -swapstatus(coin)\n\ -swapstatus(base, rel)\n\ +swapstatus(coin, limit=10)\n\ +swapstatus(base, rel, limit=10)\n\ swapstatus(requestid, quoteid)\n\ recentswaps(limit=3)\n\ public API:\n \ @@ -425,9 +425,9 @@ stop()\n\ if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) return(basilisk_swapentry(requestid,quoteid)); else if ( coin != 0 && coin[0] != 0 ) - return(basilisk_swapentries(coin,0)); + return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); else if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) - return(basilisk_swapentries(base,rel)); + return(basilisk_swapentries(base,rel,jint(argjson,"limit"))); else return(basilisk_swaplist(0,0)); } else if ( strcmp(method,"lastnonce") == 0 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index db3aa4c10..50711d73b 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1297,8 +1297,10 @@ char *LP_recent_swaps(int32_t limit) item = cJSON_CreateObject(); jaddnum(item,"expiration",Alice_expiration); jaddnum(item,"timeleft",Alice_expiration-time(NULL)); + jaddstr(item,"bob",LP_Alicequery.srccoin); jaddstr(item,"base",LP_Alicequery.srccoin); jaddnum(item,"basevalue",dstr(LP_Alicequery.satoshis)); + jaddstr(item,"alice",LP_Alicequery.destcoin); jaddstr(item,"rel",LP_Alicequery.destcoin); jaddnum(item,"relvalue",dstr(LP_Alicequery.destsatoshis)); jadd(retjson,"pending",item); @@ -1306,7 +1308,7 @@ char *LP_recent_swaps(int32_t limit) return(jprint(retjson,1)); } -void basilisk_swap_addarray(cJSON *array,cJSON *item,char *refbase,char *refrel) +int32_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) { char *base,*rel; base = jstr(item,"bob"); @@ -1314,15 +1316,18 @@ void basilisk_swap_addarray(cJSON *array,cJSON *item,char *refbase,char *refrel) if ( refrel == 0 || refrel[0] == 0 ) { if ( strcmp(base,refbase) == 0 || strcmp(rel,refbase) == 0 ) - jaddi(array,item); + return(1); } else if ( strcmp(base,refbase) == 0 && strcmp(rel,refrel) == 0 ) - jaddi(array,item); + return(1); + return(0); } -char *basilisk_swapentries(char *refbase,char *refrel) +char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) { - char *liststr; cJSON *retjson,*array,*item,*retarray; int32_t i,n; + char *liststr,*retstr2; cJSON *retjson,*array,*pending,*swapjson,*item,*retarray; int32_t i,n; uint32_t requestid,quoteid; + if ( limit <= 0 ) + limit = 10; retarray = cJSON_CreateArray(); if ( (liststr= basilisk_swaplist(0,0)) != 0 ) { @@ -1334,13 +1339,48 @@ char *basilisk_swapentries(char *refbase,char *refrel) for (i=0; i 0 ) + jaddi(retarray,item); } } free_json(retjson); } free(liststr); } + if ( (liststr= LP_recent_swaps(limit)) != 0 ) + { + if ( (retjson= cJSON_Parse(liststr)) != 0 ) + { + if ( (array= jarray(&n,retjson,"swaps")) != 0 ) + { + for (i=0; i 0 ) + jaddi(retarray,swapjson); + else free_json(swapjson); + } + free(retstr2); + } + } + } + if ( (pending= jobj(retjson,"pending")) != 0 ) + { + if ( basilisk_swap_addarray(pending,refbase,refrel) > 0 ) + jaddi(retarray,pending); + else free_json(pending); + } + free_json(retjson); + } + free(liststr); + } return(jprint(retarray,1)); } From 4bf1879cd575cf51829e78b5394bd203b782739f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:38:05 +0300 Subject: [PATCH 1612/2732] Test --- iguana/exchanges/LP_utxos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c91088ca2..49c11c283 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -762,7 +762,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) int32_t LP_passphrase_init(char *passphrase,char *gui) { - static void *ctx; int32_t iambob; struct LP_utxoinfo *utxo,*tmp; + static void *ctx; int32_t iambob,counter; struct LP_utxoinfo *utxo,*tmp; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( G.LP_pendingswaps != 0 ) @@ -770,6 +770,7 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) G.initializing = 1; if ( gui == 0 ) gui = "cli"; + counter = G.USERPASS_COUNTER; while ( G.waiting == 0 ) { printf("waiting for G.waiting\n"); @@ -800,6 +801,7 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) init_hexbytes_noT(G.LP_myrmd160str,G.LP_myrmd160,20); G.LP_sessionid = (uint32_t)time(NULL); safecopy(G.gui,gui,sizeof(G.gui)); + G.USERPASS_COUNTER = counter; return(0); } From 31ade680a61b13c01ec7061e64f3383d8369f4d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:39:31 +0300 Subject: [PATCH 1613/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5489d673a..adf514542 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -163,6 +163,7 @@ stop()\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"passphrase") == 0 ) { + G.USERPASS_COUNTER = 1; if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 ) return(clonestr("{\"error\":\"couldnt change passphrase\"}")); { From 18af98e54bdf93f4d1e27bd4785f8ce10035e197 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:45:17 +0300 Subject: [PATCH 1614/2732] Test --- iguana/exchanges/baserelswaps | 3 +++ iguana/exchanges/coinswaps | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 iguana/exchanges/baserelswaps create mode 100755 iguana/exchanges/coinswaps diff --git a/iguana/exchanges/baserelswaps b/iguana/exchanges/baserelswaps new file mode 100755 index 000000000..abea1c80e --- /dev/null +++ b/iguana/exchanges/baserelswaps @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\",\"base\":\"MNZ\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/coinswaps b/iguana/exchanges/coinswaps new file mode 100755 index 000000000..7d87697f9 --- /dev/null +++ b/iguana/exchanges/coinswaps @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"swapstatus\",\"coin\":\"CHIPS\"}" From 22ce38d6ea56a75011688c2061ac79ab7ada003d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:49:02 +0300 Subject: [PATCH 1615/2732] Test --- iguana/exchanges/LP_remember.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 50711d73b..838c8fe3b 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1328,6 +1328,7 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) char *liststr,*retstr2; cJSON *retjson,*array,*pending,*swapjson,*item,*retarray; int32_t i,n; uint32_t requestid,quoteid; if ( limit <= 0 ) limit = 10; + printf("swapentries %s %s limit.%d\n",refbase,refrel,limit); retarray = cJSON_CreateArray(); if ( (liststr= basilisk_swaplist(0,0)) != 0 ) { From db8801ceedd20126275d615e491d0fe02d638994 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:50:56 +0300 Subject: [PATCH 1616/2732] Test --- iguana/exchanges/LP_commands.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index adf514542..68174dce2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -237,6 +237,17 @@ stop()\n\ taddr = (jobj(argjson,"taddr") == 0) ? 0 : juint(argjson,"taddr"); return(LP_secretaddresses(ctx,jstr(argjson,"prefix"),jstr(argjson,"passphrase"),juint(argjson,"num"),taddr,pubtype)); } + else if ( strcmp(method,"swapstatus") == 0 ) + { + uint32_t requestid,quoteid; + if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) + return(basilisk_swapentry(requestid,quoteid)); + else if ( coin != 0 && coin[0] != 0 ) + return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); + else if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) + return(basilisk_swapentries(base,rel,jint(argjson,"limit"))); + else return(basilisk_swaplist(0,0)); + } if ( base != 0 && rel != 0 ) { double price,bid,ask; @@ -420,17 +431,6 @@ stop()\n\ } else if ( strcmp(method,"goal") == 0 ) return(LP_portfolio_goal("*",100.)); - else if ( strcmp(method,"swapstatus") == 0 ) - { - uint32_t requestid,quoteid; - if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) - return(basilisk_swapentry(requestid,quoteid)); - else if ( coin != 0 && coin[0] != 0 ) - return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); - else if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) - return(basilisk_swapentries(base,rel,jint(argjson,"limit"))); - else return(basilisk_swaplist(0,0)); - } else if ( strcmp(method,"lastnonce") == 0 ) { cJSON *retjson = cJSON_CreateObject(); From 714eba2defec6aafe50ca48bf35bf2fec6c46c2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:54:24 +0300 Subject: [PATCH 1617/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 838c8fe3b..6b3eff29b 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1341,13 +1341,17 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) { item = jitem(array,i); if ( basilisk_swap_addarray(item,refbase,refrel) > 0 ) + { + printf("add %d of %d\n",i,n); jaddi(retarray,item); + } } } free_json(retjson); } free(liststr); } + printf("check recents\n"); if ( (liststr= LP_recent_swaps(limit)) != 0 ) { if ( (retjson= cJSON_Parse(liststr)) != 0 ) From 7bfcb1b515aa779b2f595f93db8880db8f89f141 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 13:57:47 +0300 Subject: [PATCH 1618/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 6b3eff29b..c45fc26c4 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1343,7 +1343,7 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) if ( basilisk_swap_addarray(item,refbase,refrel) > 0 ) { printf("add %d of %d\n",i,n); - jaddi(retarray,item); + jaddi(retarray,jduplicate(item)); } } } diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 92842953c..2b43f8519 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From c812c32f7c8cc36595f278f7a2d3f1126adbc09a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 14:08:48 +0300 Subject: [PATCH 1619/2732] Test --- iguana/exchanges/LP_remember.c | 69 ++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c45fc26c4..2c5713943 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1297,6 +1297,8 @@ char *LP_recent_swaps(int32_t limit) item = cJSON_CreateObject(); jaddnum(item,"expiration",Alice_expiration); jaddnum(item,"timeleft",Alice_expiration-time(NULL)); + jaddnum(item,"requestid",LP_Alicequery.R.requestid); + jaddnum(item,"quoteid",LP_Alicequery.R.quoteid); jaddstr(item,"bob",LP_Alicequery.srccoin); jaddstr(item,"base",LP_Alicequery.srccoin); jaddnum(item,"basevalue",dstr(LP_Alicequery.satoshis)); @@ -1308,27 +1310,33 @@ char *LP_recent_swaps(int32_t limit) return(jprint(retjson,1)); } -int32_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) +uint64_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) { - char *base,*rel; + char *base,*rel; uint32_t requestid,quoteid; uint64_t ridqid = 0; base = jstr(item,"bob"); rel = jstr(item,"alice"); if ( refrel == 0 || refrel[0] == 0 ) { if ( strcmp(base,refbase) == 0 || strcmp(rel,refbase) == 0 ) - return(1); + ridqid = 1; } else if ( strcmp(base,refbase) == 0 && strcmp(rel,refrel) == 0 ) - return(1); - return(0); + ridqid = 1; + if ( ridqid != 0 ) + { + requestid = jint(item,"requestid"); + quoteid = jint(item,"quoteid"); + ridqid = ((uint64_t)requestid << 32) | quoteid; + } + return(ridqid); } char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) { - char *liststr,*retstr2; cJSON *retjson,*array,*pending,*swapjson,*item,*retarray; int32_t i,n; uint32_t requestid,quoteid; + uint64_t ridqids[1024],ridqid; char *liststr,*retstr2; cJSON *retjson,*array,*pending,*swapjson,*item,*retarray; int32_t i,j,n,count = 0; uint32_t requestid,quoteid; if ( limit <= 0 ) limit = 10; - printf("swapentries %s %s limit.%d\n",refbase,refrel,limit); + memset(ridqids,0,sizeof(ridqids)); retarray = cJSON_CreateArray(); if ( (liststr= basilisk_swaplist(0,0)) != 0 ) { @@ -1340,9 +1348,10 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) for (i=0; i 0 ) + if ( (ridqid= basilisk_swap_addarray(item,refbase,refrel)) > 0 ) { - printf("add %d of %d\n",i,n); + if ( count < sizeof(ridqids)/sizeof(*ridqids) ) + ridqids[count++] = ridqid; jaddi(retarray,jduplicate(item)); } } @@ -1351,7 +1360,6 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) } free(liststr); } - printf("check recents\n"); if ( (liststr= LP_recent_swaps(limit)) != 0 ) { if ( (retjson= cJSON_Parse(liststr)) != 0 ) @@ -1363,24 +1371,45 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) item = jitem(array,i); requestid = juint(jitem(item,0),0); quoteid = juint(jitem(item,1),0); - printf("r%u q%u\n",requestid,quoteid); - if ( (retstr2= basilisk_swapentry(requestid,quoteid)) != 0 ) + ridqid = ((uint64_t)requestid << 32) | quoteid; + for (j=0; j 0 ) - jaddi(retarray,swapjson); - else free_json(swapjson); + if ( (swapjson= cJSON_Parse(retstr2)) != 0 ) + { + if ( basilisk_swap_addarray(swapjson,refbase,refrel) > 0 ) + { + if ( count < sizeof(ridqids)/sizeof(*ridqids) ) + ridqids[count++] = ridqid; + jaddi(retarray,swapjson); + } else free_json(swapjson); + } + free(retstr2); } - free(retstr2); } } } if ( (pending= jobj(retjson,"pending")) != 0 ) { - if ( basilisk_swap_addarray(pending,refbase,refrel) > 0 ) - jaddi(retarray,pending); - else free_json(pending); + requestid = juint(pending,"requestid"); + quoteid = juint(pending,"quoteid"); + j = 0; + if ( (ridqid= ((uint64_t)requestid << 32) | quoteid) != 0 ) + { + for (j=0; j 0 ) + jaddi(retarray,pending); + else free_json(pending); + } else free_json(pending); } free_json(retjson); } From 4e1495a4c7e4b6d96dab01fa6523c161ba203e70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 14:15:57 +0300 Subject: [PATCH 1620/2732] Test --- iguana/exchanges/LP_remember.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 2c5713943..6e540a4eb 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1148,8 +1148,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) { - char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i; + uint64_t ridqids[4096],ridqid; char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i,j,count=0; portable_mutex_lock(&LP_swaplistmutex); + memset(ridqids,0,sizeof(ridqids)); memset(KMDtotals,0,sizeof(KMDtotals)); memset(BTCtotals,0,sizeof(BTCtotals)); //,statebits; int32_t optionduration; struct basilisk_request R; bits256 privkey; @@ -1189,8 +1190,17 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) } if ( flag == 0 ) { - if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) - jaddi(array,item); + ridqid = ((uint64_t)requestid << 32) | quoteid; + for (j=0; j Date: Fri, 27 Oct 2017 14:24:29 +0300 Subject: [PATCH 1621/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 6e540a4eb..ecf911ef5 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1361,7 +1361,10 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) if ( (ridqid= basilisk_swap_addarray(item,refbase,refrel)) > 0 ) { if ( count < sizeof(ridqids)/sizeof(*ridqids) ) + { ridqids[count++] = ridqid; + printf("add ridqid.%16llx\n",(long long)ridqid); + } jaddi(retarray,jduplicate(item)); } } @@ -1385,6 +1388,7 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) for (j=0; j Date: Fri, 27 Oct 2017 14:34:08 +0300 Subject: [PATCH 1622/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index ecf911ef5..69bc10552 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1388,14 +1388,14 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) for (j=0; j 0 ) + if ( (ridqid= basilisk_swap_addarray(swapjson,refbase,refrel)) > 0 ) { if ( count < sizeof(ridqids)/sizeof(*ridqids) ) ridqids[count++] = ridqid; From 895eda939d33dde04c0a59b0d38dea909e4241ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 14:35:50 +0300 Subject: [PATCH 1623/2732] Test --- iguana/exchanges/LP_remember.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 69bc10552..58d6ae5de 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1337,6 +1337,7 @@ uint64_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) requestid = jint(item,"requestid"); quoteid = jint(item,"quoteid"); ridqid = ((uint64_t)requestid << 32) | quoteid; + printf("%u %u -> %16llx\n",requestid,quoteid,(long long)ridqid); } return(ridqid); } From 339a5f5a572274a98a919ef75b8521f5f2f6c612 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 14:42:45 +0300 Subject: [PATCH 1624/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 58d6ae5de..d3d3c7c57 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1334,8 +1334,8 @@ uint64_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) ridqid = 1; if ( ridqid != 0 ) { - requestid = jint(item,"requestid"); - quoteid = jint(item,"quoteid"); + requestid = juint(item,"requestid"); + quoteid = juint(item,"quoteid"); ridqid = ((uint64_t)requestid << 32) | quoteid; printf("%u %u -> %16llx\n",requestid,quoteid,(long long)ridqid); } From 3bd153e87734e8303402bf46f24788eab7131dab Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 14:46:16 +0300 Subject: [PATCH 1625/2732] Fix swapstatus(coin) --- iguana/exchanges/LP_remember.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index d3d3c7c57..308bc76e6 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1337,7 +1337,7 @@ uint64_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) requestid = juint(item,"requestid"); quoteid = juint(item,"quoteid"); ridqid = ((uint64_t)requestid << 32) | quoteid; - printf("%u %u -> %16llx\n",requestid,quoteid,(long long)ridqid); + //printf("%u %u -> %16llx\n",requestid,quoteid,(long long)ridqid); } return(ridqid); } @@ -1364,7 +1364,7 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) if ( count < sizeof(ridqids)/sizeof(*ridqids) ) { ridqids[count++] = ridqid; - printf("add ridqid.%16llx\n",(long long)ridqid); + //printf("add ridqid.%16llx\n",(long long)ridqid); } jaddi(retarray,jduplicate(item)); } @@ -1389,7 +1389,7 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) for (j=0; j Date: Fri, 27 Oct 2017 15:14:34 +0300 Subject: [PATCH 1626/2732] Test --- iguana/exchanges/LP_commands.c | 7 ++++--- iguana/exchanges/LP_stats.c | 11 ++++++++++- iguana/exchanges/guistats | 3 +++ iguana/exchanges/pubkeydisp | 3 +++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100755 iguana/exchanges/guistats create mode 100755 iguana/exchanges/pubkeydisp diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 68174dce2..1c207cb18 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -222,13 +222,14 @@ stop()\n\ } else if ( strcmp(method,"parselog") == 0 ) { - int32_t n = LP_statslog_parse(); - return(LP_statslog_disp(n,2000000000,2000000000)); + bits256 zero; int32_t n = LP_statslog_parse(); + memset(zero.bytes,0,sizeof(zero)); + return(LP_statslog_disp(n,2000000000,2000000000,"",zero)); } else if ( strcmp(method,"statsdisp") == 0 ) { int32_t n = LP_statslog_parse(); - return(LP_statslog_disp(n,juint(argjson,"starttime"),juint(argjson,"endtime"))); + return(LP_statslog_disp(n,juint(argjson,"starttime"),juint(argjson,"endtime"),jstr(argjson,"gui"),jbits256(argjson,"pubkey"))); } else if ( strcmp(method,"secretaddresses") == 0 ) { diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 89919ef3f..e31cdd6db 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -321,7 +321,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) return(duplicate == 0); } -char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) +char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey) { cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i,dispflag,numtrades[LP_MAXPRICEINFOS]; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS]; if ( starttime > endtime ) @@ -345,6 +345,15 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime) else if ( sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime ) dispflag = 1; if ( dispflag != 0 ) + { + dispflag = 0; + if ( refgui == 0 || refgui[0] == 0 || strcmp(refgui,sp->bobgui) == 0 || strcmp(refgui,sp->alicegui) == 0 ) + { + if ( bits256_nonz(refpubkey) == 0 || bits256_cmp(refpubkey,sp->Q.srchash) == 0 || bits256_cmp(refpubkey,sp->Q.desthash) == 0 ) + dispflag = 1; + } + } + if ( dispflag != 0 ) { LP_swapstats_line(numtrades,basevols,relvols,line,sp); item = cJSON_CreateObject(); diff --git a/iguana/exchanges/guistats b/iguana/exchanges/guistats new file mode 100755 index 000000000..98384f32a --- /dev/null +++ b/iguana/exchanges/guistats @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\",\"starttime\":0,\"endtime\":0,\"gui\":\"buildog\"}" diff --git a/iguana/exchanges/pubkeydisp b/iguana/exchanges/pubkeydisp new file mode 100755 index 000000000..6897c0a51 --- /dev/null +++ b/iguana/exchanges/pubkeydisp @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\",\"starttime\":0,\"endtime\":0,\"pubkey\":\"a2593155464e37fcc88245780240a412a38cf3d316809445aad73f4e7789187d\"}" From 9c0683fb209fdb1e7177ae7086f6fff33b955ce1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:15:20 +0300 Subject: [PATCH 1627/2732] Test --- iguana/exchanges/install | 2 +- iguana/exchanges/{pubkeydisp => pubkeystats} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename iguana/exchanges/{pubkeydisp => pubkeystats} (100%) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 2b43f8519..4ec27cffc 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/pubkeydisp b/iguana/exchanges/pubkeystats similarity index 100% rename from iguana/exchanges/pubkeydisp rename to iguana/exchanges/pubkeystats From f5caa371b53d123c6480c6ccbb7683617d2f74c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:24:56 +0300 Subject: [PATCH 1628/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_prices.c | 32 +++++++++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0c5684d7b..5f3e2f31b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,11 +23,10 @@ // select oldest utxo first // handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. -// depth + // verify portfolio, pricearray, interest to KMD withdraw, pricebroadcast loop, trade to pubkey // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs -//statsdisp(starttime=0, endtime=0, gui="", pubkey="")\n\ #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2f8d0a456..daa0e673f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -680,7 +680,7 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) return(item); } -struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t minsatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp,uint64_t depth) +struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t minsatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp,uint64_t balance) { struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) @@ -692,7 +692,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d op->maxsatoshis = maxsatoshis; op->pubkey = pubkey; op->timestamp = timestamp; - op->depth = depth; + op->depth = balance; } return(op); } @@ -717,7 +717,7 @@ void LP_pubkeys_query() int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis,balance,depth; + char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis,balance; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); @@ -726,7 +726,6 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * now = (uint32_t)time(NULL); oldest = now - duration; memset(zeroes,0,sizeof(zeroes)); - depth = 0; HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) @@ -741,6 +740,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * ap = 0; if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL ) { + balance = 0; if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { n = LP_address_minmax(&balance,&minsatoshis,&maxsatoshis,ap); @@ -750,10 +750,9 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * minsatoshis *= price; maxsatoshis *= price; } - depth += balance; //printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,depth)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,balance)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; @@ -766,7 +765,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; + uint32_t now,i; uint64_t depth; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 ) @@ -792,16 +791,23 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); if ( numbids > 1 ) + { qsort(bids,numbids,sizeof(*bids),_revcmp_orderbook); + depth = 0; + for (i=0; idepth; + bids[i]->depth = depth; + } + } if ( numasks > 1 ) { - //for (i=0; iprice); - //printf(" -> "); qsort(asks,numasks,sizeof(*asks),_cmp_orderbook); - //for (i=0; iprice); - //printf("sorted asks.%d\n",numasks); + for (i=0; idepth; + asks[i]->depth = depth; + } } for (i=n=0; i Date: Fri, 27 Oct 2017 15:25:06 +0300 Subject: [PATCH 1629/2732] Test --- iguana/exchanges/LP_prices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index daa0e673f..b7d40127f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -803,6 +803,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) if ( numasks > 1 ) { qsort(asks,numasks,sizeof(*asks),_cmp_orderbook); + depth = 0; for (i=0; idepth; From bbe1942992201a57a6546aff84cc54d0b3afdbf9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:34:50 +0300 Subject: [PATCH 1630/2732] Test --- iguana/exchanges/LP_rpc.c | 1 + iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 991685332..4f2538342 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -273,6 +273,7 @@ cJSON *LP_paxprice(char *fiat) cJSON *LP_gettx(char *symbol,bits256 txid) { struct iguana_info *coin; char buf[512],str[65]; cJSON *retjson; + printf("LP_gettx\n"); if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c56c15323..a9398b3f1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -583,7 +583,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; - //printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); + printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) From e63525cb5c774cb279b3e9c89ac0e394da8640a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:39:44 +0300 Subject: [PATCH 1631/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4f2538342..9c013c946 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -273,7 +273,7 @@ cJSON *LP_paxprice(char *fiat) cJSON *LP_gettx(char *symbol,bits256 txid) { struct iguana_info *coin; char buf[512],str[65]; cJSON *retjson; - printf("LP_gettx\n"); + printf("LP_gettx %s %s\n",symbol,bits256_str(str,txid)); if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); From 7adb03d1fce2e0188cb5486aa6cad9444e0e84f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:48:17 +0300 Subject: [PATCH 1632/2732] Test --- iguana/exchanges/LP_socket.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a9398b3f1..caedbb46d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -241,6 +241,7 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) struct electrum_info { queue_t sendQ,pendingQ; + portable_mutex_t mutex; struct electrum_info *prev; int32_t bufsize,sock,*heightp; struct iguana_info *coin; @@ -580,7 +581,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se return(txobj); } -cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) +cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); @@ -658,6 +659,17 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso return(*retjsonp); } +cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) +{ + cJSON *retjson; + if ( ep != 0 ) + portable_mutex_lock(&ep->mutex); + retjson = _electrum_transaction(symbol,ep,retjsonp,txid); + if ( ep != 0 ) + portable_mutex_unlock(&ep->mutex); + return(retjson); +} + cJSON *electrum_getmerkle(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,int32_t height) { char params[128],str[65]; @@ -758,6 +770,7 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad return(0); } ep = calloc(1,sizeof(*ep) + bufsize); + portable_mutex_init(&ep->mutex); ep->sock = sock; safecopy(ep->symbol,symbol,sizeof(ep->symbol)); safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); From 034441ba4c23e8022c6b65831afb70095f04e018 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:52:31 +0300 Subject: [PATCH 1633/2732] Test --- iguana/exchanges/LP_socket.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index caedbb46d..cf03a272d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -241,7 +241,7 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) struct electrum_info { queue_t sendQ,pendingQ; - portable_mutex_t mutex; + portable_mutex_t mutex,txmutex; struct electrum_info *prev; int32_t bufsize,sock,*heightp; struct iguana_info *coin; @@ -378,10 +378,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp; + portable_mutex_lock(&ep->mutex); queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(10000); + portable_mutex_unlock(&ep->mutex); if ( ep->prev == 0 ) { if ( *retjsonp == 0 ) @@ -663,10 +665,10 @@ cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjso { cJSON *retjson; if ( ep != 0 ) - portable_mutex_lock(&ep->mutex); + portable_mutex_lock(&ep->txmutex); retjson = _electrum_transaction(symbol,ep,retjsonp,txid); if ( ep != 0 ) - portable_mutex_unlock(&ep->mutex); + portable_mutex_unlock(&ep->txmutex); return(retjson); } @@ -771,6 +773,7 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad } ep = calloc(1,sizeof(*ep) + bufsize); portable_mutex_init(&ep->mutex); + portable_mutex_init(&ep->txmutex); ep->sock = sock; safecopy(ep->symbol,symbol,sizeof(ep->symbol)); safecopy(ep->ipaddr,ipaddr,sizeof(ep->ipaddr)); From e4794149e6dfe50511aedc6468fcc4f6635d14e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 15:57:11 +0300 Subject: [PATCH 1634/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9c013c946..4d76ffe01 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -273,7 +273,7 @@ cJSON *LP_paxprice(char *fiat) cJSON *LP_gettx(char *symbol,bits256 txid) { struct iguana_info *coin; char buf[512],str[65]; cJSON *retjson; - printf("LP_gettx %s %s\n",symbol,bits256_str(str,txid)); + //printf("LP_gettx %s %s\n",symbol,bits256_str(str,txid)); if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); From 1ad5c5ea729e1017be0f0b1c43e85e9ee84bc6c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 16:11:26 +0300 Subject: [PATCH 1635/2732] Test --- iguana/exchanges/LP_socket.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index cf03a272d..5c4f22881 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -632,22 +632,24 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs memcpy(coin->cachedtxiddata,serialized,len); free(hexstr); //printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); - txobj = LP_transaction_fromdata(coin,txid,serialized,len); - if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) + if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) { - txobj = LP_transactioninit(coin,txid,0,txobj); - LP_transactioninit(coin,txid,1,txobj); - tx = LP_transactionfind(coin,txid); - } - if ( tx != 0 ) - { - tx->serialized = serialized; - tx->len = len; - } - else - { - printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); - free(serialized); + if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) + { + txobj = LP_transactioninit(coin,txid,0,txobj); + LP_transactioninit(coin,txid,1,txobj); + tx = LP_transactionfind(coin,txid); + } + if ( tx != 0 ) + { + tx->serialized = serialized; + tx->len = len; + } + else + { + printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); + free(serialized); + } } *retjsonp = txobj; free_json(hexjson); From 2ff963b51c4f0d89c9b8a9e7a8c5ba6198b84ae4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 16:27:06 +0300 Subject: [PATCH 1636/2732] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index fb8e1f69e..ecd03e62b 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3561,7 +3561,7 @@ cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t if ( n != len ) { int32_t i; - for (i=0; i<=len&&i<200; i++) + for (i=0; i Date: Fri, 27 Oct 2017 16:58:04 +0300 Subject: [PATCH 1637/2732] Test --- iguana/exchanges/LP_bitcoin.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index ecd03e62b..1911e7aea 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3303,7 +3303,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is sigser = calloc(1,maxsize*2); //printf("json.%p array.%p sigser.%p\n",json,vinarray,sigser); } - //printf("version.%d\n",msg->version); + printf("version.%d\n",msg->version); if ( isPoS != 0 ) { len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->timestamp),&msg->timestamp); @@ -3328,7 +3328,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } for (i=0; itx_in; i++) { - //printf("vin.%d starts offset.%d\n",i,len); + printf("vin.%d starts offset.%d numvins.%d\n",i,len,msg->tx_in); if ( vins != 0 && jitem(vins,i) != 0 ) iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); if ( (n= iguana_vinparse(rwflag,&serialized[len],&msg->vins[i])) < 0 ) @@ -3344,9 +3344,9 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is return(-1); } } - //for (i=-3; i<7; i++) - // printf("%02x",serialized[len+i]); - //printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); + for (i=-3; i<7; i++) + printf("%02x",serialized[len+i]); + printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_out); if ( rwflag == 0 ) { @@ -3366,7 +3366,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } for (i=0; itx_out; i++) { - //printf("rwflag.%d vout.%d starts %d\n",rwflag,i,len); + printf("rwflag.%d vout.%d starts %d numvouts.%d\n",rwflag,i,len,msg->tx_out); if ( (n= iguana_voutparse(rwflag,&serialized[len],&msg->vouts[i])) < 0 ) return(-1); len += n; @@ -3379,7 +3379,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is jaddi(voutarray,iguana_voutjson(taddr,pubtype,p2shtype,&msg->vouts[i],i,*txidp)); } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); - //printf("lock_time.%08x len.%d\n",msg->lock_time,len); + printf("lock_time.%08x len.%d\n",msg->lock_time,len); /*if ( strcmp(coin->symbol,"VPN") == 0 ) { uint16_t ddosflag = 0; From 2c0d64787819f31e30bdab6f9b32dbe321c770b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 17:38:24 +0300 Subject: [PATCH 1638/2732] Z->t into smartaddress support --- iguana/exchanges/LP_bitcoin.c | 86 +++++++++++++++++++++---------- iguana/exchanges/LP_coins.c | 2 + iguana/exchanges/LP_include.h | 18 +++++-- iguana/exchanges/LP_remember.c | 12 ++--- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/LP_transaction.c | 40 +++++++------- 8 files changed, 104 insertions(+), 60 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 1911e7aea..009650082 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3233,9 +3233,9 @@ int32_t iguana_vinarray_check(cJSON *vinarray,bits256 txid,int32_t vout) return(-1); } -int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys); +int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash); -bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,uint8_t *serialized,int32_t maxlen,struct iguana_msgtx *msgtx,int32_t vini,uint8_t *spendscript,int32_t spendlen,int32_t hashtype,char *vpnstr,int32_t suppress_pubkeys) +bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,uint8_t *serialized,int32_t maxlen,struct iguana_msgtx *msgtx,int32_t vini,uint8_t *spendscript,int32_t spendlen,int32_t hashtype,char *vpnstr,int32_t suppress_pubkeys,int32_t zcash) { int32_t i,len; bits256 sigtxid,txid,revsigtxid; struct iguana_msgtx dest; dest = *msgtx; @@ -3269,7 +3269,7 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i dest.vins[i].userdata = 0; dest.vins[i].userdatalen = 0; } - len = iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,1,0,serialized,maxlen,&dest,&txid,vpnstr,0,0,0,suppress_pubkeys); + len = iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,1,0,serialized,maxlen,&dest,&txid,vpnstr,0,0,0,suppress_pubkeys,zcash); //for (i=0; ivpub_old),&msg->vpub_old); + len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->vpub_new),&msg->vpub_new); + + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->anchor),msg->anchor.bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->nullifiers[0]),msg->nullifiers[0].bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->nullifiers[1]),msg->nullifiers[1].bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->commitments[0]),msg->commitments[0].bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->commitments[1]),msg->commitments[1].bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->ephemeralkey),msg->ephemeralkey.bytes); + if ( rwflag == 1 ) + memcpy(&serialized[len],msg->ciphertexts,sizeof(msg->ciphertexts)); + else memcpy(msg->ciphertexts,&serialized[len],sizeof(msg->ciphertexts)); + len += sizeof(msg->ciphertexts); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->randomseed),msg->randomseed.bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->vmacs[0]),msg->vmacs[0].bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->vmacs[1]),msg->vmacs[1].bytes); + if ( rwflag == 1 ) + memcpy(&serialized[len],msg->zkproof,sizeof(msg->zkproof)); + else memcpy(msg->zkproof,&serialized[len],sizeof(msg->zkproof)); + len += sizeof(msg->zkproof); + return(len); +} + +int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { int32_t i,n,len = 0,extraused=0; uint8_t spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) { @@ -3380,26 +3407,29 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); printf("lock_time.%08x len.%d\n",msg->lock_time,len); - /*if ( strcmp(coin->symbol,"VPN") == 0 ) + if ( zcash != 0 && msg->version > 1 ) { - uint16_t ddosflag = 0; - len += iguana_rwnum(rwflag,&serialized[len],sizeof(ddosflag),&ddosflag); - for (i=0; serialized[len]!=0&&len 0 ) { - if ( rwflag == 0 ) - serialized[len] = vpnstr[i]; - else vpnstr[i] = serialized[len]; - } - if ( rwflag == 0 ) - serialized[len] = 0; - else vpnstr[i] = 0; - len++; - if ( json != 0 ) - { - jaddnum(json,"ddosflag",ddosflag); - jaddstr(json,"vpnstr",vpnstr); + for (i=0; itx_in; i++) @@ -3408,7 +3438,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is if ( vins != 0 && jitem(vins,i) != 0 ) { iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); - sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,sigser,maxsize*2,msg,i,msg->vins[i].spendscript,msg->vins[i].spendlen,SIGHASH_ALL,vpnstr,suppress_pubkeys); + sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,sigser,maxsize*2,msg,i,msg->vins[i].spendscript,msg->vins[i].spendlen,SIGHASH_ALL,vpnstr,suppress_pubkeys,zcash); //printf("after vini.%d vinscript.%p spendscript.%p spendlen.%d (%s)\n",i,msg->vins[i].vinscript,msg->vins[i].spendscript,msg->vins[i].spendlen,jprint(jitem(vins,i),0)); if ( iguana_vinarray_check(vinarray,msg->vins[i].prev_hash,msg->vins[i].prev_vout) < 0 ) jaddi(vinarray,iguana_vinjson(&msg->vins[i],sigtxid)); @@ -3505,13 +3535,13 @@ bits256 iguana_parsetxobj(uint8_t isPoS,int32_t *txstartp,uint8_t *serialized,in return(txid); } -char *iguana_rawtxbytes(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,cJSON *json,struct iguana_msgtx *msgtx,int32_t suppress_pubkeys) +char *iguana_rawtxbytes(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,cJSON *json,struct iguana_msgtx *msgtx,int32_t suppress_pubkeys,int32_t zcash) { int32_t n; char *txbytes = 0,vpnstr[64]; uint8_t *serialized; serialized = malloc(IGUANA_MAXPACKETSIZE); vpnstr[0] = 0; //char str[65]; printf("%d of %d: %s\n",i,msg.txn_count,bits256_str(str,tx.txid)); - if ( (n= iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,1,json,serialized,IGUANA_MAXPACKETSIZE,msgtx,&msgtx->txid,vpnstr,0,0,0,suppress_pubkeys)) > 0 ) + if ( (n= iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,1,json,serialized,IGUANA_MAXPACKETSIZE,msgtx,&msgtx->txid,vpnstr,0,0,0,suppress_pubkeys,zcash)) > 0 ) { txbytes = malloc(n*2+1); init_hexbytes_noT(txbytes,serialized,n); @@ -3539,7 +3569,7 @@ char *bitcoin_json2hex(uint8_t isPoS,bits256 *txidp,cJSON *txjson,struct vin_inf return(txbytes); } -cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys) +cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { int32_t n; char vpnstr[64]; struct iguana_msgtx M; cJSON *txobj; if ( serialized == 0 ) @@ -3550,7 +3580,7 @@ cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t memset(msgtx,0,sizeof(M)); vpnstr[0] = 0; memset(txidp,0,sizeof(*txidp)); - if ( (n= iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,txobj,serialized,len,msgtx,txidp,vpnstr,extraspace,extralen,vins,suppress_pubkeys)) <= 0 ) + if ( (n= iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,txobj,serialized,len,msgtx,txidp,vpnstr,extraspace,extralen,vins,suppress_pubkeys,zcash)) <= 0 ) { printf("errortxobj.(%s)\n",jprint(txobj,0)); free_json(txobj); @@ -3568,7 +3598,7 @@ cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t return(txobj); } -cJSON *bitcoin_hex2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,char *txbytes,uint8_t *extraspace,int32_t extralen,uint8_t *origserialized,cJSON *vins,int32_t suppress_pubkeys) +cJSON *bitcoin_hex2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,char *txbytes,uint8_t *extraspace,int32_t extralen,uint8_t *origserialized,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { int32_t len; uint8_t *serialized; cJSON *txobj; if ( txbytes == 0 ) @@ -3577,7 +3607,7 @@ cJSON *bitcoin_hex2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i if ( (serialized= origserialized) == 0 ) serialized = calloc(1,len+4096); decode_hex(serialized,len,txbytes); - txobj = bitcoin_data2json(taddr,pubtype,p2shtype,isPoS,height,txidp,msgtx,extraspace,extralen,serialized,len,vins,suppress_pubkeys); + txobj = bitcoin_data2json(taddr,pubtype,p2shtype,isPoS,height,txidp,msgtx,extraspace,extralen,serialized,len,vins,suppress_pubkeys,zcash); if ( serialized != origserialized ) free(serialized); return(txobj); diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 0d97c0f81..a5573fed8 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -332,6 +332,8 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse port = LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath,port); #endif sprintf(coin->serverport,"127.0.0.1:%u",port); + if ( strcmp(symbol,"KMD") == 0 || coin->isassetchain != 0 || taddr != 0 ) + coin->zcash = 1; return(port); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3770948dd..91b01902e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -90,6 +90,9 @@ void emscripten_usleep(int32_t x); #define DEX_SLEEP 3 #define BASILISK_KEYSIZE ((int32_t)(2*sizeof(bits256)+sizeof(uint32_t)*2)) +#define ZKSNARK_PROOF_SIZE 296 +#define ZCASH_SOLUTION_ELEMENTS 1344 + extern char GLOBAL_DBDIR[]; extern int32_t IAMLP; @@ -108,6 +111,15 @@ struct iguana_msgtx uint8_t *serialized; }; +struct iguana_msgjoinsplit +{ + uint64_t vpub_old,vpub_new; + bits256 anchor,nullifiers[2],commitments[2],ephemeralkey; + bits256 randomseed,vmacs[2]; + uint8_t zkproof[ZKSNARK_PROOF_SIZE]; + uint8_t ciphertexts[2][601]; +}; + struct vin_signer { bits256 privkey; char coinaddr[64]; uint8_t siglen,sig[80],rmd160[20],pubkey[66]; }; struct vin_info @@ -205,7 +217,7 @@ struct iguana_info double price_kmd,force,perc,goal,goalperc,relvolume,rate; void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; - uint8_t pubkey33[33]; + uint8_t pubkey33[33],zcash; bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen; }; @@ -339,7 +351,7 @@ uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr); -int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson); +int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson,int32_t zcash); //void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo); struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout); int32_t LP_destaddr(char *destaddr,cJSON *item); @@ -357,7 +369,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag); uint16_t LP_randpeer(char *destip); -cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys); +cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash); //int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 308bc76e6..10ab1c787 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -960,7 +960,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } for (j=0; j<32; j++) rev.bytes[j] = rswap.myprivs[0].bytes[31 - j]; - if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]); } LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); @@ -990,7 +990,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( bits256_nonz(rswap.privBn) != 0 ) { len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); } } @@ -1012,7 +1012,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn); if ( bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) != 0 && bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) { - if ( (rswap.txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_ALICERECLAIM],rswap.alicepaymentaddr)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_ALICERECLAIM],rswap.alicepaymentaddr,alice->zcash)) != 0 ) printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICERECLAIM]); } LP_txbytes_update("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],&rswap.txids[BASILISK_ALICERECLAIM],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_ALICERECLAIM]); @@ -1042,7 +1042,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( bits256_nonz(rswap.privAm) != 0 && bits256_nonz(rswap.privBn) != 0 ) { - if ( (rswap.txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_BOBSPEND],rswap.alicepaymentaddr)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",rswap.alicecoin,rswap.Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,rswap.privAm,rswap.privBn,rswap.txids[BASILISK_ALICEPAYMENT],0,rswap.pubkey33,rswap.expiration,&rswap.values[BASILISK_BOBSPEND],rswap.alicepaymentaddr,alice->zcash)) != 0 ) printf("bobspend.(%s)\n",rswap.txbytes[BASILISK_BOBSPEND]); } LP_txbytes_update("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],&rswap.txids[BASILISK_BOBSPEND],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_BOBSPEND]); @@ -1065,7 +1065,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[1],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) { int32_t z; for (z=0; z<20; z++) @@ -1096,7 +1096,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti vcalc_sha256(0,rswap.secretBn256,rswap.privBn.bytes,sizeof(rswap.privBn)); redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); len = basilisk_swapuserdata(userdata,rswap.privBn,0,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 4d76ffe01..681511202 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -743,7 +743,7 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * signedtx = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); //printf("locktime.%u sequenceid.%x rawtx.(%s) vins.(%s)\n",locktime,sequenceid,rawtxbytes,jprint(vins,0)); - if ( (*completedp= iguana_signrawtransaction(coin->ctx,symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,16,rawtx,vins,privkeys)) < 0 ) + if ( (*completedp= iguana_signrawtransaction(coin->ctx,symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,16,rawtx,vins,privkeys,coin->zcash)) < 0 ) //if ( (signedtx= LP_signrawtx(symbol,signedtxidp,&completed,vins,rawtxbytes,privkeys,V)) == 0 ) printf("couldnt sign transaction.%s %s\n",rawtx,bits256_str(str,*signedtxidp)); else if ( *completedp == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5c4f22881..bdff4d600 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -571,7 +571,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se uint8_t *extraspace; cJSON *txobj; char str[65],str2[65]; struct iguana_msgtx msgtx; bits256 checktxid; extraspace = calloc(1,4000000); memset(&msgtx,0,sizeof(msgtx)); - txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,4000000,serialized,len,0,0); + txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,4000000,serialized,len,0,0,coin->zcash); //printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); free(extraspace); if ( bits256_cmp(txid,checktxid) != 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index a7be85525..a7cc3528b 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -609,7 +609,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba char str[65]; printf("rawtx.%s txid %s\n",rawtx->name,bits256_str(str,txid)); if ( bits256_cmp(txid,rawtx->I.actualtxid) != 0 && bits256_nonz(rawtx->I.actualtxid) == 0 ) rawtx->I.actualtxid = txid; - if ( (txobj= bitcoin_data2json(rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->coin->p2shtype,rawtx->coin->isPoS,height,&rawtx->I.signedtxid,&rawtx->msgtx,rawtx->extraspace,sizeof(rawtx->extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) + if ( (txobj= bitcoin_data2json(rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->coin->p2shtype,rawtx->coin->isPoS,height,&rawtx->I.signedtxid,&rawtx->msgtx,rawtx->extraspace,sizeof(rawtx->extraspace),data,datalen,0,suppress_pubkeys,rawtx->coin->zcash)) != 0 ) { rawtx->I.actualtxid = rawtx->I.signedtxid; rawtx->I.locktime = rawtx->msgtx.lock_time; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 20db0afd0..88816aab2 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -379,7 +379,7 @@ int32_t iguana_vininfo_create(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uin return(finalized); } -int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *signedtxidp,char **signedtx,struct iguana_msgtx *msgtx,uint8_t *serialized,int32_t maxlen,struct vin_info *V,uint32_t sighash,int32_t signtx,int32_t suppress_pubkeys) +int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *signedtxidp,char **signedtx,struct iguana_msgtx *msgtx,uint8_t *serialized,int32_t maxlen,struct vin_info *V,uint32_t sighash,int32_t signtx,int32_t suppress_pubkeys,int32_t zcash) { bits256 sigtxid; uint8_t *sig,*script; struct vin_info *vp; char vpnstr[64]; int32_t scriptlen,complete=0,j,vini=0,flag=0,siglen,numvouts,numsigs; numvouts = msgtx->tx_out; @@ -401,7 +401,7 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype, script = msgtx->vins[vini].spendscript; scriptlen = msgtx->vins[vini].spendlen; } - sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,serialized,maxlen,msgtx,vini,script,scriptlen,sighash,vpnstr,suppress_pubkeys); + sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,serialized,maxlen,msgtx,vini,script,scriptlen,sighash,vpnstr,suppress_pubkeys,zcash); if ( bits256_nonz(sigtxid) != 0 ) { vp = &V[vini]; @@ -457,7 +457,7 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype, } iguana_msgtx_Vset(serialized,maxlen,msgtx,V); cJSON *txobj = cJSON_CreateObject(); - *signedtx = iguana_rawtxbytes(taddr,pubtype,p2shtype,isPoS,height,txobj,msgtx,suppress_pubkeys); + *signedtx = iguana_rawtxbytes(taddr,pubtype,p2shtype,isPoS,height,txobj,msgtx,suppress_pubkeys,zcash); //printf("SIGNEDTX.(%s)\n",jprint(txobj,1)); *signedtxidp = msgtx->txid; return(complete); @@ -471,7 +471,7 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) return(lockval); } -int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) +int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson,int32_t zcash) { uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; maxsize = 1000000; @@ -485,7 +485,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ extraspace = malloc(extralen); memset(msgtx,0,sizeof(*msgtx)); decode_hex(serialized,len,rawtx); - if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys)) != 0 ) + if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys,zcash)) != 0 ) { //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); @@ -494,7 +494,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ { //printf("numinputs.%d (%s) msgtx.%d\n",numinputs,jprint(vins,0),msgtx->tx_in); memset(msgtx,0,sizeof(*msgtx)); - if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) + if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys,zcash) > 0 && numinputs == msgtx->tx_in ) { memset(pubkeys,0,sizeof(pubkeys)); memset(privkeys,0,sizeof(privkeys)); @@ -581,7 +581,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ } finalized = iguana_vininfo_create(taddr,pubtype,p2shtype,isPoS,serialized2,maxsize,msgtx,vins,numinputs,V); //printf("finalized.%d ignore_cltverr.%d suppress.%d\n",finalized,V[0].ignore_cltverr,V[0].suppress_pubkeys); - if ( (complete= bitcoin_verifyvins(ctx,symbol,taddr,pubtype,p2shtype,isPoS,height,signedtxidp,&signedtx,msgtx,serialized3,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys)) > 0 && signedtx != 0 ) + if ( (complete= bitcoin_verifyvins(ctx,symbol,taddr,pubtype,p2shtype,isPoS,height,signedtxidp,&signedtx,msgtx,serialized3,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys,zcash)) > 0 && signedtx != 0 ) { /*int32_t tmp; //char str[65]; if ( (tmp= iguana_interpreter(ctx,cJSON_CreateArray(),iguana_lockval(finalized,jint(txobj,"locktime")),V,numinputs)) < 0 ) @@ -601,7 +601,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ return(complete); } -char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) +char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys,int32_t zcash) { char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; LP_mark_spent(symbol,utxotxid,utxovout); @@ -750,7 +750,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch completed = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); //printf("locktime.%u sequenceid.%x rawtx.(%s) vins.(%s)\n",locktime,sequenceid,rawtxbytes,jprint(vins,0)); - if ( (completed= iguana_signrawtransaction(ctx,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,1,rawtxbytes,vins,privkeys)) < 0 ) + if ( (completed= iguana_signrawtransaction(ctx,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,1,rawtxbytes,vins,privkeys,zcash)) < 0 ) //if ( (signedtx= LP_signrawtx(symbol,signedtxidp,&completed,vins,rawtxbytes,privkeys,V)) == 0 ) printf("couldnt sign transaction.%s %s\n",name,bits256_str(str,*signedtxidp)); else if ( completed == 0 ) @@ -1045,7 +1045,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) completed = 0; memset(&msgtx,0,sizeof(msgtx)); memset(signedtxid.bytes,0,sizeof(signedtxid)); - if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,V,numvins,rawtx,vins,privkeys)) < 0 ) + if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,V,numvins,rawtx,vins,privkeys,coin->zcash)) < 0 ) printf("couldnt sign withdraw %s\n",bits256_str(str,signedtxid)); else if ( completed == 0 ) { @@ -1102,7 +1102,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub txfee = LP_MIN_TXFEE; for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys,coin->zcash)) != 0 ) { rawtx->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( rawtx->I.datalen <= sizeof(rawtx->txbytes) ) @@ -1123,7 +1123,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub return(retval); } -int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,struct basilisk_swap *swap,struct basilisk_rawtx *dest,struct basilisk_rawtx *rawtx,bits256 privkey,bits256 *privkey2,uint8_t *userdata,int32_t userdatalen,int32_t ignore_cltverr,uint8_t *changermd160,char *vinaddr) +int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,struct basilisk_swap *swap,struct basilisk_rawtx *dest,struct basilisk_rawtx *rawtx,bits256 privkey,bits256 *privkey2,uint8_t *userdata,int32_t userdatalen,int32_t ignore_cltverr,uint8_t *changermd160,char *vinaddr,int32_t zcash) { char *signedtx,*changeaddr = 0,_changeaddr[64]; int64_t txfee,newtxfee=0,destamount; uint32_t timestamp,locktime=0,sequenceid = 0xffffffff; int32_t iter,retval = -1; double estimatedrate; //char str2[65]; printf("%s rawtxsign.(%s/v%d)\n",dest->name,bits256_str(str2,dest->utxotxid),dest->utxovout); @@ -1141,7 +1141,7 @@ int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t } for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys,zcash)) != 0 ) { dest->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( dest->I.datalen <= sizeof(dest->txbytes) ) @@ -1177,7 +1177,7 @@ int32_t basilisk_alicescript(uint8_t *redeemscript,int32_t *redeemlenp,uint8_t * return(n); } -char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t utxovout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) +char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t utxovout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr,int32_t zcash) { char msigaddr[64],*signedtx = 0; int32_t spendlen,redeemlen; uint8_t tmp33[33],redeemscript[512],spendscript[128]; bits256 pubAm,pubBn,signedtxid; uint64_t txfee; if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) @@ -1201,7 +1201,7 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wifta txfee = LP_MIN_TXFEE; } //txfee = LP_txfee(symbol); - signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1); + signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1,zcash); LP_mark_spent(symbol,utxotxid,utxovout); } return(signedtx); @@ -1445,7 +1445,7 @@ int32_t basilisk_bobpayment_reclaim(struct basilisk_swap *swap,int32_t delay) len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); memcpy(swap->I.userdata_bobreclaim,userdata,len); swap->I.userdata_bobreclaimlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr,swap->bobcoin.zcash)) == 0 ) { for (i=0; ibobreclaim.I.datalen; i++) printf("%02x",swap->bobreclaim.txbytes[i]); @@ -1462,7 +1462,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) len = basilisk_swapuserdata(userdata,swap->I.privBn,0,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); memcpy(swap->I.userdata_bobrefund,userdata,len); swap->I.userdata_bobrefundlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin.zcash)) == 0 ) { for (i=0; ibobrefund.I.datalen; i++) printf("%02x",swap->bobrefund.txbytes[i]); @@ -1478,7 +1478,7 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u cJSON *txobj,*vouts,*vout; uint8_t extraspace[32768]; bits256 signedtxid; struct iguana_msgtx msgtx; int32_t n,suppress_pubkeys = 0; if ( valuep != 0 ) *valuep = 0; - if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) + if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys,coin->zcash)) != 0 ) { //char str[65]; printf("got txid.%s (%s)\n",bits256_str(str,signedtxid),jprint(txobj,0)); if ( (vouts= jarray(&n,txobj,"vout")) != 0 && n > 0 ) @@ -1744,7 +1744,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); bitcoin_address(swap->aliceclaim.I.destaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->persistent_pubkey33,33); retval = 0; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin.zcash)) == 0 ) { int32_t i; for (i=0; ibobdeposit.I.datalen; i++) printf("%02x",swap->bobdeposit.txbytes[i]); @@ -1809,7 +1809,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da memcpy(swap->alicespend.I.pubkey33,swap->persistent_pubkey33,33); bitcoin_address(swap->alicespend.I.destaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->persistent_pubkey33,33); //char str[65],str2[65]; printf("bobpaid privAm.(%s) myprivs[0].(%s)\n",bits256_str(str,swap->I.privAm),bits256_str(str2,swap->I.myprivs[0])); - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr,swap->bobcoin.zcash)) == 0 ) { /*for (i=0; ibobpayment.I.datalen; i++) printf("%02x",swap->bobpayment.txbytes[i]); From 5279d9f0abaa9615bd846e8cbca74cadb6e20fa6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 17:42:46 +0300 Subject: [PATCH 1639/2732] Test --- iguana/exchanges/LP_bitcoin.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 009650082..2c17bb13e 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3330,7 +3330,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is sigser = calloc(1,maxsize*2); //printf("json.%p array.%p sigser.%p\n",json,vinarray,sigser); } - printf("version.%d\n",msg->version); + //printf("version.%d\n",msg->version); if ( isPoS != 0 ) { len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->timestamp),&msg->timestamp); @@ -3355,7 +3355,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } for (i=0; itx_in; i++) { - printf("vin.%d starts offset.%d numvins.%d\n",i,len,msg->tx_in); + //printf("vin.%d starts offset.%d numvins.%d\n",i,len,msg->tx_in); if ( vins != 0 && jitem(vins,i) != 0 ) iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); if ( (n= iguana_vinparse(rwflag,&serialized[len],&msg->vins[i])) < 0 ) @@ -3371,9 +3371,9 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is return(-1); } } - for (i=-3; i<7; i++) - printf("%02x",serialized[len+i]); - printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); + //for (i=-3; i<7; i++) + // printf("%02x",serialized[len+i]); + //printf(" prev 3 bytes before tx_out rw.%d\n",rwflag); len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_out); if ( rwflag == 0 ) { @@ -3393,7 +3393,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } for (i=0; itx_out; i++) { - printf("rwflag.%d vout.%d starts %d numvouts.%d\n",rwflag,i,len,msg->tx_out); + //printf("rwflag.%d vout.%d starts %d numvouts.%d\n",rwflag,i,len,msg->tx_out); if ( (n= iguana_voutparse(rwflag,&serialized[len],&msg->vouts[i])) < 0 ) return(-1); len += n; @@ -3406,7 +3406,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is jaddi(voutarray,iguana_voutjson(taddr,pubtype,p2shtype,&msg->vouts[i],i,*txidp)); } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); - printf("lock_time.%08x len.%d\n",msg->lock_time,len); + //printf("lock_time.%08x len.%d\n",msg->lock_time,len); if ( zcash != 0 && msg->version > 1 ) { uint32_t numjoinsplits; struct iguana_msgjoinsplit joinsplit; uint8_t joinsplitpubkey[33],joinsplitsig[64]; From 808d4a5b33a53525df26e09e5cd38a84a0c820ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 17:46:58 +0300 Subject: [PATCH 1640/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index bdff4d600..3bb25b924 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -586,7 +586,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; - printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); + //printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) From 65a8e9dbe1edb30c3171892564d1d005ec01143a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 18:48:47 +0300 Subject: [PATCH 1641/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5f3e2f31b..0fbbf7d91 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,13 +18,10 @@ // LP_nativeDEX.c // marketmaker // -// ZEC LP_transaction_fromdata mismatched txid e2a3eebcf5bef6fe63296f53ce35d2f2c6e3b29c7c907da4171a580f50c93c74 vs 1ed5c15bbf991ff42c73b1492d1bb50e91d1d731c86cb3058405cff95cd9bd70 -//0200000000018c343500000000001976a9141462c3dd3f936d595c9af55978003b27c250441f88ac000000000100000000000000009c5b3500000000005a6c707fc604699d0166b2a750c8a2ff21c8aed0b6e6fe160f651da8cf865c2aa079a7f71f7782604785e1f9a7300cd6c89ca50b5d91f6c0ae5f293ea5a72e62bb0f05da84510e6431c5d4be7a372221265fd98dbccee11f5ed064c5afaa19eff27fd12c30a7a5205f70c99f22b7090c00048c1c9767eea1c79e54ed60c08c138758ad73d43f2692fcb05f data2json n.44 vs len. - -// select oldest utxo first -// handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc. - -// verify portfolio, pricearray, interest to KMD withdraw, pricebroadcast loop, trade to pubkey +// pricearray? RT metrics +// select oldest utxo first, handles <-> pubkeys, reputations, bonds etc. +// +// verify portfolio, interest to KMD withdraw, pricebroadcast loop, trade to pubkey // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs From cc391580df5c913c1e3800a1f3292ecea103cc92 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 19:56:37 +0300 Subject: [PATCH 1642/2732] BCH signing SIGHASH_FORKID --- iguana/exchanges/LP_bitcoin.c | 4 +++- iguana/exchanges/LP_coins.c | 4 +++- iguana/exchanges/LP_include.h | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 2c17bb13e..296d37308 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3279,6 +3279,8 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i if ( height >= BTC2_HARDFORK_HEIGHT ) hashtype |= (0x777 << 20); #endif + if ( zcash == LP_IS_BITCOINCASH ) + hashtype |= SIGHASH_FORKID; len += iguana_rwnum(1,&serialized[len],sizeof(hashtype),&hashtype); revsigtxid = bits256_doublesha256(0,serialized,len); for (i=0; ilock_time),&msg->lock_time); //printf("lock_time.%08x len.%d\n",msg->lock_time,len); - if ( zcash != 0 && msg->version > 1 ) + if ( zcash == LP_IS_ZCASHPROTOCOL && msg->version > 1 ) { uint32_t numjoinsplits; struct iguana_msgjoinsplit joinsplit; uint8_t joinsplitpubkey[33],joinsplitsig[64]; len += iguana_rwvarint32(rwflag,&serialized[len],&numjoinsplits); diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index a5573fed8..3df6b5b3a 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -333,7 +333,9 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse #endif sprintf(coin->serverport,"127.0.0.1:%u",port); if ( strcmp(symbol,"KMD") == 0 || coin->isassetchain != 0 || taddr != 0 ) - coin->zcash = 1; + coin->zcash = LP_IS_ZCASHPROTOCOL; + else if ( strcmp(symbol,"BCH") == 0 ) + coin->zcash = LP_IS_BITCOINCASH; return(port); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 91b01902e..3a380ea78 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -90,6 +90,10 @@ void emscripten_usleep(int32_t x); #define DEX_SLEEP 3 #define BASILISK_KEYSIZE ((int32_t)(2*sizeof(bits256)+sizeof(uint32_t)*2)) +#define LP_IS_ZCASHPROTOCOL 1 +#define LP_IS_BITCOINCASH 2 + +#define SIGHASH_FORKID 0x40 #define ZKSNARK_PROOF_SIZE 296 #define ZCASH_SOLUTION_ELEMENTS 1344 From 69c8e3c0529882aba1806d16d4e024bee6c244f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 21:56:08 +0300 Subject: [PATCH 1643/2732] Test --- iguana/exchanges/LP_bitcoin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 296d37308..306112144 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3280,7 +3280,10 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i hashtype |= (0x777 << 20); #endif if ( zcash == LP_IS_BITCOINCASH ) + { hashtype |= SIGHASH_FORKID; + printf("hashtype is %04x\n",hashtype); + } len += iguana_rwnum(1,&serialized[len],sizeof(hashtype),&hashtype); revsigtxid = bits256_doublesha256(0,serialized,len); for (i=0; i Date: Fri, 27 Oct 2017 21:59:41 +0300 Subject: [PATCH 1644/2732] Test --- iguana/exchanges/LP_coins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 3df6b5b3a..819a9ec6b 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -335,7 +335,10 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse if ( strcmp(symbol,"KMD") == 0 || coin->isassetchain != 0 || taddr != 0 ) coin->zcash = LP_IS_ZCASHPROTOCOL; else if ( strcmp(symbol,"BCH") == 0 ) + { coin->zcash = LP_IS_BITCOINCASH; + printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); + } return(port); } From c61811e96fde88104ccf6474a23a5aa6f66adf0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Oct 2017 22:30:30 +0300 Subject: [PATCH 1645/2732] Test --- iguana/exchanges/LP_bitcoin.c | 7 +------ iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_transaction.c | 2 ++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 306112144..1c2c5d0c5 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3244,7 +3244,7 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i memcpy(dest.vins,msgtx->vins,dest.tx_in * sizeof(*dest.vins)); memcpy(dest.vouts,msgtx->vouts,dest.tx_out * sizeof(*dest.vouts)); memset(sigtxid.bytes,0,sizeof(sigtxid)); - if ( hashtype != SIGHASH_ALL ) + if ( (hashtype & ~SIGHASH_FORKID) != SIGHASH_ALL ) { printf("currently only SIGHASH_ALL supported, not %d\n",hashtype); return(sigtxid); @@ -3279,11 +3279,6 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i if ( height >= BTC2_HARDFORK_HEIGHT ) hashtype |= (0x777 << 20); #endif - if ( zcash == LP_IS_BITCOINCASH ) - { - hashtype |= SIGHASH_FORKID; - printf("hashtype is %04x\n",hashtype); - } len += iguana_rwnum(1,&serialized[len],sizeof(hashtype),&hashtype); revsigtxid = bits256_doublesha256(0,serialized,len); for (i=0; izcash = LP_IS_BITCOINCASH; - printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); + //printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); } return(port); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 88816aab2..ad297bd75 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -401,6 +401,8 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype, script = msgtx->vins[vini].spendscript; scriptlen = msgtx->vins[vini].spendlen; } + if ( zcash == LP_IS_BITCOINCASH ) + sighash |= SIGHASH_FORKID; sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,serialized,maxlen,msgtx,vini,script,scriptlen,sighash,vpnstr,suppress_pubkeys,zcash); if ( bits256_nonz(sigtxid) != 0 ) { From d2c7509a42f4d67d11cadbef4504e158d28a1d49 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 09:03:37 +0300 Subject: [PATCH 1646/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++++- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0fbbf7d91..b6ad97819 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -745,8 +745,11 @@ void LP_price_broadcastloop(void *ctx) for (relind=0; relindmyprices[relpp->ind]) > SMALLVAL) + if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) + { + printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } } } sleep(60); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index efbfa6438..e9b022e7a 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -358,7 +358,7 @@ char *LP_postutxos_recv(cJSON *argjson) struct LP_utxos_qitem *uitem; struct iguana_info *coin; char *coinaddr,*symbol; bits256 utxoshash,pubkey; cJSON *obj; struct LP_pubkeyinfo *pubp; pubkey = jbits256(argjson,"pubkey"); pubp = LP_pubkeyfind(pubkey); - if ( pubp->numerrors > LP_MAXPUBKEY_ERRORS ) + if ( pubp != 0 && pubp->numerrors > LP_MAXPUBKEY_ERRORS ) return(clonestr("{\"error\":\"blacklisted\"}")); if ( (coinaddr= jstr(argjson,"coinaddr")) != 0 && (symbol= jstr(argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { From d5821b2cf055360827a7d3231d33feea846b842b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 13:21:05 +0300 Subject: [PATCH 1647/2732] Electrum maxerrors->reconnect --- iguana/exchanges/LP_include.h | 3 ++- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_rpc.c | 4 +-- iguana/exchanges/LP_socket.c | 41 +++++++++++++++--------------- iguana/exchanges/LP_statemachine.c | 18 +++++++++++++ 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3a380ea78..3b5a9560a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -36,7 +36,8 @@ void emscripten_usleep(int32_t x); #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 10 -#define ELECTRUM_TIMEOUT 15 +#define ELECTRUM_TIMEOUT 10 +#define LP_ELECTRUM_MAXERRORS 3 #define LP_MEMPOOL_TIMEINCR 10 #define LP_COMMAND_SENDSOCK NN_PUSH diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b6ad97819..f611e35d6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,8 @@ // LP_nativeDEX.c // marketmaker // +//MERKLE DIDNT VERIFY.ZEC 96d8484efb1f96e2a692f572d2b3bbc49a59bb586ec84ad952483186b69cb29b ht.209417 ({"error":"timeout"}) +//MERKLE DIDNT VERIFY.ZEC 2520e53f9e0366f711bd924fcfc6fa5c3de7f095e8d7459a68daba2d2124b262 ht.209418 ({"error":"timeout"}) // pricearray? RT metrics // select oldest utxo first, handles <-> pubkeys, reputations, bonds etc. // diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 681511202..d82145479 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -108,7 +108,7 @@ char *LP_apicall(struct iguana_info *coin,char *method,char *params) return(0); if ( coin->electrum != 0 ) { - if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) + if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,ELECTRUM_TIMEOUT)) != 0 ) { retstr = jprint(retjson,0); //printf("got.%p (%s)\n",retjson,retstr); @@ -142,7 +142,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) } else { - if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,LP_HTTP_TIMEOUT)) != 0 ) + if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,ELECTRUM_TIMEOUT)) != 0 ) { if ( jobj(retjson,"error") != 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3bb25b924..b21633e84 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -243,7 +243,7 @@ struct electrum_info queue_t sendQ,pendingQ; portable_mutex_t mutex,txmutex; struct electrum_info *prev; - int32_t bufsize,sock,*heightp; + int32_t bufsize,sock,*heightp,numerrors; struct iguana_info *coin; uint32_t stratumid,lasttime,pending,*heighttimep; char ipaddr[64],symbol[16]; @@ -368,7 +368,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch ep = electrum_server(symbol,0); while ( ep != 0 ) { - if ( ep != 0 && ep->sock >= 0 && retjsonp != 0 ) + if ( ep != 0 && ep->numerrors < LP_ELECTRUM_MAXERRORS && ep->sock >= 0 && retjsonp != 0 ) { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); @@ -382,8 +382,23 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) - usleep(10000); + usleep(5000); portable_mutex_unlock(&ep->mutex); + if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) + { + if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) + { + closesocket(ep->sock), ep->sock = -1; + if ( (ep->sock= LP_socket(0,ep->ipaddr,ep->port)) < 0 ) + printf("error RE-connecting to %s:%u\n",ep->ipaddr,ep->port); + else + { + printf("ep.%p %s numerrors.%d too big -> new %s:%u sock.%d\n",ep,ep->symbol,ep->numerrors,ep->ipaddr,ep->port,ep->sock); + ep->numerrors = 0; + } + } + } else if ( ep->numerrors > 0 ) + ep->numerrors++; if ( ep->prev == 0 ) { if ( *retjsonp == 0 ) @@ -395,6 +410,8 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch } } else printf("couldnt find electrum server for (%s %s) or no retjsonp.%p\n",method,params,retjsonp); ep = ep->prev; + if ( ep != 0 ) + printf("using prev ep.%s\n",ep->symbol); } return(0); } @@ -898,24 +915,6 @@ void LP_dedicatedloop(void *arg) if ( sitem->expiration != 0 ) sitem->expiration += (uint32_t)time(NULL); else sitem->expiration = (uint32_t)time(NULL) + ELECTRUM_TIMEOUT; - /*portable_mutex_lock(&ep->pendingQ.mutex); - if ( ep->pendingQ.list != 0 ) - { - printf("list %p\n",ep->pendingQ.list); - DL_FOREACH_SAFE(ep->pendingQ.list,item,tmp) - { - printf("item.%p\n",item); - if ( item->type == 0xffffffff ) - { - printf("%p purge %s",item,((struct stritem *)item)->str); - DL_DELETE(ep->pendingQ.list,item); - free(item); - } - } - } - DL_APPEND(ep->pendingQ.list,&sitem->DL); - portable_mutex_unlock(&ep->pendingQ.mutex);*/ - //printf("%p SENT.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); queue_enqueue("pendingQ",&ep->pendingQ,&sitem->DL); flag++; } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index d369f5f24..bc05ecb71 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2349,6 +2349,24 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } +/*portable_mutex_lock(&ep->pendingQ.mutex); + if ( ep->pendingQ.list != 0 ) + { + printf("list %p\n",ep->pendingQ.list); + DL_FOREACH_SAFE(ep->pendingQ.list,item,tmp) + { + printf("item.%p\n",item); + if ( item->type == 0xffffffff ) + { + printf("%p purge %s",item,((struct stritem *)item)->str); + DL_DELETE(ep->pendingQ.list,item); + free(item); + } + } + } + DL_APPEND(ep->pendingQ.list,&sitem->DL); + portable_mutex_unlock(&ep->pendingQ.mutex);*/ +//printf("%p SENT.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port); char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) { From 76f419b28378f97a03ef9faa3f857e404256dfb4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 13:24:04 +0300 Subject: [PATCH 1648/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b21633e84..af5cfb11e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -368,7 +368,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch ep = electrum_server(symbol,0); while ( ep != 0 ) { - if ( ep != 0 && ep->numerrors < LP_ELECTRUM_MAXERRORS && ep->sock >= 0 && retjsonp != 0 ) + if ( ep != 0 && ep->sock >= 0 && retjsonp != 0 ) { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); From 684cc6c64d601b9f2d745b418adce8861247cf6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 15:42:57 +0300 Subject: [PATCH 1649/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 65 ++++++++++++++++++++++++++++++++ iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 51 +++++++++++++++++++++++++ iguana/exchanges/LP_ordermatch.c | 8 +++- iguana/exchanges/Makefile | 6 +-- iguana/exchanges/nodeinstall | 16 ++++++++ 6 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 iguana/exchanges/LP_RTmetrics.c create mode 100644 iguana/exchanges/nodeinstall diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c new file mode 100644 index 000000000..3876a61cc --- /dev/null +++ b/iguana/exchanges/LP_RTmetrics.c @@ -0,0 +1,65 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_RTmetrics.c +// marketmaker +// + +cJSON *LP_RTmetrics_sort(cJSON *rawasks,int32_t numasks,double maxprice,double relvolume) +{ + cJSON *array,*item,*statsjson,*swaps=0; int32_t i,numswaps=0; bits256 zero; uint32_t futuretime; double price; char *retstr; + futuretime = (uint32_t)time(NULL) + 3600*100; + memset(zero.bytes,0,sizeof(zero)); + if ( (retstr= LP_statslog_disp(100,futuretime,futuretime,"",zero)) != 0 ) + { + if ( (statsjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (swaps= jarray(&numswaps,statsjson,"swaps")) != 0 ) + { + if ( numswaps > 0 ) + swaps = jduplicate(swaps); + else swaps = 0; + } + free_json(statsjson); + } + free(retstr); + } + //if ( numswaps == 0 || swaps == 0 ) + return(0); + printf("calc RTmetrics for (%s)\n",jprint(swaps,0)); + /*jadd64bits(item,"aliceid",sp->aliceid); + jaddbits256(item,"src",sp->Q.srchash); + jaddstr(item,"base",sp->Q.srccoin); + jaddnum(item,"basevol",dstr(sp->Q.satoshis)); + jaddbits256(item,"dest",sp->Q.desthash); + jaddstr(item,"rel",sp->Q.destcoin); + jaddnum(item,"relvol",dstr(sp->Q.destsatoshis)); + jaddnum(item,"price",sp->qprice); + jaddnum(item,"requestid",sp->Q.R.requestid); + jaddnum(item,"quoteid",sp->Q.R.quoteid); + */ + array = cJSON_CreateArray(); + for (i=0; i maxprice ) + break; + jaddi(array,jduplicate(item)); + } + free_json(swaps); + return(array); +} diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f611e35d6..4ddf01987 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -107,6 +107,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_utxos.c" #include "LP_forwarding.c" #include "LP_signatures.c" +#include "LP_RTmetrics.c" #include "LP_ordermatch.c" #include "LP_portfolio.c" #include "LP_messages.c" diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 723da5980..dbeb28a31 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -28,6 +28,57 @@ struct psock uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; +#ifdef FROM_JS + +int32_t nn_socket(int domain, int protocol) +{ + return(0); +} + +int32_t nn_close(int s) +{ + return(0); +} + +int32_t nn_setsockopt(int s, int level, int option, const void *optval,size_t optvallen) +{ + return(0); +} + +int32_t nn_getsockopt(int s, int level, int option, void *optval,size_t *optvallen) +{ + return(0); +} + +int32_t nn_bind(int s, const char *addr) +{ + return(0); +} + +int32_t nn_connect(int s, const char *addr) +{ + return(0); +} + +int32_t nn_shutdown(int s, int how) +{ + return(0); +} + +int32_t nn_send(int s, const void *buf, size_t len, int flags) +{ + return(0); +} + + +int32_t nn_recv(int s, void *buf, size_t len, int flags) +{ + return(0); +} + + +#endif + char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 13e39b9c8..831bbe44d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -766,7 +766,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,char *gui,bits256 *avoids,int32_t numavoids,bits256 destpubkey) { - bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*item; int32_t maxiters,i,j,numasks,max; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; + bits256 pubkey; char *obookstr,coinaddr[64]; cJSON *orderbook,*asks,*rawasks,*item; int32_t maxiters,i,j,numasks,max; struct LP_address_utxo **utxos; double price; struct LP_pubkeyinfo *pubp; uint64_t asatoshis; struct iguana_info *basecoin; struct LP_utxoinfo *bestutxo = 0; maxiters = 100; *ordermatchpricep = 0.; *bestsatoshisp = *bestdestsatoshisp = 0; @@ -785,8 +785,10 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) { - if ( (asks= jarray(&numasks,orderbook,"asks")) != 0 ) + if ( (rawasks= jarray(&numasks,orderbook,"asks")) != 0 ) { + if ( (asks= LP_RTmetrics_sort(rawasks,numasks,maxprice,dstr(autxo->S.satoshis))) == 0 ) + asks = rawasks; for (i=0; i Date: Sat, 28 Oct 2017 15:46:16 +0300 Subject: [PATCH 1650/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4ddf01987..401265c9c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1065,8 +1065,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #ifdef FROM_JS -extern void *Nanomsg_threadarg; -void *nn_thread_main_routine(void *arg); +//extern void *Nanomsg_threadarg; +//void *nn_thread_main_routine(void *arg); void emscripten_usleep(int32_t x) { From 13cf0f67afabacc411a4a0718d2741149ed18e14 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 15:47:49 +0300 Subject: [PATCH 1651/2732] Test --- iguana/exchanges/LP_network.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index dbeb28a31..9c7da2ef6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -76,6 +76,10 @@ int32_t nn_recv(int s, void *buf, size_t len, int flags) return(0); } +int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) +{ + return(0); +} #endif From 9951396c31ac997ffb3f57004c66ab5508ba5b40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 15:55:46 +0300 Subject: [PATCH 1652/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 5c597b160..9a64f1794 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -6,5 +6,5 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 07778a59f084e3efcb9961f11c66cc0715b02bd4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 15:59:55 +0300 Subject: [PATCH 1653/2732] Test --- iguana/exchanges/.Makefile.swp | Bin 0 -> 12288 bytes iguana/exchanges/LP_network.c | 4 +++- iguana/exchanges/LP_prices.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 iguana/exchanges/.Makefile.swp diff --git a/iguana/exchanges/.Makefile.swp b/iguana/exchanges/.Makefile.swp new file mode 100644 index 0000000000000000000000000000000000000000..07013efda72aa0bbd30a6383cf61e0abd5b9fb6f GIT binary patch literal 12288 zcmeI&&x+GP7y$5DZ;Gp;cpt3?6((ug?xqSobh}xtG)+mei`h#UC$rsb^N*yl^|C&a z;6-1-Cs6R}BY4o8lQvempjL|D;y3V-e&2Nd<@DqQJGKKF^z^i zlXW`cM}EMU2SEk`Ah5nbK0YGN&HZ{!sTPw}Zr{Q;uJ5luFU$Y}AOHd&00JNY0w4ea zAaHI3#>obHDRz6I-0`LIx^d=Orf>lP5C8!X009sH0T2KI5C8!X009sAoO0uD-mxu5qcxywTQ!V%+q2VG!Os*5C8!X009sH0T2Lz z|6JfA4;jNG!|ffzw7dOBuHNqTj83aMD_WK&sz%>xDf8Uvce;DdJhKhE-E(zKH%zCs zRo`x^)dxxq6OyDnh^a@4bHbR#ew0ZkSsY=qyJs4@`^3V;5Z~)clI%w;$UUCTGnT$c z#<8lZ#bN{dv8lCp-GO2BT&sJiwVFkF-_qQ&YqqNx%g<>lPbL%jcpL^|MvqUW;v@cX zYB>xghQ)G=1?2l@3nvL5{-l~m{&dzA`jJnDVIsz6oF%ob?U5p9DU%nO=pjLf5e3rN=;^xK`@ACayub?0u!bOyE|o`h?e9qS%m`OZneP^EmT c%i;@rDU0)z@$6so`3tYynvkf%Jb{S50o2(_YXATM literal 0 HcmV?d00001 diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9c7da2ef6..3f9099586 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -52,11 +52,13 @@ int32_t nn_getsockopt(int s, int level, int option, void *optval,size_t *optvall int32_t nn_bind(int s, const char *addr) { - return(0); + return(-1); } int32_t nn_connect(int s, const char *addr) { + if ( strncmp("ws://",addr,strlen("ws://")) != 0 ) + return(-1); return(0); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b7d40127f..e556c1281 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -197,7 +197,7 @@ struct LP_pubkeyinfo *LP_pubkeyfind(bits256 pubkey) struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) { - struct LP_pubkeyinfo *pubp=0; + char str[65]; struct LP_pubkeyinfo *pubp=0; portable_mutex_lock(&LP_pubkeymutex); HASH_FIND(hh,LP_pubkeyinfos,&pubkey,sizeof(pubkey),pubp); if ( pubp == 0 ) @@ -212,7 +212,7 @@ struct LP_pubkeyinfo *LP_pubkeyadd(bits256 pubkey) HASH_ADD_KEYPTR(hh,LP_pubkeyinfos,&pubp->pubkey,sizeof(pubp->pubkey),pubp); HASH_FIND(hh,LP_pubkeyinfos,&pubkey,sizeof(pubkey),pubp); if ( pubp == 0 ) - printf("pubkeyadd find error after add\n"); + printf("pubkeyadd find %s error after add\n",bits256_str(str,pubp->pubkey)); } portable_mutex_unlock(&LP_pubkeymutex); return(pubp); From 55c74fc0e4cda00a1540a08cdcaea0c24deb8132 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 16:02:25 +0300 Subject: [PATCH 1654/2732] Test --- .gitignore | 2 ++ iguana/exchanges/.Makefile.swp | Bin 12288 -> 0 bytes iguana/exchanges/LP_network.c | 12 +++++++++++- iguana/exchanges/Makefile | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) delete mode 100644 iguana/exchanges/.Makefile.swp diff --git a/.gitignore b/.gitignore index c2c001dd5..f6a9cbe17 100755 --- a/.gitignore +++ b/.gitignore @@ -487,3 +487,5 @@ iguana/confs/97f18454bb61e9eb7a827cfbefe42fbf7ae2832dc74c4812bdaef8bcf5c10474 iguana/DB/PRICES/.tmpmarker iguana/DB/KMD/0/.tmpmarker + +*.swp diff --git a/iguana/exchanges/.Makefile.swp b/iguana/exchanges/.Makefile.swp deleted file mode 100644 index 07013efda72aa0bbd30a6383cf61e0abd5b9fb6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&&x+GP7y$5DZ;Gp;cpt3?6((ug?xqSobh}xtG)+mei`h#UC$rsb^N*yl^|C&a z;6-1-Cs6R}BY4o8lQvempjL|D;y3V-e&2Nd<@DqQJGKKF^z^i zlXW`cM}EMU2SEk`Ah5nbK0YGN&HZ{!sTPw}Zr{Q;uJ5luFU$Y}AOHd&00JNY0w4ea zAaHI3#>obHDRz6I-0`LIx^d=Orf>lP5C8!X009sH0T2KI5C8!X009sAoO0uD-mxu5qcxywTQ!V%+q2VG!Os*5C8!X009sH0T2Lz z|6JfA4;jNG!|ffzw7dOBuHNqTj83aMD_WK&sz%>xDf8Uvce;DdJhKhE-E(zKH%zCs zRo`x^)dxxq6OyDnh^a@4bHbR#ew0ZkSsY=qyJs4@`^3V;5Z~)clI%w;$UUCTGnT$c z#<8lZ#bN{dv8lCp-GO2BT&sJiwVFkF-_qQ&YqqNx%g<>lPbL%jcpL^|MvqUW;v@cX zYB>xghQ)G=1?2l@3nvL5{-l~m{&dzA`jJnDVIsz6oF%ob?U5p9DU%nO=pjLf5e3rN=;^xK`@ACayub?0u!bOyE|o`h?e9qS%m`OZneP^EmT c%i;@rDU0)z@$6so`3tYynvkf%Jb{S50o2(_YXATM diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 3f9099586..d4f9ead6e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -72,7 +72,6 @@ int32_t nn_send(int s, const void *buf, size_t len, int flags) return(0); } - int32_t nn_recv(int s, void *buf, size_t len, int flags) { return(0); @@ -83,6 +82,17 @@ int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) return(0); } +int32_t nn_errno(void) +{ + return(-11); +} + +const char *nn_strerror(int errnum) +{ + return("nanomsg error"); +} + + #endif char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 9a64f1794..35aa6c56b 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -6,5 +6,5 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From f4c850876c637a7bfe403d92c92512ede9a6e843 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 16:06:33 +0300 Subject: [PATCH 1655/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 35aa6c56b..a77a5405f 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -6,5 +6,5 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm -lpthread From d9662c783edb6d79364aa0cecc6776777f5fb6af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 16:09:16 +0300 Subject: [PATCH 1656/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_peers.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 401265c9c..968863efe 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1102,7 +1102,7 @@ void LP_fromjs_iter() // nn_thread_main_routine(Nanomsg_threadarg); //LP_pubkeys_query(); LP_utxosQ_process(); - LP_nanomsg_recvs(ctx); + //LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); queue_loop(0); if ( (LP_counter % 10) == 0 ) // 10 seconds diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 87b03d2ad..33c776969 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -90,7 +90,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) { nanomsg_transportname(0,pushaddr,peer->ipaddr,pushport); - nanomsg_transportname(0,pushaddr2,peer->ipaddr,pushport); + nanomsg_transportname2(0,pushaddr2,peer->ipaddr,pushport); valid = 0; if ( nn_connect(pushsock,pushaddr) >= 0 ) valid++; From 64de6e09eb4a01fbaa232c110a75d37faf007c3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 16:11:57 +0300 Subject: [PATCH 1657/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 968863efe..e6cd08a08 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1104,8 +1104,8 @@ void LP_fromjs_iter() LP_utxosQ_process(); //LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); - queue_loop(0); - if ( (LP_counter % 10) == 0 ) // 10 seconds + //queue_loop(0); + if ( 0 && (LP_counter % 10) == 0 ) // 10 seconds { LP_coinsloop(0); if ( (LP_counter % 100) == 0 ) // 100 seconds From d8e44972e25bc4e154f9c67a771904740418966e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 16:42:14 +0300 Subject: [PATCH 1658/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d4f9ead6e..76b0d4515 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -29,7 +29,7 @@ struct psock uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; #ifdef FROM_JS - +/* int32_t nn_socket(int domain, int protocol) { return(0); @@ -91,7 +91,7 @@ const char *nn_strerror(int errnum) { return("nanomsg error"); } - +*/ #endif From 5f528ab8b24b40bb2b79a7a50d830b8250d11826 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:12:25 +0300 Subject: [PATCH 1659/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e6cd08a08..598aa00a1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1102,7 +1102,7 @@ void LP_fromjs_iter() // nn_thread_main_routine(Nanomsg_threadarg); //LP_pubkeys_query(); LP_utxosQ_process(); - //LP_nanomsg_recvs(ctx); + LP_nanomsg_recvs(ctx); LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); //queue_loop(0); if ( 0 && (LP_counter % 10) == 0 ) // 10 seconds From 1969115b45a04f3ec4cd997d2ff5677901e0effc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:15:45 +0300 Subject: [PATCH 1660/2732] Test --- iguana/exchanges/LP_network.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 76b0d4515..2082cb41a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -77,11 +77,6 @@ int32_t nn_recv(int s, void *buf, size_t len, int flags) return(0); } -int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) -{ - return(0); -} - int32_t nn_errno(void) { return(-11); @@ -92,6 +87,11 @@ const char *nn_strerror(int errnum) return("nanomsg error"); } */ +int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) +{ + return(0); +} + #endif From 6b489a4c78804c591acd44ab3f18da221f0a8299 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:16:26 +0300 Subject: [PATCH 1661/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 598aa00a1..9dc082d3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1101,9 +1101,9 @@ void LP_fromjs_iter() //if ( Nanomsg_threadarg != 0 ) // nn_thread_main_routine(Nanomsg_threadarg); //LP_pubkeys_query(); - LP_utxosQ_process(); + //LP_utxosQ_process(); LP_nanomsg_recvs(ctx); - LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); + //LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); //queue_loop(0); if ( 0 && (LP_counter % 10) == 0 ) // 10 seconds { From 6d715b90ca16d72e2f8b9d2e8352d725aa09dc3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:37:59 +0300 Subject: [PATCH 1662/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2082cb41a..a27fa7fc3 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -86,11 +86,11 @@ const char *nn_strerror(int errnum) { return("nanomsg error"); } -*/ + int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) { return(0); -} +}*/ #endif From 5999b9a438c4821a0b365ee16d727f7e1a65b5d1 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Sat, 28 Oct 2017 18:41:23 +0400 Subject: [PATCH 1663/2732] fix windows build of dev branch --- iguana/exchanges/mm.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 296e25647..19307baf3 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -48,13 +48,23 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas #include "../../crypto777/nanosrc/tcp.h" #include "../../crypto777/nanosrc/pair.h" #else -#include "/usr/local/include/nanomsg/nn.h" -#include "/usr/local/include/nanomsg/bus.h" -#include "/usr/local/include/nanomsg/pubsub.h" -#include "/usr/local/include/nanomsg/pipeline.h" -#include "/usr/local/include/nanomsg/reqrep.h" -#include "/usr/local/include/nanomsg/tcp.h" -#include "/usr/local/include/nanomsg/pair.h" +#if defined(WIN32) || defined(USE_STATIC_NANOMSG) + #include "../../crypto777/nanosrc/nn.h" + #include "../../crypto777/nanosrc/bus.h" + #include "../../crypto777/nanosrc/pubsub.h" + #include "../../crypto777/nanosrc/pipeline.h" + #include "../../crypto777/nanosrc/reqrep.h" + #include "../../crypto777/nanosrc/tcp.h" + #include "../../crypto777/nanosrc/pair.h" +#else + #include "/usr/local/include/nanomsg/nn.h" + #include "/usr/local/include/nanomsg/bus.h" + #include "/usr/local/include/nanomsg/pubsub.h" + #include "/usr/local/include/nanomsg/pipeline.h" + #include "/usr/local/include/nanomsg/reqrep.h" + #include "/usr/local/include/nanomsg/tcp.h" + #include "/usr/local/include/nanomsg/pair.h" +#endif #endif char DEX_baseaddr[64],DEX_reladdr[64]; From bac2a2cea8c639fa03d4257965c051bafd60aceb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:43:44 +0300 Subject: [PATCH 1664/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9dc082d3e..b0c0082da 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1065,8 +1065,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #ifdef FROM_JS -//extern void *Nanomsg_threadarg; -//void *nn_thread_main_routine(void *arg); +extern void *Nanomsg_threadarg; +void *nn_thread_main_routine(void *arg); void emscripten_usleep(int32_t x) { @@ -1098,8 +1098,8 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); - //if ( Nanomsg_threadarg != 0 ) - // nn_thread_main_routine(Nanomsg_threadarg); + if ( Nanomsg_threadarg != 0 ) + nn_thread_main_routine(Nanomsg_threadarg); //LP_pubkeys_query(); //LP_utxosQ_process(); LP_nanomsg_recvs(ctx); From 068a5876b2203981da79e545fa57d74e62b0f1bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:51:29 +0300 Subject: [PATCH 1665/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b0c0082da..1a42b6686 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -745,9 +745,13 @@ void LP_price_broadcastloop(void *ctx) for (baseind=0; baseindsymbol[0] == 0 ) + continue; for (relind=0; relindsymbol[0] == 0 ) + continue; if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) { printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); From b4fa898c478fed2fc7acfed4d63fe717f62dd45d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 17:56:48 +0300 Subject: [PATCH 1666/2732] Fix crash --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1a42b6686..90f69923f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -754,7 +754,7 @@ void LP_price_broadcastloop(void *ctx) continue; if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) { - printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); + //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index e9b022e7a..cf6f17c56 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -204,7 +204,7 @@ char *LP_quotereceived(cJSON *argjson) int32_t LP_bitcoinsig_add(cJSON *item,bits256 priv,uint8_t *pubsecp,bits256 sighash) { - static void *ctx; int32_t i,j,siglen; uint8_t pub33[33],sig[65]; char sigstr[128]; + static void *ctx; int32_t i,j,siglen; uint8_t pub33[33],sig[65]; char sigstr[256]; if ( ctx == 0 ) ctx = bitcoin_ctx(); for (j=0; j<100; j++) From a07747605a7b0f54a4811e359340247766c29c7e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:06:37 +0300 Subject: [PATCH 1667/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 90f69923f..1def43b46 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -752,10 +752,10 @@ void LP_price_broadcastloop(void *ctx) relpp = LP_priceinfo(relind); if ( relpp->symbol[0] == 0 ) continue; - if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) + if ( basepp != 0 && relpp != 0 && (price= basepp->myprices[relpp->ind]) > SMALLVAL) { //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,price); } } } From 8a6adb04ca3a98d7b707f0db6dc1066b761c30aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:22:33 +0300 Subject: [PATCH 1668/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1def43b46..0c12fcf2d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -755,11 +755,11 @@ void LP_price_broadcastloop(void *ctx) if ( basepp != 0 && relpp != 0 && (price= basepp->myprices[relpp->ind]) > SMALLVAL) { //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,1./price); } } } - sleep(60); + sleep(LP_ORDERBOOK_DURATION * .9); } } From 0fb7b1ced50e3f14f4c93ad1977d38e25b9d44e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:22:46 +0300 Subject: [PATCH 1669/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0c12fcf2d..26bd16dd1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -754,7 +754,7 @@ void LP_price_broadcastloop(void *ctx) continue; if ( basepp != 0 && relpp != 0 && (price= basepp->myprices[relpp->ind]) > SMALLVAL) { - //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); + printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,1./price); } } From 13f11a03660f2afff687c9260b14cf5039889705 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:23:48 +0300 Subject: [PATCH 1670/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 26bd16dd1..34ee0fc6e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -755,7 +755,7 @@ void LP_price_broadcastloop(void *ctx) if ( basepp != 0 && relpp != 0 && (price= basepp->myprices[relpp->ind]) > SMALLVAL) { printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,1./price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } } } From 88ef7e27ab3772bad945dc0c024f7ef76c406de0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:24:32 +0300 Subject: [PATCH 1671/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 34ee0fc6e..a0f6f9439 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -755,7 +755,7 @@ void LP_price_broadcastloop(void *ctx) if ( basepp != 0 && relpp != 0 && (price= basepp->myprices[relpp->ind]) > SMALLVAL) { printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,1./price); } } } From f9566785490892868102f29660f317c292ae0d5e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:25:25 +0300 Subject: [PATCH 1672/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a0f6f9439..c06599f55 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -740,7 +740,7 @@ void LP_price_broadcastloop(void *ctx) { struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; sleep(30); - while ( 1 ) + while ( 0 ) { for (baseind=0; baseind Date: Sat, 28 Oct 2017 18:25:36 +0300 Subject: [PATCH 1673/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c06599f55..a0f6f9439 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -740,7 +740,7 @@ void LP_price_broadcastloop(void *ctx) { struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; sleep(30); - while ( 0 ) + while ( 1 ) { for (baseind=0; baseind Date: Sat, 28 Oct 2017 18:36:34 +0300 Subject: [PATCH 1674/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a0f6f9439..ec5779fad 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -752,10 +752,10 @@ void LP_price_broadcastloop(void *ctx) relpp = LP_priceinfo(relind); if ( relpp->symbol[0] == 0 ) continue; - if ( basepp != 0 && relpp != 0 && (price= basepp->myprices[relpp->ind]) > SMALLVAL) + if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) { - printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,1./price); + //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } } } From 53aaabd89e304640f075ded13da9f5524ac92b37 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Oct 2017 18:50:49 +0300 Subject: [PATCH 1675/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ec5779fad..a94923cf6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1043,7 +1043,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_price_broadcastloop,(void *)ctx) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_price_broadcastloop,(void *)ctx) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); From 37b71f8bed7ba7f28e2170f82c807eaeab6726a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 16:10:39 +0200 Subject: [PATCH 1676/2732] RTmetrics --- iguana/exchanges/LP_RTmetrics.c | 247 ++++++++++++++++++++++++++--- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_include.h | 8 +- iguana/exchanges/LP_nativeDEX.c | 8 +- iguana/exchanges/LP_ordermatch.c | 11 +- iguana/exchanges/LP_statemachine.c | 14 ++ iguana/exchanges/LP_utxo.c | 2 +- 7 files changed, 260 insertions(+), 32 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 3876a61cc..873195cdf 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -18,9 +18,139 @@ // marketmaker // -cJSON *LP_RTmetrics_sort(cJSON *rawasks,int32_t numasks,double maxprice,double relvolume) +struct LP_metricinfo { - cJSON *array,*item,*statsjson,*swaps=0; int32_t i,numswaps=0; bits256 zero; uint32_t futuretime; double price; char *retstr; + bits256 pubkey; + double metric,price,balance,minvol,maxvol; + int32_t ind,numutxos,age,pendingswaps; +}; + +struct LP_RTmetrics_pendings +{ + char refbase[16],refrel[16]; + int32_t numswaps,numavoidtxids,numwhitelist,numblacklist,numpendings,pending_swaps[1024]; + bits256 avoidtxids[8192],whitelist[1024],blacklist[1024],pending_pubkeys[1024]; +} LP_RTmetrics; + +int32_t LP_bits256_find(bits256 *list,int32_t num,bits256 val) +{ + int32_t i; + if ( bits256_nonz(val) != 0 ) + { + for (i=0; i= 0 ) + LP_RTmetrics.pending_swaps[ind]++; + return(ind); +} + +int32_t LP_RTmetrics_pendingswaps(bits256 pubkey) +{ + int32_t ind; + if ( (ind= LP_bits256_find(LP_RTmetrics.pending_pubkeys,LP_RTmetrics.numpendings,pubkey)) >= 0 ) + return(LP_RTmetrics.pending_swaps[ind]); + else return(0); +} + +int32_t LP_RTmetrics_avoidtxid(bits256 txid) +{ + return(LP_bits256_find(LP_RTmetrics.avoidtxids,LP_RTmetrics.numavoidtxids,txid)); +} + +int32_t LP_RTmetrics_whitelisted(bits256 pubkey) +{ + return(LP_bits256_find(LP_RTmetrics.whitelist,LP_RTmetrics.numwhitelist,pubkey)); +} + +int32_t LP_RTmetrics_blacklisted(bits256 pubkey) +{ + return(LP_bits256_find(LP_RTmetrics.blacklist,LP_RTmetrics.numblacklist,pubkey)); +} + +void LP_RTmetrics_swapsinfo(char *refbase,char *refrel,cJSON *swaps,int32_t numswaps) +{ + int32_t i; char *base,*rel,*retstr; cJSON *item,*swapjson; bits256 srcpub,destpub; uint64_t aliceid,basesatoshis,relsatoshis; uint32_t requestid,quoteid; double price; + for (i=0; iistrusted > 0 ) + LP_RTmetrics_whitelistadd(pubp->pubkey); + else if ( pubp->istrusted < 0 ) + LP_RTmetrics_blacklistadd(pubp->pubkey); + } futuretime = (uint32_t)time(NULL) + 3600*100; memset(zero.bytes,0,sizeof(zero)); if ( (retstr= LP_statslog_disp(100,futuretime,futuretime,"",zero)) != 0 ) @@ -29,37 +159,110 @@ cJSON *LP_RTmetrics_sort(cJSON *rawasks,int32_t numasks,double maxprice,double r { if ( (swaps= jarray(&numswaps,statsjson,"swaps")) != 0 ) { + printf("LP_RTmetrics_update for (%s)\n",jprint(swaps,0)); if ( numswaps > 0 ) - swaps = jduplicate(swaps); - else swaps = 0; + LP_RTmetrics_swapsinfo(base,rel,swaps,numswaps); } free_json(statsjson); } free(retstr); } - //if ( numswaps == 0 || swaps == 0 ) - return(0); - printf("calc RTmetrics for (%s)\n",jprint(swaps,0)); - /*jadd64bits(item,"aliceid",sp->aliceid); - jaddbits256(item,"src",sp->Q.srchash); - jaddstr(item,"base",sp->Q.srccoin); - jaddnum(item,"basevol",dstr(sp->Q.satoshis)); - jaddbits256(item,"dest",sp->Q.desthash); - jaddstr(item,"rel",sp->Q.destcoin); - jaddnum(item,"relvol",dstr(sp->Q.destsatoshis)); - jaddnum(item,"price",sp->qprice); - jaddnum(item,"requestid",sp->Q.R.requestid); - jaddnum(item,"quoteid",sp->Q.R.quoteid); - */ - array = cJSON_CreateArray(); - for (i=0; i LP_MAXPENDING_SWAPS ) + { + char str[65]; printf("%s has %d pending swaps! which is more than %d\n",bits256_str(str,LP_RTmetrics.pending_pubkeys[i]),LP_RTmetrics.pending_swaps[i],LP_MAXPENDING_SWAPS); + LP_RTmetrics_blacklistadd(LP_RTmetrics.pending_pubkeys[i]); + } + printf("%d pubkeys have pending swaps, whitelist.%d blacklist.%d avoidtxids.%d\n",LP_RTmetrics.numpendings,LP_RTmetrics.numwhitelist,LP_RTmetrics.numblacklist,LP_RTmetrics.numavoidtxids); +} + +double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxprice,double relvolume) +{ + int32_t n; double metric,origmetric = (bestprice / mp->price); + metric = origmetric; + if ( mp->numutxos == 0 || relvolume == 0. || mp->maxvol == 0. || mp->balance == 0. ) + return(metric * 100.); + if ( relvolume < mp->minvol ) + { + metric *= (mp->minvol / relvolume); + } + else if ( relvolume > mp->maxvol ) + { + metric *= (relvolume / mp->maxvol); + } + if ( relvolume < mp->balance/LP_MINVOL ) + { + metric *= (mp->balance / relvolume); + } + else if ( relvolume > mp->balance/mp->numutxos ) + { + metric *= (relvolume / (mp->balance/mp->numutxos)); + } + if ( mp->age > LP_ORDERBOOK_DURATION*0.8 ) + metric *= 2; + else if ( mp->age > 60 ) + metric *= 1.03; + if ( (n= mp->pendingswaps) > 0 ) + while ( n-- > 0 ) + metric *= 1.1; + if ( metric != origmetric ) + printf("price %.8f orig %.8f -> %.8f relvol %.8f min %.8f max %.8f bal %.8f age.%d pend.%d\n",mp->price,origmetric,metric,relvolume,mp->minvol,mp->maxvol,mp->balance,mp->age,mp->pendingswaps); + return(metric); +} + +void LP_RTmetric_calc(struct LP_metricinfo *sortbuf,int32_t ind,cJSON *item,double bestprice,double maxprice,double relvolume,double prevdepth) +{ + sortbuf[ind].pubkey = jbits256(item,"pubkey"); + sortbuf[ind].price = jdouble(item,"price"); + sortbuf[ind].maxvol = jdouble(item,"maxvolume"); + sortbuf[ind].minvol = jdouble(item,"minvolume"); + sortbuf[ind].balance = jdouble(item,"depth") - prevdepth; + sortbuf[ind].numutxos = juint(item,"numutxos"); + sortbuf[ind].age = juint(item,"age"); + sortbuf[ind].ind = ind; + sortbuf[ind].pendingswaps = LP_RTmetrics_pendingswaps(sortbuf[ind].pubkey); + sortbuf[ind].metric = _LP_RTmetric_calc(&sortbuf[ind],bestprice,maxprice,relvolume); +} + +cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,double maxprice,double relvolume) +{ + cJSON *array,*item; int32_t i,num,groupi; double price,prevdepth,bestprice; struct LP_metricinfo *sortbuf; + groupi = -1; + bestprice = 0.; + for (num=i=0; i maxprice ) break; - jaddi(array,jduplicate(item)); + if ( i == 0 ) + bestprice = price; + else if ( price < bestprice*1.01 ) + groupi = i; + num++; } - free_json(swaps); + if ( groupi > 0 ) + { + sortbuf = calloc(groupi+1,sizeof(*sortbuf)); + prevdepth = 0.; + for (i=0; i<=groupi; i++) + { + item = jitem(rawasks,i); + LP_RTmetric_calc(sortbuf,i,item,bestprice,maxprice,relvolume,prevdepth); + prevdepth = jdouble(item,"depth"); + } + revsortds(&sortbuf[0].metric,groupi+1,sizeof(*sortbuf)); + array = cJSON_CreateArray(); + for (i=0; i<=groupi; i++) + { + printf("(%d -> %d) ",i,sortbuf[i].ind); + item = jitem(rawasks,sortbuf[i].ind); + jaddi(array,jduplicate(item)); + } + free(sortbuf); + for (; i pubkeys, reputations, bonds etc. // @@ -96,6 +94,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_bitcoin.c" #include "LP_coins.c" #include "LP_rpc.c" +#include "LP_RTmetrics.c" #include "LP_utxo.c" #include "LP_prices.c" #include "LP_scan.c" @@ -107,7 +106,6 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_utxos.c" #include "LP_forwarding.c" #include "LP_signatures.c" -#include "LP_RTmetrics.c" #include "LP_ordermatch.c" #include "LP_portfolio.c" #include "LP_messages.c" @@ -732,7 +730,7 @@ void LP_pubkeysloop(void *ctx) LP_counter += 100; //printf("LP_pubkeysloop %d\n",LP_counter); LP_notify_pubkeys(ctx,LP_mypubsock); - sleep(60); + sleep(LP_ORDERBOOK_DURATION * .777); } } @@ -771,7 +769,7 @@ void LP_privkeysloop(void *ctx) LP_counter += 1000; //printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); - sleep(60); + sleep(LP_ORDERBOOK_DURATION * .777); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 831bbe44d..31558980d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -656,6 +656,12 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("request.(%s)\n",jprint(argjson,0)); if ( 1 )//LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) { + LP_RTmetrics_update(Q.srccoin,Q.destcoin); + if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) + { + printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); + return(retval); + } printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); LP_listunspent_both(Q.srccoin,Q.coinaddr,0); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) @@ -787,7 +793,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { if ( (rawasks= jarray(&numasks,orderbook,"asks")) != 0 ) { - if ( (asks= LP_RTmetrics_sort(rawasks,numasks,maxprice,dstr(autxo->S.satoshis))) == 0 ) + if ( (asks= LP_RTmetrics_sort(base,autxo->coin,rawasks,numasks,maxprice,dstr(autxo->S.satoshis))) == 0 ) asks = rawasks; for (i=0; i= 0 ) + continue; //printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { @@ -904,6 +912,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } + LP_RTmetrics_update(base,rel); while ( 1 ) { if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs,destpubkey)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index bc05ecb71..c3cd25927 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2349,6 +2349,20 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } + +/*static int _LP_metric_eval(const void *a,const void *b) + { + #define aptr (*(struct LP_metricinfo **)a) + #define bptr (*(struct LP_metricinfo **)b) + if ( bptr->metric > aptr->metric ) + return(1); + else if ( bptr->metric < aptr->metric ) + return(-1); + return(0); + #undef aptr + #undef bptr + }*/ + /*portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b031eeec2..cb3d90a6e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -149,7 +149,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a DL_FOREACH_SAFE(ap->utxos,up,tmp) { //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); - if ( up->spendheight <= 0 ) + if ( up->spendheight <= 0 && LP_RTmetrics_avoidtxid(up->U.txid) < 0 ) { if ( coin->electrum == 0 ) { From 67a0dc12523c68d422c88bc3faa4643c7078c188 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 16:12:53 +0200 Subject: [PATCH 1677/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 2 +- iguana/exchanges/LP_include.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 873195cdf..f0b813a9f 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -237,7 +237,7 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou break; if ( i == 0 ) bestprice = price; - else if ( price < bestprice*1.01 ) + else if ( price < bestprice*LP_RTMETRICS_TOPGROUP ) groupi = i; num++; } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 145bd7cfd..48d38e15a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -39,6 +39,9 @@ void emscripten_usleep(int32_t x); #define ELECTRUM_TIMEOUT 10 #define LP_ELECTRUM_MAXERRORS 3 #define LP_MEMPOOL_TIMEINCR 10 + +// RTmetrics +#define LP_RTMETRICS_TOPGROUP 1.01 #define LP_MAXPENDING_SWAPS 13 #define LP_COMMAND_SENDSOCK NN_PUSH From 30ddc8b1897e12692120eddd823383df79751219 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 16:35:35 +0200 Subject: [PATCH 1678/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 --- iguana/exchanges/LP_stats.c | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7a5afcb82..513b1b93b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,9 +18,6 @@ // LP_nativeDEX.c // marketmaker // -// pricearray? RT metrics -// select oldest utxo first, handles <-> pubkeys, reputations, bonds etc. -// // verify portfolio, interest to KMD withdraw, pricebroadcast loop, trade to pubkey // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index e31cdd6db..1fcea0355 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -191,7 +191,10 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO sp->Apaymentspent = LP_swapstats_txid(lineobj,"Apaymentspent",sp->Apaymentspent); sp->depositspent = LP_swapstats_txid(lineobj,"depositspent",sp->depositspent); if ( (statusstr= jstr(lineobj,"status")) != 0 && strcmp(statusstr,"finished") == 0 ) - sp->finished = juint(lineobj,"timestamp"); + { + if ( (sp->finished= juint(lineobj,"timestamp")) == 0 ) + sp->finished = (uint32_t)time(NULL); + } if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) sp->expired = (uint32_t)time(NULL); return(0); @@ -231,7 +234,6 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj) quoteid = juint(lineobj,"quoteid"); if ( (sp= LP_swapstats_find(aliceid)) != 0 ) { - flag = 1; sp->methodind = methodind; if ( LP_swapstats_update(sp,&Q,lineobj) == 0 ) flag = 1; From 2ded94c9748b895b139a11254a5a78e9f5302a4b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 21:48:17 +0200 Subject: [PATCH 1679/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 27 --------------------------- iguana/exchanges/LP_portfolio.c | 27 +++++++++++++++++++++++++++ iguana/exchanges/LP_rpc.c | 12 ++++++++++++ iguana/exchanges/LP_statemachine.c | 10 ++++++++++ iguana/exchanges/mm.c | 17 ++++++----------- 5 files changed, 55 insertions(+), 38 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 513b1b93b..6102be6dc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -731,33 +731,6 @@ void LP_pubkeysloop(void *ctx) } } -void LP_price_broadcastloop(void *ctx) -{ - struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; - sleep(30); - while ( 1 ) - { - for (baseind=0; baseindsymbol[0] == 0 ) - continue; - for (relind=0; relindsymbol[0] == 0 ) - continue; - if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) - { - //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); - } - } - } - sleep(LP_ORDERBOOK_DURATION * .9); - } -} - void LP_privkeysloop(void *ctx) { sleep(20); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 16f1d65fe..495636a89 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -305,6 +305,33 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP } } +void LP_price_broadcastloop(void *ctx) +{ + struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; + sleep(30); + while ( 1 ) + { + for (baseind=0; baseindsymbol[0] == 0 ) + continue; + for (relind=0; relindsymbol[0] == 0 ) + continue; + if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) + { + //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } + } + } + sleep(LP_ORDERBOOK_DURATION * .9); + } +} + double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d82145479..aeacff432 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -170,6 +170,18 @@ void LP_unspents_mark(char *symbol,cJSON *vins) char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.207.76", "188.174.110.224", "91.235.72.49", "213.144.130.91", "209.222.98.250", "216.155.128.10", "178.33.203.157", "162.243.122.251", "69.163.47.173", "193.151.106.129", "78.94.2.74", "192.3.196.10", "173.33.112.87", "104.198.173.28", "35.184.154.126", "174.140.167.239", "23.88.113.131", "198.71.84.173", "178.150.207.53", "23.88.61.53", "192.157.233.106", "192.157.241.212", "23.89.192.88", "23.89.200.27", "192.157.241.139", "23.89.200.63", "23.89.192.98", "163.172.214.102", "176.9.85.5", "80.150.243.88", "80.150.243.92", "80.150.243.98", "109.70.186.198", "146.148.84.237", "104.155.56.82", "104.197.157.140", "37.48.73.249", "146.148.77.226", "84.57.170.200", "107.161.145.131", "80.150.243.97", "80.150.243.93", "80.150.243.100", "80.150.243.95", "80.150.243.91", "80.150.243.99", "80.150.243.96", "93.231.187.177", "212.237.23.85", "35.158.179.254", "46.36.66.41", "185.170.113.79", "163.172.68.112", "78.47.35.210", "77.90.90.75", "94.177.196.134", "212.237.22.215", "94.177.234.11", "167.160.180.199", "54.68.189.9", "94.159.62.14", "195.181.221.89", "185.33.145.94", "195.181.209.245", "195.181.221.38", "195.181.221.162", "185.33.145.12", "185.33.145.176", "178.79.128.235", "94.177.214.120", "94.177.199.41", "94.177.214.200", "94.177.213.201", "212.237.13.162", "195.181.221.236", "195.181.221.185", "185.28.103.187", "185.33.146.244", "217.61.123.71", "195.181.214.45", "195.181.212.99", "195.181.214.46", "195.181.214.215", "195.181.214.68", "217.61.123.118", "195.181.214.79", "217.61.123.14", "217.61.124.100", "195.181.214.111", "85.255.0.176", "81.2.254.116", "217.61.123.184", "195.181.212.231", "94.177.214.110", "195.181.209.164", "104.129.56.238", "85.255.13.64", "167.160.180.206", "217.61.123.226", "167.160.180.208", "93.186.253.127", "212.237.6.208", "94.177.207.190", "217.61.123.119", "85.255.1.245", "217.61.124.157", "37.59.57.141", "167.160.180.58", "104.223.53.14", "217.61.124.69", "195.181.212.103", "85.255.13.141", "104.207.133.204", "71.90.7.107", "107.150.18.108", "23.94.134.161", "80.150.243.13", "80.150.243.11", "185.81.165.52", "80.150.243.8" }; +cJSON *LP_NXT_redeems() +{ + char url[1024],*retstr; cJSON *retjson=0; + sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getAccountTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); + if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + { + retjson = cJSON_Parse(retstr); + printf("%s\n",retstr); + free(retstr); + } + return(retjson); +} cJSON *LP_assethbla(char *assetid) { diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index c3cd25927..9c11acca4 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2349,6 +2349,16 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } +if ( (0) ) +{ + ep = LP_electrum_info(&already,"BTC","88.198.241.196",50001,IGUANA_MAXPACKETSIZE * 10); + if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) + { + printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); + exit(-1); + } else printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); + electrum_test(); + } /*static int _LP_metric_eval(const void *a,const void *b) { diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 19307baf3..23f1ac62f 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -875,20 +875,15 @@ void LP_main(void *ptr) int main(int argc, const char * argv[]) { - char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; struct electrum_info *ep; + char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; - cJSON *retjson,*loginjson; int32_t i,already; - OS_init(); - if ( (0) ) + cJSON *retjson,*loginjson; int32_t i; + if ( argc == 0 ) { - ep = LP_electrum_info(&already,"BTC","88.198.241.196",50001,IGUANA_MAXPACKETSIZE * 10); - if ( ep != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_dedicatedloop,(void *)ep) != 0 ) - { - printf("error launching LP_dedicatedloop (%s:%u)\n",ep->ipaddr,ep->port); - exit(-1); - } else printf("launched.(%s:%u)\n",ep->ipaddr,ep->port); - electrum_test(); + LP_NXT_redeems(); + return(0); } + OS_init(); sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); From 5885825e4111367b3bafbd282aaecbaec636e5dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 21:55:11 +0200 Subject: [PATCH 1680/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index aeacff432..66735862a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -173,13 +173,13 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 cJSON *LP_NXT_redeems() { char url[1024],*retstr; cJSON *retjson=0; - sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getAccountTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); + sprintf(url,"http://%s:7876/nxt?requestType=getAccountTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { retjson = cJSON_Parse(retstr); printf("%s\n",retstr); free(retstr); - } + } else printf("%s -> null\n",url); return(retjson); } From 0e790dd9a628517b254b8224efd65a79ef824d52 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 21:56:30 +0200 Subject: [PATCH 1681/2732] Test --- iguana/exchanges/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 23f1ac62f..e3c18afb8 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -881,6 +881,7 @@ int main(int argc, const char * argv[]) if ( argc == 0 ) { LP_NXT_redeems(); + sleep(3); return(0); } OS_init(); From 23d5fd762a1d380f0a6216128582fcf686cfe24e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 21:58:08 +0200 Subject: [PATCH 1682/2732] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 66735862a..2817a1488 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -173,7 +173,8 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 cJSON *LP_NXT_redeems() { char url[1024],*retstr; cJSON *retjson=0; - sprintf(url,"http://%s:7876/nxt?requestType=getAccountTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); + printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { retjson = cJSON_Parse(retstr); From 180d53c46c40a433d4c93c02d67cf3469843b688 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 21:59:11 +0200 Subject: [PATCH 1683/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index e3c18afb8..7477b00ab 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -878,7 +878,7 @@ int main(int argc, const char * argv[]) char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; - if ( argc == 0 ) + if ( argc == 1 ) { LP_NXT_redeems(); sleep(3); From cef256a91c63dc3c9d91c5edcb99ccb59a71516f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 22:02:14 +0200 Subject: [PATCH 1684/2732] Test --- crypto777/OS_time.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/OS_time.c b/crypto777/OS_time.c index 03489f03e..b5d2efc09 100755 --- a/crypto777/OS_time.c +++ b/crypto777/OS_time.c @@ -357,7 +357,7 @@ struct tai tai_now() #ifndef DISABLE_LEAPS UTC_ADJUST = -36; #endif - printf("TAINOW.%llu %03.3f UTC.%u vs %u [diff %d]\n",(long long)t.x,t.millis,First_utc,tai2utc(t),UTC_ADJUST); + //printf("TAINOW.%llu %03.3f UTC.%u vs %u [diff %d]\n",(long long)t.x,t.millis,First_utc,tai2utc(t),UTC_ADJUST); } return(t); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2817a1488..d2ed870a9 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -173,7 +173,7 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 cJSON *LP_NXT_redeems() { char url[1024],*retstr; cJSON *retjson=0; - sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { From 6500710c99aa5bec12e01fbd119c57996b8c0854 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 22:18:27 +0200 Subject: [PATCH 1685/2732] Test --- iguana/exchanges/LP_rpc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d2ed870a9..0164028ec 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -172,28 +172,38 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 cJSON *LP_NXT_redeems() { - char url[1024],*retstr; cJSON *retjson=0; + char url[1024],*retstr; int32_t i,numtx; cJSON *item,*array,*retjson=0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { - retjson = cJSON_Parse(retstr); - printf("%s\n",retstr); + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (array= jarray(&numtx,retjson,"transactions")) != 0 ) + { + for (i=0; i null\n",url); + } ; return(retjson); } cJSON *LP_assethbla(char *assetid) { char url[1024],*retstr; int32_t n; cJSON *array,*bid=0,*ask=0,*retjson; - sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getBidOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); + sprintf(url,"http://%s:7876/nxt?requestType=getBidOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { bid = cJSON_Parse(retstr); free(retstr); } - sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getAskOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); + sprintf(url,"http://%s:7876/nxt?requestType=getAskOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { ask = cJSON_Parse(retstr); From 9ec9d651cb5f6087274a53953b9c99c5dbad377e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 22:55:35 +0200 Subject: [PATCH 1686/2732] Test --- iguana/exchanges/LP_rpc.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0164028ec..0340ab102 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -170,9 +170,24 @@ void LP_unspents_mark(char *symbol,cJSON *vins) char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.207.76", "188.174.110.224", "91.235.72.49", "213.144.130.91", "209.222.98.250", "216.155.128.10", "178.33.203.157", "162.243.122.251", "69.163.47.173", "193.151.106.129", "78.94.2.74", "192.3.196.10", "173.33.112.87", "104.198.173.28", "35.184.154.126", "174.140.167.239", "23.88.113.131", "198.71.84.173", "178.150.207.53", "23.88.61.53", "192.157.233.106", "192.157.241.212", "23.89.192.88", "23.89.200.27", "192.157.241.139", "23.89.200.63", "23.89.192.98", "163.172.214.102", "176.9.85.5", "80.150.243.88", "80.150.243.92", "80.150.243.98", "109.70.186.198", "146.148.84.237", "104.155.56.82", "104.197.157.140", "37.48.73.249", "146.148.77.226", "84.57.170.200", "107.161.145.131", "80.150.243.97", "80.150.243.93", "80.150.243.100", "80.150.243.95", "80.150.243.91", "80.150.243.99", "80.150.243.96", "93.231.187.177", "212.237.23.85", "35.158.179.254", "46.36.66.41", "185.170.113.79", "163.172.68.112", "78.47.35.210", "77.90.90.75", "94.177.196.134", "212.237.22.215", "94.177.234.11", "167.160.180.199", "54.68.189.9", "94.159.62.14", "195.181.221.89", "185.33.145.94", "195.181.209.245", "195.181.221.38", "195.181.221.162", "185.33.145.12", "185.33.145.176", "178.79.128.235", "94.177.214.120", "94.177.199.41", "94.177.214.200", "94.177.213.201", "212.237.13.162", "195.181.221.236", "195.181.221.185", "185.28.103.187", "185.33.146.244", "217.61.123.71", "195.181.214.45", "195.181.212.99", "195.181.214.46", "195.181.214.215", "195.181.214.68", "217.61.123.118", "195.181.214.79", "217.61.123.14", "217.61.124.100", "195.181.214.111", "85.255.0.176", "81.2.254.116", "217.61.123.184", "195.181.212.231", "94.177.214.110", "195.181.209.164", "104.129.56.238", "85.255.13.64", "167.160.180.206", "217.61.123.226", "167.160.180.208", "93.186.253.127", "212.237.6.208", "94.177.207.190", "217.61.123.119", "85.255.1.245", "217.61.124.157", "37.59.57.141", "167.160.180.58", "104.223.53.14", "217.61.124.69", "195.181.212.103", "85.255.13.141", "104.207.133.204", "71.90.7.107", "107.150.18.108", "23.94.134.161", "80.150.243.13", "80.150.243.11", "185.81.165.52", "80.150.243.8" }; +cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) +{ + char url[1024],*retstr; cJSON *retjson = 0; + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=%s&transaction=%llu&secretPhrase=%s",method,(long long)txnum,passphrase); + if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + free_json(retjson); + } + free(retstr); + } + return(retjson); +} + cJSON *LP_NXT_redeems() { - char url[1024],*retstr; int32_t i,numtx; cJSON *item,*array,*retjson=0; + char url[1024],*retstr,*recv,*method; uint64_t txnum; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) @@ -184,7 +199,18 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Sun, 29 Oct 2017 22:58:45 +0200 Subject: [PATCH 1687/2732] Test --- iguana/exchanges/LP_rpc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0340ab102..a2aa83348 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -174,11 +174,12 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) { char url[1024],*retstr; cJSON *retjson = 0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=%s&transaction=%llu&secretPhrase=%s",method,(long long)txnum,passphrase); + //printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - free_json(retjson); + } free(retstr); } @@ -207,8 +208,8 @@ cJSON *LP_NXT_redeems() if ( jint(attach,"version.PrunablePlainMessage") == 1 ) method = "getPrunableMessage"; else method = "readMessage"; - msgjson = LP_NXT_message(method,txnum,""); - printf("%d method.(%s) (%s)\n",i,method,jprint(msgjson,0)); + if ( (msgjson= LP_NXT_message(method,txnum,"test")) != 0 ) + printf("%d method.(%s) (%s)\n",i,method,jprint(msgjson,0)); } } } From dd48aaa2f8407d8005bb8e078370a41c26a7b4d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 23:02:28 +0200 Subject: [PATCH 1688/2732] Test --- iguana/exchanges/LP_rpc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a2aa83348..342a0c87a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -174,7 +174,7 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) { char url[1024],*retstr; cJSON *retjson = 0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=%s&transaction=%llu&secretPhrase=%s",method,(long long)txnum,passphrase); - //printf("issue.(%s)\n",url); + printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) @@ -204,12 +204,16 @@ cJSON *LP_NXT_redeems() { if ( (attach= jobj(item,"attachment")) != 0 ) { + printf("(%s)\n",jprint(attach,0)); txnum = j64bits(item,"transaction"); if ( jint(attach,"version.PrunablePlainMessage") == 1 ) method = "getPrunableMessage"; else method = "readMessage"; if ( (msgjson= LP_NXT_message(method,txnum,"test")) != 0 ) + { printf("%d method.(%s) (%s)\n",i,method,jprint(msgjson,0)); + free_json(retjson); + } } } } From 3ae357307f0addaa2f2beb94631a506cc748dbce Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Oct 2017 23:26:58 +0200 Subject: [PATCH 1689/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 342a0c87a..51fe555ab 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -212,7 +212,7 @@ cJSON *LP_NXT_redeems() if ( (msgjson= LP_NXT_message(method,txnum,"test")) != 0 ) { printf("%d method.(%s) (%s)\n",i,method,jprint(msgjson,0)); - free_json(retjson); + free_json(msgjson); } } } From b6c76c9dc4b6fa7a23b2b0d7d9d11e56d8046aca Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 00:13:24 +0200 Subject: [PATCH 1690/2732] Test --- iguana/exchanges/LP_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 51fe555ab..96ad3f394 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -202,6 +202,7 @@ cJSON *LP_NXT_redeems() item = jitem(array,i); if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 ) { + printf("%s\n",jprint(item,0)); if ( (attach= jobj(item,"attachment")) != 0 ) { printf("(%s)\n",jprint(attach,0)); From a7d5ec9c989017a85b45cded059c87915600f07c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 00:15:07 +0200 Subject: [PATCH 1691/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 96ad3f394..9a9d6add3 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -200,9 +200,9 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 00:19:02 +0200 Subject: [PATCH 1692/2732] Test --- iguana/exchanges/LP_rpc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9a9d6add3..df05bd37f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -200,7 +200,7 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 00:35:15 +0200 Subject: [PATCH 1693/2732] Test --- iguana/exchanges/LP_rpc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index df05bd37f..415250cdf 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -188,7 +188,7 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method; uint64_t txnum; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) @@ -203,6 +203,7 @@ cJSON *LP_NXT_redeems() //printf("%d: %s\n",i,jprint(item,0)); if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 ) { + msgstr = jstr(item,"message"); if ( (attach= jobj(item,"attachment")) != 0 ) { printf("(%s)\n",jprint(attach,0)); @@ -212,12 +213,16 @@ cJSON *LP_NXT_redeems() method = "getPrunableMessage"; if ( (msgjson= LP_NXT_message(method,txnum,"test")) != 0 ) { - printf("%d method.(%s) (%s)\n",i,method,jprint(msgjson,0)); + msgstr = jstr(msgjson,"message"); + printf("%d method.(%s) (%s)\n",i,method,msgstr); free_json(msgjson); } } - printf("%d: message.(%s)\n",i,jstr(attach,"message")); + else if ( msgstr == 0 && msgstr[0] == 0 ) + msgstr = jstr(attach,"message"); } + if ( msgstr != 0 ) + printf("%d: message.(%s)\n",i,msgstr); } } } From 735d94744069b4a360f6abfcd82fc0ead0407fd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 00:36:40 +0200 Subject: [PATCH 1694/2732] Test --- iguana/exchanges/LP_rpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 415250cdf..8ddab826c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -199,6 +199,7 @@ cJSON *LP_NXT_redeems() { for (i=0; i Date: Mon, 30 Oct 2017 00:39:19 +0200 Subject: [PATCH 1695/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8ddab826c..ca562a15b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -218,7 +218,7 @@ cJSON *LP_NXT_redeems() printf("%d method.(%s) (%s)\n",i,method,msgstr); } } - else if ( msgstr == 0 && msgstr[0] == 0 ) + else if ( msgstr == 0 || msgstr[0] == 0 ) msgstr = jstr(attach,"message"); } if ( msgstr != 0 ) From 8483ccca4906b1230094dd5fa45c4d466a336bbd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 00:43:59 +0200 Subject: [PATCH 1696/2732] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index ca562a15b..5a896d27a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -207,9 +207,9 @@ cJSON *LP_NXT_redeems() msgstr = jstr(item,"message"); if ( (attach= jobj(item,"attachment")) != 0 ) { - printf("(%s)\n",jprint(attach,0)); txnum = j64bits(item,"transaction"); - if ( jint(attach,"version.PrunablePlainMessage") == 1 ) + printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); + if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) { method = "getPrunableMessage"; if ( (msgjson= LP_NXT_message(method,txnum,"test")) != 0 ) @@ -218,7 +218,7 @@ cJSON *LP_NXT_redeems() printf("%d method.(%s) (%s)\n",i,method,msgstr); } } - else if ( msgstr == 0 || msgstr[0] == 0 ) + if ( msgstr == 0 || msgstr[0] == 0 ) msgstr = jstr(attach,"message"); } if ( msgstr != 0 ) From b8d2d9b6ba17ee47ed3baf576e7eef60f7011ccd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 10:44:26 +0200 Subject: [PATCH 1697/2732] Test --- iguana/exchanges/LP_rpc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5a896d27a..f35a7720f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -200,6 +200,7 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 10:46:51 +0200 Subject: [PATCH 1698/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f35a7720f..fd609c669 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -227,7 +227,7 @@ cJSON *LP_NXT_redeems() if ( msgjson != 0 ) free_json(msgjson); } - if ( txnum == 7256847492742571143LL ) + if ( txnum == calc_nxt64bits("7256847492742571143") ) break; } } From d8b6dc9fe70001edb5df7b1c14a8afb4237565bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 10:55:10 +0200 Subject: [PATCH 1699/2732] Test --- iguana/exchanges/LP_rpc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index fd609c669..12ffb15fc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -188,9 +188,9 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum,assetid,qty; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); - printf("calling (%s)\n",url); + //printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) @@ -200,30 +200,31 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 10:57:13 +0200 Subject: [PATCH 1700/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 12ffb15fc..cac54b8a7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -206,7 +206,7 @@ cJSON *LP_NXT_redeems() if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 && jint(item,"version.AssetTransfer") == 1 ) { txnum = j64bits(item,"transaction"); - assetid = j64bits(item,"17571711292785902558"); + assetid = j64bits(item,"asset"); qty = j64bits(item,"quantityQNT"); msgstr = jstr(item,"message"); if ( (attach= jobj(item,"attachment")) != 0 ) From 3faa099f90e5e22759e34fff25a5d84526a96647 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:00:42 +0200 Subject: [PATCH 1701/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cac54b8a7..f1b04c887 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -202,7 +202,7 @@ cJSON *LP_NXT_redeems() msgjson = 0; txnum = assetid = qty = 0; item = jitem(array,i); - //printf("%d: %s\n",i,jprint(item,0)); + printf("%d: %s\n",i,jprint(item,0)); if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 && jint(item,"version.AssetTransfer") == 1 ) { txnum = j64bits(item,"transaction"); @@ -211,7 +211,7 @@ cJSON *LP_NXT_redeems() msgstr = jstr(item,"message"); if ( (attach= jobj(item,"attachment")) != 0 ) { - //printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); + printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) { method = "getPrunableMessage"; From 78c0f5cd74acf777a8804a5f224406a7ebb19271 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:01:58 +0200 Subject: [PATCH 1702/2732] Test --- iguana/exchanges/LP_rpc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f1b04c887..752492d7c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -202,13 +202,13 @@ cJSON *LP_NXT_redeems() msgjson = 0; txnum = assetid = qty = 0; item = jitem(array,i); - printf("%d: %s\n",i,jprint(item,0)); + txnum = j64bits(item,"transaction"); + assetid = j64bits(item,"asset"); + qty = j64bits(item,"quantityQNT"); + msgstr = jstr(item,"message"); + //printf("%d: %s\n",i,jprint(item,0)); if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 && jint(item,"version.AssetTransfer") == 1 ) { - txnum = j64bits(item,"transaction"); - assetid = j64bits(item,"asset"); - qty = j64bits(item,"quantityQNT"); - msgstr = jstr(item,"message"); if ( (attach= jobj(item,"attachment")) != 0 ) { printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); From 90974e2500f2e46b137cb7e0ee6c76bd6bad173c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:04:35 +0200 Subject: [PATCH 1703/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 752492d7c..6c8fdfce8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -207,9 +207,9 @@ cJSON *LP_NXT_redeems() qty = j64bits(item,"quantityQNT"); msgstr = jstr(item,"message"); //printf("%d: %s\n",i,jprint(item,0)); - if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 && jint(item,"version.AssetTransfer") == 1 ) + if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 ) { - if ( (attach= jobj(item,"attachment")) != 0 ) + if ( (attach= jobj(item,"attachment")) != 0 && jint(item,"version.AssetTransfer") == 1 ) { printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) From ecb9dc99d8b27efb38031ba86d129cbd43a55e08 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:06:27 +0200 Subject: [PATCH 1704/2732] Test --- iguana/exchanges/LP_rpc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 6c8fdfce8..cac54b8a7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -202,16 +202,16 @@ cJSON *LP_NXT_redeems() msgjson = 0; txnum = assetid = qty = 0; item = jitem(array,i); - txnum = j64bits(item,"transaction"); - assetid = j64bits(item,"asset"); - qty = j64bits(item,"quantityQNT"); - msgstr = jstr(item,"message"); //printf("%d: %s\n",i,jprint(item,0)); - if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 ) + if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 && jint(item,"version.AssetTransfer") == 1 ) { - if ( (attach= jobj(item,"attachment")) != 0 && jint(item,"version.AssetTransfer") == 1 ) + txnum = j64bits(item,"transaction"); + assetid = j64bits(item,"asset"); + qty = j64bits(item,"quantityQNT"); + msgstr = jstr(item,"message"); + if ( (attach= jobj(item,"attachment")) != 0 ) { - printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); + //printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) { method = "getPrunableMessage"; From 88816d0134fc083ad41fe7d330bb27c7c5596e6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:07:23 +0200 Subject: [PATCH 1705/2732] Test --- iguana/exchanges/LP_rpc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index cac54b8a7..197857e5c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -188,7 +188,7 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum,assetid,qty; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); //printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) @@ -200,31 +200,30 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 12:10:16 +0200 Subject: [PATCH 1706/2732] Test --- iguana/exchanges/LP_rpc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 197857e5c..879a6d38e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -188,7 +188,7 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr; uint64_t txnum,assetid,qty; int32_t i,numtx; cJSON *item,*attach,*array,*msgjson,*retjson=0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); //printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) @@ -200,15 +200,17 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 12:11:51 +0200 Subject: [PATCH 1707/2732] Test --- iguana/exchanges/LP_rpc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 879a6d38e..be5b82e5e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -209,7 +209,7 @@ cJSON *LP_NXT_redeems() { assetid = j64bits(item,"asset"); qty = j64bits(item,"quantityQNT"); - if ( (attach= jobj(item,"attachment")) != 0 && jint(item,"version.AssetTransfer") == 1 ) + if ( (attach= jobj(item,"attachment")) != 0 && jint(attach,"version.AssetTransfer") == 1 ) { printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) @@ -224,8 +224,7 @@ cJSON *LP_NXT_redeems() if ( msgstr == 0 || msgstr[0] == 0 ) msgstr = jstr(attach,"message"); } - if ( msgstr != 0 ) - printf("%d: message.(%s) <- %.8f %llu\n",i,msgstr,dstr(qty),(long long)assetid); + printf("%d: message.(%s) <- %.8f %llu\n",i,msgstr,dstr(qty),(long long)assetid); if ( msgjson != 0 ) free_json(msgjson); } From 6ff861d056e6ae0e48dd6b798e5683bec858067c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:12:08 +0200 Subject: [PATCH 1708/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index be5b82e5e..33ddbaa01 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -207,10 +207,10 @@ cJSON *LP_NXT_redeems() //printf("%d: %s\n",i,jprint(item,0)); if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 ) { - assetid = j64bits(item,"asset"); - qty = j64bits(item,"quantityQNT"); if ( (attach= jobj(item,"attachment")) != 0 && jint(attach,"version.AssetTransfer") == 1 ) { + assetid = j64bits(attach,"asset"); + qty = j64bits(attach,"quantityQNT"); printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) { From 38b21fca7c0766eb1280f83e96452a5941ecc5f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:13:02 +0200 Subject: [PATCH 1709/2732] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 33ddbaa01..0195d4b2a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -211,7 +211,7 @@ cJSON *LP_NXT_redeems() { assetid = j64bits(attach,"asset"); qty = j64bits(attach,"quantityQNT"); - printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); + //printf("txnum.%llu (%s)\n",(long long)txnum,jprint(attach,0)); if ( (msgstr == 0 || msgstr[0] == 0) && jint(attach,"version.PrunablePlainMessage") == 1 ) { method = "getPrunableMessage"; @@ -224,7 +224,7 @@ cJSON *LP_NXT_redeems() if ( msgstr == 0 || msgstr[0] == 0 ) msgstr = jstr(attach,"message"); } - printf("%d: message.(%s) <- %.8f %llu\n",i,msgstr,dstr(qty),(long long)assetid); + printf("%d: (%s) <- %.8f %llu\n",i,msgstr,dstr(qty),(long long)assetid); if ( msgjson != 0 ) free_json(msgjson); } From d15eab096d6a0bc149a28b0c8caeb53c90b23b0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:14:35 +0200 Subject: [PATCH 1710/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0195d4b2a..be937c126 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -224,7 +224,7 @@ cJSON *LP_NXT_redeems() if ( msgstr == 0 || msgstr[0] == 0 ) msgstr = jstr(attach,"message"); } - printf("%d: (%s) <- %.8f %llu\n",i,msgstr,dstr(qty),(long long)assetid); + printf("%d: (%s) <- %.8f %llu\n",i,msgstr!=0?msgstr:jprint(attach,0),dstr(qty),(long long)assetid); if ( msgjson != 0 ) free_json(msgjson); } From 495ff5e96e37e3b6236a0f437e21f7bb5047f894 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:23:46 +0200 Subject: [PATCH 1711/2732] Test --- iguana/exchanges/LP_portfolio.c | 14 ------------ iguana/exchanges/LP_rpc.c | 40 +++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 495636a89..457a53ef1 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -425,20 +425,6 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf return(nxtkmd); } -static char *assetids[][3] = -{ - { "12071612744977229797", "UNITY", "10000" }, - { "15344649963748848799", "DEX", "1" }, - { "6883271355794806507", "PANGEA", "10000" }, - { "17911762572811467637", "JUMBLR", "10000" }, - { "17083334802666450484", "BET", "10000" }, - { "13476425053110940554", "CRYPTO", "1000" }, - { "6932037131189568014", "HODL", "1" }, - { "3006420581923704757", "SHARK", "10000" }, - { "17571711292785902558", "BOTS", "1" }, - { "10524562908394749924", "MGW", "1" }, -}; - void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *kmdpp,*fiatpp,*nxtpp,*basepp,*relpp; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index be937c126..69f3f9530 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -170,6 +170,36 @@ void LP_unspents_mark(char *symbol,cJSON *vins) char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.207.76", "188.174.110.224", "91.235.72.49", "213.144.130.91", "209.222.98.250", "216.155.128.10", "178.33.203.157", "162.243.122.251", "69.163.47.173", "193.151.106.129", "78.94.2.74", "192.3.196.10", "173.33.112.87", "104.198.173.28", "35.184.154.126", "174.140.167.239", "23.88.113.131", "198.71.84.173", "178.150.207.53", "23.88.61.53", "192.157.233.106", "192.157.241.212", "23.89.192.88", "23.89.200.27", "192.157.241.139", "23.89.200.63", "23.89.192.98", "163.172.214.102", "176.9.85.5", "80.150.243.88", "80.150.243.92", "80.150.243.98", "109.70.186.198", "146.148.84.237", "104.155.56.82", "104.197.157.140", "37.48.73.249", "146.148.77.226", "84.57.170.200", "107.161.145.131", "80.150.243.97", "80.150.243.93", "80.150.243.100", "80.150.243.95", "80.150.243.91", "80.150.243.99", "80.150.243.96", "93.231.187.177", "212.237.23.85", "35.158.179.254", "46.36.66.41", "185.170.113.79", "163.172.68.112", "78.47.35.210", "77.90.90.75", "94.177.196.134", "212.237.22.215", "94.177.234.11", "167.160.180.199", "54.68.189.9", "94.159.62.14", "195.181.221.89", "185.33.145.94", "195.181.209.245", "195.181.221.38", "195.181.221.162", "185.33.145.12", "185.33.145.176", "178.79.128.235", "94.177.214.120", "94.177.199.41", "94.177.214.200", "94.177.213.201", "212.237.13.162", "195.181.221.236", "195.181.221.185", "185.28.103.187", "185.33.146.244", "217.61.123.71", "195.181.214.45", "195.181.212.99", "195.181.214.46", "195.181.214.215", "195.181.214.68", "217.61.123.118", "195.181.214.79", "217.61.123.14", "217.61.124.100", "195.181.214.111", "85.255.0.176", "81.2.254.116", "217.61.123.184", "195.181.212.231", "94.177.214.110", "195.181.209.164", "104.129.56.238", "85.255.13.64", "167.160.180.206", "217.61.123.226", "167.160.180.208", "93.186.253.127", "212.237.6.208", "94.177.207.190", "217.61.123.119", "85.255.1.245", "217.61.124.157", "37.59.57.141", "167.160.180.58", "104.223.53.14", "217.61.124.69", "195.181.212.103", "85.255.13.141", "104.207.133.204", "71.90.7.107", "107.150.18.108", "23.94.134.161", "80.150.243.13", "80.150.243.11", "185.81.165.52", "80.150.243.8" }; +static char *assetids[][3] = +{ + { "12071612744977229797", "UNITY", "10000" }, + { "15344649963748848799", "DEX", "1" }, + { "6883271355794806507", "PANGEA", "10000" }, + { "17911762572811467637", "JUMBLR", "10000" }, + { "17083334802666450484", "BET", "10000" }, + { "13476425053110940554", "CRYPTO", "1000" }, + { "6932037131189568014", "HODL", "1" }, + { "3006420581923704757", "SHARK", "10000" }, + { "17571711292785902558", "BOTS", "1" }, + { "10524562908394749924", "MGW", "1" }, +}; + +uint64_t LP_assetid_mult(char *name,uint64_t assetid) +{ + int32_t i; uint64_t mult = 0; + name[0] = 0; + for (i=0; i Date: Mon, 30 Oct 2017 12:28:01 +0200 Subject: [PATCH 1712/2732] Test --- iguana/exchanges/LP_rpc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 69f3f9530..2da2bb830 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -172,7 +172,9 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 static char *assetids[][3] = { + { "13502152099823770958", "SUPERNETx2", "10000" }, { "12071612744977229797", "UNITY", "10000" }, + { "12071612744977229797", "SUPERNET", "10000" }, { "15344649963748848799", "DEX", "1" }, { "6883271355794806507", "PANGEA", "10000" }, { "17911762572811467637", "JUMBLR", "10000" }, @@ -256,11 +258,11 @@ cJSON *LP_NXT_redeems() if ( msgstr == 0 || msgstr[0] == 0 ) { if ( (encjson= jobj(attach,"encryptedMessage")) != 0 ) - msgstr = jstr(encjson,"data"); + msgstr = "encryptedMessage";//jstr(encjson,"data"); } } mult = LP_assetid_mult(assetname,assetid); - printf("%d: (%s) <- %.8f %8s %llu\n",i,msgstr!=0?msgstr:jprint(attach,0),dstr(qty * mult),assetname,(long long)assetid); + printf("%d: (%s) <- %13.8f %8s %llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)assetid); if ( msgjson != 0 ) free_json(msgjson); } From 0a55ddbe74b09fe6c0e9bc603beaf4f28ab1f39f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:34:10 +0200 Subject: [PATCH 1713/2732] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2da2bb830..f1e840149 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -262,7 +262,8 @@ cJSON *LP_NXT_redeems() } } mult = LP_assetid_mult(assetname,assetid); - printf("%d: (%s) <- %13.8f %8s %llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)assetid); + if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) + printf("%d: (%35s) <- %13.8f %8s %llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)mult); if ( msgjson != 0 ) free_json(msgjson); } From 6a615d56d28ecc5b760057403478b84fe28195e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:34:59 +0200 Subject: [PATCH 1714/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f1e840149..7c5e3b65b 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -263,7 +263,7 @@ cJSON *LP_NXT_redeems() } mult = LP_assetid_mult(assetname,assetid); if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) - printf("%d: (%35s) <- %13.8f %8s %llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)mult); + printf("%d: (%35s) <- %13.8f %8s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); if ( msgjson != 0 ) free_json(msgjson); } From c07113313bab40a7dea1b327dd525b70f55c905e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:39:38 +0200 Subject: [PATCH 1715/2732] Test --- iguana/exchanges/LP_rpc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7c5e3b65b..75515bd4e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -170,20 +170,20 @@ void LP_unspents_mark(char *symbol,cJSON *vins) char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.207.76", "188.174.110.224", "91.235.72.49", "213.144.130.91", "209.222.98.250", "216.155.128.10", "178.33.203.157", "162.243.122.251", "69.163.47.173", "193.151.106.129", "78.94.2.74", "192.3.196.10", "173.33.112.87", "104.198.173.28", "35.184.154.126", "174.140.167.239", "23.88.113.131", "198.71.84.173", "178.150.207.53", "23.88.61.53", "192.157.233.106", "192.157.241.212", "23.89.192.88", "23.89.200.27", "192.157.241.139", "23.89.200.63", "23.89.192.98", "163.172.214.102", "176.9.85.5", "80.150.243.88", "80.150.243.92", "80.150.243.98", "109.70.186.198", "146.148.84.237", "104.155.56.82", "104.197.157.140", "37.48.73.249", "146.148.77.226", "84.57.170.200", "107.161.145.131", "80.150.243.97", "80.150.243.93", "80.150.243.100", "80.150.243.95", "80.150.243.91", "80.150.243.99", "80.150.243.96", "93.231.187.177", "212.237.23.85", "35.158.179.254", "46.36.66.41", "185.170.113.79", "163.172.68.112", "78.47.35.210", "77.90.90.75", "94.177.196.134", "212.237.22.215", "94.177.234.11", "167.160.180.199", "54.68.189.9", "94.159.62.14", "195.181.221.89", "185.33.145.94", "195.181.209.245", "195.181.221.38", "195.181.221.162", "185.33.145.12", "185.33.145.176", "178.79.128.235", "94.177.214.120", "94.177.199.41", "94.177.214.200", "94.177.213.201", "212.237.13.162", "195.181.221.236", "195.181.221.185", "185.28.103.187", "185.33.146.244", "217.61.123.71", "195.181.214.45", "195.181.212.99", "195.181.214.46", "195.181.214.215", "195.181.214.68", "217.61.123.118", "195.181.214.79", "217.61.123.14", "217.61.124.100", "195.181.214.111", "85.255.0.176", "81.2.254.116", "217.61.123.184", "195.181.212.231", "94.177.214.110", "195.181.209.164", "104.129.56.238", "85.255.13.64", "167.160.180.206", "217.61.123.226", "167.160.180.208", "93.186.253.127", "212.237.6.208", "94.177.207.190", "217.61.123.119", "85.255.1.245", "217.61.124.157", "37.59.57.141", "167.160.180.58", "104.223.53.14", "217.61.124.69", "195.181.212.103", "85.255.13.141", "104.207.133.204", "71.90.7.107", "107.150.18.108", "23.94.134.161", "80.150.243.13", "80.150.243.11", "185.81.165.52", "80.150.243.8" }; -static char *assetids[][3] = +static char *assetids[][4] = { - { "13502152099823770958", "SUPERNETx2", "10000" }, - { "12071612744977229797", "UNITY", "10000" }, - { "12071612744977229797", "SUPERNET", "10000" }, - { "15344649963748848799", "DEX", "1" }, - { "6883271355794806507", "PANGEA", "10000" }, - { "17911762572811467637", "JUMBLR", "10000" }, - { "17083334802666450484", "BET", "10000" }, - { "13476425053110940554", "CRYPTO", "1000" }, - { "6932037131189568014", "HODL", "1" }, - { "3006420581923704757", "SHARK", "10000" }, - { "17571711292785902558", "BOTS", "1" }, - { "10524562908394749924", "MGW", "1" }, + { "13502152099823770958", "SUPERNETx2", "10000", "10000" }, + { "12071612744977229797", "UNITY", "10000", "10000" }, + { "12071612744977229797", "SUPERNET", "10000", "10000" }, + { "15344649963748848799", "DEX", "1", "100000000" }, + { "6883271355794806507", "PANGEA", "10000", "10000" }, + { "17911762572811467637", "JUMBLR", "10000", "10000" }, + { "17083334802666450484", "BET", "10000", "10000" }, + { "13476425053110940554", "CRYPTO", "1000", "100000" }, + { "6932037131189568014", "HODL", "1", "100000000" }, + { "3006420581923704757", "SHARK", "10000", "10000" }, + { "17571711292785902558", "BOTS", "1", "100000000" }, + { "10524562908394749924", "MGW", "1", "100000000" }, }; uint64_t LP_assetid_mult(char *name,uint64_t assetid) @@ -194,7 +194,7 @@ uint64_t LP_assetid_mult(char *name,uint64_t assetid) { if ( assetid == calc_nxt64bits(assetids[i][0]) ) { - mult = atoi(assetids[i][2]); + mult = atoi(assetids[i][3]); strcpy(name,assetids[i][1]); break; } @@ -206,7 +206,7 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) { char url[1024],*retstr; cJSON *retjson = 0; sprintf(url,"http://127.0.0.1:7876/nxt?requestType=%s&transaction=%llu&secretPhrase=%s",method,(long long)txnum,passphrase); - printf("issue.(%s)\n",url); + //printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) @@ -263,7 +263,7 @@ cJSON *LP_NXT_redeems() } mult = LP_assetid_mult(assetname,assetid); if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) - printf("%d: (%35s) <- %13.8f %8s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + printf("%-4d: (%35s) <- %13.8f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); if ( msgjson != 0 ) free_json(msgjson); } From f278bd48e9319397c946bd8c6f9fd117a28e82e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 12:47:03 +0200 Subject: [PATCH 1716/2732] Test --- iguana/exchanges/LP_rpc.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 75515bd4e..2559588e7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -173,8 +173,8 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 static char *assetids[][4] = { { "13502152099823770958", "SUPERNETx2", "10000", "10000" }, - { "12071612744977229797", "UNITY", "10000", "10000" }, { "12071612744977229797", "SUPERNET", "10000", "10000" }, + { "12071612744977229797", "UNITY", "10000", "10000" }, { "15344649963748848799", "DEX", "1", "100000000" }, { "6883271355794806507", "PANGEA", "10000", "10000" }, { "17911762572811467637", "JUMBLR", "10000", "10000" }, @@ -186,14 +186,16 @@ static char *assetids[][4] = { "10524562908394749924", "MGW", "1", "100000000" }, }; -uint64_t LP_assetid_mult(char *name,uint64_t assetid) +uint64_t LP_assetid_mult(int32_t *assetindp,char *name,uint64_t assetid) { int32_t i; uint64_t mult = 0; name[0] = 0; + *assetindp = -1; for (i=0; i= 0 ) + totals[ind] += qty * mult; if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) - printf("%-4d: (%35s) <- %13.8f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + printf("%-4d: (%35s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); if ( msgjson != 0 ) free_json(msgjson); } @@ -274,7 +279,13 @@ cJSON *LP_NXT_redeems() free_json(retjson); } free(retstr); - } ; + } + printf("\nTotal redeemed\n"); + for (i=0; i Date: Mon, 30 Oct 2017 12:55:42 +0200 Subject: [PATCH 1717/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2559588e7..eb0dab1e2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -284,7 +284,7 @@ cJSON *LP_NXT_redeems() for (i=0; i Date: Mon, 30 Oct 2017 13:13:03 +0200 Subject: [PATCH 1718/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index e556c1281..445406ec9 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -333,7 +333,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) timestamp = now; if ( timestamp >= pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) { - pubp->timestamp = timestamp; + //pubp->timestamp = timestamp; for (i=0; i Date: Mon, 30 Oct 2017 13:23:05 +0200 Subject: [PATCH 1719/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index cf6f17c56..b8f75fe68 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -509,7 +509,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) memset(zeroes,0,sizeof(zeroes)); if ( memcmp(zeroes,rmd160,sizeof(rmd160)) != 0 ) { - if ( memcmp(rmd160,pubp->rmd160,20) != 0 ) + //if ( memcmp(rmd160,pubp->rmd160,20) != 0 ) { if ( (pubsecpstr= jstr(item,"pubsecp")) != 0 && is_hexstr(pubsecpstr,0) == 66 ) { @@ -545,7 +545,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) printf(" for %s\n",pubsecpstr); } } - } else pubp->timestamp = (uint32_t)time(NULL); + }// else pubp->timestamp = (uint32_t)time(NULL); } } return(retval); From a698243d924478fb7598d01d246e072984934388 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 13:27:54 +0200 Subject: [PATCH 1720/2732] Test --- iguana/exchanges/LP_prices.c | 3 +-- iguana/exchanges/LP_signatures.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 445406ec9..d566f55cf 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1061,10 +1061,9 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { + printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { - if ( (rand() % 5000) == 0 ) - printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->matrix[basepp->ind][relpp->ind] = price; dxblend(&basepp->relvals[relpp->ind],price,0.9); dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b8f75fe68..9f5b3aad2 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -523,13 +523,16 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) decode_hex(sig,siglen,sigstr); if ( _LP_pubkey_sigcheck(sig,siglen,juint(item,"timestamp"),pubp->pubkey,rmd160,pubsecp) == 0 ) { - for (i=0; i<20; i++) - printf("%02x",pubp->rmd160[i]); - memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); - memcpy(pubp->sig,sig,sizeof(pubp->sig)); - pubp->siglen = siglen; - char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + if ( memcmp(rmd160,pubp->rmd160,20) != 0 ) + { + for (i=0; i<20; i++) + printf("%02x",pubp->rmd160[i]); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + memcpy(pubp->sig,sig,sizeof(pubp->sig)); + pubp->siglen = siglen; + char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + } retval = 0; pubp->timestamp = (uint32_t)time(NULL); } else pubp->numerrors++; From aac14e077e221e2c7827477b4fcca0260d9c4cfe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 13:33:38 +0200 Subject: [PATCH 1721/2732] Test --- iguana/exchanges/LP_prices.c | 1 - iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d566f55cf..ad3620691 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -333,7 +333,6 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) timestamp = now; if ( timestamp >= pubp->timestamp && (asks= jarray(&n,obj,"asks")) != 0 ) { - //pubp->timestamp = timestamp; for (i=0; isig,sig,sizeof(pubp->sig)); pubp->siglen = siglen; char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + pubp->timestamp = (uint32_t)time(NULL); } retval = 0; - pubp->timestamp = (uint32_t)time(NULL); } else pubp->numerrors++; } } From b84513a92e3dd132bc84426849c5076721cccd51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 13:56:00 +0200 Subject: [PATCH 1722/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_prices.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6102be6dc..64d1214c0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -284,14 +284,14 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int #ifdef FROM_JS printf("%s RECV.(%s)\n",typestr,(char *)ptr); #endif - cJSON *recvjson; //char *mstr,*cstr; + cJSON *recvjson; char *mstr,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { - /*if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && + if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { printf("%s RECV.(%s)\n",typestr,(char *)ptr); - }*/ + } safecopy(methodstr,jstr(recvjson,"method"),sizeof(methodstr)); free_json(recvjson); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ad3620691..2e9ab63f1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1060,6 +1060,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { + if ( (rand() % 100) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { From 33b40cbfa88178037522dee79f543bbd1920f6eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 14:02:32 +0200 Subject: [PATCH 1723/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 64d1214c0..75a8468df 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -284,11 +284,10 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int #ifdef FROM_JS printf("%s RECV.(%s)\n",typestr,(char *)ptr); #endif - cJSON *recvjson; char *mstr,*cstr; + cJSON *recvjson; char *mstr;//,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { - if ( (mstr= jstr(recvjson,"method")) != 0 && strcmp(mstr,"uitem") == 0 && - (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) + if ( (mstr= jstr(recvjson,"method")) != 0 )//&& strcmp(mstr,"uitem") == 0 && (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { printf("%s RECV.(%s)\n",typestr,(char *)ptr); } From cb2075379c8cb15a0ed1b540d09c6cb64c0ed675 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 14:07:11 +0200 Subject: [PATCH 1724/2732] Test --- iguana/exchanges/LP_portfolio.c | 6 +++++- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 457a53ef1..4d4ef3485 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -266,6 +266,7 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP_priceinfo *relpp,double price,char *refbase,char *refrel) { + static uint32_t lasttime; double margin,minprice,newprice,oppomargin,factor,offset; double bid,ask; int32_t changed; margin = basepp->margins[relpp->ind]; oppomargin = relpp->margins[basepp->ind]; @@ -298,8 +299,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); //printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); - if ( changed != 0 ) + if ( changed != 0 || time(NULL) > lasttime+LP_ORDERBOOK_DURATION*.777) + { + lasttime = (uint32_t)time(NULL); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,newprice); + } } } } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2e9ab63f1..6228e6e9a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -487,7 +487,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) if ( base != 0 && rel != 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) + if ( fabs(basepp->myprices[relpp->ind] - price)/price > 0.001 ) *changedp = 1; basepp->myprices[relpp->ind] = price; // ask //printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); From 50aedf190a300663cf37ecf81ad73cff8477c499 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 14:10:42 +0200 Subject: [PATCH 1725/2732] Test --- iguana/exchanges/LP_commands.c | 5 +++-- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ade9ae58c..e64569763 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -503,11 +503,12 @@ stop()\n\ return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"wantnotify") == 0 ) { - bits256 pub; + bits256 pub; static uint32_t lastnotify; pub = jbits256(argjson,"pub"); //char str[65]; printf("got wantnotify.(%s) vs %s\n",jprint(argjson,0),bits256_str(str,G.LP_mypub25519)); - if ( bits256_cmp(pub,G.LP_mypub25519) == 0 ) + if ( bits256_cmp(pub,G.LP_mypub25519) == 0 && time(NULL) > lastnotify+30 ) { + lastnotify = (uint32_t)time(NULL); printf("wantnotify for me!\n"); LP_notify_pubkeys(ctx,LP_mypubsock); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 18b74acad..35ade4e60 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -587,7 +587,7 @@ void LP_smartutxos_push(struct iguana_info *coin) struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; if ( coin->smartaddr[0] == 0 ) return; - LP_notify_pubkeys(coin->ctx,LP_mypubsock); + //LP_notify_pubkeys(coin->ctx,LP_mypubsock); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { memset(zero.bytes,0,sizeof(zero)); From 8daa45db6cd5eaf49648ee7245aa5ff2736770d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 14:17:16 +0200 Subject: [PATCH 1726/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 75a8468df..34315bed6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -279,7 +279,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { methodstr[0] = 0; - if ( 1 ) + if ( 0 ) { #ifdef FROM_JS printf("%s RECV.(%s)\n",typestr,(char *)ptr); From 94a36855ed0011aadafaf5011260003578353812 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 14:30:01 +0200 Subject: [PATCH 1727/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 +------ iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_portfolio.c | 27 ------------------------- iguana/exchanges/LP_statemachine.c | 32 ++++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 34315bed6..884fff9d5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,7 +18,7 @@ // LP_nativeDEX.c // marketmaker // -// verify portfolio, interest to KMD withdraw, pricebroadcast loop, trade to pubkey +// verify portfolio, interest to KMD withdraw, pricebroadcast loop // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -1010,11 +1010,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_price_broadcastloop,(void *)ctx) != 0 ) - { - printf("error launching LP_swapsloop for port.%u\n",myport); - exit(-1); - } int32_t nonz; while ( 1 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 31558980d..d33c757d0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -853,7 +853,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i if ( *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); int32_t changed; - LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); + //LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 4d4ef3485..e7e3a5c10 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -309,33 +309,6 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP } } -void LP_price_broadcastloop(void *ctx) -{ - struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; - sleep(30); - while ( 1 ) - { - for (baseind=0; baseindsymbol[0] == 0 ) - continue; - for (relind=0; relindsymbol[0] == 0 ) - continue; - if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) - { - //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); - } - } - } - sleep(LP_ORDERBOOK_DURATION * .9); - } -} - double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 9c11acca4..ae640364e 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2219,6 +2219,38 @@ if ( 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"") LP_utxo_clientpublish(utxo); } }*/ +void LP_price_broadcastloop(void *ctx) +{ + struct LP_priceinfo *basepp,*relpp; double price; int32_t baseind,relind; + sleep(30); + while ( 1 ) + { + for (baseind=0; baseindsymbol[0] == 0 ) + continue; + for (relind=0; relindsymbol[0] == 0 ) + continue; + if ( basepp != 0 && relpp != 0 && (price= relpp->myprices[basepp->ind]) > SMALLVAL) + { + //printf("automated price broadcast %s/%s %.8f\n",relpp->symbol,basepp->symbol,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } + } + } + sleep(LP_ORDERBOOK_DURATION * .9); + } +} + +if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_price_broadcastloop,(void *)ctx) != 0 ) +{ + printf("error launching LP_swapsloop for port.%u\n",myport); + exit(-1); +} #ifdef oldway struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) From 9be726148e96f829a9b6e065ea75b5e8685b840f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 14:47:15 +0200 Subject: [PATCH 1728/2732] Test --- iguana/exchanges/LP_include.h | 2 + iguana/exchanges/LP_network.c | 58 ++--------------------- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 4 +- iguana/exchanges/LP_statemachine.c | 76 +++++++++++++++++++++++++++++- 5 files changed, 86 insertions(+), 56 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 48d38e15a..65f7171ae 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -34,6 +34,8 @@ void emscripten_usleep(int32_t x); #endif //#define LP_STRICTPEERS +#define LP_BARTERDEX_VERSION 100 + #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 10 #define ELECTRUM_TIMEOUT 10 diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a27fa7fc3..56f5456b5 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -107,7 +107,7 @@ char *nanomsg_transportname2(int32_t bindflag,char *str,char *ipaddr,uint16_t po return(str); } -int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) +/*int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) { int32_t sentbytes; if ( sock < 0 ) @@ -123,7 +123,7 @@ int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) if ( freeflag != 0 ) free(msg); return(sentbytes); -} +}*/ int32_t LP_sockcheck(int32_t sock) { @@ -282,32 +282,7 @@ void queue_loop(void *arg) void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) { int32_t maxind,peerind = 0; //sentbytes, - if ( sock0 >= 0 || sock1 >= 0 ) - { -/* if ( sock0 >= 0 && LP_sockcheck(sock0) > 0 ) - { - if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) - printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); - else - { -printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); - sock0 = -1; - } - } - if ( sock1 >= 0 && LP_sockcheck(sock1) > 0 ) - { - if ( (sentbytes= nn_send(sock1,msg,msglen,0)) != msglen ) - printf("_LP_queuesend1 sent %d instead of %d\n",sentbytes,msglen); - else - { -printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); - sock1 = -1; - } - } - if ( sock0 < 0 && sock1 < 0 ) - return;*/ - } - else + if ( sock0 < 0 && sock1 < 0 ) { if ( (maxind= LP_numpeers()) > 0 ) peerind = (rand() % maxind) + 1; @@ -326,19 +301,10 @@ printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) { - //struct iguana_info *coin; int32_t flag=0,socks[2]; portable_mutex_lock(&LP_networkmutex); if ( pubsock >= 0 ) - { - //socks[0] = socks[1] = -1; - //if ( rel != 0 && rel[0] != 0 && (coin= LP_coinfind(rel)) != 0 && coin->bussock >= 0 ) - // socks[flag++] = coin->bussock; - //if ( base != 0 && base[0] != 0 && (coin= LP_coinfind(base)) != 0 && coin->bussock >= 0 ) - // socks[flag++] = coin->bussock; - //if ( flag == 0 && pubsock >= 0 ) - _LP_queuesend(crc32,pubsock,-1,msg,msglen,0); - //else _LP_queuesend(socks[0],socks[1],msg,msglen,0); - } else _LP_queuesend(crc32,-1,-1,msg,msglen,1); + _LP_queuesend(crc32,pubsock,-1,msg,msglen,0); + else _LP_queuesend(crc32,-1,-1,msg,msglen,1); portable_mutex_unlock(&LP_networkmutex); } @@ -362,21 +328,7 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON // add signature here msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; -#ifdef FROM_JS - int32_t sentbytes,sock,peerind,maxind; - if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind) + 1; - else peerind = 1; - sock = LP_peerindsock(&peerind); - if ( sock >= 0 ) - { - if ( (sentbytes= nn_send(sock,msg,msglen,0)) != msglen ) - printf("LP_send sent %d instead of %d\n",sentbytes,msglen); - else printf("sent %d bytes of %d to sock.%d\n",sentbytes,msglen,sock); - } else printf("couldnt get valid sock\n"); -#else LP_queuesend(crc32,-1,base,rel,msg,msglen); -#endif } else LP_queuesend(crc32,pubsock,base,rel,msg,msglen); free(msg); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d33c757d0..1ed257db0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -852,7 +852,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i free(utxos); if ( *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); - int32_t changed; + //int32_t changed; //LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6228e6e9a..fca6902a2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -698,13 +698,15 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d void LP_pubkeys_query() { + static uint32_t lasttime; uint8_t zeroes[20]; bits256 zero; cJSON *reqjson; struct LP_pubkeyinfo *pubp=0,*tmp; memset(zero.bytes,0,sizeof(zero)); memset(zeroes,0,sizeof(zeroes)); HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { - if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) + if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 && time(NULL) > lasttime+30 ) { + lasttime = (uint32_t)time(NULL); reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index ae640364e..35b01f1cc 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2245,13 +2245,87 @@ void LP_price_broadcastloop(void *ctx) sleep(LP_ORDERBOOK_DURATION * .9); } } +#ifdef FROM_JS +int32_t sentbytes,sock,peerind,maxind; +if ( (maxind= LP_numpeers()) > 0 ) +peerind = (rand() % maxind) + 1; +else peerind = 1; +sock = LP_peerindsock(&peerind); +if ( sock >= 0 ) +{ + if ( (sentbytes= nn_send(sock,msg,msglen,0)) != msglen ) + printf("LP_send sent %d instead of %d\n",sentbytes,msglen); + else printf("sent %d bytes of %d to sock.%d\n",sentbytes,msglen,sock); + } else printf("couldnt get valid sock\n"); +#else + +void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) +{ + int32_t maxind,peerind = 0; //sentbytes, + if ( sock0 >= 0 || sock1 >= 0 ) + { + /* if ( sock0 >= 0 && LP_sockcheck(sock0) > 0 ) + { + if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) + printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); + else + { + printf("Q sent %u msglen.%d (%s)\n",crc32,msglen,msg); + sock0 = -1; + } + } + if ( sock1 >= 0 && LP_sockcheck(sock1) > 0 ) + { + if ( (sentbytes= nn_send(sock1,msg,msglen,0)) != msglen ) + printf("_LP_queuesend1 sent %d instead of %d\n",sentbytes,msglen); + else + { + printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); + sock1 = -1; + } + } + if ( sock0 < 0 && sock1 < 0 ) + return;*/ + } + else + { + if ( (maxind= LP_numpeers()) > 0 ) + peerind = (rand() % maxind) + 1; + else peerind = 1; + sock0 = LP_peerindsock(&peerind); + if ( (maxind= LP_numpeers()) > 0 ) + peerind = (rand() % maxind) + 1; + else peerind = 1; + sock1 = LP_peerindsock(&peerind); + } + if ( sock0 >= 0 ) + _LP_sendqueueadd(crc32,sock0,msg,msglen,needack * peerind); + if ( sock1 >= 0 ) + _LP_sendqueueadd(crc32,sock1,msg,msglen,needack); +} if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_price_broadcastloop,(void *)ctx) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - +void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) +{ + //struct iguana_info *coin; int32_t flag=0,socks[2]; + portable_mutex_lock(&LP_networkmutex); + if ( pubsock >= 0 ) + { + //socks[0] = socks[1] = -1; + //if ( rel != 0 && rel[0] != 0 && (coin= LP_coinfind(rel)) != 0 && coin->bussock >= 0 ) + // socks[flag++] = coin->bussock; + //if ( base != 0 && base[0] != 0 && (coin= LP_coinfind(base)) != 0 && coin->bussock >= 0 ) + // socks[flag++] = coin->bussock; + //if ( flag == 0 && pubsock >= 0 ) + _LP_queuesend(crc32,pubsock,-1,msg,msglen,0); + //else _LP_queuesend(socks[0],socks[1],msg,msglen,0); + } else _LP_queuesend(crc32,-1,-1,msg,msglen,1); + portable_mutex_unlock(&LP_networkmutex); +} #ifdef oldway struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) { From 34e6c6021171bde50370087299bc21aaa08413fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 15:19:34 +0200 Subject: [PATCH 1729/2732] Limit api from port --- iguana/exchanges/LP_commands.c | 34 ++-------------------------- iguana/exchanges/LP_statemachine.c | 32 +++++++++++++++++++++++++- iguana/exchanges/stats.c | 36 ++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 33 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e64569763..a9b217906 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -561,44 +561,14 @@ stop()\n\ } retstr = clonestr("{\"result\":\"success\"}"); } - //else if ( strcmp(method,"checktxid") == 0 ) - // retstr = LP_spentcheck(argjson); - //else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) - // return(clonestr("{\"result\":\"at least one of coins disabled\"}")); - //else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) - // retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); else // psock requests/response { if ( IAMLP != 0 ) { - /*if ( strcmp(method,"broadcast") == 0 ) - { - bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; - if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) - { - Broadcaststr = jprint(reqjson,0); - if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) - { - cipherlen = (int32_t)strlen(cipherstr) >> 1; - if ( cipherlen <= sizeof(cipher) ) - { - decode_hex(cipher,cipherlen,cipherstr); - LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,base,rel,cipher,cipherlen); - } else retstr = clonestr("{\"error\":\"cipher too big\"}"); - } - else - { - memset(zero.bytes,0,sizeof(zero)); - //printf("broadcast.(%s)\n",Broadcaststr); - LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); - } - retstr = clonestr("{\"result\":\"success\"}"); - } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); - } - else*/ if ( strcmp(method,"psock") == 0 ) - { + if ( strcmp(method,"psock") == 0 ) + { if ( myipaddr == 0 || myipaddr[0] == 0 || strcmp(myipaddr,"127.0.0.1") == 0 ) { if ( LP_mypeer != 0 ) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 35b01f1cc..c14c557ee 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2245,7 +2245,37 @@ void LP_price_broadcastloop(void *ctx) sleep(LP_ORDERBOOK_DURATION * .9); } } -#ifdef FROM_JS +//else if ( strcmp(method,"checktxid") == 0 ) +// retstr = LP_spentcheck(argjson); +//else if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) +// return(clonestr("{\"result\":\"at least one of coins disabled\"}")); +//else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) +// retstr = clonestr("{\"result\":\"coin is disabled\"}"); +/*if ( strcmp(method,"broadcast") == 0 ) + { + bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; + if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) + { + Broadcaststr = jprint(reqjson,0); + if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) + { + cipherlen = (int32_t)strlen(cipherstr) >> 1; + if ( cipherlen <= sizeof(cipher) ) + { + decode_hex(cipher,cipherlen,cipherstr); + LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,base,rel,cipher,cipherlen); + } else retstr = clonestr("{\"error\":\"cipher too big\"}"); + } + else + { + memset(zero.bytes,0,sizeof(zero)); + //printf("broadcast.(%s)\n",Broadcaststr); + LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); + } + retstr = clonestr("{\"result\":\"success\"}"); + } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); + } + else*/ #ifdef FROM_JS int32_t sentbytes,sock,peerind,maxind; if ( (maxind= LP_numpeers()) > 0 ) peerind = (rand() % maxind) + 1; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 3a76f3e48..2ff62895d 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -30,6 +30,24 @@ #include "DEXstats.h" char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port); +char *stats_validmethods[] = +{ + "getprices", "listunspent", "notify", "getpeers", "uitem", // from issue_ + "orderbook", "help", "getcoins", "pricearray", "balance" +}; + +int32_t LP_valid_remotemethod(cJSON *argjson) +{ + char *method; int32_t i; + if ( (method= jstr(argjson,"method")) != 0 ) + { + for (i=0; i 0 ) + { + if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) + { + if ( (retitem= cJSON_Parse(retstr)) != 0 ) + jaddi(retarray,retitem); + free(retstr); + } + } else retstr = clonestr("{\"error\":\"invalid remote method\"}"); +#else if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) { if ( (retitem= cJSON_Parse(retstr)) != 0 ) jaddi(retarray,retitem); free(retstr); } +#endif //printf("(%s) {%s} -> (%s) postflag.%d (%s)\n",urlstr,jprint(argjson,0),cJSON_Print(json),*postflagp,retstr); } free_json(origargjson); @@ -516,7 +546,13 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po //printf("ARGJSON.(%s)\n",jprint(arg,0)); if ( userpass != 0 && jstr(arg,"userpass") == 0 ) jaddstr(arg,"userpass",userpass); +#ifdef FROM_MARKETMAKER + if ( strcmp(remoteaddr,"127.0.0.1") == 0 || LP_valid_remotemethod(arg) > 0 ) + retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port); + else retstr = clonestr("{\"error\":\"invalid remote method\"}"); +#else retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port); +#endif } free_json(argjson); free_json(json); From 60b88cd1ddf4a8abde5b1026c5e8549bb965c589 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 15:57:04 +0200 Subject: [PATCH 1730/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 2 +- iguana/exchanges/LP_include.h | 8 ++++---- iguana/exchanges/LP_network.c | 24 +++++++++++++++++++++--- iguana/exchanges/LP_prices.c | 13 ++++++++----- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index f0b813a9f..ad23b851e 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -123,7 +123,7 @@ void LP_RTmetrics_swapsinfo(char *refbase,char *refrel,cJSON *swaps,int32_t nums quoteid = juint(item,"quoteid"); LP_RTmetrics_pendingswap(srcpub); LP_RTmetrics_pendingswap(destpub); - if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) + if ( 0 && (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) // no need for this { if ( (swapjson= cJSON_Parse(retstr)) != 0 ) { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 65f7171ae..815b7ad34 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -34,7 +34,7 @@ void emscripten_usleep(int32_t x); #endif //#define LP_STRICTPEERS -#define LP_BARTERDEX_VERSION 100 +#define LP_BARTERDEX_VERSION 0 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 10 @@ -313,13 +313,13 @@ struct basilisk_swap }; -#define LP_MAXPRICEINFOS 1024 +#define LP_MAXPRICEINFOS 256 struct LP_pubkeyinfo { UT_hash_handle hh; bits256 pubkey; - double matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; - uint32_t timestamp,numerrors; + float matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; + uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS],timestamp,numerrors; int32_t istrusted; uint8_t rmd160[20],sig[65],pubsecp[33],siglen; }; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 56f5456b5..41d514078 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -147,17 +147,32 @@ int32_t LP_Qenqueued,LP_Qerrors,LP_Qfound; void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; - ptr = calloc(1,sizeof(*ptr) + msglen); + ptr = calloc(1,sizeof(*ptr) + msglen + sizeof(bits256)); ptr->crc32 = crc32; ptr->sock = sock; ptr->peerind = peerind; - ptr->msglen = msglen; - memcpy(ptr->msg,msg,msglen); + ptr->msglen = (int32_t)(msglen + sizeof(bits256)); + memcpy(ptr->msg,msg,msglen); // sizeof(bits256) at the end all zeroes DL_APPEND(LP_Q,ptr); LP_Qenqueued++; //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); } +bits256 LP_calc_magic(uint8_t *msg,int32_t len) +{ + bits256 magic,hash,pubkey,shared; + vcalc_sha256(0,hash.bytes,msg,len); + while ( 1 ) + { + magic = rand256(1); + pubkey = curve25519(magic,curve25519_basepoint9()); + shared = curve25519(magic,pubkey); + if ( shared.bytes[1] == LP_BARTERDEX_VERSION ) + break; + } + return(magic); +} + int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { static uint32_t crcs[1024]; static unsigned long dup,total; @@ -228,6 +243,9 @@ void queue_loop(void *arg) { if ( LP_sockcheck(ptr->sock) > 0 ) { + bits256 magic; + magic = LP_calc_magic(ptr->msg,(int32_t)(ptr->msglen - sizeof(bits256))); + memcpy(&ptr->msg[ptr->msglen - sizeof(bits256)],&magic,sizeof(magic)); if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); ptr->sock = -1; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index fca6902a2..aadb119ee 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -343,8 +343,9 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { - //char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); + char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; + pubp->timestamps[basepp->ind][relid] = timestamp; if ( (relpp= LP_priceinfofind(rel)) != 0 ) { dxblend(&basepp->relvals[relpp->ind],askprice,0.9); @@ -494,9 +495,10 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) //relpp->myprices[basepp->ind] = (1. / price); // bid if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) { + pubp->timestamp = (uint32_t)time(NULL); pubp->matrix[basepp->ind][relpp->ind] = price; + pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); - pubp->timestamp = (uint32_t)time(NULL); } return(0); } else return(-1); @@ -739,7 +741,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); minsatoshis = maxsatoshis = n = 0; ap = 0; - if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL ) + if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamps[baseid][relid] >= oldest ) { balance = 0; if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) @@ -1063,14 +1065,15 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { if ( (rand() % 100) == 0 ) - printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); + printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); + pubp->timestamp = (uint32_t)time(NULL); if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { pubp->matrix[basepp->ind][relpp->ind] = price; + pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; dxblend(&basepp->relvals[relpp->ind],price,0.9); dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); } - pubp->timestamp = (uint32_t)time(NULL); } else printf("error finding pubkey entry %s, ok if rare\n",bits256_str(str,pubkey)); } //else if ( (rand() % 100) == 0 ) From 4d59cdbb8e9b93e3244b35a775fcffa8f3b455d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 15:59:09 +0200 Subject: [PATCH 1731/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index aadb119ee..b13607477 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1064,7 +1064,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - if ( (rand() % 100) == 0 ) + //if ( (rand() % 100) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->timestamp = (uint32_t)time(NULL); if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) From 9fdd532e472cbdc17871f5b68adc766cba9fb32d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 15:59:44 +0200 Subject: [PATCH 1732/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b13607477..b2df04c4a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -755,7 +755,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * } //printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,balance)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamps[baseid][relid],balance)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; From f7cfff0a6d19aa79b9d41ee701d3fb3ff4dc43fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:07:56 +0200 Subject: [PATCH 1733/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index e7e3a5c10..c67cda50a 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -298,7 +298,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); - //printf("changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); + //printf("autoprice changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); if ( changed != 0 || time(NULL) > lasttime+LP_ORDERBOOK_DURATION*.777) { lasttime = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b2df04c4a..90159811e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -343,7 +343,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { - char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); + //char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; pubp->timestamps[basepp->ind][relid] = timestamp; if ( (relpp= LP_priceinfofind(rel)) != 0 ) From 9b57afb323d7d5af081c69fb980dffe12c219a38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:20:59 +0200 Subject: [PATCH 1734/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ iguana/exchanges/LP_network.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 884fff9d5..1a4cd79d3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -299,6 +299,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int else printf("%s got recv.%d\n",typestr,recvlen); #endif double millis = OS_milliseconds(); + if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) + if ( LP_magic_check(ptr,recvlen) < 0 ) + printf("magic check error\n"); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 41d514078..b8d973f49 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -166,13 +166,29 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) { magic = rand256(1); pubkey = curve25519(magic,curve25519_basepoint9()); - shared = curve25519(magic,pubkey); + shared = curve25519(hash,pubkey); if ( shared.bytes[1] == LP_BARTERDEX_VERSION ) break; } return(magic); } +int32_t LP_magic_check(uint8_t *msg,int32_t recvlen) +{ + bits256 magic,hash,pubkey,shared; + recvlen -= sizeof(bits256); + if ( recvlen > 0 ) + { + vcalc_sha256(0,hash.bytes,msg,recvlen); + memcpy(magic.bytes,&msg[recvlen],sizeof(magic)); + pubkey = curve25519(magic,curve25519_basepoint9()); + shared = curve25519(hash,pubkey); + printf("shared.[1] = %d\n",shared.bytes[1]); + return(shared.bytes[1] == LP_BARTERDEX_VERSION); + } + return(-1); +} + int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { static uint32_t crcs[1024]; static unsigned long dup,total; From bae8b6f912b929657ebde41e048f46dc6e05674c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:26:35 +0200 Subject: [PATCH 1735/2732] Test --- iguana/exchanges/LP_network.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index b8d973f49..2e211c348 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -160,7 +160,7 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in bits256 LP_calc_magic(uint8_t *msg,int32_t len) { - bits256 magic,hash,pubkey,shared; + static uint32_t maxn; bits256 magic,hash,pubkey,shared; int32_t n = 0; vcalc_sha256(0,hash.bytes,msg,len); while ( 1 ) { @@ -169,6 +169,12 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) shared = curve25519(hash,pubkey); if ( shared.bytes[1] == LP_BARTERDEX_VERSION ) break; + n++; + } + if ( n > maxn ) + { + printf("LP_calc_magic maxn.%d <- %d\n",maxn,n); + maxn = n; } return(magic); } From fdc392319c5432104ef13c0b6c78004935015659 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:28:38 +0200 Subject: [PATCH 1736/2732] Test --- iguana/exchanges/LP_network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2e211c348..74779da5d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -160,7 +160,8 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in bits256 LP_calc_magic(uint8_t *msg,int32_t len) { - static uint32_t maxn; bits256 magic,hash,pubkey,shared; int32_t n = 0; + static uint32_t maxn; bits256 magic,hash,pubkey,shared; int32_t n = 0; double millis; + millis = OS_milliseconds(); vcalc_sha256(0,hash.bytes,msg,len); while ( 1 ) { @@ -171,6 +172,7 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) break; n++; } + printf("millis %.3f\n",OS_milliseconds() - millis); if ( n > maxn ) { printf("LP_calc_magic maxn.%d <- %d\n",maxn,n); From 8ec4667f21de6a551d2002ba53a89898638f9bc3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:39:13 +0200 Subject: [PATCH 1737/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_network.c | 37 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 815b7ad34..626c5b456 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -35,6 +35,7 @@ void emscripten_usleep(int32_t x); //#define LP_STRICTPEERS #define LP_BARTERDEX_VERSION 0 +#define LP_MAGICBITS 10 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 10 diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 74779da5d..9be81c94a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -158,41 +158,52 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); } +uint32_t _LP_magic_check(bits256 hash,bits256 magic) +{ + bits256 pubkey,shared; + pubkey = curve25519(magic,curve25519_basepoint9()); + shared = curve25519(hash,pubkey); + return(shared.uints[1] & ~(1 << LP_MAGICBITS)); +} + bits256 LP_calc_magic(uint8_t *msg,int32_t len) { - static uint32_t maxn; bits256 magic,hash,pubkey,shared; int32_t n = 0; double millis; + static uint32_t maxn,counter; static double sum; + bits256 magic,hash; int32_t n = 0; double millis; millis = OS_milliseconds(); vcalc_sha256(0,hash.bytes,msg,len); while ( 1 ) { magic = rand256(1); - pubkey = curve25519(magic,curve25519_basepoint9()); - shared = curve25519(hash,pubkey); - if ( shared.bytes[1] == LP_BARTERDEX_VERSION ) + if ( _LP_magic_check(hash,magic) == LP_BARTERDEX_VERSION ) break; n++; } - printf("millis %.3f\n",OS_milliseconds() - millis); - if ( n > maxn ) + sum += (OS_milliseconds() - millis); + counter++; + if ( n > maxn || (rand() % 100) == 0 ) { - printf("LP_calc_magic maxn.%d <- %d\n",maxn,n); - maxn = n; + if ( n > maxn ) + { + printf("LP_calc_magic maxn.%d <- %d\n",maxn,n); + maxn = n; + } + printf("millis %.3f ave %.3f\n",OS_milliseconds() - millis,sum/counter); } return(magic); } int32_t LP_magic_check(uint8_t *msg,int32_t recvlen) { - bits256 magic,hash,pubkey,shared; + bits256 magic,hash; uint32_t val; recvlen -= sizeof(bits256); if ( recvlen > 0 ) { vcalc_sha256(0,hash.bytes,msg,recvlen); memcpy(magic.bytes,&msg[recvlen],sizeof(magic)); - pubkey = curve25519(magic,curve25519_basepoint9()); - shared = curve25519(hash,pubkey); - printf("shared.[1] = %d\n",shared.bytes[1]); - return(shared.bytes[1] == LP_BARTERDEX_VERSION); + val = _LP_magic_check(hash,magic); + printf("magicval = %d\n",val); + return(val == LP_BARTERDEX_VERSION); } return(-1); } From daafb9dc126de0eef086c9f689f21fc422afdb44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:41:29 +0200 Subject: [PATCH 1738/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9be81c94a..2161106ae 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -163,7 +163,7 @@ uint32_t _LP_magic_check(bits256 hash,bits256 magic) bits256 pubkey,shared; pubkey = curve25519(magic,curve25519_basepoint9()); shared = curve25519(hash,pubkey); - return(shared.uints[1] & ~(1 << LP_MAGICBITS)); + return(shared.uints[1] & ((1 << LP_MAGICBITS)-1)); } bits256 LP_calc_magic(uint8_t *msg,int32_t len) @@ -202,7 +202,7 @@ int32_t LP_magic_check(uint8_t *msg,int32_t recvlen) vcalc_sha256(0,hash.bytes,msg,recvlen); memcpy(magic.bytes,&msg[recvlen],sizeof(magic)); val = _LP_magic_check(hash,magic); - printf("magicval = %d\n",val); + printf("magicval = %x\n",val); return(val == LP_BARTERDEX_VERSION); } return(-1); From e2c3f2d5fcf2d759be6cceaf9a799001a808f58b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:47:02 +0200 Subject: [PATCH 1739/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1a4cd79d3..1e07c1aac 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -300,7 +300,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int #endif double millis = OS_milliseconds(); if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) - if ( LP_magic_check(ptr,recvlen) < 0 ) + if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) printf("magic check error\n"); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2161106ae..6565e1470 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -168,7 +168,7 @@ uint32_t _LP_magic_check(bits256 hash,bits256 magic) bits256 LP_calc_magic(uint8_t *msg,int32_t len) { - static uint32_t maxn,counter; static double sum; + static uint32_t maxn,counter,nsum; static double sum; bits256 magic,hash; int32_t n = 0; double millis; millis = OS_milliseconds(); vcalc_sha256(0,hash.bytes,msg,len); @@ -180,6 +180,7 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) n++; } sum += (OS_milliseconds() - millis); + nsum += n; counter++; if ( n > maxn || (rand() % 100) == 0 ) { @@ -188,12 +189,12 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) printf("LP_calc_magic maxn.%d <- %d\n",maxn,n); maxn = n; } - printf("millis %.3f ave %.3f\n",OS_milliseconds() - millis,sum/counter); + printf("millis %.3f ave %.3f, aveiters %.1f\n",OS_milliseconds() - millis,sum/counter,(double)nsum/counter); } return(magic); } -int32_t LP_magic_check(uint8_t *msg,int32_t recvlen) +int32_t LP_magic_check(uint8_t *msg,int32_t recvlen,char *remoteaddr) { bits256 magic,hash; uint32_t val; recvlen -= sizeof(bits256); @@ -202,7 +203,8 @@ int32_t LP_magic_check(uint8_t *msg,int32_t recvlen) vcalc_sha256(0,hash.bytes,msg,recvlen); memcpy(magic.bytes,&msg[recvlen],sizeof(magic)); val = _LP_magic_check(hash,magic); - printf("magicval = %x\n",val); + if ( val != LP_BARTERDEX_VERSION ) + printf("magicval = %x from %s\n",val,remoteaddr); return(val == LP_BARTERDEX_VERSION); } return(-1); From d84672331e45817393caed431c8fea4ee3296108 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 16:49:20 +0200 Subject: [PATCH 1740/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 6565e1470..040efab2a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -170,8 +170,8 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) { static uint32_t maxn,counter,nsum; static double sum; bits256 magic,hash; int32_t n = 0; double millis; - millis = OS_milliseconds(); vcalc_sha256(0,hash.bytes,msg,len); + millis = OS_milliseconds(); while ( 1 ) { magic = rand256(1); From 941d419b3558ab4231fe0b5889fa085a20a851dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 17:48:04 +0200 Subject: [PATCH 1741/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 90159811e..117667e28 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1064,7 +1064,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - //if ( (rand() % 100) == 0 ) + if ( (rand() % 1000) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->timestamp = (uint32_t)time(NULL); if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) From e7f862c34b2b03498f3b434f68c0e7b5077a8b75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:05:43 +0200 Subject: [PATCH 1742/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index ad23b851e..4faab9712 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -259,10 +259,10 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou item = jitem(rawasks,sortbuf[i].ind); jaddi(array,jduplicate(item)); } - free(sortbuf); - for (; i 0 ) { methodstr[0] = 0; - if ( 0 ) + if ( 1 ) { #ifdef FROM_JS printf("%s RECV.(%s)\n",typestr,(char *)ptr); @@ -289,7 +289,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { if ( (mstr= jstr(recvjson,"method")) != 0 )//&& strcmp(mstr,"uitem") == 0 && (cstr= jstr(recvjson,"coin")) != 0 && strcmp(cstr,"REVS") == 0 ) { - printf("%s RECV.(%s)\n",typestr,(char *)ptr); + //printf("%s RECV.(%s)\n",typestr,(char *)ptr); } safecopy(methodstr,jstr(recvjson,"method"),sizeof(methodstr)); free_json(recvjson); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1ed257db0..74b198d1e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -862,6 +862,8 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); + if ( gui == 0 ) + gui = "nogui"; if ( basecoin == 0 || basecoin->inactive != 0 || relcoin == 0 || relcoin->inactive != 0 ) return(clonestr("{\"error\":\"base or rel not found or inactive\"}")); if ( LP_aliceonly(base) > 0 ) From 1d99ec785dca250644d3a75b334a252d68625df7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:12:07 +0200 Subject: [PATCH 1743/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 626c5b456..e0cab6456 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -35,7 +35,7 @@ void emscripten_usleep(int32_t x); //#define LP_STRICTPEERS #define LP_BARTERDEX_VERSION 0 -#define LP_MAGICBITS 10 +#define LP_MAGICBITS 7 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 10 From de1833988cb46d85b2dbf2b0c6acfbba8d0d8795 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:24:01 +0200 Subject: [PATCH 1744/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ iguana/exchanges/LP_network.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 17bde0d35..85ba7a701 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -300,8 +300,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int #endif double millis = OS_milliseconds(); if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) + { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) printf("magic check error\n"); + recvlen -= sizeof(bits256); + } if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 040efab2a..1b6713614 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -212,7 +212,7 @@ int32_t LP_magic_check(uint8_t *msg,int32_t recvlen,char *remoteaddr) int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[1024]; static unsigned long dup,total; + static uint32_t crcs[4096]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) From dab05594dd7c88157df7a2937c316b2078822397 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:25:45 +0200 Subject: [PATCH 1745/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e0cab6456..626c5b456 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -35,7 +35,7 @@ void emscripten_usleep(int32_t x); //#define LP_STRICTPEERS #define LP_BARTERDEX_VERSION 0 -#define LP_MAGICBITS 7 +#define LP_MAGICBITS 10 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 10 From 8ebb94830e82419de9193c63739826721466a40f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:27:37 +0200 Subject: [PATCH 1746/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 74b198d1e..aba389945 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -852,8 +852,8 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i free(utxos); if ( *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); - //int32_t changed; - //LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); + int32_t changed; + LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } From 77b100cb22b58984e62f026a167f2ead673887d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:32:04 +0200 Subject: [PATCH 1747/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 626c5b456..1f798bde9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -38,7 +38,7 @@ void emscripten_usleep(int32_t x); #define LP_MAGICBITS 10 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 10 +#define LP_AUTOTRADE_TIMEOUT 15 #define ELECTRUM_TIMEOUT 10 #define LP_ELECTRUM_MAXERRORS 3 #define LP_MEMPOOL_TIMEINCR 10 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 85ba7a701..034d3b9c8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -302,7 +302,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) - printf("magic check error\n"); + { + //printf("magic check error\n"); + } recvlen -= sizeof(bits256); } if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) From 04c16d6a9565567cc57a669272540940eb67b732 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:35:35 +0200 Subject: [PATCH 1748/2732] Test --- crypto777/OS_portable.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- iguana/exchanges/LP_scan.c | 4 ++-- iguana/exchanges/LP_swap.c | 8 ++++---- iguana/exchanges/LP_transaction.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crypto777/OS_portable.c b/crypto777/OS_portable.c index 3b9c4d271..422b51427 100755 --- a/crypto777/OS_portable.c +++ b/crypto777/OS_portable.c @@ -249,13 +249,13 @@ void *OS_portable_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long if ( mem->totalsize > origsize ) size = mem->totalsize; else size = origsize; - fprintf(stderr,"filealloc.(%s) -> ",fname); + printf("filealloc.(%s) -> ",fname); if ( OS_filealloc(&mem->M,fname,mem,size) == 0 ) { printf("couldnt map tmpfile %s\n",fname); return(0); } - fprintf(stderr,"created\n"); + printf("created\n"); } ptr = iguana_memalloc(mem,origsize,1); if ( mem->threadsafe != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 034d3b9c8..7c519636e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -669,7 +669,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) int32_t i,n; cJSON *item; for (i=0; i max ) { - fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",(long)sizeof(banned_txids)/sizeof(*banned_txids),max); + printf("komodo_bannedset: buffer too small %ld vs %d\n",(long)sizeof(banned_txids)/sizeof(*banned_txids),max); exit(-1); } for (i=0; iN.pair); + printf("start swap iamalice pair.%d\n",swap->N.pair); if ( LP_sendwait("pubkeys",60,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 ) printf("error LP_sendwait pubkeys\n"); else if ( LP_sendwait("choosei",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_choosei_verify,LP_choosei_data) < 0 ) @@ -910,12 +910,12 @@ int32_t instantdex_pubkeyargs(struct basilisk_swap *swap,int32_t numpubs,bits256 { if ( swap->I.numpubs+2 >= numpubs ) return(numpubs); - //fprintf(stderr,">>>>>> start generating %s\n",buf); + //printf(">>>>>> start generating %s\n",buf); } for (i=n=m=0; ictx,&privkey,pubkey,privkey,hash); - //fprintf(stderr,"i.%d n.%d numpubs.%d %02x vs %02x\n",i,n,numpubs,pubkey[0],firstbyte); + //printf("i.%d n.%d numpubs.%d %02x vs %02x\n",i,n,numpubs,pubkey[0],firstbyte); if ( pubkey[0] != firstbyte ) continue; if ( n < 2 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ad297bd75..66a24ee0f 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -490,7 +490,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys,zcash)) != 0 ) { //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); - } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); + } else printf("no txobj from bitcoin_hex2json\n"); //printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) { @@ -593,7 +593,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ } else printf("interpreter passed\n");*/ } else printf("complete.%d\n",complete); } else printf("rwmsgtx error\n"); - } else fprintf(stderr,"no inputs in vins.(%s)\n",vins!=0?jprint(vins,0):"null"); + } else printf("no inputs in vins.(%s)\n",vins!=0?jprint(vins,0):"null"); free(extraspace); free(serialized), free(serialized2), free(serialized3), free(serialized4); } else return(-1); From 2be88df60eed05749eff9592d4aaf71835fe4e0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:37:06 +0200 Subject: [PATCH 1749/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1f798bde9..f53c28993 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -35,7 +35,7 @@ void emscripten_usleep(int32_t x); //#define LP_STRICTPEERS #define LP_BARTERDEX_VERSION 0 -#define LP_MAGICBITS 10 +#define LP_MAGICBITS 8 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 15 From a809081c140a9395a6b5ab57eb3f819f91fcf118 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:50:01 +0200 Subject: [PATCH 1750/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 4faab9712..ebadeec52 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -178,7 +178,7 @@ void LP_RTmetrics_update(char *base,char *rel) double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxprice,double relvolume) { - int32_t n; double metric,origmetric = (bestprice / mp->price); + int32_t n; double metric,origmetric = (mp->price / bestprice); metric = origmetric; if ( mp->numutxos == 0 || relvolume == 0. || mp->maxvol == 0. || mp->balance == 0. ) return(metric * 100.); @@ -241,7 +241,7 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou groupi = i; num++; } - if ( groupi > 0 ) + if ( 0 && groupi > 0 ) { sortbuf = calloc(groupi+1,sizeof(*sortbuf)); prevdepth = 0.; From f956a72677c1e855e29697b2b8221c8ea7a7f6c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 18:54:38 +0200 Subject: [PATCH 1751/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index ebadeec52..35fd9ed8d 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -206,7 +206,7 @@ double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxpri while ( n-- > 0 ) metric *= 1.1; if ( metric != origmetric ) - printf("price %.8f orig %.8f -> %.8f relvol %.8f min %.8f max %.8f bal %.8f age.%d pend.%d\n",mp->price,origmetric,metric,relvolume,mp->minvol,mp->maxvol,mp->balance,mp->age,mp->pendingswaps); + printf("i.%d price %.8f orig %.8f -> %.8f relvol %.8f min %.8f max %.8f bal %.8f age.%d pend.%d\n",mp->ind,mp->price,origmetric,metric,relvolume,mp->minvol,mp->maxvol,mp->balance,mp->age,mp->pendingswaps); return(metric); } @@ -241,9 +241,10 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou groupi = i; num++; } - if ( 0 && groupi > 0 ) + if ( groupi > 0 ) { sortbuf = calloc(groupi+1,sizeof(*sortbuf)); + printf("alloc %d\n",groupi+1); prevdepth = 0.; for (i=0; i<=groupi; i++) { @@ -251,7 +252,9 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou LP_RTmetric_calc(sortbuf,i,item,bestprice,maxprice,relvolume,prevdepth); prevdepth = jdouble(item,"depth"); } + printf("call revsortds\n"); revsortds(&sortbuf[0].metric,groupi+1,sizeof(*sortbuf)); + printf("back\n"); array = cJSON_CreateArray(); for (i=0; i<=groupi; i++) { From 30d0e7560671fb481415ee0984b5c0ec33a4399a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 19:01:46 +0200 Subject: [PATCH 1752/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 35fd9ed8d..c32e91507 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -20,8 +20,10 @@ struct LP_metricinfo { + double metric; + double price,balance,minvol; bits256 pubkey; - double metric,price,balance,minvol,maxvol; + double maxvol; int32_t ind,numutxos,age,pendingswaps; }; @@ -205,7 +207,7 @@ double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxpri if ( (n= mp->pendingswaps) > 0 ) while ( n-- > 0 ) metric *= 1.1; - if ( metric != origmetric ) + //if ( metric != origmetric ) printf("i.%d price %.8f orig %.8f -> %.8f relvol %.8f min %.8f max %.8f bal %.8f age.%d pend.%d\n",mp->ind,mp->price,origmetric,metric,relvolume,mp->minvol,mp->maxvol,mp->balance,mp->age,mp->pendingswaps); return(metric); } @@ -226,7 +228,7 @@ void LP_RTmetric_calc(struct LP_metricinfo *sortbuf,int32_t ind,cJSON *item,doub cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,double maxprice,double relvolume) { - cJSON *array,*item; int32_t i,num,groupi; double price,prevdepth,bestprice; struct LP_metricinfo *sortbuf; + cJSON *array=rawasks,*item; int32_t i,num,groupi; double price,prevdepth,bestprice; struct LP_metricinfo *sortbuf; groupi = -1; bestprice = 0.; for (num=i=0; i Date: Mon, 30 Oct 2017 19:08:39 +0200 Subject: [PATCH 1753/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index c32e91507..c44c86dbe 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -183,7 +183,10 @@ double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxpri int32_t n; double metric,origmetric = (mp->price / bestprice); metric = origmetric; if ( mp->numutxos == 0 || relvolume == 0. || mp->maxvol == 0. || mp->balance == 0. ) + { + printf("skip i.%d as no info\n",mp->ind); return(metric * 100.); + } if ( relvolume < mp->minvol ) { metric *= (mp->minvol / relvolume); @@ -246,7 +249,6 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou if ( groupi > 0 ) { sortbuf = calloc(groupi+1,sizeof(*sortbuf)); - printf("alloc %d\n",groupi+1); prevdepth = 0.; for (i=0; i<=groupi; i++) { @@ -254,13 +256,11 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou LP_RTmetric_calc(sortbuf,i,item,bestprice,maxprice,relvolume,prevdepth); prevdepth = jdouble(item,"depth"); } - printf("call revsortds\n"); revsortds(&sortbuf[0].metric,groupi+1,sizeof(*sortbuf)); - printf("back\n"); array = cJSON_CreateArray(); for (i=0; i<=groupi; i++) { - printf("(%d -> %d) ",i,sortbuf[i].ind); + printf("(%d -> %d %.3f) ",i,sortbuf[i].ind,sortbuf[i].metric); item = jitem(rawasks,sortbuf[i].ind); jaddi(array,jduplicate(item)); } From 065998ae87534a7760972988532cc0a1bb6dc0a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 19:12:12 +0200 Subject: [PATCH 1754/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_swap.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7c519636e..395866af8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -208,7 +208,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { - printf("packet not for this node %u\n",crc32); + //printf("packet not for this node %u\n",crc32); } } else printf("error (%s) method is %s\n",jsonstr,method); } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 65cbcefb0..0238e398b 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -575,10 +575,10 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( rawtx->I.redeemlen > 0 && rawtx->I.redeemlen < 0x100 ) { memcpy(rawtx->redeemscript,&data[datalen],rawtx->I.redeemlen); - for (i=0; iI.redeemlen; i++) - printf("%02x",rawtx->redeemscript[i]); + //for (i=0; iI.redeemlen; i++) + // printf("%02x",rawtx->redeemscript[i]); bitcoin_address(redeemaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->redeemscript,rawtx->I.redeemlen); - printf(" received redeemscript.(%s) %s taddr.%d\n",redeemaddr,rawtx->coin->symbol,rawtx->coin->taddr); + //printf(" received redeemscript.(%s) %s taddr.%d\n",redeemaddr,rawtx->coin->symbol,rawtx->coin->taddr); LP_swap_coinaddr(rawtx->coin,checkaddr,0,data,datalen,0); if ( strcmp(redeemaddr,checkaddr) != 0 ) { From a7adf2d171687061ffe49c1670d3e550726fbf97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 19:40:53 +0200 Subject: [PATCH 1755/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- iguana/iguana_payments.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a9b217906..63b8ce736 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -509,7 +509,7 @@ stop()\n\ if ( bits256_cmp(pub,G.LP_mypub25519) == 0 && time(NULL) > lastnotify+30 ) { lastnotify = (uint32_t)time(NULL); - printf("wantnotify for me!\n"); + //printf("wantnotify for me!\n"); LP_notify_pubkeys(ctx,LP_mypubsock); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 35ade4e60..be24aae78 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -284,7 +284,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) { static uint32_t counter; - if ( counter++ < 100 ) + if ( counter++ < 10 ) { if ( pubp != 0 ) pubp->numerrors++; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 66a24ee0f..7d0f963a3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -879,7 +879,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ utxos[numunspents] = 0; total += up->U.value; remains -= up->U.value; - //if ( coin->electrum == 0 && strcmp(coin->symbol,"KMD") == 0 ) + if ( up->U.height < 7777777 && strcmp(coin->symbol,"KMD") == 0 ) { if ( (interest= LP_komodo_interest(up->U.txid,up->U.value)) > 0 ) { diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index a5b2876cf..cbc23aa6c 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -344,7 +344,8 @@ bits256 iguana_sendrawtransaction(struct supernet_info *myinfo,struct iguana_inf uint64_t _iguana_interest(uint32_t now,int32_t txheight,uint32_t txlocktime,uint64_t value) { int32_t minutes; uint64_t numerator=0,denominator=0,interest=0; uint32_t activation = 1491350400; - + if ( txheight >= 7777777 ) + return(0); if ( (minutes= ((uint32_t)time(NULL) - 60 - txlocktime) / 60) >= 60 ) { if ( minutes > 365 * 24 * 60 ) From 22df627ebb8c3eb35aad2011667dd2ce15fb32e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 21:00:37 +0200 Subject: [PATCH 1756/2732] Notarize CHIPS --- iguana/coins/chips_7776 | 2 ++ iguana/iguana_notary.c | 2 +- iguana/m_notary | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 iguana/coins/chips_7776 diff --git a/iguana/coins/chips_7776 b/iguana/coins/chips_7776 new file mode 100755 index 000000000..e09f9c87c --- /dev/null +++ b/iguana/coins/chips_7776 @@ -0,0 +1,2 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"chips.conf\",\"path\":\"${HOME#"/"}/.chips\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"CHIPS\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":57777,\"minconfirms\":1}" diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index c3c7a415c..65d42428e 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -556,7 +556,7 @@ STRING_ARG(iguana,addnotary,ipaddr) char NOTARY_CURRENCIES[][16] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", - "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "MNZ" }; // "LTC", + "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "MNZ", "CHIPS" }; // "LTC", ZERO_ARGS(dpow,notarychains) { diff --git a/iguana/m_notary b/iguana/m_notary index d514d2680..9a4fbb305 100755 --- a/iguana/m_notary +++ b/iguana/m_notary @@ -22,6 +22,7 @@ tests/addnotarys_7776 coins/btc_7776 coins/ltc_7776 coins/kmd_7776 +coins/chips_7776 ./wp_7776 coins/revs_7776 From 13e0f362d4fc3f4fe2b8daccaa2f6ca2ec73b079 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Oct 2017 21:21:26 +0200 Subject: [PATCH 1757/2732] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 10ab1c787..8f5272f20 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1327,10 +1327,10 @@ uint64_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel) rel = jstr(item,"alice"); if ( refrel == 0 || refrel[0] == 0 ) { - if ( strcmp(base,refbase) == 0 || strcmp(rel,refbase) == 0 ) + if ( (base != 0 && strcmp(base,refbase) == 0) || (rel != 0 && strcmp(rel,refbase) == 0) ) ridqid = 1; } - else if ( strcmp(base,refbase) == 0 && strcmp(rel,refrel) == 0 ) + else if ( (base != 0 && strcmp(base,refbase) == 0) && (rel != 0 && strcmp(rel,refrel) == 0) ) ridqid = 1; if ( ridqid != 0 ) { From 5941868628a5d7bdfeb9be5ccc1913e218f3227c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 11:58:52 +0200 Subject: [PATCH 1758/2732] Test --- iguana/exchanges/DB/PRICES/.tmpmarker | 0 iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_rpc.c | 34 +++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 iguana/exchanges/DB/PRICES/.tmpmarker diff --git a/iguana/exchanges/DB/PRICES/.tmpmarker b/iguana/exchanges/DB/PRICES/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 395866af8..e82caf3a4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,9 +18,10 @@ // LP_nativeDEX.c // marketmaker // -// verify portfolio, interest to KMD withdraw, pricebroadcast loop +// verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs +// BCH signing #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index eb0dab1e2..2ac79a5c5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -220,11 +220,32 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) return(retjson); } +cJSON *LP_NXT_decrypt(char *account,char *data,char *nonce,char *passphrase) +{ + char url[1024],*retstr; cJSON *retjson = 0; + if ( account != 0 && data != 0 && nonce != 0 && passphrase != 0 ) + { + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); + //printf("issue.(%s)\n",url); + if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + + } + free(retstr); + } + } + return(retjson); +} + cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method,*msgstr,assetname[16]; uint64_t totals[20],mult,txnum,assetid,qty; int32_t i,ind,numtx; cJSON *item,*attach,*array,*msgjson,*encjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr,assetname[16]; uint64_t totals[20],mult,txnum,assetid,qty; int32_t i,ind,numtx; cJSON *item,*attach,*decjson,*array,*msgjson,*encjson,*retjson=0; +char *passphrase = ""; +char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; memset(totals,0,sizeof(totals)); - sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=NXT-MRBN-8DFH-PFMK-A4DBM");//,NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))]); + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getBlockchainTransactions&account=%s",account); //printf("calling (%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { @@ -260,8 +281,17 @@ cJSON *LP_NXT_redeems() msgstr = jstr(attach,"message"); if ( msgstr == 0 || msgstr[0] == 0 ) { + if ( (encjson= jobj(attach,"encryptedMessage")) != 0 ) + { msgstr = "encryptedMessage";//jstr(encjson,"data"); + if ( (decjson= LP_NXT_decrypt(account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) + { + printf("%s\n",jprint(decjson,0)); + free_json(decjson); + } + + } } } mult = LP_assetid_mult(&ind,assetname,assetid); From cd2766143dbad2001867cffa284a8bf9cc9575c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 12:26:24 +0200 Subject: [PATCH 1759/2732] Test --- iguana/exchanges/LP_rpc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2ac79a5c5..0e71e62be 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -225,6 +225,9 @@ cJSON *LP_NXT_decrypt(char *account,char *data,char *nonce,char *passphrase) char url[1024],*retstr; cJSON *retjson = 0; if ( account != 0 && data != 0 && nonce != 0 && passphrase != 0 ) { + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountId&secretPhrase=%s",passphrase); + if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + printf("%s\n",retstr); sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); //printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) From 122170f3042a1b8c7d3bd30506ad1b7876a812e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 12:30:20 +0200 Subject: [PATCH 1760/2732] Test --- iguana/exchanges/LP_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0e71e62be..5194b40f6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -220,12 +220,13 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) return(retjson); } -cJSON *LP_NXT_decrypt(char *account,char *data,char *nonce,char *passphrase) +cJSON *LP_NXT_decrypt(uint64_t txnum,char *account,char *data,char *nonce,char *passphrase) { char url[1024],*retstr; cJSON *retjson = 0; if ( account != 0 && data != 0 && nonce != 0 && passphrase != 0 ) { sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountId&secretPhrase=%s",passphrase); + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=readMessage&transaction=%llu&secretPhrase=%s",(long long)txnum,passphrase); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) printf("%s\n",retstr); sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); @@ -288,7 +289,7 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; if ( (encjson= jobj(attach,"encryptedMessage")) != 0 ) { msgstr = "encryptedMessage";//jstr(encjson,"data"); - if ( (decjson= LP_NXT_decrypt(account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) + if ( (decjson= LP_NXT_decrypt(txnum,account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) { printf("%s\n",jprint(decjson,0)); free_json(decjson); From 1ca484597af9422b42ec27bf7b1c82b19365a6aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 12:33:44 +0200 Subject: [PATCH 1761/2732] Test --- iguana/exchanges/LP_rpc.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5194b40f6..528675f75 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -225,11 +225,11 @@ cJSON *LP_NXT_decrypt(uint64_t txnum,char *account,char *data,char *nonce,char * char url[1024],*retstr; cJSON *retjson = 0; if ( account != 0 && data != 0 && nonce != 0 && passphrase != 0 ) { - sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountId&secretPhrase=%s",passphrase); + //sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountId&secretPhrase=%s",passphrase); sprintf(url,"http://127.0.0.1:7876/nxt?requestType=readMessage&transaction=%llu&secretPhrase=%s",(long long)txnum,passphrase); - if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + //if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) printf("%s\n",retstr); - sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); + //sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); //printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { @@ -259,7 +259,7 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; { for (i=0; i= 0 ) totals[ind] += qty * mult; if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) - printf("%-4d: (%35s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); if ( msgjson != 0 ) free_json(msgjson); + if ( encjson != 0 ) + free_json(encjson); + if ( decjson != 0 ) + free_json(decjson); } if ( txnum == calc_nxt64bits("7256847492742571143") ) break; From f9c0d9b89788c92a76cc23880f930bdc65dcb4ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:22:38 +0200 Subject: [PATCH 1762/2732] Test --- iguana/exchanges/LP_rpc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 528675f75..67c347c6a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -225,12 +225,7 @@ cJSON *LP_NXT_decrypt(uint64_t txnum,char *account,char *data,char *nonce,char * char url[1024],*retstr; cJSON *retjson = 0; if ( account != 0 && data != 0 && nonce != 0 && passphrase != 0 ) { - //sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountId&secretPhrase=%s",passphrase); sprintf(url,"http://127.0.0.1:7876/nxt?requestType=readMessage&transaction=%llu&secretPhrase=%s",(long long)txnum,passphrase); - //if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) - printf("%s\n",retstr); - //sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); - //printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) @@ -302,11 +297,12 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; if ( ind >= 0 ) totals[ind] += qty * mult; if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) - printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + { + // extract valid address + printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + } if ( msgjson != 0 ) free_json(msgjson); - if ( encjson != 0 ) - free_json(encjson); if ( decjson != 0 ) free_json(decjson); } @@ -314,7 +310,7 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; break; } } - free_json(retjson); + //free_json(retjson); } free(retstr); } From 7160bd0b1caef999f18b77c0e71564cc2d739707 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:29:01 +0200 Subject: [PATCH 1763/2732] Test --- iguana/exchanges/LP_rpc.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 67c347c6a..24d2cb5f2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -240,7 +240,9 @@ cJSON *LP_NXT_decrypt(uint64_t txnum,char *account,char *data,char *nonce,char * cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method,*msgstr,assetname[16]; uint64_t totals[20],mult,txnum,assetid,qty; int32_t i,ind,numtx; cJSON *item,*attach,*decjson,*array,*msgjson,*encjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr,assetname[16]; uint64_t totals[20],mult,txnum,assetid,qty; int32_t i,ind,numtx,past_marker=0; cJSON *item,*attach,*decjson,*array,*msgjson,*encjson,*retjson=0; + uint64_t txnum_marker = calc_nxt64bits("0"); + uint64_t txnum_marker2 = calc_nxt64bits("7256847492742571143"); char *passphrase = ""; char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; memset(totals,0,sizeof(totals)); @@ -259,6 +261,8 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; item = jitem(array,i); msgstr = jstr(item,"message"); txnum = j64bits(item,"transaction"); + if ( txnum == txnum_marker ) + past_marker = 1; //printf("%d: %s\n",i,jprint(item,0)); if ( (recv= jstr(item,"recipientRS")) != 0 && strcmp(recv,"NXT-MRBN-8DFH-PFMK-A4DBM") == 0 ) { @@ -298,15 +302,31 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; totals[ind] += qty * mult; if ( msgstr != 0 && assetname[0] != 0 && qty != 0 ) { - // extract valid address - printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + char validaddress[64]; int32_t z,n; + n = (int32_t)strlen(msgstr); + for (z=0; z= 34 ) + strncpy(validaddress,&msgstr[z],34); + if ( strlen(validaddress) == 34 || strlen(validaddress) == 33 ) + { + printf("%-4d: (%34s) <- %13.5f %10s tx.%llu past_marker.%d\n",i,validaddress,dstr(qty * mult),assetname,(long long)txnum,past_marker); + } else printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); + if ( past_marker == 0 ) + { + + } } if ( msgjson != 0 ) free_json(msgjson); if ( decjson != 0 ) free_json(decjson); } - if ( txnum == calc_nxt64bits("7256847492742571143") ) + if ( txnum == txnum_marker2 ) break; } } From 147553ef53919d7e8ebeaececabaad6d62a4580b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:45:29 +0200 Subject: [PATCH 1764/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 23 +++++++++++++---------- iguana/exchanges/LP_signatures.c | 8 ++++++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f53c28993..0f4ad5861 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -222,7 +222,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; + uint32_t lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e82caf3a4..7af6fbe6a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -619,9 +619,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; -#ifndef FROM_JS - LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); +#ifdef FROM_JS + if ( (rand() % 100) == 0 ) #endif + LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; LP_peer_pricesquery(peer); LP_utxos_sync(peer); @@ -633,23 +634,25 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { peer->diduquery = now; nonz++; -#ifndef FROM_JS +#ifdef FROM_JS + if ( (rand() % 100) == 0 ) +#endif if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); -#endif peer->needping = 0; needpings++; } } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coin->addr_listunspent_requested != 0 ) + if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+60 ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + coin->lastpushtime = (uint32_t)time(NULL); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } - if ( coin->inactive == 0 && time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) + if ( coin->electrum == 0 && coin->inactive == 0 && time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { nonz++; if ( (height= LP_getheight(coin)) > coin->longestchain ) @@ -1073,12 +1076,12 @@ void LP_fromjs_iter() ctx = bitcoin_ctx(); if ( 0 && (LP_counter % 100) == 0 ) printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); - if ( Nanomsg_threadarg != 0 ) - nn_thread_main_routine(Nanomsg_threadarg); + //if ( Nanomsg_threadarg != 0 ) + // nn_thread_main_routine(Nanomsg_threadarg); //LP_pubkeys_query(); //LP_utxosQ_process(); - LP_nanomsg_recvs(ctx); - //LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); + //LP_nanomsg_recvs(ctx); + LP_mainloop_iter(ctx,LP_myipaddr,0,LP_mypubsock,LP_publicaddr,LP_RPCPORT); //queue_loop(0); if ( 0 && (LP_counter % 10) == 0 ) // 10 seconds { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index be24aae78..d5eeeb21f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -584,7 +584,7 @@ char *LP_notify_recv(cJSON *argjson) void LP_smartutxos_push(struct iguana_info *coin) { - struct LP_peerinfo *peer,*tmp; uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; char *retstr; cJSON *array,*item,*req; + uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; cJSON *array,*item,*req; if ( coin->smartaddr[0] == 0 ) return; //LP_notify_pubkeys(coin->ctx,LP_mypubsock); @@ -601,14 +601,17 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); - if ( 0 && (rand() % 100) == 0 && IAMLP == 0 ) +#ifdef FROM_JS + //if ( 0 && (rand() % 100) == 0 && IAMLP == 0 ) { + struct LP_peerinfo *peer,*tmp; char *retstr; HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) free(retstr); } } +#else req = cJSON_CreateObject(); jaddstr(req,"method","uitem"); jaddstr(req,"coin",coin->symbol); @@ -619,6 +622,7 @@ void LP_smartutxos_push(struct iguana_info *coin) jadd64bits(req,"value",value); //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); LP_reserved_msg("","",zero,jprint(req,1)); +#endif } } free_json(array); From 34e6c37d188c6b6191dc98a505546594efdd0fbf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:49:44 +0200 Subject: [PATCH 1765/2732] Test --- iguana/exchanges/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index a77a5405f..62f0f1679 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -1,10 +1,9 @@ #cd .. - #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc #include ../crypto777/crypto777.sources #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm -lpthread + emcc ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 950ce5b2cd10563e6bffe5ce121bb354ccfd412c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:50:29 +0200 Subject: [PATCH 1766/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 62f0f1679..cebf43df7 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -5,5 +5,5 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 0fed9d301b2f9eebe17d2945aded8fe91cbbc4f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:52:53 +0200 Subject: [PATCH 1767/2732] Test --- iguana/exchanges/LP_network.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1b6713614..4c786b304 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -29,7 +29,7 @@ struct psock uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; #ifdef FROM_JS -/* + int32_t nn_socket(int domain, int protocol) { return(0); @@ -69,6 +69,7 @@ int32_t nn_shutdown(int s, int how) int32_t nn_send(int s, const void *buf, size_t len, int flags) { + printf("JS cant nn_send (%s)\n",(char *buf)); return(0); } @@ -90,7 +91,7 @@ const char *nn_strerror(int errnum) int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) { return(0); -}*/ +} #endif From 5f8aff76d387fafa8daef764bfcbdabcabc4a849 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:53:22 +0200 Subject: [PATCH 1768/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 4c786b304..b53e58159 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -69,7 +69,7 @@ int32_t nn_shutdown(int s, int how) int32_t nn_send(int s, const void *buf, size_t len, int flags) { - printf("JS cant nn_send (%s)\n",(char *buf)); + printf("JS cant nn_send (%s)\n",(char *)buf); return(0); } From 4e6aab23e8a8fbf07a955b951a6715c148639913 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 13:56:48 +0200 Subject: [PATCH 1769/2732] Test --- iguana/exchanges/mm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 7477b00ab..632ab794d 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -878,12 +878,6 @@ int main(int argc, const char * argv[]) char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; - if ( argc == 1 ) - { - LP_NXT_redeems(); - sleep(3); - return(0); - } OS_init(); sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); @@ -895,6 +889,12 @@ int main(int argc, const char * argv[]) LP_main(retjson); emscripten_set_main_loop(LP_fromjs_iter,1,0); #else + if ( argc == 1 ) + { + LP_NXT_redeems(); + sleep(3); + return(0); + } if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { if ( (passphrase= jstr(retjson,"passphrase")) == 0 ) From ff4018ee8bd96bb620d428c0398806f828d09faf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:11:28 +0200 Subject: [PATCH 1770/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7af6fbe6a..63e34191e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1055,7 +1055,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * static uint32_t counter; char fname[512],*retstr; long fsize; if ( strncmp("http://",url,strlen("http://")) != 0 ) return(clonestr("{\"error\":\"only http allowed\"}")); - sprintf(fname,"bitcoind_RPC/req.%u",counter); + sprintf(fname,"bitcoind_RPC/request.%d",counter % 10); counter++; //printf("issue.(%s)\n",url); emscripten_wget(url,fname); @@ -1064,6 +1064,18 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * return(retstr); } +char *barterDEX(char *argstr) +{ + cJSON *argjson; char *retstr; + printf("barterDEX.(%s)\n",argstr); + if ( (argjson= cJSON_Parse(argstr)) != 0 ) + { + retstr = LP_command_process(void *ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr))); + free_json(argjson); + } else retstr = clonestr("{\"error\":\"couldnt parse request\"}"); + return(retstr); +} + void LP_fromjs_iter() { static void *ctx; char *retstr; From 1d08068f867612525afd69d0881e574f74378d07 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:12:34 +0200 Subject: [PATCH 1771/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index cebf43df7..c609e85c4 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -5,5 +5,5 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=536870912 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 1ca3eae10bce7e71a7fe3e7352c92559637c745b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:13:34 +0200 Subject: [PATCH 1772/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 63e34191e..8c496430e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1066,7 +1066,10 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * char *barterDEX(char *argstr) { + static void *ctx; cJSON *argjson; char *retstr; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); printf("barterDEX.(%s)\n",argstr); if ( (argjson= cJSON_Parse(argstr)) != 0 ) { From 632e6648400bb6be31c0f7604bcf49bd04e7a4ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:13:59 +0200 Subject: [PATCH 1773/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8c496430e..e850c39fc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1073,7 +1073,7 @@ char *barterDEX(char *argstr) printf("barterDEX.(%s)\n",argstr); if ( (argjson= cJSON_Parse(argstr)) != 0 ) { - retstr = LP_command_process(void *ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr))); + retstr = LP_command_process(ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr))); free_json(argjson); } else retstr = clonestr("{\"error\":\"couldnt parse request\"}"); return(retstr); From d1e625965beef76fb07ddcc90986768b342f7c1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:14:58 +0200 Subject: [PATCH 1774/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e850c39fc..3cf810ec2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1073,7 +1073,7 @@ char *barterDEX(char *argstr) printf("barterDEX.(%s)\n",argstr); if ( (argjson= cJSON_Parse(argstr)) != 0 ) { - retstr = LP_command_process(ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr))); + retstr = LP_command_process(ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr)); free_json(argjson); } else retstr = clonestr("{\"error\":\"couldnt parse request\"}"); return(retstr); diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index c609e85c4..840f98f7e 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -5,5 +5,5 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --preload-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 4abddc9f65b83334011c192d4f7261cf89298bc1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:37:09 +0200 Subject: [PATCH 1775/2732] Require validreq --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 43 ++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 63b8ce736..72b40cdf5 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -527,7 +527,7 @@ stop()\n\ LP_listunspent_issue(coin,coinaddr,1); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - printf("network invoked\n"); + //printf("network invoked\n"); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3cf810ec2..71d9e6c0a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -299,39 +299,42 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int #ifdef FROM_JS else printf("%s got recv.%d\n",typestr,recvlen); #endif - double millis = OS_milliseconds(); + int32_t validreq = 0; double millis = OS_milliseconds(); if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) { //printf("magic check error\n"); - } + } else validreq = 1; recvlen -= sizeof(bits256); } - if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) - free(retstr); - if ( Broadcaststr != 0 ) + if ( validreq != 0 ) { - //printf("self broadcast.(%s)\n",Broadcaststr); - str = Broadcaststr; - Broadcaststr = 0; - if ( (argjson= cJSON_Parse(str)) != 0 ) + if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) + free(retstr); + if ( Broadcaststr != 0 ) { - if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) - printf("self.(%s)\n",str); - if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) + //printf("self broadcast.(%s)\n",Broadcaststr); + str = Broadcaststr; + Broadcaststr = 0; + if ( (argjson= cJSON_Parse(str)) != 0 ) { - portable_mutex_lock(&LP_commandmutex); - if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) - free(retstr); - portable_mutex_unlock(&LP_commandmutex); + if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) + printf("self.(%s)\n",str); + if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) + { + portable_mutex_lock(&LP_commandmutex); + if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) + free(retstr); + portable_mutex_unlock(&LP_commandmutex); + } + free_json(argjson); } - free_json(argjson); + free(str); } - free(str); + if ( OS_milliseconds()-millis > 1000 ) + printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } - if ( OS_milliseconds()-millis > 1000 ) - printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } } } From faa5a7b30054d7776d8d4dca3cae967b2214f4c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:42:52 +0200 Subject: [PATCH 1776/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 117667e28..497b22b75 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -755,7 +755,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * } //printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamps[baseid][relid],balance)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,balance)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; From 6f21da3bd82e4362d61a4240fd0f8cc164d9b035 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:44:01 +0200 Subject: [PATCH 1777/2732] Test --- iguana/exchanges/LP_signatures.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index d5eeeb21f..cf4d648bd 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -532,8 +532,9 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) memcpy(pubp->sig,sig,sizeof(pubp->sig)); pubp->siglen = siglen; char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); - pubp->timestamp = (uint32_t)time(NULL); + //pubp->timestamp = (uint32_t)time(NULL); } + pubp->timestamp = juint(item,"timestamp"); retval = 0; } else pubp->numerrors++; } @@ -548,7 +549,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) printf(" for %s\n",pubsecpstr); } } - }// else pubp->timestamp = (uint32_t)time(NULL); + } } } return(retval); From fb12f4dbea6ef629027ce43e5e5ed8920eef60bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 14:56:15 +0200 Subject: [PATCH 1778/2732] Test --- iguana/exchanges/LP_include.h | 3 ++- iguana/exchanges/LP_prices.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0f4ad5861..91ccaae0d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -320,7 +320,8 @@ struct LP_pubkeyinfo UT_hash_handle hh; bits256 pubkey; float matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; - uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS],timestamp,numerrors; + //uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; + uint32_t timestamp,numerrors; int32_t istrusted; uint8_t rmd160[20],sig[65],pubsecp[33],siglen; }; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 497b22b75..6cc110671 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -345,7 +345,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { //char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; - pubp->timestamps[basepp->ind][relid] = timestamp; + //pubp->timestamps[basepp->ind][relid] = timestamp; if ( (relpp= LP_priceinfofind(rel)) != 0 ) { dxblend(&basepp->relvals[relpp->ind],askprice,0.9); @@ -497,7 +497,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) { pubp->timestamp = (uint32_t)time(NULL); pubp->matrix[basepp->ind][relpp->ind] = price; - pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; + //pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); } return(0); @@ -741,7 +741,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); minsatoshis = maxsatoshis = n = 0; ap = 0; - if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamps[baseid][relid] >= oldest ) + if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL )//&& pubp->timestamps[baseid][relid] >= oldest ) { balance = 0; if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) @@ -1070,7 +1070,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { pubp->matrix[basepp->ind][relpp->ind] = price; - pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; + //pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; dxblend(&basepp->relvals[relpp->ind],price,0.9); dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); } From 4e464ef9ca6f81fd0956296605b3d15637fd8ad6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 15:00:36 +0200 Subject: [PATCH 1779/2732] Test --- iguana/exchanges/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 840f98f7e..ac16abf5c 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -6,4 +6,5 @@ all: emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s WASM=1 -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From a2929a11478eed5a4c74f464b15c637cbb44d7e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 15:04:32 +0200 Subject: [PATCH 1780/2732] Test --- iguana/exchanges/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index ac16abf5c..a725d24d9 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -5,6 +5,6 @@ #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc all: - emcc -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm - emcc -s WASM=1 -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 52ec0dbb6e719caef659e77bd379e2ca1b83ff79 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 15:24:34 +0200 Subject: [PATCH 1781/2732] Test --- iguana/exchanges/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index a725d24d9..852034787 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -4,7 +4,8 @@ #include ../crypto777/crypto777.sources #emcc -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=134217728 --preload-file coins.json -D__PNACL -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c $(CRYPTO777_SRCS) mini-gmp.c secp256k1/src/secp256k1.c -lm -lc +#emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + all: emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm - emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From a8c12aebd32be9816b6006a1a7c0e1d6224a54fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 15:34:32 +0200 Subject: [PATCH 1782/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 71d9e6c0a..2ea7ee2cd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1074,6 +1074,7 @@ char *barterDEX(char *argstr) if ( ctx == 0 ) ctx = bitcoin_ctx(); printf("barterDEX.(%s)\n",argstr); + return(clonestr("{\"error\":\"couldnt parse request\"}")); if ( (argjson= cJSON_Parse(argstr)) != 0 ) { retstr = LP_command_process(ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr)); From 77136d7c2e0a1c4f139cf53610b0018006ae54c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 15:41:44 +0200 Subject: [PATCH 1783/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 852034787..8251330b7 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,5 +7,5 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 87a5d1506ee251bbc557b4a6d85467cccd2a202b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:10:19 +0200 Subject: [PATCH 1784/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index cf4d648bd..5847ed4a7 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -378,7 +378,7 @@ char *LP_postutxos_recv(cJSON *argjson) uitem->argjson = jduplicate(argjson); queue_enqueue("utxosQ",&utxosQ,&uitem->DL); return(clonestr("{\"result\":\"success\"}")); - } + } else printf("valid utxos sig\n"); } return(clonestr("{\"error\":\"sig failure\"}")); } From b1f8fb3f30ddc59513333c09d145004ef9b3621a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:14:16 +0200 Subject: [PATCH 1785/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 8251330b7..7d2f1b95f 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,5 +7,5 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 98fdd04b0add42f7d351e236c62caec2148d9b0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:17:06 +0200 Subject: [PATCH 1786/2732] Test --- iguana/exchanges/Makefile | 3 ++- iguana/exchanges/barterDEX.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 iguana/exchanges/barterDEX.c diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 7d2f1b95f..c2a03c4fd 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,5 +7,6 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c diff --git a/iguana/exchanges/barterDEX.c b/iguana/exchanges/barterDEX.c new file mode 100644 index 000000000..0462e04c0 --- /dev/null +++ b/iguana/exchanges/barterDEX.c @@ -0,0 +1,10 @@ + +char *barterDEX(char *jsonstr) +{ +char *str = "{\"result\":\"success\"}"; +printf("barterDEX.(%s)\n",jsonstr); +retstr = malloc(strlen(str)+1); +strcpy(retstr,str); +return(retstr); +} + From 15863afcd4fa7f55b4065a7108dbfdf1e1d4a565 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:18:29 +0200 Subject: [PATCH 1787/2732] Test --- iguana/exchanges/barterDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/barterDEX.c b/iguana/exchanges/barterDEX.c index 0462e04c0..3f342b38e 100644 --- a/iguana/exchanges/barterDEX.c +++ b/iguana/exchanges/barterDEX.c @@ -1,3 +1,6 @@ +#include +#include +#include char *barterDEX(char *jsonstr) { From 9aaeb7423bb23897858aaf86af0365d8ce90b61f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:19:26 +0200 Subject: [PATCH 1788/2732] Test --- iguana/exchanges/barterDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/barterDEX.c b/iguana/exchanges/barterDEX.c index 3f342b38e..976016bc2 100644 --- a/iguana/exchanges/barterDEX.c +++ b/iguana/exchanges/barterDEX.c @@ -1,10 +1,11 @@ #include +#include #include #include char *barterDEX(char *jsonstr) { -char *str = "{\"result\":\"success\"}"; +char *retstr,*str = "{\"result\":\"success\"}"; printf("barterDEX.(%s)\n",jsonstr); retstr = malloc(strlen(str)+1); strcpy(retstr,str); From 5ff499a5f0f66819b7557e891d0473bcdae6fb5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:20:10 +0200 Subject: [PATCH 1789/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index c2a03c4fd..d4b0273ec 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,6 +7,6 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c From 585f6fb7f49f949a1afc9054d67fe463d8c764b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:28:07 +0200 Subject: [PATCH 1790/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 5847ed4a7..b23ba449b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -371,14 +371,14 @@ char *LP_postutxos_recv(cJSON *argjson) if ( (obj= jobj(argjson,"utxos")) != 0 ) { utxoshash = LP_utxoshash_calc(obj); - //char str[65]; printf("got utxoshash %s\n",bits256_str(str,utxoshash)); + char str[65]; //printf("got utxoshash %s\n",bits256_str(str,utxoshash)); if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,utxoshash) == 0 ) { uitem = calloc(1,sizeof(*uitem)); uitem->argjson = jduplicate(argjson); queue_enqueue("utxosQ",&utxosQ,&uitem->DL); return(clonestr("{\"result\":\"success\"}")); - } else printf("valid utxos sig\n"); + } else printf("valid utxos sig %s\n",bits256_str(str,pubp->pubkey)); } return(clonestr("{\"error\":\"sig failure\"}")); } From 236d13b5ed44ca8db31e286fef93eb9430c1a343 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:31:22 +0200 Subject: [PATCH 1791/2732] Test --- iguana/exchanges/LP_signatures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b23ba449b..9939fc064 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -288,7 +288,8 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { if ( pubp != 0 ) pubp->numerrors++; - printf("LP_utxos_sigcheck failure.%d, probably from %s with older version\n",pubp!=0?pubp->numerrors:-1,bits256_str(str,pubkey)); + if ( pubp != 0 && pubp->numerrors > 1 ) + printf("LP_utxos_sigcheck failure.%d, probably from %s with older version\n",pubp!=0?pubp->numerrors:-1,bits256_str(str,pubkey)); } retval = -1; } else retval = 0; From 90fe08fb27c1d183f63cc5014a0ed8018548a29c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:38:28 +0200 Subject: [PATCH 1792/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 9939fc064..3a4729287 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -379,7 +379,7 @@ char *LP_postutxos_recv(cJSON *argjson) uitem->argjson = jduplicate(argjson); queue_enqueue("utxosQ",&utxosQ,&uitem->DL); return(clonestr("{\"result\":\"success\"}")); - } else printf("valid utxos sig %s\n",bits256_str(str,pubp->pubkey)); + } //else printf("valid utxos sig %s\n",bits256_str(str,pubp->pubkey)); } return(clonestr("{\"error\":\"sig failure\"}")); } From d58c6ed6fe5680d722b47c70cc06c6d526465d60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 16:38:59 +0200 Subject: [PATCH 1793/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 3a4729287..960e36127 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -372,7 +372,7 @@ char *LP_postutxos_recv(cJSON *argjson) if ( (obj= jobj(argjson,"utxos")) != 0 ) { utxoshash = LP_utxoshash_calc(obj); - char str[65]; //printf("got utxoshash %s\n",bits256_str(str,utxoshash)); + //char str[65]; //printf("got utxoshash %s\n",bits256_str(str,utxoshash)); if ( LP_utxos_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,utxoshash) == 0 ) { uitem = calloc(1,sizeof(*uitem)); From 8643c03c787d4946b18735bb10911bca93e684ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 18:02:17 +0200 Subject: [PATCH 1794/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index d4b0273ec..327bc0b3c 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,6 +7,6 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/realDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c From 5fdf07760a52638bb6365b4983f3b0df5943e547 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 18:03:55 +0200 Subject: [PATCH 1795/2732] Test --- iguana/exchanges/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 327bc0b3c..4e5727688 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,6 +7,6 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/realDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm - emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c + emcc -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/realDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + #emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c From ff56647b4c535961732025c6afdd97d830b6a0f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 18:16:39 +0200 Subject: [PATCH 1796/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2ea7ee2cd..71d9e6c0a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1074,7 +1074,6 @@ char *barterDEX(char *argstr) if ( ctx == 0 ) ctx = bitcoin_ctx(); printf("barterDEX.(%s)\n",argstr); - return(clonestr("{\"error\":\"couldnt parse request\"}")); if ( (argjson= cJSON_Parse(argstr)) != 0 ) { retstr = LP_command_process(ctx,LP_myipaddr,LP_mypubsock,argjson,(uint8_t *)argstr,(int32_t)strlen(argstr)); From ad35268432b9b03ffe750ecd713470da8a1e06f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 18:19:19 +0200 Subject: [PATCH 1797/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 4e5727688..274471167 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,6 +7,6 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/realDEX.js exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.hmtl exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm #emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c From ea5e687f0e27c88e4d952db2c33462bb7e1c9526 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 18:26:06 +0200 Subject: [PATCH 1798/2732] Test --- iguana/exchanges/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 274471167..1af1e611a 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -7,6 +7,6 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm all: - emcc -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.hmtl exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.hmtl exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm #emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c From c9df55466f5e92546b7d42d61ad70628225e0309 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 18:27:26 +0200 Subject: [PATCH 1799/2732] Test --- iguana/exchanges/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/Makefile b/iguana/exchanges/Makefile index 1af1e611a..be75a297c 100644 --- a/iguana/exchanges/Makefile +++ b/iguana/exchanges/Makefile @@ -6,7 +6,10 @@ #emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm +#emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.hmtl exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm + +#emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c + all: - emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_barterDEX', '_main']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/index.hmtl exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm - #emcc -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -I../includes -I../crypto777 -o /var/www/html/barterDEX.js exchanges/barterDEX.c + emcc -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_barterDEX']" -s ABORTING_MALLOC=0 -s ASSERTIONS=1 -s ASYNCIFY=1 -s TOTAL_MEMORY=167772160 --embed-file coins.json -DFROM_JS -O2 -I../includes -I../crypto777 -o /var/www/html/index.html exchanges/mm.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c mini-gmp.c secp256k1/src/secp256k1.c -lm From 4eb0f23c945c4dd0355419a8dc3aa141c24b8876 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 21:41:21 +0200 Subject: [PATCH 1800/2732] Chips fix --- iguana/coins/chips_7776 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/coins/chips_7776 b/iguana/coins/chips_7776 index e09f9c87c..38f1e5f1c 100755 --- a/iguana/coins/chips_7776 +++ b/iguana/coins/chips_7776 @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"chips.conf\",\"path\":\"${HOME#"/"}/.chips\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"CHIPS\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":57777,\"minconfirms\":1}" +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"chips.conf\",\"path\":\"${HOME#"/"}/.chips\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"CHIPS\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":57777,\"minconfirms\":1,\"pubval\":60,\"p2shval\":85,\"wifval\":188}" From 5f26e29d4d62fd8e489dd791e465c91c396594c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 21:49:43 +0200 Subject: [PATCH 1801/2732] Test --- iguana/dpow/dpow_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 6da004617..5f695f84a 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -820,7 +820,7 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits } } if ( haveutxo == 0 ) - printf("no utxo: need to fund address.(%s) or wait for splitfund to confirm\n",coinaddr); + printf("no %s utxo: need to fund address.(%s) or wait for splitfund to confirm\n",coin->symbol,coinaddr); } //else printf("null utxo array size\n"); free_json(unspents); } else printf("null return from dpow_listunspent\n"); From e9da3e786e390e45d599239fe9c3979808b8cc85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 22:37:17 +0200 Subject: [PATCH 1802/2732] Server.version --- iguana/exchanges/LP_socket.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index af5cfb11e..9749f2273 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -454,7 +454,16 @@ cJSON *electrum_hasharg(char *symbol,struct electrum_info *ep,cJSON **retjsonp,c return(electrum_submit(symbol,ep,retjsonp,method,params,timeout)); } -cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.version",ELECTRUM_TIMEOUT)); } +cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) +{ + char params[128]; cJSON *retjson; + if ( retjsonp == 0 ) + retjsonp = &retjson; + sprintf(params,"[\"client_name\":\"barterDEX\", \"protocol_version\":[\"1.1\", \"1.1\"]]"); + return(electrum_submit(symbol,ep,retjsonp,"server.version",params,ELECTRUM_TIMEOUT)); +} + + cJSON *electrum_banner(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.banner",ELECTRUM_TIMEOUT)); } cJSON *electrum_donation(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.donation_address",ELECTRUM_TIMEOUT)); } cJSON *electrum_peers(char *symbol,struct electrum_info *ep,cJSON **retjsonp) { return(electrum_noargs(symbol,ep,retjsonp,"server.peers.subscribe",ELECTRUM_TIMEOUT)); } @@ -767,7 +776,7 @@ void electrum_test() struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { - struct electrum_info *ep=0; int32_t i,sock; struct stritem *sitem; char name[512],*str = "init string"; + struct electrum_info *ep=0; cJSON *retjson; int32_t i,sock; struct stritem *sitem; char name[512],*str = "init string"; *alreadyp = 0; portable_mutex_lock(&LP_electrummutex); for (i=0; ipendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); electrum_server(symbol,ep); + if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) + printf("electrum_version %s\n",jprint(retjson,1)); } return(ep); } From 98b04c7b44778198e81e240806538a8b441709fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 22:45:05 +0200 Subject: [PATCH 1803/2732] Test --- iguana/exchanges/LP_socket.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9749f2273..45f2d73f7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -776,7 +776,7 @@ void electrum_test() struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipaddr,uint16_t port,int32_t bufsize) { - struct electrum_info *ep=0; cJSON *retjson; int32_t i,sock; struct stritem *sitem; char name[512],*str = "init string"; + struct electrum_info *ep=0; int32_t i,sock; struct stritem *sitem; char name[512],*str = "init string"; *alreadyp = 0; portable_mutex_lock(&LP_electrummutex); for (i=0; ipendingQ)) == 0 && strcmp(sitem->str,str) != 0 ) printf("error with string pendingQ sitem.%p (%s)\n",sitem,sitem==0?0:sitem->str); electrum_server(symbol,ep); - if ( (retjson= electrum_version(symbol,ep,0)) != 0 ) - printf("electrum_version %s\n",jprint(retjson,1)); } return(ep); } @@ -904,9 +902,11 @@ void LP_dedicatedloop(void *arg) struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; - if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 ) + if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) free_json(retjson); - printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); + if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) + printf("electrum_version %s\n",jprint(retjson,1)); + printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { flag = 0; From c5eb47ce8d9a5720ca25a74a68424977089e3969 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 22:46:54 +0200 Subject: [PATCH 1804/2732] Test --- iguana/exchanges/LP_socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 45f2d73f7..e6b51ae6c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -459,7 +459,7 @@ cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp) char params[128]; cJSON *retjson; if ( retjsonp == 0 ) retjsonp = &retjson; - sprintf(params,"[\"client_name\":\"barterDEX\", \"protocol_version\":[\"1.1\", \"1.1\"]]"); + sprintf(params,"[\"barterDEX\", [\"1.1\", \"1.1\"]]"); return(electrum_submit(symbol,ep,retjsonp,"server.version",params,ELECTRUM_TIMEOUT)); } @@ -902,11 +902,11 @@ void LP_dedicatedloop(void *arg) struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; - if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) - free_json(retjson); if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) printf("electrum_version %s\n",jprint(retjson,1)); - printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); + if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) + free_json(retjson); + printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { flag = 0; From c5b1b8b9a4b796bb69da0b15b3d818778fbafea8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 22:56:12 +0200 Subject: [PATCH 1805/2732] Test --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e6b51ae6c..ca409527a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -902,6 +902,7 @@ void LP_dedicatedloop(void *arg) struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; + sleep(2); if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) printf("electrum_version %s\n",jprint(retjson,1)); if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) From d3fed6994fd25224f57958cb4208693336c19b77 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 23:03:35 +0200 Subject: [PATCH 1806/2732] Test --- iguana/iguana_notary.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 65d42428e..c8808191b 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -145,8 +145,10 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } else { - freq = 1; minsigs = DPOW_MIN_ASSETCHAIN_SIGS; + if ( strcmp("CHIPS",dp->symbol) == 0 ) + freq = 100; + else freq = 1; } dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); if ( strcmp(dp->dest,"KMD") == 0 ) From 7ac36c88ce37fa19f7c9d374299a97ea165a2301 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 23:36:43 +0200 Subject: [PATCH 1807/2732] Merkleroot cache --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_utxo.c | 44 ++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 91ccaae0d..4f9f4acc4 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -231,6 +231,7 @@ struct iguana_info uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen; + bits256 cachedmerkle; int32_t cachedmerkleheight; }; struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout,height; }; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index cb3d90a6e..aca156389 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -362,9 +362,31 @@ bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proof return(hash); } +bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t height) +{ + cJSON *hdrobj; bits256 merkleroot; + memset(merkleroot.bytes,0,sizeof(merkleroot)); + if ( coin->cachedmerkleheight == height ) + return(coin->cachedmerkle); + if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 ) + { + if ( jobj(hdrobj,"merkle_root") != 0 ) + { + merkleroot = jbits256(hdrobj,"merkle_root"); + if ( bits256_nonz(merkleroot) != 0 ) + { + coin->cachedmerkle = merkleroot; + coin->cachedmerkleheight = height; + } + } + free_json(hdrobj); + } else printf("couldnt get header for ht.%d\n",height); + return(merkleroot); +} + int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) { - cJSON *merkobj,*merkles,*hdrobj; bits256 roothash,merkleroot; int32_t m,SPV = 0; + cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) { char str[65],str2[65],str3[65]; @@ -373,20 +395,16 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) { roothash = validate_merkle(jint(merkobj,"pos"),txid,merkles,m); - if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 ) + merkleroot = LP_merkleroot(coin,ep,height); + if ( bits256_nonz(merkleroot) != 0 ) { - if ( jobj(hdrobj,"merkle_root") != 0 ) + if ( bits256_cmp(merkleroot,roothash) == 0 ) { - merkleroot = jbits256(hdrobj,"merkle_root"); - if ( bits256_cmp(merkleroot,roothash) == 0 ) - { - SPV = height; - //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); - } - else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s (%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot),jprint(hdrobj,0)); - } else SPV = 0; - free_json(hdrobj); - } else printf("couldnt get header for ht.%d\n",height); + SPV = height; + //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + } + else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + } else SPV = 0; } if ( SPV < 0 ) { From 6c18756834d2a958ef544a937112f4ed9c3a890c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:30:45 +0200 Subject: [PATCH 1808/2732] Initial tradebots --- iguana/exchanges/LP_commands.c | 10 + iguana/exchanges/LP_include.h | 6 +- iguana/exchanges/LP_nativeDEX.c | 10 +- iguana/exchanges/LP_tradebots.c | 454 ++++++++++++++++++++++++++++++++ iguana/exchanges/bot_buy | 3 + iguana/exchanges/bot_list | 3 + iguana/exchanges/bot_pause | 3 + iguana/exchanges/bot_resume | 3 + iguana/exchanges/bot_sell | 3 + iguana/exchanges/bot_settings | 3 + iguana/exchanges/bot_status | 3 + iguana/exchanges/bot_stop | 3 + iguana/kmd_lookup.h | 2 +- 13 files changed, 501 insertions(+), 5 deletions(-) create mode 100644 iguana/exchanges/LP_tradebots.c create mode 100755 iguana/exchanges/bot_buy create mode 100755 iguana/exchanges/bot_list create mode 100755 iguana/exchanges/bot_pause create mode 100755 iguana/exchanges/bot_resume create mode 100755 iguana/exchanges/bot_sell create mode 100755 iguana/exchanges/bot_settings create mode 100755 iguana/exchanges/bot_status create mode 100755 iguana/exchanges/bot_stop diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 72b40cdf5..e495179a7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -141,6 +141,14 @@ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ stop()\n\ +bot_list()\n\ +bot_buy(base, rel, maxprice, relvolume) -> botid\n\ +bot_sell(base, rel, minprice, basevolume) -> botid\n\ +bot_settings(botid, newprice, newvolume)\n\ +bot_status(botid)\n\ +bot_stop(botid)\n\ +bot_pause(botid)\n\ +bot_resume(botid)\n\ \"}")); //sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ @@ -445,6 +453,8 @@ stop()\n\ return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); else if ( strcmp(method,"trusted") == 0 ) return(LP_pubkey_trusted()); + else if ( (retstr= LP_istradebots_command(ctx,pubsock,method,argjson)) != 0 ) + return(retstr); } // end of protected localhost commands if ( IAMLP == 0 ) { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4f9f4acc4..a250c9434 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,8 +23,8 @@ #ifdef FROM_JS #include -#define sleep(x) emscripten_sleep((x) * 1000) -void emscripten_usleep(int32_t x); +#define sleep(x) emscripten_usleep((x) * 1000000) +void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define usleep(x) emscripten_usleep(x) // ./autogen.sh // emconfigure ./configure CFLAGS="-s PTHREAD_POOL_SIZE=8 -s USE_PTHREADS=1 -O2" @@ -40,7 +40,7 @@ void emscripten_usleep(int32_t x); #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 15 #define ELECTRUM_TIMEOUT 10 -#define LP_ELECTRUM_MAXERRORS 3 +#define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 // RTmetrics diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 71d9e6c0a..06276ed78 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +// limit bot // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -25,7 +26,7 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex; int32_t LP_canbind; char *Broadcaststr,*Reserved_msgs[1000]; int32_t num_Reserved_msgs,max_Reserved_msgs; @@ -105,6 +106,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_forwarding.c" #include "LP_signatures.c" #include "LP_ordermatch.c" +#include "LP_tradebots.c" #include "LP_portfolio.c" #include "LP_messages.c" #include "LP_commands.c" @@ -883,6 +885,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_butxomutex); portable_mutex_init(&LP_reservedmutex); portable_mutex_init(&LP_nanorecvsmutex); + portable_mutex_init(&LP_tradebotsmutex); myipaddr = clonestr("127.0.0.1"); #ifndef _WIN32 #ifndef FROM_JS @@ -1025,6 +1028,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_tradebot_timeslices,(void *)myipaddr) != 0 ) + { + printf("error launching LP_tradebot_timeslices for port.%u\n",myport); + exit(-1); + } int32_t nonz; while ( 1 ) { diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c new file mode 100644 index 000000000..c22a2db50 --- /dev/null +++ b/iguana/exchanges/LP_tradebots.c @@ -0,0 +1,454 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_tradebots.c +// marketmaker +// + +#define TRADEBOTS_GAPTIME 60 +#define LP_TRADEBOTS_MAXTRADES 100 + +struct LP_tradebot_trade +{ + double maxprice,relvolume,basevol,relvol; + uint64_t aliceid; + int32_t dispdir; + uint32_t started,finished,requestid,quoteid; + char base[32],rel[32]; +}; + +struct LP_tradebot +{ + struct LP_tradebot *next,*prev; + char name[128],base[32],rel[32]; + int32_t numtrades,numpending,completed,dispdir; + double maxprice,totalrelvolume,basesum,relsum,pendbasesum,pendrelsum; + uint32_t dead,pause,started,id; + struct LP_tradebot_trade *trades[LP_TRADEBOTS_MAXTRADES]; +} *LP_tradebots; + +/*struct tradebot_trade *tradebot_issuetrade(struct LP_tradebot *bot,char *base,char *rel,double price,double volume,int32_t dir) +{ + struct tradebot_trade *tr; char *str; int32_t maxseconds = 30,dotrade = 1; + bot = realloc(bot,sizeof(*bot) + (bot->numtrades + 1) * sizeof(bot->trades[0])); + tr = &bot->trades[bot->numtrades++]; + memset(tr,0,sizeof(*tr)); + tr->price = price, tr->volume = volume, tr->dir = dir; + safecopy(tr->exchangestr,exchange->name,sizeof(tr->exchangestr)); + safecopy(tr->base,base,sizeof(tr->base)); + safecopy(tr->rel,rel,sizeof(tr->rel)); + if ( (str= exchanges777_Qtrade(exchange,base,rel,maxseconds,dotrade,dir,price,volume,0)) != 0 ) + free(str); + return(tr); +}*/ + +void LP_tradebot_updatestats(struct LP_tradebot *bot,struct LP_tradebot_trade *tp) +{ + char *swapstr,*status; int32_t flag; cJSON *swapjson; + if ( (swapstr= basilisk_swapentry(tp->requestid,tp->quoteid)) != 0 ) + { + flag = 0; + if ( (swapjson= cJSON_Parse(swapstr)) != 0 ) + { + tp->basevol = dstr(j64bits(swapjson,"satoshis")); + tp->relvol = dstr(j64bits(swapjson,"destsatoshis")); + tp->aliceid = j64bits(swapjson,"aliceid"); + if ( (status= jstr(swapjson,"status")) != 0 ) + { + if ( strcmp(status,"finished") == 0 ) + { + flag = 1; + bot->completed++; + bot->basesum += tp->basevol; + bot->relsum += tp->relvol; + } + } + if ( flag == 0 ) + { + bot->numpending++; + bot->pendbasesum += tp->basevol; + bot->pendrelsum += tp->relvol; + } + free_json(swapjson); + } + free(swapstr); + } +} + +void LP_tradebot_calcstats(struct LP_tradebot *bot) +{ + int32_t i; + bot->basesum = bot->relsum = bot->pendbasesum = bot->pendrelsum = 0.; + bot->numpending = bot->completed = 0; + for (i=0; inumtrades; i++) + LP_tradebot_updatestats(bot,bot->trades[i]); +} + +double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) +{ + *basevolumep = 0.; + if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) + { + *basevolumep = (relvolume / maxprice); + return(1. / maxprice); + } + return(0.); +} + +cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) +{ + double price,basevol; cJSON *item = cJSON_CreateObject(); + jaddnum(item,"requestid",tp->requestid); + jaddnum(item,"quoteid",tp->quoteid); + if ( tp->basevol > SMALLVAL && tp->relvol > SMALLVAL ) + { + if ( dispflag > 0 ) + { + jaddnum(item,"price",tp->relvol/tp->basevol); + jaddnum(item,"volume",tp->relvol); + } + else + { + price = LP_pricevol_invert(&basevol,tp->basevol / tp->relvol,tp->relvol); + jaddnum(item,"price",price); + jaddnum(item,"volume",basevol); + } + } + return(item); +} + +cJSON *LP_tradebot_json(struct LP_tradebot *bot) +{ + int32_t i; double aveprice,basevolume,vol; cJSON *json,*array; + json = cJSON_CreateObject(); + jaddstr(json,"result","success"); + jaddstr(json,"name",bot->name); + jaddnum(json,"botid",bot->id); + jaddnum(json,"started",bot->started); + if ( bot->pause != 0 ) + jaddnum(json,"paused",bot->pause); + if ( bot->dead != 0 ) + jaddnum(json,"stopped",bot->dead); + if ( bot->dispdir > 0 ) + { + jaddstr(json,"base",bot->base); + jaddstr(json,"rel",bot->rel); + jaddnum(json,"maxprice",bot->maxprice); + jaddnum(json,"totalvolume",bot->totalrelvolume); + if ( (vol= bot->relsum) > SMALLVAL ) + { + jaddnum(json,"aveprice",bot->basesum/vol); + jaddnum(json,"volume",vol); + } + } + else + { + jaddstr(json,"base",bot->rel); + jaddstr(json,"rel",bot->base); + aveprice = LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); + jaddnum(json,"minprice",aveprice); + jaddnum(json,"totalvolume",basevolume); + if ( (vol= bot->relsum) > SMALLVAL ) + { + aveprice = LP_pricevol_invert(&basevolume,bot->basesum / vol,vol); + jaddnum(json,"aveprice",aveprice); + jaddnum(json,"volume",basevolume); + } + } + array = cJSON_CreateArray(); + LP_tradebot_calcstats(bot); + for (i=0; inumtrades; i++) + { + jaddi(array,LP_tradebot_tradejson(bot->trades[i],bot->dispdir)); + jadd(json,"trades",array); + } + if ( bot->basesum > SMALLVAL && bot->relsum > SMALLVAL && bot->completed > 0 ) + { + jaddnum(json,"completed",bot->completed); + jaddnum(json,"percentage",100. * (bot->relsum / bot->totalrelvolume)); + if ( bot->dispdir > 0 ) + { + jaddnum(json,"aveprice",bot->relsum / bot->basesum); + jaddnum(json,"volume",bot->relsum); + } + else + { + jaddnum(json,"aveprice",bot->basesum / bot->relsum); + jaddnum(json,"volume",bot->basesum); + } + } + if ( bot->pendbasesum > SMALLVAL && bot->pendrelsum > SMALLVAL && bot->numpending > 0 ) + { + jaddnum(json,"pending",bot->numpending); + if ( bot->dispdir > 0 ) + { + jaddnum(json,"pendingprice",bot->pendrelsum / bot->pendbasesum); + jaddnum(json,"pendingvolume",bot->pendrelsum); + } + else + { + jaddnum(json,"pendingprice",bot->pendbasesum / bot->pendrelsum); + jaddnum(json,"pendingvolume",bot->pendbasesum); + } + } + return(json); +} + +struct LP_tradebot *_LP_tradebotfind(uint32_t botid) +{ + struct LP_tradebot *tmp,*bot,*retbot = 0; + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + { + if ( botid == bot->id ) + { + retbot = bot; + break; + } + } + return(retbot); +} + +struct LP_tradebot *LP_tradebotfind(uint32_t botid) +{ + struct LP_tradebot *retbot = 0; + portable_mutex_lock(&LP_tradebotsmutex); + retbot = _LP_tradebotfind(botid); + portable_mutex_unlock(&LP_tradebotsmutex); + return(retbot); +} + +void LP_tradebotadd(struct LP_tradebot *bot) +{ + portable_mutex_lock(&LP_tradebotsmutex); + while ( _LP_tradebotfind(bot->id) != 0 ) + { + printf("BOT collision at %u, ok if rare\n",bot->id); + bot->id++; + } + DL_APPEND(LP_tradebots,bot); + portable_mutex_unlock(&LP_tradebotsmutex); +} + +void LP_tradebot_timeslice(struct LP_tradebot *bot) +{ + double minprice,basevol,relvol; + if ( bot->dead == 0 ) + { + if ( bot->pause == 0 ) + { + if ( (rand() % 100) == 0 ) + { + if ( bot->dispdir > 0 ) + { + printf("simulated trade %s/%s maxprice %.8f volume %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum); + } + else + { + minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); + printf("simulated trade %s/%s maxprice %.8f volume %.8f\n",bot->rel,bot->base,minprice,basevol); + } + relvol = bot->totalrelvolume * 0.1; + minprice = LP_pricevol_invert(&basevol,bot->maxprice,relvol); + bot->relsum += relvol; + bot->basesum += basevol; + } + } + } + else + { + //DL_DELETE(LP_tradebots,bot); + //free(bot); + } +} + +void LP_tradebot_timeslices(void *ignore) +{ + struct LP_tradebot *bot,*tmp; + while ( 1 ) + { + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + { + portable_mutex_lock(&LP_tradebotsmutex); + LP_tradebot_timeslice(bot); + portable_mutex_unlock(&LP_tradebotsmutex); + sleep(1); + } + sleep(30); + } +} + +char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) +{ + struct LP_tradebot *bot,*tmp; cJSON *array = cJSON_CreateArray(); + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + { + jaddinum(array,bot->id); + } + return(jprint(array,1)); +} + +char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) +{ + struct LP_tradebot *bot; + if ( (bot= calloc(1,sizeof(*bot))) != 0 ) + { + safecopy(bot->base,base,sizeof(bot->base)); + safecopy(bot->rel,rel,sizeof(bot->rel)); + bot->dispdir = dispdir, bot->maxprice = maxprice, bot->totalrelvolume = relvolume; + bot->started = (uint32_t)time(NULL); + if ( dispdir > 0 ) + sprintf(bot->name,"%s_%s.%d",base,rel,bot->started); + else sprintf(bot->name,"%s_%s.%d",rel,base,bot->started); + bot->id = calc_crc32(0,(uint8_t *)bot,sizeof(*bot)); + LP_tradebotadd(bot); + return(jprint(LP_tradebot_json(bot),1)); + } + return(0); +} + +char *LP_tradebot_limitbuy(void *ctx,int32_t pubsock,cJSON *argjson) +{ + double relvolume,maxprice; char *base,*rel; + base = jstr(argjson,"base"); + rel = jstr(argjson,"rel"); + maxprice = jdouble(argjson,"maxprice"); + relvolume = jdouble(argjson,"relvolume"); + if ( LP_priceinfofind(base) != 0 && LP_priceinfofind(rel) != 0 && maxprice > SMALLVAL && maxprice < SATOSHIDEN && relvolume > 0.0001 && relvolume < SATOSHIDEN ) + return(LP_tradebot_buy(1,base,rel,maxprice,relvolume)); + return(clonestr("{\"error\":\"invalid parameter\"}")); +} + +char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) +{ + double relvolume,maxprice,price,basevolume; char *base,*rel; + base = jstr(argjson,"base"); + rel = jstr(argjson,"rel"); + price = jdouble(argjson,"minprice"); + basevolume = jdouble(argjson,"basevolume"); + if ( LP_priceinfofind(base) != 0 && LP_priceinfofind(rel) != 0 && price > SMALLVAL && price < SATOSHIDEN && basevolume > 0.0001 && basevolume < SATOSHIDEN ) + { + maxprice = 1. / price; + relvolume = (price * basevolume); + return(LP_tradebot_buy(-1,rel,base,maxprice,relvolume)); + } + return(clonestr("{\"error\":\"invalid parameter\"}")); +} + +char *LP_tradebot_settings(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid) +{ + struct LP_tradebot *bot; double newprice,newvolume; + if ( (bot= LP_tradebotfind(botid)) != 0 ) + { + if ( bot->dead != 0 ) + return(clonestr("{\"error\":\"botid aleady stopped\"}")); + newprice = jdouble(argjson,"newprice"); + newvolume = jdouble(argjson,"newvolume"); + if ( (newprice > SMALLVAL && newprice < SATOSHIDEN) || (newvolume > 0.0001 && newvolume < SATOSHIDEN) ) + { + if ( bot->dispdir < 0 ) + { + if ( newprice > SMALLVAL ) + bot->maxprice = 1. / newprice; + if ( newvolume > SMALLVAL ) + bot->totalrelvolume = (bot->maxprice * newvolume); + } + else + { + if ( newprice > SMALLVAL ) + bot->maxprice = newprice; + if ( newvolume > SMALLVAL ) + bot->totalrelvolume = newvolume; + } + } + return(jprint(LP_tradebot_json(bot),1)); + } + return(clonestr("{\"error\":\"couldnt find botid\"}")); +} + +char *LP_tradebot_status(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid) +{ + struct LP_tradebot *bot; + if ( (bot= LP_tradebotfind(botid)) != 0 ) + return(jprint(LP_tradebot_json(bot),1)); + return(clonestr("{\"error\":\"couldnt find botid\"}")); +} + +char *LP_tradebot_stop(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid) +{ + struct LP_tradebot *bot; + if ( (bot= LP_tradebotfind(botid)) != 0 ) + { + bot->dead = (uint32_t)time(NULL); + return(clonestr("{\"result\":\"success\"}")); + } + return(clonestr("{\"error\":\"couldnt find botid\"}")); +} + +char *LP_tradebot_pause(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid) +{ + struct LP_tradebot *bot; + if ( (bot= LP_tradebotfind(botid)) != 0 ) + { + if ( bot->dead != 0 ) + return(clonestr("{\"error\":\"botid aleady stopped\"}")); + bot->pause = (uint32_t)time(NULL); + return(clonestr("{\"result\":\"success\"}")); + } + return(clonestr("{\"error\":\"couldnt find botid\"}")); +} + +char *LP_tradebot_resume(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid) +{ + struct LP_tradebot *bot; + if ( (bot= LP_tradebotfind(botid)) != 0 ) + { + if ( bot->dead != 0 ) + return(clonestr("{\"error\":\"botid aleady stopped\"}")); + if ( bot->pause == 0 ) + return(clonestr("{\"result\":\"success\",\"status\":\"botid not paused\"}")); + bot->pause = 0; + return(clonestr("{\"result\":\"success\"}")); + } + return(clonestr("{\"error\":\"couldnt find botid\"}")); +} + +char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjson) +{ + uint32_t botid; + if ( strcmp(method,"bot_list") == 0 ) + return(LP_tradebot_list(ctx,pubsock,argjson)); + else if ( strcmp(method,"bot_buy") == 0 ) + return(LP_tradebot_limitbuy(ctx,pubsock,argjson)); + else if ( strcmp(method,"bot_sell") == 0 ) + return(LP_tradebot_limitsell(ctx,pubsock,argjson)); + if ( (botid= juint(argjson,"botid")) == 0 ) + return(clonestr("{\"error\":\"no botid specified\"}")); + else + { + if ( strcmp(method,"bot_status") == 0 ) + return(LP_tradebot_status(ctx,pubsock,argjson,botid)); + else if ( strcmp(method,"bot_settings") == 0 ) + return(LP_tradebot_settings(ctx,pubsock,argjson,botid)); + else if ( strcmp(method,"bot_stop") == 0 ) + return(LP_tradebot_stop(ctx,pubsock,argjson,botid)); + else if ( strcmp(method,"bot_pause") == 0 ) + return(LP_tradebot_pause(ctx,pubsock,argjson,botid)); + else if ( strcmp(method,"bot_resume") == 0 ) + return(LP_tradebot_resume(ctx,pubsock,argjson,botid)); + } + return(0); +} + diff --git a/iguana/exchanges/bot_buy b/iguana/exchanges/bot_buy new file mode 100755 index 000000000..d26f5a8f7 --- /dev/null +++ b/iguana/exchanges/bot_buy @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_buy\",\"base\":\"REVS\",\"rel\":\"KMD\",\"maxprice\":3,\"relvolume\":10.0}" diff --git a/iguana/exchanges/bot_list b/iguana/exchanges/bot_list new file mode 100755 index 000000000..40cb49145 --- /dev/null +++ b/iguana/exchanges/bot_list @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_list\"}" diff --git a/iguana/exchanges/bot_pause b/iguana/exchanges/bot_pause new file mode 100755 index 000000000..ed9323e71 --- /dev/null +++ b/iguana/exchanges/bot_pause @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_pause\",\"botid\":$1}" diff --git a/iguana/exchanges/bot_resume b/iguana/exchanges/bot_resume new file mode 100755 index 000000000..6d161b155 --- /dev/null +++ b/iguana/exchanges/bot_resume @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_resume\",\"botid\":$1}" diff --git a/iguana/exchanges/bot_sell b/iguana/exchanges/bot_sell new file mode 100755 index 000000000..3613db3cb --- /dev/null +++ b/iguana/exchanges/bot_sell @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_sell\",\"base\":\"REVS\",\"rel\":\"KMD\",\"minprice\":2,\"basevolume\":5.0}" diff --git a/iguana/exchanges/bot_settings b/iguana/exchanges/bot_settings new file mode 100755 index 000000000..f619f92e3 --- /dev/null +++ b/iguana/exchanges/bot_settings @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_settings\",\"botid\":$1,\"newprice\":$1,\"newvolume\":$2}" diff --git a/iguana/exchanges/bot_status b/iguana/exchanges/bot_status new file mode 100755 index 000000000..e64bc5ae7 --- /dev/null +++ b/iguana/exchanges/bot_status @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_status\",\"botid\":$1}" diff --git a/iguana/exchanges/bot_stop b/iguana/exchanges/bot_stop new file mode 100755 index 000000000..665e2ac9e --- /dev/null +++ b/iguana/exchanges/bot_stop @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_stop\",\"botid\":$1}" diff --git a/iguana/kmd_lookup.h b/iguana/kmd_lookup.h index 61f7f60b0..05cb91ad4 100755 --- a/iguana/kmd_lookup.h +++ b/iguana/kmd_lookup.h @@ -668,7 +668,7 @@ int32_t _kmd_bitcoinscan(struct iguana_info *coin) { if ( bits256_cmp(txid,jbits256(txjson,"txid")) != 0 ) { - printf("txid mismatch error ht.%d i.%d\n",loadheight,i); + printf("%s txid mismatch error ht.%d i.%d\n",coin->symbol,loadheight,i); continue; } vouts = jarray(&numvouts,txjson,"vout"); From 5b0cc4eef81ddded860718afdac7c674ccd18687 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:35:56 +0200 Subject: [PATCH 1809/2732] Test --- iguana/exchanges/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 4ec27cffc..ef6617a55 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp bot_buy bot_list bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From 075b55bf6383432989bd6e755bd0c71704eabe6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:38:53 +0200 Subject: [PATCH 1810/2732] Test --- iguana/exchanges/LP_tradebots.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index c22a2db50..7b6b6d442 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -303,6 +303,7 @@ char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { struct LP_tradebot *bot; + printf("disp.%d tradebot_buy(%s / %s) maxprice %.8f relvolume %.8f\n",dispdir,base,rel,maxprice,relvolume); if ( (bot= calloc(1,sizeof(*bot))) != 0 ) { safecopy(bot->base,base,sizeof(bot->base)); @@ -428,6 +429,7 @@ char *LP_tradebot_resume(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjson) { uint32_t botid; + printf("istradebots.(%s)\n",method); if ( strcmp(method,"bot_list") == 0 ) return(LP_tradebot_list(ctx,pubsock,argjson)); else if ( strcmp(method,"bot_buy") == 0 ) @@ -449,6 +451,7 @@ char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjs else if ( strcmp(method,"bot_resume") == 0 ) return(LP_tradebot_resume(ctx,pubsock,argjson,botid)); } + printf("not tradebots\n"); return(0); } From 8d3d8f791c24e473ade3889ec280d8565fc5b8f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:42:07 +0200 Subject: [PATCH 1811/2732] Test --- iguana/exchanges/LP_tradebots.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 7b6b6d442..ac9f8a157 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -327,6 +327,7 @@ char *LP_tradebot_limitbuy(void *ctx,int32_t pubsock,cJSON *argjson) rel = jstr(argjson,"rel"); maxprice = jdouble(argjson,"maxprice"); relvolume = jdouble(argjson,"relvolume"); + printf("limit buy %s/%s %.8f %.8f\n",base,rel,maxprice,relvolume); if ( LP_priceinfofind(base) != 0 && LP_priceinfofind(rel) != 0 && maxprice > SMALLVAL && maxprice < SATOSHIDEN && relvolume > 0.0001 && relvolume < SATOSHIDEN ) return(LP_tradebot_buy(1,base,rel,maxprice,relvolume)); return(clonestr("{\"error\":\"invalid parameter\"}")); From d966805c379b59bc49b21d95e230ceed6fb5023a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:43:54 +0200 Subject: [PATCH 1812/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e495179a7..2c147dc00 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -257,6 +257,8 @@ bot_resume(botid)\n\ return(basilisk_swapentries(base,rel,jint(argjson,"limit"))); else return(basilisk_swaplist(0,0)); } + else if ( (retstr= LP_istradebots_command(ctx,pubsock,method,argjson)) != 0 ) + return(retstr); if ( base != 0 && rel != 0 ) { double price,bid,ask; @@ -453,8 +455,6 @@ bot_resume(botid)\n\ return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); else if ( strcmp(method,"trusted") == 0 ) return(LP_pubkey_trusted()); - else if ( (retstr= LP_istradebots_command(ctx,pubsock,method,argjson)) != 0 ) - return(retstr); } // end of protected localhost commands if ( IAMLP == 0 ) { From 0ea6e850de82cc9047b5e168e7539d246d727fd0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:45:56 +0200 Subject: [PATCH 1813/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index ac9f8a157..7f2d92939 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -430,6 +430,8 @@ char *LP_tradebot_resume(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjson) { uint32_t botid; + if ( strncmp("bot_",method,strlen("bot_")) != 0 ) + return(0); printf("istradebots.(%s)\n",method); if ( strcmp(method,"bot_list") == 0 ) return(LP_tradebot_list(ctx,pubsock,argjson)); From 7fef554728828f6d7eba76f233b128c9f81fe141 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:50:41 +0200 Subject: [PATCH 1814/2732] Test --- iguana/exchanges/LP_tradebots.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 7f2d92939..87e74e32f 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -102,7 +102,7 @@ double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) *basevolumep = 0.; if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) { - *basevolumep = (relvolume / maxprice); + *basevolumep = (relvolume * maxprice); return(1. / maxprice); } return(0.); @@ -147,7 +147,7 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"base",bot->base); jaddstr(json,"rel",bot->rel); jaddnum(json,"maxprice",bot->maxprice); - jaddnum(json,"totalvolume",bot->totalrelvolume); + jaddnum(json,"totalrelvolume",bot->totalrelvolume); if ( (vol= bot->relsum) > SMALLVAL ) { jaddnum(json,"aveprice",bot->basesum/vol); @@ -160,7 +160,7 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"rel",bot->base); aveprice = LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); jaddnum(json,"minprice",aveprice); - jaddnum(json,"totalvolume",basevolume); + jaddnum(json,"totalbasevolume",basevolume); if ( (vol= bot->relsum) > SMALLVAL ) { aveprice = LP_pricevol_invert(&basevolume,bot->basesum / vol,vol); From 4fa7c97733749f2c623a77b99af1b1a092b63a8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 12:55:50 +0200 Subject: [PATCH 1815/2732] Test --- iguana/exchanges/LP_tradebots.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 87e74e32f..79c0dcc2c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -144,10 +144,13 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddnum(json,"stopped",bot->dead); if ( bot->dispdir > 0 ) { + jaddstr(json,"action","buy"); jaddstr(json,"base",bot->base); jaddstr(json,"rel",bot->rel); jaddnum(json,"maxprice",bot->maxprice); jaddnum(json,"totalrelvolume",bot->totalrelvolume); + LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); + jaddnum(json,"totalbasevolume",basevolume); if ( (vol= bot->relsum) > SMALLVAL ) { jaddnum(json,"aveprice",bot->basesum/vol); @@ -156,11 +159,13 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) } else { + jaddstr(json,"action","sell"); jaddstr(json,"base",bot->rel); jaddstr(json,"rel",bot->base); aveprice = LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); jaddnum(json,"minprice",aveprice); jaddnum(json,"totalbasevolume",basevolume); + jaddnum(json,"totalrelvolume",bot->totalrelvolume); if ( (vol= bot->relsum) > SMALLVAL ) { aveprice = LP_pricevol_invert(&basevolume,bot->basesum / vol,vol); @@ -432,7 +437,6 @@ char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjs uint32_t botid; if ( strncmp("bot_",method,strlen("bot_")) != 0 ) return(0); - printf("istradebots.(%s)\n",method); if ( strcmp(method,"bot_list") == 0 ) return(LP_tradebot_list(ctx,pubsock,argjson)); else if ( strcmp(method,"bot_buy") == 0 ) @@ -454,7 +458,6 @@ char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjs else if ( strcmp(method,"bot_resume") == 0 ) return(LP_tradebot_resume(ctx,pubsock,argjson,botid)); } - printf("not tradebots\n"); return(0); } From c311720c1d1b5f3298fb38195f0be1765643550d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:00:39 +0200 Subject: [PATCH 1816/2732] Test --- iguana/exchanges/LP_tradebots.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 79c0dcc2c..e8bace080 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -102,7 +102,7 @@ double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) *basevolumep = 0.; if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) { - *basevolumep = (relvolume * maxprice); + *basevolumep = (relvolume / maxprice); return(1. / maxprice); } return(0.); @@ -122,7 +122,7 @@ cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) } else { - price = LP_pricevol_invert(&basevol,tp->basevol / tp->relvol,tp->relvol); + price = LP_pricevol_invert(&basevol,tp->relvol / tp->basevol,tp->relvol); jaddnum(item,"price",price); jaddnum(item,"volume",basevol); } @@ -316,8 +316,8 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl bot->dispdir = dispdir, bot->maxprice = maxprice, bot->totalrelvolume = relvolume; bot->started = (uint32_t)time(NULL); if ( dispdir > 0 ) - sprintf(bot->name,"%s_%s.%d",base,rel,bot->started); - else sprintf(bot->name,"%s_%s.%d",rel,base,bot->started); + sprintf(bot->name,"buy_%s_%s.%d",base,rel,bot->started); + else sprintf(bot->name,"sell_%s_%s.%d",rel,base,bot->started); bot->id = calc_crc32(0,(uint8_t *)bot,sizeof(*bot)); LP_tradebotadd(bot); return(jprint(LP_tradebot_json(bot),1)); @@ -348,7 +348,7 @@ char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) if ( LP_priceinfofind(base) != 0 && LP_priceinfofind(rel) != 0 && price > SMALLVAL && price < SATOSHIDEN && basevolume > 0.0001 && basevolume < SATOSHIDEN ) { maxprice = 1. / price; - relvolume = (price * basevolume); + relvolume = (maxprice * basevolume); return(LP_tradebot_buy(-1,rel,base,maxprice,relvolume)); } return(clonestr("{\"error\":\"invalid parameter\"}")); From 1d99f9d69ebf00eae6968dbfc92aa16fb43ec586 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:04:45 +0200 Subject: [PATCH 1817/2732] Test --- iguana/exchanges/LP_tradebots.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index e8bace080..7805f2db9 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -340,7 +340,7 @@ char *LP_tradebot_limitbuy(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) { - double relvolume,maxprice,price,basevolume; char *base,*rel; + double relvolume,maxprice,price,basevolume,p,v; char *base,*rel; base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); price = jdouble(argjson,"minprice"); @@ -348,7 +348,9 @@ char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) if ( LP_priceinfofind(base) != 0 && LP_priceinfofind(rel) != 0 && price > SMALLVAL && price < SATOSHIDEN && basevolume > 0.0001 && basevolume < SATOSHIDEN ) { maxprice = 1. / price; - relvolume = (maxprice * basevolume); + relvolume = (price * basevolume); + p = LP_pricevol_invert(&v,maxprice,relvolume); + printf("minprice %.8f basevolume %.8f -> (%.8f %.8f) -> (%.8f %.8f)\n",price,basevolume,maxprice,relvolume,p,v); return(LP_tradebot_buy(-1,rel,base,maxprice,relvolume)); } return(clonestr("{\"error\":\"invalid parameter\"}")); From 648ba26b3324638e5727a285757fb912356821c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:09:48 +0200 Subject: [PATCH 1818/2732] Test --- iguana/exchanges/LP_tradebots.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 7805f2db9..db082b8b5 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -102,7 +102,7 @@ double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) *basevolumep = 0.; if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) { - *basevolumep = (relvolume / maxprice); + *basevolumep = (relvolume * maxprice); return(1. / maxprice); } return(0.); @@ -284,6 +284,7 @@ void LP_tradebot_timeslices(void *ignore) struct LP_tradebot *bot,*tmp; while ( 1 ) { + printf("LP_tradebot_timeslices\n"); DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { portable_mutex_lock(&LP_tradebotsmutex); From cd49afc49b8e022b0fc5d3907a2c28c0fa504c8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:18:32 +0200 Subject: [PATCH 1819/2732] Test --- iguana/exchanges/LP_tradebots.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index db082b8b5..1dc4cebec 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -149,7 +149,7 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"rel",bot->rel); jaddnum(json,"maxprice",bot->maxprice); jaddnum(json,"totalrelvolume",bot->totalrelvolume); - LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); + LP_pricevol_invert(&basevolume,1./bot->maxprice,bot->totalrelvolume); jaddnum(json,"totalbasevolume",basevolume); if ( (vol= bot->relsum) > SMALLVAL ) { @@ -254,7 +254,7 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) { if ( bot->pause == 0 ) { - if ( (rand() % 100) == 0 ) + //if ( (rand() % 100) == 0 ) { if ( bot->dispdir > 0 ) { @@ -292,7 +292,7 @@ void LP_tradebot_timeslices(void *ignore) portable_mutex_unlock(&LP_tradebotsmutex); sleep(1); } - sleep(30); + sleep(10); } } From 407d2573cc635dd06d75496533de2479a9c70b76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:26:55 +0200 Subject: [PATCH 1820/2732] Test --- iguana/exchanges/LP_tradebots.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 1dc4cebec..d286f13a1 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -35,7 +35,7 @@ struct LP_tradebot struct LP_tradebot *next,*prev; char name[128],base[32],rel[32]; int32_t numtrades,numpending,completed,dispdir; - double maxprice,totalrelvolume,basesum,relsum,pendbasesum,pendrelsum; + double maxprice,totalrelvolume,totalbasevolume,basesum,relsum,pendbasesum,pendrelsum; uint32_t dead,pause,started,id; struct LP_tradebot_trade *trades[LP_TRADEBOTS_MAXTRADES]; } *LP_tradebots; @@ -99,11 +99,13 @@ void LP_tradebot_calcstats(struct LP_tradebot *bot) double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) { + double price; *basevolumep = 0.; if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) { - *basevolumep = (relvolume * maxprice); - return(1. / maxprice); + price = (1. / maxprice); + *basevolumep = (relvolume * price); + return(price); } return(0.); } @@ -149,8 +151,9 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"rel",bot->rel); jaddnum(json,"maxprice",bot->maxprice); jaddnum(json,"totalrelvolume",bot->totalrelvolume); - LP_pricevol_invert(&basevolume,1./bot->maxprice,bot->totalrelvolume); - jaddnum(json,"totalbasevolume",basevolume); + LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); + jaddnum(json,"totalbasevolume2",basevolume); + jaddnum(json,"totalbasevolume",bot->totalbasevolume); if ( (vol= bot->relsum) > SMALLVAL ) { jaddnum(json,"aveprice",bot->basesum/vol); @@ -314,7 +317,10 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl { safecopy(bot->base,base,sizeof(bot->base)); safecopy(bot->rel,rel,sizeof(bot->rel)); - bot->dispdir = dispdir, bot->maxprice = maxprice, bot->totalrelvolume = relvolume; + bot->dispdir = dispdir; + bot->maxprice = maxprice; + bot->totalrelvolume = relvolume; + LP_pricevol_invert(&bot->totalbasevolume,maxprice,relvolume); bot->started = (uint32_t)time(NULL); if ( dispdir > 0 ) sprintf(bot->name,"buy_%s_%s.%d",base,rel,bot->started); From e0224484501870013b05d9dc6fe8336d9e64e787 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:32:05 +0200 Subject: [PATCH 1821/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index d286f13a1..dd1684234 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -104,7 +104,7 @@ double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) { price = (1. / maxprice); - *basevolumep = (relvolume * price); + *basevolumep = (relvolume * maxprice); return(price); } return(0.); From eb7ef221a7d578be827d0a01b3751a9aba5b3e83 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:35:16 +0200 Subject: [PATCH 1822/2732] Test --- iguana/exchanges/LP_tradebots.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index dd1684234..d10022dc5 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -104,7 +104,7 @@ double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) if ( maxprice > SMALLVAL && maxprice < SATOSHIDEN ) { price = (1. / maxprice); - *basevolumep = (relvolume * maxprice); + *basevolumep = (relvolume * price); return(price); } return(0.); @@ -354,7 +354,7 @@ char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) basevolume = jdouble(argjson,"basevolume"); if ( LP_priceinfofind(base) != 0 && LP_priceinfofind(rel) != 0 && price > SMALLVAL && price < SATOSHIDEN && basevolume > 0.0001 && basevolume < SATOSHIDEN ) { - maxprice = 1. / price; + maxprice = price; relvolume = (price * basevolume); p = LP_pricevol_invert(&v,maxprice,relvolume); printf("minprice %.8f basevolume %.8f -> (%.8f %.8f) -> (%.8f %.8f)\n",price,basevolume,maxprice,relvolume,p,v); From 9e9db4254801ffd65ffbf4603b4c46eec0cf37db Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:40:36 +0200 Subject: [PATCH 1823/2732] Test --- iguana/exchanges/LP_tradebots.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index d10022dc5..98f84cf61 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -261,17 +261,21 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) { if ( bot->dispdir > 0 ) { - printf("simulated trade %s/%s maxprice %.8f volume %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum); + printf("simulated trade buy %s/%s maxprice %.8f volume %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum); } else { minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); - printf("simulated trade %s/%s maxprice %.8f volume %.8f\n",bot->rel,bot->base,minprice,basevol); + printf("simulated trade sell %s/%s maxprice %.8f volume %.8f\n",bot->rel,bot->base,minprice,basevol); } relvol = bot->totalrelvolume * 0.1; minprice = LP_pricevol_invert(&basevol,bot->maxprice,relvol); bot->relsum += relvol; bot->basesum += basevol; + if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) + bot->dead = (uint32_t)time(NULL); + else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) + bot->pause = (uint32_t)time(NULL); } } } @@ -287,7 +291,6 @@ void LP_tradebot_timeslices(void *ignore) struct LP_tradebot *bot,*tmp; while ( 1 ) { - printf("LP_tradebot_timeslices\n"); DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { portable_mutex_lock(&LP_tradebotsmutex); @@ -357,7 +360,7 @@ char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) maxprice = price; relvolume = (price * basevolume); p = LP_pricevol_invert(&v,maxprice,relvolume); - printf("minprice %.8f basevolume %.8f -> (%.8f %.8f) -> (%.8f %.8f)\n",price,basevolume,maxprice,relvolume,p,v); + printf("minprice %.8f basevolume %.8f -> (%.8f %.8f) -> (%.8f %.8f)\n",price,basevolume,maxprice,relvolume,1./p,v); return(LP_tradebot_buy(-1,rel,base,maxprice,relvolume)); } return(clonestr("{\"error\":\"invalid parameter\"}")); From e99d385dfe4752edea73b1161f2c22f424f63b1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:43:52 +0200 Subject: [PATCH 1824/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 98f84cf61..7aa0eeb61 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -361,7 +361,7 @@ char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) relvolume = (price * basevolume); p = LP_pricevol_invert(&v,maxprice,relvolume); printf("minprice %.8f basevolume %.8f -> (%.8f %.8f) -> (%.8f %.8f)\n",price,basevolume,maxprice,relvolume,1./p,v); - return(LP_tradebot_buy(-1,rel,base,maxprice,relvolume)); + return(LP_tradebot_buy(-1,rel,base,p,relvolume)); } return(clonestr("{\"error\":\"invalid parameter\"}")); } From 6b6290cbf6e6ae4965ace5ea09839245e5fcbd67 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:47:05 +0200 Subject: [PATCH 1825/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 7aa0eeb61..9c2c6bf94 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -361,7 +361,7 @@ char *LP_tradebot_limitsell(void *ctx,int32_t pubsock,cJSON *argjson) relvolume = (price * basevolume); p = LP_pricevol_invert(&v,maxprice,relvolume); printf("minprice %.8f basevolume %.8f -> (%.8f %.8f) -> (%.8f %.8f)\n",price,basevolume,maxprice,relvolume,1./p,v); - return(LP_tradebot_buy(-1,rel,base,p,relvolume)); + return(LP_tradebot_buy(-1,rel,base,p,v)); } return(clonestr("{\"error\":\"invalid parameter\"}")); } From 2e8498ec5012bd800a975960d5f938f39ab578df Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 13:54:48 +0200 Subject: [PATCH 1826/2732] Test --- iguana/exchanges/LP_tradebots.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 9c2c6bf94..5919cf21d 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -151,8 +151,6 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"rel",bot->rel); jaddnum(json,"maxprice",bot->maxprice); jaddnum(json,"totalrelvolume",bot->totalrelvolume); - LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); - jaddnum(json,"totalbasevolume2",basevolume); jaddnum(json,"totalbasevolume",bot->totalbasevolume); if ( (vol= bot->relsum) > SMALLVAL ) { @@ -252,26 +250,26 @@ void LP_tradebotadd(struct LP_tradebot *bot) void LP_tradebot_timeslice(struct LP_tradebot *bot) { - double minprice,basevol,relvol; + double minprice,basevol,relvol,p,v; if ( bot->dead == 0 ) { if ( bot->pause == 0 ) { //if ( (rand() % 100) == 0 ) { + relvol = bot->totalrelvolume * 0.1; + p = LP_pricevol_invert(&v,bot->maxprice,relvol); if ( bot->dispdir > 0 ) { - printf("simulated trade buy %s/%s maxprice %.8f volume %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum); + printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base); } else { minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); - printf("simulated trade sell %s/%s maxprice %.8f volume %.8f\n",bot->rel,bot->base,minprice,basevol); + printf("simulated trade sell %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s min %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); } - relvol = bot->totalrelvolume * 0.1; - minprice = LP_pricevol_invert(&basevol,bot->maxprice,relvol); bot->relsum += relvol; - bot->basesum += basevol; + bot->basesum += v; if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) From 624cc50088e8a0fcf2882ef57221ea37bf65fe59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:00:53 +0200 Subject: [PATCH 1827/2732] Test --- iguana/exchanges/LP_tradebots.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 5919cf21d..f5111f6ac 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -165,8 +165,8 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"rel",bot->base); aveprice = LP_pricevol_invert(&basevolume,bot->maxprice,bot->totalrelvolume); jaddnum(json,"minprice",aveprice); - jaddnum(json,"totalbasevolume",basevolume); - jaddnum(json,"totalrelvolume",bot->totalrelvolume); + jaddnum(json,"totalbasevolume",bot->totalrelvolume); + jaddnum(json,"totalrelvolume",basevolume); if ( (vol= bot->relsum) > SMALLVAL ) { aveprice = LP_pricevol_invert(&basevolume,bot->basesum / vol,vol); @@ -175,7 +175,7 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) } } array = cJSON_CreateArray(); - LP_tradebot_calcstats(bot); + //LP_tradebot_calcstats(bot); for (i=0; inumtrades; i++) { jaddi(array,LP_tradebot_tradejson(bot->trades[i],bot->dispdir)); @@ -266,14 +266,23 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) else { minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); - printf("simulated trade sell %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s min %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); + printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s min %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); + } + if ( (rand() % 2) == 0 ) + { + bot->relsum += relvol; + bot->basesum += v; + } + else + { + bot->pendrelsum += relvol; + bot->pendbasesum += v; } - bot->relsum += relvol; - bot->basesum += v; if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); + printf("%s\n",jprint(LP_tradebot_json(bot),1)); } } } From bcdbb31c274f11492252a794f32f9883331d7697 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:04:27 +0200 Subject: [PATCH 1828/2732] Test --- iguana/exchanges/LP_tradebots.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f5111f6ac..1eab5a419 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -113,6 +113,8 @@ double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) { double price,basevol; cJSON *item = cJSON_CreateObject(); + if ( tp == 0 ) + return(cJSON_Parse("{}")); jaddnum(item,"requestid",tp->requestid); jaddnum(item,"quoteid",tp->quoteid); if ( tp->basevol > SMALLVAL && tp->relvol > SMALLVAL ) @@ -272,12 +274,15 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) { bot->relsum += relvol; bot->basesum += v; + bot->completed++; } else { bot->pendrelsum += relvol; bot->pendbasesum += v; + bot->numpending++; } + bot->numtrades++; if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) From 62a272713a75cd00872f98db693ea9eee3bb1751 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:15:43 +0200 Subject: [PATCH 1829/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 1eab5a419..5afa04414 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -270,7 +270,7 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s min %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); } - if ( (rand() % 2) == 0 ) + if ( 1 || (rand() % 2) == 0 ) { bot->relsum += relvol; bot->basesum += v; From 766feb92bfda24baa95bea0eb9343efeef8439c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:18:32 +0200 Subject: [PATCH 1830/2732] Test --- iguana/exchanges/LP_tradebots.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 5afa04414..9c841829e 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -179,10 +179,8 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) array = cJSON_CreateArray(); //LP_tradebot_calcstats(bot); for (i=0; inumtrades; i++) - { jaddi(array,LP_tradebot_tradejson(bot->trades[i],bot->dispdir)); - jadd(json,"trades",array); - } + jadd(json,"trades",array); if ( bot->basesum > SMALLVAL && bot->relsum > SMALLVAL && bot->completed > 0 ) { jaddnum(json,"completed",bot->completed); From 2b1f5e288b5240599f4d04dddeca9382825803ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:21:30 +0200 Subject: [PATCH 1831/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 9c841829e..e96c1d459 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -268,7 +268,7 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s min %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); } - if ( 1 || (rand() % 2) == 0 ) + if ( (rand() % 2) == 0 ) { bot->relsum += relvol; bot->basesum += v; From 4f14a69c59c1180a7ecb93beb96908c817c048f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:25:25 +0200 Subject: [PATCH 1832/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index e96c1d459..f3378045c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -258,7 +258,7 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) //if ( (rand() % 100) == 0 ) { relvol = bot->totalrelvolume * 0.1; - p = LP_pricevol_invert(&v,bot->maxprice,relvol); + p = LP_pricevol_invert(&v,bot->maxprice,relvol) * (double)(91 + (rand()%10)/100.); if ( bot->dispdir > 0 ) { printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base); From 5196c2d5ccd050492def9620c7fe924fac1c33d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:28:14 +0200 Subject: [PATCH 1833/2732] Test --- iguana/exchanges/LP_tradebots.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f3378045c..78c8d453e 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -250,15 +250,16 @@ void LP_tradebotadd(struct LP_tradebot *bot) void LP_tradebot_timeslice(struct LP_tradebot *bot) { - double minprice,basevol,relvol,p,v; + double minprice,basevol,relvol,p,v,r; if ( bot->dead == 0 ) { if ( bot->pause == 0 ) { //if ( (rand() % 100) == 0 ) { - relvol = bot->totalrelvolume * 0.1; - p = LP_pricevol_invert(&v,bot->maxprice,relvol) * (double)(91 + (rand()%10)/100.); + r = (double)(91 + (rand()%10)/100.); + relvol = bot->totalrelvolume * 0.1 * r; + p = LP_pricevol_invert(&v,bot->maxprice,relvol); if ( bot->dispdir > 0 ) { printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base); From 3162ee0a69662cf9c43eb2ecfa6aa2c619f9b4e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:30:54 +0200 Subject: [PATCH 1834/2732] Test --- iguana/exchanges/LP_tradebots.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 78c8d453e..e2f2cc8b7 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -257,17 +257,18 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) { //if ( (rand() % 100) == 0 ) { - r = (double)(91 + (rand()%10)/100.); + r = (double)(91 + (rand()%10))/100.; relvol = bot->totalrelvolume * 0.1 * r; - p = LP_pricevol_invert(&v,bot->maxprice,relvol); + r = (double)(96 + (rand()%5))/100.; + p = LP_pricevol_invert(&v,bot->maxprice * r,relvol); if ( bot->dispdir > 0 ) { - printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base); + printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice*r); } else { minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); - printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s min %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); + printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s price %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); } if ( (rand() % 2) == 0 ) { From 71b96cf9259371e00579bfd12780484abaac06c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:37:15 +0200 Subject: [PATCH 1835/2732] Test --- iguana/exchanges/LP_tradebots.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index e2f2cc8b7..0b53b44e1 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -257,8 +257,10 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) { //if ( (rand() % 100) == 0 ) { - r = (double)(91 + (rand()%10))/100.; - relvol = bot->totalrelvolume * 0.1 * r; + r = (double)(51 + (rand()%50))/100.; + relvol = (bot->totalrelvolume - bot->relsum); + if ( relvol > (bot->totalrelvolume * .1) ) + relvol *= r; r = (double)(96 + (rand()%5))/100.; p = LP_pricevol_invert(&v,bot->maxprice * r,relvol); if ( bot->dispdir > 0 ) From a266e14c1523b1692cf3ac03832dbac76562710e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:43:53 +0200 Subject: [PATCH 1836/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_tradebots.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 06276ed78..1139a0ea7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,7 +18,7 @@ // LP_nativeDEX.c // marketmaker // -// limit bot +// electrum keepalive // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 0b53b44e1..fd195cdcc 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -257,7 +257,7 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) { //if ( (rand() % 100) == 0 ) { - r = (double)(51 + (rand()%50))/100.; + r = (double)(51 + (rand()%25))/100.; relvol = (bot->totalrelvolume - bot->relsum); if ( relvol > (bot->totalrelvolume * .1) ) relvol *= r; @@ -265,12 +265,12 @@ void LP_tradebot_timeslice(struct LP_tradebot *bot) p = LP_pricevol_invert(&v,bot->maxprice * r,relvol); if ( bot->dispdir > 0 ) { - printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice*r); + printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f relvol %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice*r,relvol); } else { minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); - printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s price %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p); + printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s price %.8f relvol %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p,relvol); } if ( (rand() % 2) == 0 ) { @@ -328,7 +328,11 @@ char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { - struct LP_tradebot *bot; + struct LP_tradebot *bot; struct iguana_info *basecoin,*relcoin; + basecoin = LP_coinfind(base); + relcoin = LP_coinfind(rel); + if ( basecoin == 0 || relcoin == 0 || basecoin->inactive != 0 || relcoin->inactive != 0 ) + return(clonestr("{\"error\":\"one or more coins inactive\"}")); printf("disp.%d tradebot_buy(%s / %s) maxprice %.8f relvolume %.8f\n",dispdir,base,rel,maxprice,relvolume); if ( (bot= calloc(1,sizeof(*bot))) != 0 ) { From 223d0f64d62b3bbb08d52741add36b72bff74c6c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 14:47:09 +0200 Subject: [PATCH 1837/2732] Test --- iguana/exchanges/LP_tradebots.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index fd195cdcc..dc7b7cfbc 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -250,22 +250,18 @@ void LP_tradebotadd(struct LP_tradebot *bot) void LP_tradebot_timeslice(struct LP_tradebot *bot) { - double minprice,basevol,relvol,p,v,r; + double minprice,basevol,relvol,p,v; if ( bot->dead == 0 ) { if ( bot->pause == 0 ) { //if ( (rand() % 100) == 0 ) { - r = (double)(51 + (rand()%25))/100.; - relvol = (bot->totalrelvolume - bot->relsum); - if ( relvol > (bot->totalrelvolume * .1) ) - relvol *= r; - r = (double)(96 + (rand()%5))/100.; - p = LP_pricevol_invert(&v,bot->maxprice * r,relvol); + relvol = bot->totalrelvolume * .1; + p = LP_pricevol_invert(&v,bot->maxprice,relvol); if ( bot->dispdir > 0 ) { - printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f relvol %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice*r,relvol); + printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f relvol %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice,relvol); } else { From 0cfa8f8a6c0687546211aa20deff872d67f2e4af Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 18:43:26 +0200 Subject: [PATCH 1838/2732] Enable bots trading --- iguana/exchanges/LP_nativeDEX.c | 6 +- iguana/exchanges/LP_ordermatch.c | 8 +- iguana/exchanges/LP_remember.c | 4 +- iguana/exchanges/LP_statemachine.c | 29 ++++- iguana/exchanges/LP_swap.c | 4 +- iguana/exchanges/LP_tradebots.c | 189 ++++++++++++++++++++--------- 6 files changed, 172 insertions(+), 68 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1139a0ea7..a4bf251b1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -49,7 +49,7 @@ uint32_t LP_lastnonce,LP_counter; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; -int32_t LP_showwif,IAMLP = 0; +int32_t LP_numfinished,LP_showwif,IAMLP = 0; double LP_profitratio = 1.; struct LP_privkey { bits256 privkey; uint8_t rmd160[20]; }; @@ -1028,9 +1028,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_tradebot_timeslices,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_tradebot_timeslices,ctx) != 0 ) { - printf("error launching LP_tradebot_timeslices for port.%u\n",myport); + printf("error launching LP_tradebot_timeslices\n"); exit(-1); } int32_t nonz; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index aba389945..0f0451750 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -411,7 +411,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; - return(clonestr("{\"result\":\"success\"}")); + return(LP_recent_swaps(0)); } int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) @@ -625,11 +625,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } - if ( coin->electrum != 0 ) + /*if ( coin->electrum != 0 ) { printf("electrum can only be for alice\n"); return(retval); - } + }*/ if ( LP_aliceonly(Q.srccoin) > 0 ) { printf("{\"error\":\"GAME can only be alice coin\"}\n"); @@ -783,7 +783,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(0); if ( basecoin->electrum == 0 ) max = 1000; - else max = 20; + else max = 40; utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 8f5272f20..953910c42 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1130,7 +1130,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( rswap.origfinishedflag == 0 && rswap.finishedflag != 0 ) { char fname[1024],*itemstr; FILE *fp; - printf("SWAP %u-%u finished!\n",requestid,quoteid); + LP_numfinished++; + printf("SWAP %u-%u finished LP_numfinished.%d !\n",requestid,quoteid,LP_numfinished); sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap.requestid,rswap.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { @@ -1315,6 +1316,7 @@ char *LP_recent_swaps(int32_t limit) jaddstr(item,"alice",LP_Alicequery.destcoin); jaddstr(item,"rel",LP_Alicequery.destcoin); jaddnum(item,"relvalue",dstr(LP_Alicequery.destsatoshis)); + jaddnum(item,"aliceid",LP_aliceid_calc(LP_Alicequery.desttxid,LP_Alicequery.destvout,LP_Alicequery.feetxid,LP_Alicequery.feevout)); jadd(retjson,"pending",item); } else Alice_expiration = 0; return(jprint(retjson,1)); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index c14c557ee..a3b824d36 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2275,7 +2275,34 @@ void LP_price_broadcastloop(void *ctx) retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); } - else*/ #ifdef FROM_JS + else*/ + +/*relvol = bot->totalrelvolume * .1; + p = LP_pricevol_invert(&v,bot->maxprice,relvol); + if ( bot->dispdir > 0 ) + { + printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f relvol %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice,relvol); + } + else + { + minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); + printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s price %.8f relvol %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p,relvol); + } + if ( (rand() % 2) == 0 ) + { + bot->relsum += relvol; + bot->basesum += v; + bot->completed++; + } + else + { + bot->pendrelsum += relvol; + bot->pendbasesum += v; + bot->numpending++; + } + bot->numtrades++; + */ +#ifdef FROM_JS int32_t sentbytes,sock,peerind,maxind; if ( (maxind= LP_numpeers()) > 0 ) peerind = (rand() % maxind) + 1; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 0238e398b..72860cc80 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -798,7 +798,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,INSTANTDEX_LOCKTIME*2,30); } } } @@ -864,7 +864,7 @@ void LP_aliceloop(void *_swap) }*/ if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,INSTANTDEX_LOCKTIME*2,30); } } } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index dc7b7cfbc..f6ede98e5 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -23,7 +23,7 @@ struct LP_tradebot_trade { - double maxprice,relvolume,basevol,relvol; + double maxprice,totalrelvolume,basevol,relvol; uint64_t aliceid; int32_t dispdir; uint32_t started,finished,requestid,quoteid; @@ -40,21 +40,6 @@ struct LP_tradebot struct LP_tradebot_trade *trades[LP_TRADEBOTS_MAXTRADES]; } *LP_tradebots; -/*struct tradebot_trade *tradebot_issuetrade(struct LP_tradebot *bot,char *base,char *rel,double price,double volume,int32_t dir) -{ - struct tradebot_trade *tr; char *str; int32_t maxseconds = 30,dotrade = 1; - bot = realloc(bot,sizeof(*bot) + (bot->numtrades + 1) * sizeof(bot->trades[0])); - tr = &bot->trades[bot->numtrades++]; - memset(tr,0,sizeof(*tr)); - tr->price = price, tr->volume = volume, tr->dir = dir; - safecopy(tr->exchangestr,exchange->name,sizeof(tr->exchangestr)); - safecopy(tr->base,base,sizeof(tr->base)); - safecopy(tr->rel,rel,sizeof(tr->rel)); - if ( (str= exchanges777_Qtrade(exchange,base,rel,maxseconds,dotrade,dir,price,volume,0)) != 0 ) - free(str); - return(tr); -}*/ - void LP_tradebot_updatestats(struct LP_tradebot *bot,struct LP_tradebot_trade *tp) { char *swapstr,*status; int32_t flag; cJSON *swapjson; @@ -177,7 +162,7 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) } } array = cJSON_CreateArray(); - //LP_tradebot_calcstats(bot); + LP_tradebot_calcstats(bot); for (i=0; inumtrades; i++) jaddi(array,LP_tradebot_tradejson(bot->trades[i],bot->dispdir)); jadd(json,"trades",array); @@ -248,66 +233,156 @@ void LP_tradebotadd(struct LP_tradebot *bot) portable_mutex_unlock(&LP_tradebotsmutex); } -void LP_tradebot_timeslice(struct LP_tradebot *bot) +struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pending) { - double minprice,basevol,relvol,p,v; - if ( bot->dead == 0 ) + struct LP_tradebot_trade *tp; + tp = calloc(1,sizeof(*tp)); + tp->maxprice = bot->maxprice; + tp->totalrelvolume = bot->totalrelvolume; + tp->started = (uint32_t)time(NULL); + tp->dispdir = bot->dispdir; + strcpy(tp->base,bot->base); + strcpy(tp->rel,bot->rel); + tp->aliceid = j64bits(pending,"aliceid"); + tp->basevol = jdouble(pending,"basevalue"); + tp->relvol = jdouble(pending,"relvalue"); + bot->pendrelsum += tp->relvol; + bot->pendbasesum += tp->basevol; + bot->numpending++; + return(tp); +} + +void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) +{ + double remaining; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*pending; + memset(destpubkey.bytes,0,sizeof(destpubkey)); + if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { - if ( bot->pause == 0 ) + if ( (liststr= LP_recent_swaps(0)) != 0 ) { - //if ( (rand() % 100) == 0 ) + if ( (retjson= cJSON_Parse(liststr)) != 0 ) { - relvol = bot->totalrelvolume * .1; - p = LP_pricevol_invert(&v,bot->maxprice,relvol); - if ( bot->dispdir > 0 ) - { - printf("simulated trade buy %s/%s maxprice %.8f volume %.8f, %.8f %s -> %s, price %.8f relvol %.8f\n",bot->base,bot->rel,bot->maxprice,bot->totalrelvolume - bot->relsum,relvol,bot->rel,bot->base,bot->maxprice,relvol); - } - else - { - minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); - printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s price %.8f relvol %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p,relvol); - } - if ( (rand() % 2) == 0 ) - { - bot->relsum += relvol; - bot->basesum += v; - bot->completed++; - } - else + if ( jobj(retjson,"pending") == 0 ) { - bot->pendrelsum += relvol; - bot->pendbasesum += v; - bot->numpending++; + remaining = bot->totalrelvolume - (bot->relsum + bot->pendrelsum); + printf("try autobuy %s/%s remaining %.8f maxprice %.8f\n",bot->base,bot->rel,remaining,bot->maxprice); + if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining,0,0,G.gui,0,destpubkey)) != 0 ) + { + if ( (pending= cJSON_Parse(retstr)) != 0 ) + { + if ( jobj(pending,"pending") != 0 ) + { + bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending); + if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) + bot->dead = (uint32_t)time(NULL); + else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) + bot->pause = (uint32_t)time(NULL); + printf("%s\n",jprint(LP_tradebot_json(bot),1)); + } else printf("didnt get any trade pending %s\n",bot->name); + free_json(pending); + } + free(retstr); + } } - bot->numtrades++; - if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) - bot->dead = (uint32_t)time(NULL); - else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) - bot->pause = (uint32_t)time(NULL); - printf("%s\n",jprint(LP_tradebot_json(bot),1)); + free_json(retjson); } + free(liststr); } } - else - { - //DL_DELETE(LP_tradebots,bot); - //free(bot); - } + else if ( bot->pause == 0 ) + bot->pause = (uint32_t)time(NULL); } -void LP_tradebot_timeslices(void *ignore) +void LP_tradebot_timeslices(void *ctx) { - struct LP_tradebot *bot,*tmp; + struct LP_tradebot_trade *tp; struct LP_tradebot *bot,*tmp; char *retstr,*status; cJSON *retjson,*item; uint64_t aliceid; int32_t i,j,n,flag,lastnumfinished = 0; while ( 1 ) { DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { portable_mutex_lock(&LP_tradebotsmutex); - LP_tradebot_timeslice(bot); + LP_tradebot_timeslice(ctx,bot); + if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) + { + // expire pending trades and see if any still need their requestid/quoteid + for (i=flag=0; inumtrades; i++) + { + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 ) + { + if ( time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) + { + bot->pendbasesum -= tp->basevol; + bot->pendrelsum -= tp->relvol; + bot->numpending--; + tp->finished = (uint32_t)time(NULL); + printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); + } + else if ( tp->requestid == 0 && tp->quoteid == 0 ) + flag = 1; + } + } + if ( flag != 0 ) + { + // need to find the requestid/quoteid for aliceid + if ( (retstr= basilisk_swapentries(bot->base,bot->rel,0)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(retjson)) != 0 ) + { + for (flag=j=0; jnumtrades; i++) + { + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->requestid == 0 && tp->quoteid == 0 ) + { + if ( tp->aliceid == aliceid ) + { + tp->requestid = juint(item,"requestid"); + tp->quoteid = juint(item,"quoteid"); + printf("found aliceid.%llx to set requestid.%u quoteid.%u\n",(long long)aliceid,tp->requestid,tp->quoteid); + flag = 1; + break; + } + } + } + } + } + free_json(retjson); + } + free(retstr); + } + } + // check for finished pending swap + for (i=0; inumtrades; i++) + { + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->requestid != 0 && tp->quoteid != 0 ) + { + if ( (retstr= basilisk_swapentry(tp->requestid,tp->quoteid)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (status= jstr(retjson,"status")) != 0 && strcmp(status,"finished") == 0 ) + { + bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; + bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; + bot->numpending--, bot->completed++; + printf("detected completion aliceid.%llx r.%u q.%u\n",(long long)tp->aliceid,tp->requestid,tp->quoteid); + tp->finished = (uint32_t)time(NULL); + } + free_json(retjson); + } + free(retstr); + } + } + } + } portable_mutex_unlock(&LP_tradebotsmutex); sleep(1); } + lastnumfinished = LP_numfinished; sleep(10); } } From 0174ea595255415ad06156e6c7ee5c1faffa17b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 18:53:15 +0200 Subject: [PATCH 1839/2732] Test --- iguana/exchanges/LP_tradebots.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f6ede98e5..96d6d206c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -399,11 +399,37 @@ char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { - struct LP_tradebot *bot; struct iguana_info *basecoin,*relcoin; + struct LP_tradebot *bot; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0; struct iguana_info *basecoin,*relcoin; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 || basecoin->inactive != 0 || relcoin->inactive != 0 ) return(clonestr("{\"error\":\"one or more coins inactive\"}")); + if ( (array= LP_inventory(rel)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 && is_cJSON_Array(array) != 0 ) + { + for (i=0; itxfee; + if ( dstr(balance) < relvolume + dstr(txfees) ) + { + printf("%s inventory balance only %.8f, less than relvolume %.8f + txfees %.8f\n",rel,dstr(balance),relvolume,dstr(txfees)); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"error","not enough funds"); + jaddstr(retjson,"coin",rel); + jaddnum(retjson,"balance",dstr(balance)); + jaddnum(retjson,"relvolume",relvolume); + jaddnum(retjson,"txfees",dstr(txfees)); + jaddnum(retjson,"shortfall",(relvolume + dstr(txfees)) - dstr(balance)); + return(jprint(retjson,1)); + } printf("disp.%d tradebot_buy(%s / %s) maxprice %.8f relvolume %.8f\n",dispdir,base,rel,maxprice,relvolume); if ( (bot= calloc(1,sizeof(*bot))) != 0 ) { From 996fba765e4bd56b2e810d39d3fadd570a03e5c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 19:21:06 +0200 Subject: [PATCH 1840/2732] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_tradebots.c | 33 +++++++++++++++++++++++++++------ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 945bd5915..5db73995d 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -198,7 +198,7 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) if ( coin->userpass[0] != 0 ) { jaddnum(item,"height",LP_getheight(coin)); - balance = LP_smartbalance(coin); + balance = LP_RTsmartbalance(coin); jaddnum(item,"balance",dstr(balance)); jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance))); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a250c9434..35e2aa43e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -356,7 +356,7 @@ uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int3 //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); -uint64_t LP_smartbalance(struct iguana_info *coin); +uint64_t LP_RTsmartbalance(struct iguana_info *coin); int32_t LP_getheight(struct iguana_info *coin); int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 24d2cb5f2..e2fc80bb2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -397,7 +397,7 @@ int32_t LP_getheight(struct iguana_info *coin) return(height); } -uint64_t LP_smartbalance(struct iguana_info *coin) +uint64_t LP_RTsmartbalance(struct iguana_info *coin) { cJSON *array,*item; char buf[512],*retstr; int32_t i,n; uint64_t valuesum,value; valuesum = 0; diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 96d6d206c..77c694717 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -399,7 +399,7 @@ char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { - struct LP_tradebot *bot; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0; struct iguana_info *basecoin,*relcoin; + struct LP_tradebot *bot; double shortfall; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0,abalance=0; struct iguana_info *basecoin,*relcoin; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 || basecoin->inactive != 0 || relcoin->inactive != 0 ) @@ -412,22 +412,43 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl { item = jitem(array,i); //valuesum += j64bits(item,"value") + j64bits(item,"value2"); - balance += j64bits(item,"satoshis"); + abalance += j64bits(item,"satoshis"); } } free_json(array); } txfees = 10 * relcoin->txfee; - if ( dstr(balance) < relvolume + dstr(txfees) ) + if ( dstr(abalance) < relvolume + dstr(txfees) ) { - printf("%s inventory balance only %.8f, less than relvolume %.8f + txfees %.8f\n",rel,dstr(balance),relvolume,dstr(txfees)); + printf("%s inventory balance only %.8f, less than relvolume %.8f + txfees %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees)); retjson = cJSON_CreateObject(); jaddstr(retjson,"error","not enough funds"); jaddstr(retjson,"coin",rel); - jaddnum(retjson,"balance",dstr(balance)); + jaddnum(retjson,"balance",dstr(abalance)); jaddnum(retjson,"relvolume",relvolume); jaddnum(retjson,"txfees",dstr(txfees)); - jaddnum(retjson,"shortfall",(relvolume + dstr(txfees)) - dstr(balance)); + shortfall = (relvolume + dstr(txfees)) - dstr(balance); + jaddnum(retjson,"shortfall",shortfall); + if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*shortfall ) + { + char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; + outputjson = cJSON_CreateObject(); + outputs = cJSON_CreateArray(); + item = cJSON_CreateObject(); + jaddnum(item,relcoin->smartaddr,relvolume+dstr(txfees)); + jaddi(outputs,item); + item = cJSON_CreateObject(); + jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); + jaddi(outputs,item); + jadd(outputjson,"outputs",outputs); + if ( (withdrawstr= LP_withdraw(relcoin,outputjson)) != 0 ) + { + if ( (withdrawjson= cJSON_Parse(withdrawstr)) != 0 ) + jadd(retjson,"withdraw",withdrawjson); + free(withdrawstr); + } + free_json(outputjson); + } return(jprint(retjson,1)); } printf("disp.%d tradebot_buy(%s / %s) maxprice %.8f relvolume %.8f\n",dispdir,base,rel,maxprice,relvolume); From 1766ca95abafce928d341a1bd2671313a709a95b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 19:31:11 +0200 Subject: [PATCH 1841/2732] Test --- iguana/exchanges/LP_tradebots.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 77c694717..7496d8914 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -280,7 +280,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) printf("%s\n",jprint(LP_tradebot_json(bot),1)); } else printf("didnt get any trade pending %s\n",bot->name); free_json(pending); - } + } else printf("%s\n",retstr); free(retstr); } } @@ -418,9 +418,9 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl free_json(array); } txfees = 10 * relcoin->txfee; + printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees)); if ( dstr(abalance) < relvolume + dstr(txfees) ) { - printf("%s inventory balance only %.8f, less than relvolume %.8f + txfees %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees)); retjson = cJSON_CreateObject(); jaddstr(retjson,"error","not enough funds"); jaddstr(retjson,"coin",rel); @@ -429,7 +429,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*shortfall ) + if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*(shortfall+relvolume/77.) ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; outputjson = cJSON_CreateObject(); @@ -440,6 +440,12 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl item = cJSON_CreateObject(); jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); jaddi(outputs,item); + item = cJSON_CreateObject(); + jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); + jaddi(outputs,item); + item = cJSON_CreateObject(); + jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); + jaddi(outputs,item); jadd(outputjson,"outputs",outputs); if ( (withdrawstr= LP_withdraw(relcoin,outputjson)) != 0 ) { From 0989658c5d1499b2676273b7f625b77e757dbbfe Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 19:37:24 +0200 Subject: [PATCH 1842/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0f0451750..0e5bd8852 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -411,6 +411,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; + printf("LP_trade %s/%s %.8f vol %.8f\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis)); return(LP_recent_swaps(0)); } @@ -905,6 +906,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; +printf("call bestfit\n"); if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) @@ -914,6 +916,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } + printf("update metrics\n"); LP_RTmetrics_update(base,rel); while ( 1 ) { @@ -929,6 +932,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); maxiters = 200; qprice = 1. / SMALLVAL; +printf("validate\n"); for (i=0; i Date: Wed, 1 Nov 2017 19:37:48 +0200 Subject: [PATCH 1843/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 7496d8914..3e0b7e93c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -278,7 +278,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); printf("%s\n",jprint(LP_tradebot_json(bot),1)); - } else printf("didnt get any trade pending %s\n",bot->name); + } else printf("didnt get any trade pending %s\n\n",bot->name); free_json(pending); } else printf("%s\n",retstr); free(retstr); From d9b40f78a98bd1a77a6760d06cd2ac817e27769b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 19:41:07 +0200 Subject: [PATCH 1844/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- iguana/exchanges/LP_utxos.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 3e0b7e93c..714b171ba 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -278,7 +278,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); printf("%s\n",jprint(LP_tradebot_json(bot),1)); - } else printf("didnt get any trade pending %s\n\n",bot->name); + } else printf("didnt get any trade pending %s %s\n\n",bot->name,retstr); free_json(pending); } else printf("%s\n",retstr); free(retstr); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 49c11c283..3f1ed5f40 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -247,12 +247,13 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { + printf("not elibible\n"); //if ( utxo->T.spentflag == 0 ) // utxo->T.spentflag = (uint32_t)time(NULL); continue; } bestutxo = utxo; - } //else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); + } else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); } } return(bestutxo); From eca43db50ffdb59625ae3e9c41cefd6ac9f3d4b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 20:02:05 +0200 Subject: [PATCH 1845/2732] Test --- iguana/exchanges/LP_utxos.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3f1ed5f40..546a6aba0 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -229,7 +229,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { - uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; int32_t iambob = 0; + uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; int32_t bestsize,iambob = 0; if ( symbol == 0 || destsatoshis == 0 ) { printf("LP_utxo_bestfit error symbol.%p %.8f\n",symbol,dstr(destsatoshis)); @@ -243,7 +243,28 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { - if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || (bestutxo->S.satoshis < destsatoshis && utxo->S.satoshis >= destsatoshis) || (bestutxo->S.satoshis >= destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis)) ) + bestsize = 0; + if ( bestutxo == 0 ) + { + if ( utxo->S.satoshis > destsatoshis/LP_MINCLIENTVOL ) + bestsize = 1; + } + else + { + if ( bestutxo->S.satoshis < destsatoshis ) + { + if ( utxo->S.satoshis > destsatoshis ) + bestsize = 1; + else if ( utxo->S.satoshis > bestutxo->S.satoshis ) + bestsize = 1; + } + else + { + if ( utxo->S.satoshis > destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis ) + bestsize = 1; + } + } + if ( bestsize > 0 ) { if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { From 8639d9a241b962e212e387643f4272e56f13c4ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 20:14:50 +0200 Subject: [PATCH 1846/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0e5bd8852..b27a942af 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -905,9 +905,8 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel else maxprice *= 1.001; memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); - destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; -printf("call bestfit\n"); - if ( (autxo= LP_utxo_bestfit(rel,destsatoshis)) == 0 ) + destsatoshis = SATOSHIDEN * relvolume; + if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis; @@ -916,7 +915,6 @@ printf("call bestfit\n"); printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } - printf("update metrics\n"); LP_RTmetrics_update(base,rel); while ( 1 ) { @@ -932,7 +930,6 @@ printf("call bestfit\n"); return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); maxiters = 200; qprice = 1. / SMALLVAL; -printf("validate\n"); for (i=0; i Date: Wed, 1 Nov 2017 20:18:11 +0200 Subject: [PATCH 1847/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b27a942af..219146838 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -909,7 +909,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) - autxo->S.satoshis = destsatoshis; + autxo->S.satoshis = destsatoshis - 2*desttxfee; if ( destsatoshis < (autxo->payment.value / LP_MINCLIENTVOL) || autxo->payment.value < desttxfee*LP_MINSIZE_TXFEEMULT ) { printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); From 2c32901a7cb62b6c06bb53e19b08b765e2d7e3c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 20:21:39 +0200 Subject: [PATCH 1848/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 219146838..6da5f6f86 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -910,6 +910,8 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); if ( destsatoshis < autxo->S.satoshis ) autxo->S.satoshis = destsatoshis - 2*desttxfee; + else if ( autxo->S.satoshis < destsatoshis ) + destsatoshis = autxo->S.satoshis - 2*desttxfee; if ( destsatoshis < (autxo->payment.value / LP_MINCLIENTVOL) || autxo->payment.value < desttxfee*LP_MINSIZE_TXFEEMULT ) { printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); From d4372457120ef7e81816cd976dba8239a512d5d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 20:26:13 +0200 Subject: [PATCH 1849/2732] Test --- iguana/exchanges/LP_ordermatch.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6da5f6f86..67e5db04d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -908,10 +908,18 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - if ( destsatoshis < autxo->S.satoshis ) - autxo->S.satoshis = destsatoshis - 2*desttxfee; - else if ( autxo->S.satoshis < destsatoshis ) - destsatoshis = autxo->S.satoshis - 2*desttxfee; + if ( destsatoshis - 2*desttxfee < autxo->S.satoshis ) + { + destsatoshis -= 2*desttxfee; + autxo->S.satoshis = destsatoshis; + printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); + } + else if ( autxo->S.satoshis - 2*desttxfee < destsatoshis ) + { + autxo->S.satoshis -= 2*desttxfee; + destsatoshis = autxo->S.satoshis; + printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); + } if ( destsatoshis < (autxo->payment.value / LP_MINCLIENTVOL) || autxo->payment.value < desttxfee*LP_MINSIZE_TXFEEMULT ) { printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); From d379440946fb9a5de6213272537b5a6aa9695c76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 21:28:19 +0200 Subject: [PATCH 1850/2732] Test --- iguana/exchanges/LP_commands.c | 4 +- iguana/exchanges/LP_include.h | 31 ++++++++- iguana/exchanges/LP_ordermatch.c | 19 +++--- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_remember.c | 32 ++------- iguana/exchanges/LP_signatures.c | 4 +- iguana/exchanges/LP_statemachine.c | 59 ++++++++++++++++ iguana/exchanges/LP_swap.c | 8 +-- iguana/exchanges/LP_tradebots.c | 104 +++++++++-------------------- 9 files changed, 148 insertions(+), 115 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 2c147dc00..0dbd7c350 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -300,7 +300,7 @@ bot_resume(botid)\n\ //* if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"))); + return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"),0)); } else return(clonestr("{\"error\":\"no price set\"}")); } else if ( strcmp(method,"sell") == 0 ) @@ -308,7 +308,7 @@ bot_resume(botid)\n\ //* if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"),0)); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 35e2aa43e..51f336cd2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -206,6 +206,31 @@ struct basilisk_swapinfo uint8_t userdata_bobrefund[256],userdata_bobrefundlen; }; +#define BASILISK_ALICESPEND 0 +#define BASILISK_BOBSPEND 1 +#define BASILISK_BOBPAYMENT 2 +#define BASILISK_ALICEPAYMENT 3 +#define BASILISK_BOBDEPOSIT 4 +#define BASILISK_OTHERFEE 5 +#define BASILISK_MYFEE 6 +#define BASILISK_BOBREFUND 7 +#define BASILISK_BOBRECLAIM 8 +#define BASILISK_ALICERECLAIM 9 +#define BASILISK_ALICECLAIM 10 +//0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0 +char *txnames[] = { "alicespend", "bobspend", "bobpayment", "alicepayment", "bobdeposit", "otherfee", "myfee", "bobrefund", "bobreclaim", "alicereclaim", "aliceclaim" }; + +struct LP_swap_remember +{ + bits256 pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)]; + uint64_t Atxfee,Btxfee,srcamount,destamount,aliceid; + int64_t values[sizeof(txnames)/sizeof(*txnames)]; + uint32_t tradeid,requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; + int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; + uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; + char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; +}; + struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; char coinaddr[64]; }; struct LP_transaction @@ -291,7 +316,8 @@ struct LP_quoteinfo struct basilisk_request R; bits256 srchash,desthash,txid,txid2,desttxid,feetxid,privkey; uint64_t satoshis,txfee,destsatoshis,desttxfee,aliceid; - uint32_t timestamp,quotetime; int32_t vout,vout2,destvout,feevout,pair; + uint32_t timestamp,quotetime,tradeid; + int32_t vout,vout2,destvout,feevout,pair; char srccoin[16],coinaddr[64],destcoin[16],destaddr[64],gui[64]; }; @@ -302,7 +328,8 @@ struct basilisk_swap void *ctx; struct iguana_info bobcoin,alicecoin; struct LP_utxoinfo *utxo; struct LP_endpoint N; void (*balancingtrade)(struct basilisk_swap *swap,int32_t iambob); - int32_t subsock,pushsock,connected,aliceunconf,depositunconf,paymentunconf; uint32_t lasttime,aborted; + int32_t subsock,pushsock,connected,aliceunconf,depositunconf,paymentunconf; + uint32_t lasttime,aborted,tradeid; FILE *fp; bits256 persistent_privkey,persistent_pubkey; struct basilisk_swapinfo I; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 67e5db04d..a9a21da85 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -78,7 +78,7 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp,struct LP_utxoinfo *autxo, double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp,int32_t iambob) { double qprice=0.; char str[65]; cJSON *txout; uint64_t txfee,desttxfee,srcvalue=0,srcvalue2=0,destvalue=0,destvalue2=0; - printf(">>>>>>> quote satoshis.(%.8f %.8f) %s %.8f -> %s %.8f\n",dstr(qp->satoshis),dstr(qp->destsatoshis),qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); + //printf(">>>>>>> quote satoshis.(%.8f %.8f) %s %.8f -> %s %.8f\n",dstr(qp->satoshis),dstr(qp->destsatoshis),qp->srccoin,dstr(qp->satoshis),qp->destcoin,dstr(qp->destsatoshis)); if ( butxo != 0 ) { if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) @@ -163,7 +163,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str txfee = qp->txfee; if ( desttxfee < qp->desttxfee ) desttxfee = qp->desttxfee; - printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); + //printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); if ( qp->txfee < LP_REQUIRED_TXFEE*txfee || qp->desttxfee < LP_REQUIRED_TXFEE*desttxfee ) return(-14); if ( butxo != 0 ) @@ -399,7 +399,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ struct LP_quoteinfo LP_Alicequery; double LP_Alicemaxprice; uint32_t Alice_expiration; -char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) +char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t botid) { struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) @@ -409,6 +409,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } price = 0.; qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); + qp->botid = botid; LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; printf("LP_trade %s/%s %.8f vol %.8f\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis)); @@ -442,6 +443,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) { + qp->botid = LP_Alicequery.botid; memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; @@ -457,7 +459,7 @@ char *LP_connectedalice(cJSON *argjson) // alice clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); - printf("CONNECTED.(%s) numpending.%d\n",jprint(argjson,0),G.LP_pendingswaps); + printf("CONNECTED.(%s) numpending.%d botid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.botid); /*if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) { printf("reject mismatched alice query\n"); @@ -505,6 +507,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); + swap->botid = Q.botid; swap->N.pair = pairsock; autxo->S.swap = swap; swap->utxo = autxo; @@ -827,7 +830,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) { - printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); + //printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } asatoshis = (asatoshis / 64) * 63; @@ -858,7 +861,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(bestutxo); } -char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey) +char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t botid) { uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; basecoin = LP_coinfind(base); @@ -949,7 +952,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel } if ( qprice/ordermatchprice < 1.+SMALLVAL ) { - printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); + //printf("i.%d/%d qprice %.8f < ordermatchprice %.8f\n",i,maxiters,qprice,ordermatchprice); if ( strcmp("BTC",Q.destcoin) == 0 || strcmp("BTC",Q.srccoin) == 0 ) Q.satoshis *= 0.999; else Q.satoshis *= 0.9999; @@ -962,7 +965,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel continue; else return(clonestr("{\"error\":\"cant ordermatch to destpubkey\"}")); } - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,botid)); } return(clonestr("{\"error\":\"cant get here\"}")); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index c67cda50a..19aba3cb4 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -495,7 +495,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) { memset(zero.bytes,0,sizeof(zero)); - if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1,zero)) != 0 ) + if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1,zero,1)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 953910c42..d4eeeb6e1 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -93,7 +93,7 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx sprintf(fname,"%s/SWAPS/%u-%u",GLOBAL_DBDIR,swap->I.req.requestid,swap->I.req.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { - fprintf(fp,"{\"aliceid\":\"%llu\",\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u,\"Atxfee\":%llu,\"Btxfee\":%llu",(long long)swap->aliceid,swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime,(long long)swap->I.Atxfee,(long long)swap->I.Btxfee); + fprintf(fp,"{\"tradeid\":%u,\"aliceid\":\"%llu\",\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u,\"Atxfee\":%llu,\"Btxfee\":%llu",swap->tradeid,(long long)swap->aliceid,swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime,(long long)swap->I.Atxfee,(long long)swap->I.Btxfee); if ( memcmp(zeroes,swap->I.secretAm,20) != 0 ) { init_hexbytes_noT(secretAmstr,swap->I.secretAm,20); @@ -303,20 +303,6 @@ bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,in return(spendtxid); } -#define BASILISK_ALICESPEND 0 -#define BASILISK_BOBSPEND 1 -#define BASILISK_BOBPAYMENT 2 -#define BASILISK_ALICEPAYMENT 3 -#define BASILISK_BOBDEPOSIT 4 -#define BASILISK_OTHERFEE 5 -#define BASILISK_MYFEE 6 -#define BASILISK_BOBREFUND 7 -#define BASILISK_BOBRECLAIM 8 -#define BASILISK_ALICERECLAIM 9 -#define BASILISK_ALICECLAIM 10 -//0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0 -char *txnames[] = { "alicespend", "bobspend", "bobpayment", "alicepayment", "bobdeposit", "otherfee", "myfee", "bobrefund", "bobreclaim", "alicereclaim", "aliceclaim" }; - int32_t basilisk_isbobcoin(int32_t iambob,int32_t ind) { switch ( ind ) @@ -460,21 +446,11 @@ void LP_totals_update(int32_t iambob,char *alicecoin,char *bobcoin,int64_t *KMDt } } -struct LP_swap_remember -{ - bits256 pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)]; - uint64_t Atxfee,Btxfee,srcamount,destamount,aliceid; - int64_t values[sizeof(txnames)/sizeof(*txnames)]; - uint32_t requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; - int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; - uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; - char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; -}; - cJSON *LP_swap_json(struct LP_swap_remember *rswap) { cJSON *item,*array; int32_t i; item = cJSON_CreateObject(); + jaddnum(item,"tradeid",rswap->tradeid); jaddnum(item,"requestid",rswap->requestid); jaddnum(item,"quoteid",rswap->quoteid); jaddnum(item,"iambob",rswap->iambob); @@ -523,6 +499,7 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t if ( (item= cJSON_Parse(fstr)) != 0 ) { rswap->iambob = jint(item,"iambob"); + rswap->tradeid = juint(item,"tradeid"); rswap->aliceid = j64bits(item,"aliceid"); if ( (secretstr= jstr(item,"secretAm")) != 0 && strlen(secretstr) == 40 ) decode_hex(rswap->secretAm,20,secretstr); @@ -1132,6 +1109,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti char fname[1024],*itemstr; FILE *fp; LP_numfinished++; printf("SWAP %u-%u finished LP_numfinished.%d !\n",requestid,quoteid,LP_numfinished); + if ( rswap.tradeid != 0 ) + LP_tradebot_finished(rswap.tradeid); sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap.requestid,rswap.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { @@ -1308,6 +1287,7 @@ char *LP_recent_swaps(int32_t limit) item = cJSON_CreateObject(); jaddnum(item,"expiration",Alice_expiration); jaddnum(item,"timeleft",Alice_expiration-time(NULL)); + jaddnum(item,"tradeid",LP_Alicequery.tradeid); jaddnum(item,"requestid",LP_Alicequery.R.requestid); jaddnum(item,"quoteid",LP_Alicequery.R.quoteid); jaddstr(item,"bob",LP_Alicequery.srccoin); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 960e36127..a53f3b28f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -44,6 +44,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) double price; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"gui",qp->gui[0] != 0 ? qp->gui : LP_gui); jadd64bits(retjson,"aliceid",qp->aliceid); + jaddnum(retjson,"botid",qp->botid); jaddstr(retjson,"base",qp->srccoin); jaddstr(retjson,"rel",qp->destcoin); if ( qp->coinaddr[0] != 0 ) @@ -109,6 +110,7 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin)); safecopy(qp->destaddr,jstr(argjson,"destaddr"),sizeof(qp->destaddr)); qp->aliceid = j64bits(argjson,"aliceid"); + qp->botid = juint(argjson,"botid"); qp->timestamp = juint(argjson,"timestamp"); qp->quotetime = juint(argjson,"quotetime"); qp->txid = jbits256(argjson,"txid"); @@ -146,7 +148,7 @@ void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) { *txfeep = LP_txfeecalc(LP_coinfind(base),0,0); *desttxfeep = LP_txfeecalc(LP_coinfind(rel),0,0); - printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); + //printf("LP_txfees(%.8f %.8f)\n",dstr(*txfeep),dstr(*desttxfeep)); } int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char *destcoin,double price,uint64_t satoshis,uint64_t destsatoshis) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index a3b824d36..f209a0737 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1613,6 +1613,65 @@ void LP_address_monitor(struct LP_pubkeyinfo *pubp) return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set\"}")); }*/ +if ( flag != 0 ) +{ + // need to find the requestid/quoteid for aliceid + if ( (retstr= basilisk_swapentries(bot->base,bot->rel,0)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(retjson)) != 0 ) + { + for (flag=j=0; jnumtrades; i++) + { + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->requestid == 0 && tp->quoteid == 0 ) + { + if ( tp->aliceid == aliceid ) + { + tp->requestid = juint(item,"requestid"); + tp->quoteid = juint(item,"quoteid"); + printf("found aliceid.%llx to set requestid.%u quoteid.%u\n",(long long)aliceid,tp->requestid,tp->quoteid); + flag = 1; + break; + } + } + } + } + } + free_json(retjson); + } + free(retstr); + } +} +// check for finished pending swap +for (i=0; inumtrades; i++) +{ + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->requestid != 0 && tp->quoteid != 0 ) + { + if ( (retstr= basilisk_swapentry(tp->requestid,tp->quoteid)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (status= jstr(retjson,"status")) != 0 && strcmp(status,"finished") == 0 ) + { + bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; + bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; + bot->numpending--, bot->completed++; + printf("detected completion aliceid.%llx r.%u q.%u\n",(long long)tp->aliceid,tp->requestid,tp->quoteid); + tp->finished = (uint32_t)time(NULL); + } + free_json(retjson); + } + free(retstr); + } + } +} +} + int32_t LP_utxopurge(int32_t allutxos) { char str[65]; struct LP_utxoinfo *utxo,*tmp; int32_t iambob,n = 0; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 72860cc80..267646c6d 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -785,7 +785,7 @@ void LP_bobloop(void *_swap) else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { - char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) @@ -842,7 +842,7 @@ void LP_aliceloop(void *_swap) else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { - char str[65];printf("%d waiting for alicepayment %s to be confirmed.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } swap->sentflag = 1; @@ -852,14 +852,14 @@ void LP_aliceloop(void *_swap) { while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { - char str[65];printf("%d waiting for bobpayment %s to be confirmed.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); + char str[65];printf("%d wait for bobpayment %s numconfs.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(10); } /*if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) { - char str[65];printf("%d waiting for alicespend %s to be confirmed.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); + char str[65];printf("%d wait for alicespend %s numconfs.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); }*/ if ( swap->N.pair >= 0 ) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 714b171ba..fa1b881b9 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -26,7 +26,7 @@ struct LP_tradebot_trade double maxprice,totalrelvolume,basevol,relvol; uint64_t aliceid; int32_t dispdir; - uint32_t started,finished,requestid,quoteid; + uint32_t started,finished,requestid,quoteid,tradeid; char base[32],rel[32]; }; @@ -233,10 +233,11 @@ void LP_tradebotadd(struct LP_tradebot *bot) portable_mutex_unlock(&LP_tradebotsmutex); } -struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pending) +struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pending,uint32_t tradeid) { struct LP_tradebot_trade *tp; tp = calloc(1,sizeof(*tp)); + tp->tradeid = tradeid; tp->maxprice = bot->maxprice; tp->totalrelvolume = bot->totalrelvolume; tp->started = (uint32_t)time(NULL); @@ -254,7 +255,7 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { - double remaining; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*pending; + double remaining; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { @@ -266,13 +267,14 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { remaining = bot->totalrelvolume - (bot->relsum + bot->pendrelsum); printf("try autobuy %s/%s remaining %.8f maxprice %.8f\n",bot->base,bot->rel,remaining,bot->maxprice); - if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining,0,0,G.gui,0,destpubkey)) != 0 ) + tradeid = rand(); + if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { if ( (pending= cJSON_Parse(retstr)) != 0 ) { if ( jobj(pending,"pending") != 0 ) { - bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending); + bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending,tradeid); if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) @@ -293,19 +295,37 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->pause = (uint32_t)time(NULL); } +void LP_tradebots_finished(uint32_t tradeid) +{ + struct LP_tradebot *bot,*tmp; int32_t i; struct LP_tradebot_trade *tp; + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + { + for (i=0; inumtrades; i++) + { + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->tradeid == tradeid ) + { + bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; + bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; + bot->numpending--, bot->completed++; + printf("detected completion aliceid.%llx r.%u q.%u\n",(long long)tp->aliceid,tp->requestid,tp->quoteid); + tp->finished = (uint32_t)time(NULL); + break; + } + } + } +} + void LP_tradebot_timeslices(void *ctx) { - struct LP_tradebot_trade *tp; struct LP_tradebot *bot,*tmp; char *retstr,*status; cJSON *retjson,*item; uint64_t aliceid; int32_t i,j,n,flag,lastnumfinished = 0; + struct LP_tradebot_trade *tp; struct LP_tradebot *bot,*tmp; int32_t i,lastnumfinished = 0; while ( 1 ) { DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { - portable_mutex_lock(&LP_tradebotsmutex); - LP_tradebot_timeslice(ctx,bot); if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) { // expire pending trades and see if any still need their requestid/quoteid - for (i=flag=0; inumtrades; i++) + for (i=0; inumtrades; i++) { if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 ) { @@ -317,73 +337,15 @@ void LP_tradebot_timeslices(void *ctx) tp->finished = (uint32_t)time(NULL); printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); } - else if ( tp->requestid == 0 && tp->quoteid == 0 ) - flag = 1; - } - } - if ( flag != 0 ) - { - // need to find the requestid/quoteid for aliceid - if ( (retstr= basilisk_swapentries(bot->base,bot->rel,0)) != 0 ) - { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( (n= cJSON_GetArraySize(retjson)) != 0 ) - { - for (flag=j=0; jnumtrades; i++) - { - if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->requestid == 0 && tp->quoteid == 0 ) - { - if ( tp->aliceid == aliceid ) - { - tp->requestid = juint(item,"requestid"); - tp->quoteid = juint(item,"quoteid"); - printf("found aliceid.%llx to set requestid.%u quoteid.%u\n",(long long)aliceid,tp->requestid,tp->quoteid); - flag = 1; - break; - } - } - } - } - } - free_json(retjson); - } - free(retstr); - } - } - // check for finished pending swap - for (i=0; inumtrades; i++) - { - if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->requestid != 0 && tp->quoteid != 0 ) - { - if ( (retstr= basilisk_swapentry(tp->requestid,tp->quoteid)) != 0 ) - { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( (status= jstr(retjson,"status")) != 0 && strcmp(status,"finished") == 0 ) - { - bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; - bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; - bot->numpending--, bot->completed++; - printf("detected completion aliceid.%llx r.%u q.%u\n",(long long)tp->aliceid,tp->requestid,tp->quoteid); - tp->finished = (uint32_t)time(NULL); - } - free_json(retjson); - } - free(retstr); - } } } + printf("%s\n",jprint(LP_tradebot_json(bot),1)); } - portable_mutex_unlock(&LP_tradebotsmutex); - sleep(1); + else if ( bot->numpending == 0 ) + LP_tradebot_timeslice(ctx,bot); } lastnumfinished = LP_numfinished; - sleep(10); + sleep(60); } } From 4fb6ba1178d4e5921c0ee445bf5133efc80f709b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 21:30:11 +0200 Subject: [PATCH 1851/2732] Test --- iguana/exchanges/LP_ordermatch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a9a21da85..197824077 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -399,7 +399,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ struct LP_quoteinfo LP_Alicequery; double LP_Alicemaxprice; uint32_t Alice_expiration; -char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t botid) +char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t tradeid) { struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) @@ -409,7 +409,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } price = 0.; qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); - qp->botid = botid; + qp->tradeid = tradeid; LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; printf("LP_trade %s/%s %.8f vol %.8f\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis)); @@ -443,7 +443,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) { - qp->botid = LP_Alicequery.botid; + qp->tradeid = LP_Alicequery.tradeid; memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; @@ -459,7 +459,7 @@ char *LP_connectedalice(cJSON *argjson) // alice clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); - printf("CONNECTED.(%s) numpending.%d botid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.botid); + printf("CONNECTED.(%s) numpending.%d tradeid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid); /*if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) { printf("reject mismatched alice query\n"); @@ -507,7 +507,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); - swap->botid = Q.botid; + swap->tradeid = Q.tradeid; swap->N.pair = pairsock; autxo->S.swap = swap; swap->utxo = autxo; @@ -861,7 +861,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(bestutxo); } -char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t botid) +char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid) { uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; basecoin = LP_coinfind(base); @@ -965,7 +965,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel continue; else return(clonestr("{\"error\":\"cant ordermatch to destpubkey\"}")); } - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,botid)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); } return(clonestr("{\"error\":\"cant get here\"}")); } From 7439b00ca56ada1a5dd8651c7be4408daa4a8eab Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 21:32:27 +0200 Subject: [PATCH 1852/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_signatures.c | 4 ++-- iguana/exchanges/LP_tradebots.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 51f336cd2..a431eeb72 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -389,6 +389,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); +void LP_tradebot_finished(uint32_t tradeid); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index a53f3b28f..7ce2350e2 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -44,7 +44,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) double price; cJSON *retjson = cJSON_CreateObject(); jaddstr(retjson,"gui",qp->gui[0] != 0 ? qp->gui : LP_gui); jadd64bits(retjson,"aliceid",qp->aliceid); - jaddnum(retjson,"botid",qp->botid); + jaddnum(retjson,"tradeid",qp->tradeid); jaddstr(retjson,"base",qp->srccoin); jaddstr(retjson,"rel",qp->destcoin); if ( qp->coinaddr[0] != 0 ) @@ -110,7 +110,7 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin)); safecopy(qp->destaddr,jstr(argjson,"destaddr"),sizeof(qp->destaddr)); qp->aliceid = j64bits(argjson,"aliceid"); - qp->botid = juint(argjson,"botid"); + qp->tradeid = juint(argjson,"tradeid"); qp->timestamp = juint(argjson,"timestamp"); qp->quotetime = juint(argjson,"quotetime"); qp->txid = jbits256(argjson,"txid"); diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index fa1b881b9..42c0b2434 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -295,7 +295,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->pause = (uint32_t)time(NULL); } -void LP_tradebots_finished(uint32_t tradeid) +void LP_tradebot_finished(uint32_t tradeid) { struct LP_tradebot *bot,*tmp; int32_t i; struct LP_tradebot_trade *tp; DL_FOREACH_SAFE(LP_tradebots,bot,tmp) From 86ea52d2ebb7f34db42208598e10e72fdedb21a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 21:49:10 +0200 Subject: [PATCH 1853/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_tradebots.c | 15 ++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a431eeb72..3000b44b3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -389,7 +389,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); -void LP_tradebot_finished(uint32_t tradeid); +void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index d4eeeb6e1..e27a13aab 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1110,7 +1110,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_numfinished++; printf("SWAP %u-%u finished LP_numfinished.%d !\n",requestid,quoteid,LP_numfinished); if ( rswap.tradeid != 0 ) - LP_tradebot_finished(rswap.tradeid); + LP_tradebot_finished(rswap.tradeid,rswap.requestid,rswap.quoteid); sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap.requestid,rswap.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 42c0b2434..33a25d890 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -100,8 +100,11 @@ cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) double price,basevol; cJSON *item = cJSON_CreateObject(); if ( tp == 0 ) return(cJSON_Parse("{}")); - jaddnum(item,"requestid",tp->requestid); - jaddnum(item,"quoteid",tp->quoteid); + if ( tp->requestid != 0 && tp->quoteid != 0 ) + { + jaddnum(item,"requestid",tp->requestid); + jaddnum(item,"quoteid",tp->quoteid); + } else jaddnum(item,"tradeid",tp->tradeid); if ( tp->basevol > SMALLVAL && tp->relvol > SMALLVAL ) { if ( dispflag > 0 ) @@ -295,7 +298,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->pause = (uint32_t)time(NULL); } -void LP_tradebot_finished(uint32_t tradeid) +void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) { struct LP_tradebot *bot,*tmp; int32_t i; struct LP_tradebot_trade *tp; DL_FOREACH_SAFE(LP_tradebots,bot,tmp) @@ -304,11 +307,14 @@ void LP_tradebot_finished(uint32_t tradeid) { if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->tradeid == tradeid ) { + tp->requestid = requestid; + tp->quoteid = quoteid; bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; bot->numpending--, bot->completed++; - printf("detected completion aliceid.%llx r.%u q.%u\n",(long long)tp->aliceid,tp->requestid,tp->quoteid); + printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid); tp->finished = (uint32_t)time(NULL); + printf("%s\n",jprint(LP_tradebot_json(bot),1)); break; } } @@ -373,7 +379,6 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl for (i=0; i Date: Wed, 1 Nov 2017 22:44:35 +0200 Subject: [PATCH 1854/2732] Test --- iguana/exchanges/LP_tradebots.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 33a25d890..92758f6d3 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -258,7 +258,7 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { - double remaining; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*pending; + double remaining; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { @@ -273,9 +273,9 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) tradeid = rand(); if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { - if ( (pending= cJSON_Parse(retstr)) != 0 ) + if ( (retjson2= cJSON_Parse(retstr)) != 0 ) { - if ( jobj(pending,"pending") != 0 ) + if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) { bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending,tradeid); if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) @@ -284,7 +284,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->pause = (uint32_t)time(NULL); printf("%s\n",jprint(LP_tradebot_json(bot),1)); } else printf("didnt get any trade pending %s %s\n\n",bot->name,retstr); - free_json(pending); + free_json(retjson2); } else printf("%s\n",retstr); free(retstr); } From 6b83f8f8ee44e4f4ee1ed01d78102d0506f7b0b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 22:46:50 +0200 Subject: [PATCH 1855/2732] Test --- iguana/exchanges/LP_tradebots.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 92758f6d3..622ed8332 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -250,6 +250,7 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen tp->aliceid = j64bits(pending,"aliceid"); tp->basevol = jdouble(pending,"basevalue"); tp->relvol = jdouble(pending,"relvalue"); + printf("tradebot pending basevol %.8f relvol %.8f\n",tp->basevol,tp->relvol); bot->pendrelsum += tp->relvol; bot->pendbasesum += tp->basevol; bot->numpending++; From 55785ee868404a54af48f24662a757febd67c7c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 22:49:46 +0200 Subject: [PATCH 1856/2732] Test --- iguana/exchanges/LP_tradebots.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 622ed8332..1a9329d63 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -324,11 +324,13 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) void LP_tradebot_timeslices(void *ctx) { - struct LP_tradebot_trade *tp; struct LP_tradebot *bot,*tmp; int32_t i,lastnumfinished = 0; + struct LP_tradebot_trade *tp; struct iguana_info *relcoin; struct LP_tradebot *bot,*tmp; int32_t i,lastnumfinished = 0; while ( 1 ) { DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { + if ( (relcoin= LP_coinfind(bot->rel)) != 0 ) + LP_listunspent_issue(bot->rel,relcoin->smartaddr,1); if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) { // expire pending trades and see if any still need their requestid/quoteid From ca9467ac6e65bc5cb01607ff6e78ed0a168f97bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 22:57:41 +0200 Subject: [PATCH 1857/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_signatures.c | 3 +-- iguana/exchanges/LP_swap.c | 10 +++++----- iguana/exchanges/LP_transaction.c | 20 +++++++++----------- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 8 files changed, 23 insertions(+), 26 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a4bf251b1..625a5fac2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -147,7 +147,7 @@ char *LP_decrypt(uint8_t *ptr,int32_t *recvlenp) { printf("unexpected len %d vs recvlen.%d\n",(int32_t)strlen(jsonstr)+1,recvlen); jsonstr = 0; - } else printf("decrypted (%s)\n",jsonstr); + } //else printf("decrypted (%s)\n",jsonstr); } } else printf("cipher.%d too big for %d\n",cipherlen,(int32_t)sizeof(decoded)); *recvlenp = recvlen; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 197824077..6becabca6 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -599,7 +599,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); + //printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); retval = 1; if ( strcmp(method,"reserved") == 0 ) { @@ -616,7 +616,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { - printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); + //printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_connectedalice(argjson)) != 0 ) free(retstr); } @@ -790,7 +790,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i else max = 40; utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); - printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); + //printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e2fc80bb2..9a546dd8d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -694,7 +694,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) } else if ( IAMLP == 0 ) { - printf("LP_listunspent_query.(%s %s)\n",symbol,coinaddr); + //printf("LP_listunspent_query.(%s %s)\n",symbol,coinaddr); LP_listunspent_query(coin->symbol,coin->smartaddr); if ( fullflag != 0 ) { @@ -862,7 +862,7 @@ char *LP_sendrawtransaction(char *symbol,char *signedtx) jaddistr(array,signedtx); paramstr = jprint(array,1); retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"sendrawtransaction",paramstr); - printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr); + //printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr); free(paramstr); } else diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 7ce2350e2..7db6a6a28 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -682,8 +682,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddnum(reqjson,"timestamp",time(NULL)); msg = jprint(reqjson,1); msg2 = clonestr(msg); - // LP_addsig - printf("QUERY.(%s)\n",msg); + //printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 267646c6d..612c3ecd8 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -275,13 +275,13 @@ int32_t LP_choosei_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datal swap->I.pubA0.bytes[i] = data[len++]; for (i=0; i<32; i++) swap->I.pubA1.bytes[i] = data[len++]; - printf("GOT pubA0/1 %s\n",bits256_str(str,swap->I.pubA0)); + //printf("GOT pubA0/1 %s\n",bits256_str(str,swap->I.pubA0)); swap->I.privBn = swap->privkeys[swap->I.otherchoosei]; memset(&swap->privkeys[swap->I.otherchoosei],0,sizeof(swap->privkeys[swap->I.otherchoosei])); revcalc_rmd160_sha256(swap->I.secretBn,swap->I.privBn);//.bytes,sizeof(swap->privBn)); vcalc_sha256(0,swap->I.secretBn256,swap->I.privBn.bytes,sizeof(swap->I.privBn)); swap->I.pubBn = bitcoin_pubkey33(swap->ctx,pubkey33,swap->I.privBn); - printf("set privBn.%s %s\n",bits256_str(str,swap->I.privBn),bits256_str(str2,*(bits256 *)swap->I.secretBn256)); + //printf("set privBn.%s %s\n",bits256_str(str,swap->I.privBn),bits256_str(str2,*(bits256 *)swap->I.secretBn256)); //basilisk_bobscripts_set(swap,1,1); } else @@ -290,18 +290,18 @@ int32_t LP_choosei_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datal swap->I.pubB0.bytes[i] = data[len++]; for (i=0; i<32; i++) swap->I.pubB1.bytes[i] = data[len++]; - printf("GOT pubB0/1 %s\n",bits256_str(str,swap->I.pubB0)); + //printf("GOT pubB0/1 %s\n",bits256_str(str,swap->I.pubB0)); swap->I.privAm = swap->privkeys[swap->I.otherchoosei]; memset(&swap->privkeys[swap->I.otherchoosei],0,sizeof(swap->privkeys[swap->I.otherchoosei])); revcalc_rmd160_sha256(swap->I.secretAm,swap->I.privAm);//.bytes,sizeof(swap->privAm)); vcalc_sha256(0,swap->I.secretAm256,swap->I.privAm.bytes,sizeof(swap->I.privAm)); swap->I.pubAm = bitcoin_pubkey33(swap->ctx,pubkey33,swap->I.privAm); - printf("set privAm.%s %s\n",bits256_str(str,swap->I.privAm),bits256_str(str2,*(bits256 *)swap->I.secretAm256)); + //printf("set privAm.%s %s\n",bits256_str(str,swap->I.privAm),bits256_str(str2,*(bits256 *)swap->I.secretAm256)); swap->bobdeposit.I.pubkey33[0] = 2; swap->bobpayment.I.pubkey33[0] = 2; for (i=0; i<32; i++) swap->bobpayment.I.pubkey33[i+1] = swap->bobdeposit.I.pubkey33[i+1] = swap->I.pubA0.bytes[i]; - printf("SET bobdeposit pubkey33.(02%s)\n",bits256_str(str,swap->I.pubA0)); + //printf("SET bobdeposit pubkey33.(02%s)\n",bits256_str(str,swap->I.pubA0)); //basilisk_bobscripts_set(swap,0); } return(0); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 7d0f963a3..50fee8dcb 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1554,10 +1554,9 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i swap->bobdeposit.I.spendlen = basilisk_bobscript(swap->bobdeposit.I.rmd160,swap->bobdeposit.redeemscript,&swap->bobdeposit.I.redeemlen,swap->bobdeposit.spendscript,0,&swap->bobdeposit.I.locktime,&swap->bobdeposit.I.secretstart,&swap->I,1); bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); - //LP_importaddress(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr); - int32_t i; for (i=0; ibobdeposit.I.redeemlen; i++) - printf("%02x",swap->bobdeposit.redeemscript[i]); - printf(" <- bobdeposit redeem %d %s\n",i,swap->bobdeposit.I.destaddr); + //int32_t i; for (i=0; ibobdeposit.I.redeemlen; i++) + // printf("%02x",swap->bobdeposit.redeemscript[i]); + //printf(" <- bobdeposit redeem %d %s\n",i,swap->bobdeposit.I.destaddr); if ( genflag != 0 && (swap->bobdeposit.I.datalen == 0 || swap->bobrefund.I.datalen == 0) ) { basilisk_rawtx_gen(swap->ctx,"deposit",swap->I.started,swap->persistent_pubkey33,1,1,&swap->bobdeposit,swap->bobdeposit.I.locktime,swap->bobdeposit.spendscript,swap->bobdeposit.I.spendlen,swap->bobdeposit.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); @@ -1734,13 +1733,12 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); basilisk_dontforget_update(swap,&swap->bobdeposit); - //LP_importaddress(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr); - int32_t i; char str[65]; for (i=0; ibobdeposit.I.datalen; i++) - printf("%02x",swap->bobdeposit.txbytes[i]); - printf(" <- bobdeposit.%d %s\n",swap->bobdeposit.I.datalen,bits256_str(str,swap->bobdeposit.I.signedtxid)); - for (i=0; ibobdeposit.I.redeemlen; i++) - printf("%02x",swap->bobdeposit.redeemscript[i]); - printf(" <- bobdeposit redeem %d %s suppress.%d\n",i,swap->bobdeposit.I.destaddr,swap->aliceclaim.I.suppress_pubkeys); + //int32_t i; char str[65]; for (i=0; ibobdeposit.I.datalen; i++) + // printf("%02x",swap->bobdeposit.txbytes[i]); + //printf(" <- bobdeposit.%d %s\n",swap->bobdeposit.I.datalen,bits256_str(str,swap->bobdeposit.I.signedtxid)); + //for (i=0; ibobdeposit.I.redeemlen; i++) + // printf("%02x",swap->bobdeposit.redeemscript[i]); + //printf(" <- bobdeposit redeem %d %s suppress.%d\n",i,swap->bobdeposit.I.destaddr,swap->aliceclaim.I.suppress_pubkeys); memcpy(swap->aliceclaim.redeemscript,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); swap->aliceclaim.I.redeemlen = swap->bobdeposit.I.redeemlen; memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index aca156389..8a7f0d0b6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -168,7 +168,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a } else { - printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); + //printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 546a6aba0..45dc9c614 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -274,7 +274,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; } bestutxo = utxo; - } else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); + } // else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); } } return(bestutxo); From ced78486cf24bc003f33b41a0078ebdbc3411ce1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 22:58:55 +0200 Subject: [PATCH 1858/2732] Test --- iguana/exchanges/LP_tradebots.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 1a9329d63..845677124 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -283,7 +283,6 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); - printf("%s\n",jprint(LP_tradebot_json(bot),1)); } else printf("didnt get any trade pending %s %s\n\n",bot->name,retstr); free_json(retjson2); } else printf("%s\n",retstr); @@ -315,7 +314,6 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) bot->numpending--, bot->completed++; printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid); tp->finished = (uint32_t)time(NULL); - printf("%s\n",jprint(LP_tradebot_json(bot),1)); break; } } @@ -348,7 +346,6 @@ void LP_tradebot_timeslices(void *ctx) } } } - printf("%s\n",jprint(LP_tradebot_json(bot),1)); } else if ( bot->numpending == 0 ) LP_tradebot_timeslice(ctx,bot); From ae2188f76d6e2a483e8307b9c72f31967b646c59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 23:00:12 +0200 Subject: [PATCH 1859/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2ff62895d..2cb647dde 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -32,7 +32,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char char *stats_validmethods[] = { - "getprices", "listunspent", "notify", "getpeers", "uitem", // from issue_ + "psock", "getprices", "listunspent", "notify", "getpeers", "uitem", // from issue_ "orderbook", "help", "getcoins", "pricearray", "balance" }; From 033a5664d608f266721768fb0d9ccbf53a5a3b83 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 1 Nov 2017 23:23:58 +0200 Subject: [PATCH 1860/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/LP_tradebots.c | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 625a5fac2..1e76da0a3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -236,8 +236,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, else { memset(zero.bytes,0,sizeof(zero)); - if ( (method= jstr(reqjson,"method")) != 0 && (strcmp(method,"request") == 0 || strcmp(method,"requested") == 0 || strcmp(method,"connect") == 0 || strcmp(method,"connected") == 0) ) - printf("broadcast.(%s)\n",Broadcaststr); + /*if ( (method= jstr(reqjson,"method")) != 0 && (strcmp(method,"request") == 0 || strcmp(method,"requested") == 0 || strcmp(method,"connect") == 0 || strcmp(method,"connected") == 0) ) + printf("broadcast.(%s)\n",Broadcaststr);*/ LP_reserved_msg("","",zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 7db6a6a28..c300bf3e8 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -35,7 +35,7 @@ struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srch rp->desthash = desthash; rp->destamount = destsatoshis; rp->quoteid = basilisk_quoteid(rp); - printf("r.%u %u, q.%u %u: %s %.8f -> %s %.8f\n",rp->timestamp,rp->requestid,rp->quotetime,rp->quoteid,rp->src,dstr(rp->srcamount),rp->dest,dstr(rp->destamount)); + //printf("r.%u %u, q.%u %u: %s %.8f -> %s %.8f\n",rp->timestamp,rp->requestid,rp->quotetime,rp->quoteid,rp->src,dstr(rp->srcamount),rp->dest,dstr(rp->destamount)); return(rp); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 845677124..d5d309f1c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -142,9 +142,9 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddnum(json,"maxprice",bot->maxprice); jaddnum(json,"totalrelvolume",bot->totalrelvolume); jaddnum(json,"totalbasevolume",bot->totalbasevolume); - if ( (vol= bot->relsum) > SMALLVAL ) + if ( (vol= bot->relsum) > SMALLVAL && bot->basesum > SMALLVAL ) { - jaddnum(json,"aveprice",bot->basesum/vol); + jaddnum(json,"aveprice",vol/bot->basesum); jaddnum(json,"volume",vol); } } @@ -157,9 +157,9 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddnum(json,"minprice",aveprice); jaddnum(json,"totalbasevolume",bot->totalrelvolume); jaddnum(json,"totalrelvolume",basevolume); - if ( (vol= bot->relsum) > SMALLVAL ) + if ( (vol= bot->relsum) > SMALLVAL && bot->basesum > SMALLVAL ) { - aveprice = LP_pricevol_invert(&basevolume,bot->basesum / vol,vol); + aveprice = LP_pricevol_invert(&basevolume,vol/bot->basesum,vol); jaddnum(json,"aveprice",aveprice); jaddnum(json,"volume",basevolume); } @@ -279,9 +279,9 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) { bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending,tradeid); - if ( bot->relsum >= bot->totalrelvolume-SMALLVAL || bot->basesum >= bot->totalbasevolume-SMALLVAL ) + if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); - else if ( (bot->pendrelsum+bot->relsum) >= bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= bot->totalbasevolume-SMALLVAL ) + else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); } else printf("didnt get any trade pending %s %s\n\n",bot->name,retstr); free_json(retjson2); From 6e6f6d51e1af2960cd3b9de9e484f19882b70fe2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 09:30:57 +0200 Subject: [PATCH 1861/2732] Remove ws:// --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 11 ++++++----- iguana/exchanges/LP_network.c | 30 +++++++++++++++--------------- iguana/exchanges/LP_peers.c | 22 +++++++++++----------- iguana/exchanges/LP_swap.c | 2 +- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3000b44b3..38f8b1393 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -379,7 +379,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); -uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int32_t ispaired); +uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1e76da0a3..1b410bff7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // electrum keepalive +// merge bots + portfoliot // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -825,7 +826,7 @@ int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) 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; long filesize,n; int32_t valid,timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],bindaddr2[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); + char *myipaddr=0; 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(); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { @@ -910,15 +911,15 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu pubsock = -1; nanomsg_transportname(0,subaddr,myipaddr,mypubport); nanomsg_transportname(1,bindaddr,myipaddr,mypubport); - nanomsg_transportname2(1,bindaddr2,myipaddr,mypubport); + //nanomsg_transportname2(1,bindaddr2,myipaddr,mypubport); valid = 0; if ( (pubsock= nn_socket(AF_SP,NN_PUB)) >= 0 ) { valid = 0; if ( nn_bind(pubsock,bindaddr) >= 0 ) valid++; - if ( nn_bind(pubsock,bindaddr2) >= 0 ) - valid++; + //if ( nn_bind(pubsock,bindaddr2) >= 0 ) + // valid++; if ( valid > 0 ) { timeout = 1; @@ -931,7 +932,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu nn_close(pubsock), pubsock = -1; } } else printf("error getting pubsock %d\n",pubsock); - printf(">>>>>>>>> myipaddr.(%s %s) (%s) pullsock.%d valid.%d\n",bindaddr,bindaddr2,subaddr,pubsock,valid); + printf(">>>>>>>>> myipaddr.(%s) (%s) pullsock.%d valid.%d\n",bindaddr,subaddr,pubsock,valid); LP_mypubsock = pubsock; } printf("got %s, initpeers\n",myipaddr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index b53e58159..e936e8fc8 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -98,17 +98,17 @@ int32_t nn_poll(struct nn_pollfd *fds, int nfds, int timeout) char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); + sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); return(str); } -char *nanomsg_transportname2(int32_t bindflag,char *str,char *ipaddr,uint16_t port) +/*char *nanomsg_transportname2(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port+10); + sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port+10); return(str); } -/*int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) +int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) { int32_t sentbytes; if ( sock < 0 ) @@ -735,7 +735,7 @@ char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) return(retstr); } -uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int32_t ispaired) +uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) { uint16_t publicport = 0; char *retstr,*addr; cJSON *retjson; struct LP_peerinfo *peer,*tmp; HASH_ITER(hh,LP_peerinfos,peer,tmp) @@ -750,8 +750,8 @@ uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int3 safecopy(publicaddr,addr,128); if ( (addr= jstr(retjson,"connectaddr")) != 0 ) safecopy(connectaddr,addr,128); - if ( (addr= jstr(retjson,"connectaddr2")) != 0 ) - safecopy(connectaddr2,addr,128); + //if ( (addr= jstr(retjson,"connectaddr2")) != 0 ) + // safecopy(connectaddr2,addr,128); if ( publicaddr[0] != 0 && connectaddr[0] != 0 ) publicport = juint(retjson,"publicport"); free_json(retjson); @@ -767,9 +767,9 @@ uint16_t LP_psock_get(char *connectaddr,char *connectaddr2,char *publicaddr,int3 int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char *myipaddr,uint16_t mypullport,int32_t ispaired) { - int32_t nntype,pullsock,timeout; char bindaddr[128],bindaddr2[128],connectaddr[128],connectaddr2[128]; + int32_t nntype,pullsock,timeout; char bindaddr[128],connectaddr[128]; *mypullportp = mypullport; - connectaddr2[0] = 0; + //connectaddr2[0] = 0; if ( ispaired == 0 ) { if ( LP_canbind != 0 ) @@ -780,7 +780,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char { nanomsg_transportname(0,publicaddr,myipaddr,mypullport); nanomsg_transportname(1,bindaddr,myipaddr,mypullport); - nanomsg_transportname2(1,bindaddr2,myipaddr,mypullport); + //nanomsg_transportname2(1,bindaddr2,myipaddr,mypullport); } else { @@ -792,7 +792,7 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } while ( *mypullportp == 0 ) { - if ( (*mypullportp= LP_psock_get(connectaddr,connectaddr2,publicaddr,ispaired)) != 0 ) + if ( (*mypullportp= LP_psock_get(connectaddr,publicaddr,ispaired)) != 0 ) break; sleep(10); printf("try to get publicaddr again\n"); @@ -811,8 +811,8 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } else { - if ( connectaddr2[0] != 0 && nn_connect(pullsock,connectaddr2) > 0 ) - printf("%s ",connectaddr2); + //if ( connectaddr2[0] != 0 && nn_connect(pullsock,connectaddr2) > 0 ) + // printf("%s ",connectaddr2); printf("nntype.%d NN_PAIR.%d connect to %s connectsock.%d\n",nntype,NN_PAIR,connectaddr,pullsock); } } @@ -823,8 +823,8 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char printf("bind to %s error for %s: %s\n",bindaddr,publicaddr,nn_strerror(nn_errno())); exit(-1); } - if ( nn_bind(pullsock,bindaddr2) >= 0 ) - printf("bound to %s\n",bindaddr2); + //if ( nn_bind(pullsock,bindaddr2) >= 0 ) + // printf("bound to %s\n",bindaddr2); } timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 33c776969..8539fef27 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -56,7 +56,7 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { - uint32_t ipbits; int32_t valid,pushsock,subsock,timeout; char checkip[64],subaddr2[64],pushaddr[64],pushaddr2[64],subaddr[64]; struct LP_peerinfo *peer = 0; + uint32_t ipbits; int32_t valid,pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) @@ -90,19 +90,19 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) { nanomsg_transportname(0,pushaddr,peer->ipaddr,pushport); - nanomsg_transportname2(0,pushaddr2,peer->ipaddr,pushport); + //nanomsg_transportname2(0,pushaddr2,peer->ipaddr,pushport); valid = 0; if ( nn_connect(pushsock,pushaddr) >= 0 ) valid++; - if ( nn_connect(pushsock,pushaddr2) >= 0 ) - valid++; + //if ( nn_connect(pushsock,pushaddr2) >= 0 ) + // valid++; if ( valid > 0 ) { timeout = 1; nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; //nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); - printf("connected to push.(%s %s) pushsock.%d valid.%d\n",pushaddr,pushaddr2,pushsock,valid); + printf("connected to push.(%s) pushsock.%d valid.%d\n",pushaddr,pushsock,valid); peer->connected = (uint32_t)time(NULL); peer->pushsock = pushsock; if ( (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 ) @@ -111,20 +111,20 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char nn_setsockopt(subsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(subsock,NN_SUB,NN_SUB_SUBSCRIBE,"",0); nanomsg_transportname(0,subaddr,peer->ipaddr,subport); - nanomsg_transportname2(0,subaddr2,peer->ipaddr,subport); + //nanomsg_transportname2(0,subaddr2,peer->ipaddr,subport); valid = 0; if ( nn_connect(subsock,subaddr) >= 0 ) valid++; - if ( nn_connect(subsock,subaddr2) >= 0 ) - valid++; + //if ( nn_connect(subsock,subaddr2) >= 0 ) + // valid++; if ( valid > 0 ) { peer->subsock = subsock; - printf("connected to sub.(%s %s) subsock.%d valid.%d\n",subaddr,subaddr2,peer->subsock,valid); + printf("connected to sub.(%s) subsock.%d valid.%d\n",subaddr,peer->subsock,valid); } else { - printf("error connecting to subsock.%d (%s %s)\n",subsock,subaddr,subaddr2); + printf("error connecting to subsock.%d (%s)\n",subsock,subaddr); nn_close(subsock); subsock = -1; } @@ -134,7 +134,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { nn_close(pushsock); pushsock = -1; - printf("error connecting to push.(%s %s)\n",pushaddr,pushaddr2); + printf("error connecting to push.(%s)\n",pushaddr); } } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); if ( peer->pushsock >= 0 && peer->subsock >= 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 612c3ecd8..41c65f031 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -262,7 +262,7 @@ int32_t LP_choosei_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t LP_choosei_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - int32_t otherchoosei=-1,i,len = 0; uint8_t pubkey33[33]; char str[65],str2[65]; + int32_t otherchoosei=-1,i,len = 0; uint8_t pubkey33[33]; if ( datalen == sizeof(otherchoosei)+sizeof(bits256)*2 ) { len += iguana_rwnum(0,data,sizeof(otherchoosei),&otherchoosei); From f8f99cc7ef2ecc1426ab9e9aead4800290908840 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 09:52:53 +0200 Subject: [PATCH 1862/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +------ iguana/exchanges/LP_portfolio.c | 9 +++----- iguana/exchanges/LP_tradebots.c | 41 +++++++++++++++------------------ 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1b410bff7..eb0f2bd68 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -994,7 +994,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); exit(-1); @@ -1029,11 +1029,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_tradebot_timeslices,ctx) != 0 ) - { - printf("error launching LP_tradebot_timeslices\n"); - exit(-1); - } int32_t nonz; while ( 1 ) { @@ -1117,7 +1112,6 @@ void LP_fromjs_iter() { LP_notify_pubkeys(ctx,LP_mypubsock); LP_privkey_updates(ctx,LP_mypubsock,0); - prices_loop(0); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 19aba3cb4..38fe3ba69 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -586,15 +586,14 @@ int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *a return(n); } -void prices_loop(void *arg) +void prices_loop(void *ctx) { - char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; while ( 1 ) { + LP_tradebots_timeslice(ctx); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) { - if ( arg == 0 ) - return; sleep(60); continue; } @@ -628,8 +627,6 @@ void prices_loop(void *arg) } free(retstr); } - if ( arg == 0 ) - return; sleep(60); } } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index d5d309f1c..fc7cc2cb9 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -320,39 +320,36 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) } } -void LP_tradebot_timeslices(void *ctx) +void LP_tradebots_timeslice(void *ctx) { - struct LP_tradebot_trade *tp; struct iguana_info *relcoin; struct LP_tradebot *bot,*tmp; int32_t i,lastnumfinished = 0; - while ( 1 ) + static uint32_t lastnumfinished = 0; + struct LP_tradebot_trade *tp; struct iguana_info *relcoin; struct LP_tradebot *bot,*tmp; int32_t i; + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { - DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + if ( (relcoin= LP_coinfind(bot->rel)) != 0 ) + LP_listunspent_issue(bot->rel,relcoin->smartaddr,1); + if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) { - if ( (relcoin= LP_coinfind(bot->rel)) != 0 ) - LP_listunspent_issue(bot->rel,relcoin->smartaddr,1); - if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) + // expire pending trades and see if any still need their requestid/quoteid + for (i=0; inumtrades; i++) { - // expire pending trades and see if any still need their requestid/quoteid - for (i=0; inumtrades; i++) + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 ) { - if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 ) + if ( time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) { - if ( time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) - { - bot->pendbasesum -= tp->basevol; - bot->pendrelsum -= tp->relvol; - bot->numpending--; - tp->finished = (uint32_t)time(NULL); - printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); - } + bot->pendbasesum -= tp->basevol; + bot->pendrelsum -= tp->relvol; + bot->numpending--; + tp->finished = (uint32_t)time(NULL); + printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); } } } - else if ( bot->numpending == 0 ) - LP_tradebot_timeslice(ctx,bot); } - lastnumfinished = LP_numfinished; - sleep(60); + else if ( bot->numpending == 0 ) + LP_tradebot_timeslice(ctx,bot); } + lastnumfinished = LP_numfinished; } char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) From ee624436c52c6ae8a8b561e0ab63896a22316ca7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 10:02:00 +0200 Subject: [PATCH 1863/2732] Test --- iguana/exchanges/LP_coins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 5db73995d..c2771e308 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -389,9 +389,9 @@ struct iguana_info *LP_coinfind(char *symbol) if ( (coin= LP_coinadd(&cdata)) != 0 ) { coin->inactive = isinactive * (uint32_t)time(NULL); - if ( strcmp(symbol,"KMD") == 0 ) + /*if ( strcmp(symbol,"KMD") == 0 ) coin->inactive = 0; - else if ( strcmp(symbol,"BTC") == 0 ) + else*/ if ( strcmp(symbol,"BTC") == 0 ) { coin->inactive = (uint32_t)time(NULL) * !IAMLP; printf("BTC inactive.%u\n",coin->inactive); From ca8a512e221cc68fbc93849c754d81877b086852 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 10:04:53 +0200 Subject: [PATCH 1864/2732] Handle null electrum server --- iguana/exchanges/LP_socket.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index ca409527a..1b584ac28 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -971,7 +971,13 @@ void LP_dedicatedloop(void *arg) cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { - struct electrum_info *ep; int32_t already; cJSON *retjson = cJSON_CreateObject(); + struct electrum_info *ep; int32_t already; cJSON *retjson; + if ( ipaddr == 0 || ipaddr[0] == 0 || port == 0 ) + { + coin->electrum = 0; + return(cJSON_Parse("{\"result\":\"success\",\"status\":\"electrum mode disabled, now in native coin mode\"}")); + } + retjson = cJSON_CreateObject(); jaddstr(retjson,"ipaddr",ipaddr); jaddnum(retjson,"port",port); if ( (ep= LP_electrum_info(&already,coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10)) == 0 ) From bee2ac1fb835d1e0dedc910d1a28ce4f50128a7f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 10:22:40 +0200 Subject: [PATCH 1865/2732] Test --- iguana/exchanges/LP_coins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index c2771e308..4a6736b6e 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -447,6 +447,8 @@ struct iguana_info *LP_coincreate(cJSON *item) } if ( 0 && coin != 0 && coin->inactive != 0 ) printf("LPnode.%d %s inactive.%u %p vs %p\n",IAMLP,coin->symbol,coin->inactive,assetname,name); + if ( coin != 0 && LP_getheight(coin) <= 0 ) + coin->inactive = (uint32_t)time(NULL); return(0); } From 1c61c5a978548544c6e62982a79692d72f420721 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 10:32:47 +0200 Subject: [PATCH 1866/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxos.c | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 38f8b1393..cbbd765ec 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -247,7 +247,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; + uint32_t importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 45dc9c614..590ebcb30 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -733,18 +733,19 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan userpub = curve25519(userpass,curve25519_basepoint9()); printf("userpass.(%s)\n",bits256_str(G.USERPASS,userpub)); } - if ( coin->electrum == 0 && coin->userpass[0] != 0 ) + } + if ( coin->importedprivkey == 0 && coin->electrum == 0 && coin->userpass[0] != 0 && LP_getheight(coin) > 0 ) + { + LP_listunspent_issue(coin->symbol,coin->smartaddr,0); + if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) { - LP_listunspent_issue(coin->symbol,coin->smartaddr,0); - if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) + if ( jobj(retjson,"error") != 0 ) { - if ( jobj(retjson,"error") != 0 ) - { - printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1)); - exit(-1); - } - } else free_json(retjson); - } + printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1)); + exit(-1); + } + } else free_json(retjson); + coin->importedprivkey = (uint32_t)time(NULL); } vcalc_sha256(0,checkkey.bytes,privkey.bytes,sizeof(privkey)); checkkey.bytes[0] &= 248, checkkey.bytes[31] &= 127, checkkey.bytes[31] |= 64; From 9f333982f4dce2feac90d307b5f68fab9d05352b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 10:38:38 +0200 Subject: [PATCH 1867/2732] Test --- iguana/exchanges/LP_coins.c | 2 -- iguana/exchanges/LP_nativeDEX.c | 15 +++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 4a6736b6e..c2771e308 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -447,8 +447,6 @@ struct iguana_info *LP_coincreate(cJSON *item) } if ( 0 && coin != 0 && coin->inactive != 0 ) printf("LPnode.%d %s inactive.%u %p vs %p\n",IAMLP,coin->symbol,coin->inactive,assetname,name); - if ( coin != 0 && LP_getheight(coin) <= 0 ) - coin->inactive = (uint32_t)time(NULL); return(0); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index eb0f2bd68..3f7f7ea16 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -676,21 +676,28 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) { - int32_t i,n; cJSON *item; + int32_t i,n; cJSON *item; char *symbol; struct iguana_info *coin; for (i=0; iinactive = (uint32_t)time(NULL); } if ( (n= cJSON_GetArraySize(coins)) > 0 ) { for (i=0; iinactive = (uint32_t)time(NULL); + } } } printf("privkey updates\n"); From a3b84b2e2b60a92da36ebe74bb0314aaa232120d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 11:19:45 +0200 Subject: [PATCH 1868/2732] unspents cache --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_socket.c | 10 +++++++++- iguana/exchanges/LP_utxo.c | 34 +++++++++++++++++++++++++++++++++ iguana/exchanges/mm.c | 1 + 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index cbbd765ec..eeb6a823a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -379,6 +379,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); +void LP_unspents_cache(char *symbol,char *addr,char *arraystr); uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3f7f7ea16..6ae7a566a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -684,6 +684,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) LP_priceinfoadd(activecoins[i]); if ( (coin= LP_coinfind(activecoins[i])) != 0 && LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); + LP_unspents_load(coin->symbol,coin->smartaddr); } if ( (n= cJSON_GetArraySize(coins)) > 0 ) { @@ -697,6 +698,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) LP_priceinfoadd(jstr(item,"coin")); if ( (coin= LP_coinfind(symbol)) != 0 && LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); + LP_unspents_load(coin->symbol,coin->smartaddr); } } } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1b584ac28..19a7b5363 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -543,7 +543,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr,int32_t electrumflag) { - cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; + cJSON *retjson=0; char *retstr; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); if ( ep == 0 || ep->heightp == 0 ) @@ -565,7 +565,15 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) + { LP_postutxos(coin->symbol,addr); + if ( strcmp(addr,coin->smartaddr) == 0 ) + { + retstr = jprint(retjson,0); + LP_unspents_cache(coin->symbol,coin->smartaddr,retstr); + free(retstr); + } + } if ( ap != 0 ) { ap->unspenttime = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8a7f0d0b6..ffd5d3f9e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -981,3 +981,37 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) } return(num); } + +void LP_unspents_cache(char *symbol,char *addr,char *arraystr) +{ + char fname[1024]; FILE *fp; + sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + if ( (fp= fopen(fname,"wb")) != 0 ) + { + fwrite(arraystr,1,strlen(arraystr),fp); + fclose(fp); + } +} + +void LP_unspents_load(char *symbol,char *addr) +{ + char fname[1024],*arraystr; long fsize; struct iguana_info *coin; cJSON *retjson; + if ( (coin= LP_coinfind(symbol)) != 0 ) + { + sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + if ( (arraystr= OS_filestr(&fsize,fname)) != 0 ) + { + if ( (retjson= cJSON_Parse(arraystr)) != 0 ) + { + if ( electrum_process_array(coin,coin->electrum,coin->smartaddr,retjson,1) == 0 ) + printf("error electrum_process_array\n"); + else printf("processed %s\n",arraystr); + free_json(retjson); + } + free(arraystr); + } + } +} + + + diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 632ab794d..b5cc4404e 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -882,6 +882,7 @@ int main(int argc, const char * argv[]) sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); + sprintf(dirname,"%s/UNSPENTS",GLOBAL_DBDIR), OS_ensure_directory(dirname); #ifdef FROM_JS argc = 2; retjson = cJSON_Parse("{\"client\":1,\"passphrase\":\"test\"}"); From 010a80c9c277896fe475d8c74d5fafa871dd0ba0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 11:49:52 +0200 Subject: [PATCH 1869/2732] Test --- iguana/exchanges/LP_socket.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 19a7b5363..f2e91f2a8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -565,14 +565,12 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) - { LP_postutxos(coin->symbol,addr); - if ( strcmp(addr,coin->smartaddr) == 0 ) - { - retstr = jprint(retjson,0); - LP_unspents_cache(coin->symbol,coin->smartaddr,retstr); - free(retstr); - } + if ( strcmp(addr,coin->smartaddr) == 0 ) + { + retstr = jprint(retjson,0); + LP_unspents_cache(coin->symbol,coin->smartaddr,retstr); + free(retstr); } if ( ap != 0 ) { From 34fc21fa6b983e7f5ec4682b288b8700e6440b31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 11:56:33 +0200 Subject: [PATCH 1870/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 7 ++++--- iguana/exchanges/LP_utxo.c | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index eeb6a823a..870628dc9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -379,7 +379,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); -void LP_unspents_cache(char *symbol,char *addr,char *arraystr); +void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag); uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f2e91f2a8..87bb1560e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -543,7 +543,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr,int32_t electrumflag) { - cJSON *retjson=0; char *retstr; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; + cJSON *retjson=0; char *retstr; struct LP_address *ap; struct iguana_info *coin; int32_t updatedflag,height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); if ( ep == 0 || ep->heightp == 0 ) @@ -564,12 +564,13 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); + updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) - LP_postutxos(coin->symbol,addr); + LP_postutxos(coin->symbol,addr), updatedflag = 1; if ( strcmp(addr,coin->smartaddr) == 0 ) { retstr = jprint(retjson,0); - LP_unspents_cache(coin->symbol,coin->smartaddr,retstr); + LP_unspents_cache(coin->symbol,coin->smartaddr,retstr,updatedflag); free(retstr); } if ( ap != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ffd5d3f9e..39e414aff 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -982,11 +982,14 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) return(num); } -void LP_unspents_cache(char *symbol,char *addr,char *arraystr) +void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag) { char fname[1024]; FILE *fp; sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - if ( (fp= fopen(fname,"wb")) != 0 ) + if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) + updatedflag = 1; + else fclose(fp); + if ( updatedflag != 0 && (fp= fopen(fname,"wb")) != 0 ) { fwrite(arraystr,1,strlen(arraystr),fp); fclose(fp); From 35b9ac68b7108103c1946e2f84e0299a739aaff7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 11:58:58 +0200 Subject: [PATCH 1871/2732] Test --- iguana/exchanges/LP_utxo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 39e414aff..30f6a0ab7 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -984,11 +984,12 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag) { - char fname[1024]; FILE *fp; + char fname[1024]; FILE *fp=0; sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) updatedflag = 1; - else fclose(fp); + else if ( fp != 0 ) + fclose(fp); if ( updatedflag != 0 && (fp= fopen(fname,"wb")) != 0 ) { fwrite(arraystr,1,strlen(arraystr),fp); @@ -1006,6 +1007,7 @@ void LP_unspents_load(char *symbol,char *addr) { if ( (retjson= cJSON_Parse(arraystr)) != 0 ) { + printf("PROCESS UNSPENTS %s\n",arraystr); if ( electrum_process_array(coin,coin->electrum,coin->smartaddr,retjson,1) == 0 ) printf("error electrum_process_array\n"); else printf("processed %s\n",arraystr); From b7adbcad8b0f55a866a40d24cf34ce952fee5a88 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 12:10:52 +0200 Subject: [PATCH 1872/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0dbd7c350..515138f3f 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -337,6 +337,8 @@ bot_resume(botid)\n\ { ptr->inactive = 0; cJSON *array = cJSON_CreateArray(); + if ( ptr->smartaddr[0] != 0 ) + LP_unspents_load(coin,ptr->smartaddr); jaddi(array,LP_coinjson(ptr,0)); return(jprint(array,1)); } else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); From 9d33f4f7e4855df1f60bec802f77fc67c6c92ed6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 12:17:21 +0200 Subject: [PATCH 1873/2732] Test --- iguana/exchanges/LP_socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 87bb1560e..55e30ade7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -410,8 +410,8 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch } } else printf("couldnt find electrum server for (%s %s) or no retjsonp.%p\n",method,params,retjsonp); ep = ep->prev; - if ( ep != 0 ) - printf("using prev ep.%s\n",ep->symbol); + //if ( ep != 0 ) + // printf("using prev ep.%s\n",ep->symbol); } return(0); } @@ -563,7 +563,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); + //printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr), updatedflag = 1; From abb7a8ff3e7e10a93c615d9294b03c514d08ed98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 12:25:44 +0200 Subject: [PATCH 1874/2732] Test --- iguana/exchanges/LP_signatures.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index c300bf3e8..32d02000b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -528,21 +528,20 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { if ( memcmp(rmd160,pubp->rmd160,20) != 0 ) { - for (i=0; i<20; i++) - printf("%02x",pubp->rmd160[i]); + //for (i=0; i<20; i++) + // printf("%02x",pubp->rmd160[i]); memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); memcpy(pubp->sig,sig,sizeof(pubp->sig)); pubp->siglen = siglen; - char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); - //pubp->timestamp = (uint32_t)time(NULL); + //char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); } pubp->timestamp = juint(item,"timestamp"); retval = 0; } else pubp->numerrors++; } } - else + else if ( 0 ) { for (i=0; i<20; i++) printf("%02x",rmd160[i]); From b740c7727f39e38de175e7110dbb4fb65093dbf5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 13:35:37 +0200 Subject: [PATCH 1875/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 13 +++++++++++-- iguana/exchanges/LP_socket.c | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 870628dc9..efce3fe4b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -40,6 +40,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 15 #define ELECTRUM_TIMEOUT 10 +#define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6ae7a566a..d8ff7961c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,6 @@ // marketmaker // // electrum keepalive -// merge bots + portfoliot // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -494,7 +493,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) void LP_coinsloop(void *_coins) { - struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + struct LP_address *ap=0,*atmp; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; while ( 1 ) { nonz = 0; @@ -548,6 +547,16 @@ void LP_coinsloop(void *_coins) } } } + while ( ep != 0 ) + { + if ( time(NULL) > ep->keepalive+LP_ELECTRUM_KEEPALIVE ) + { + printf("%s electrum.%p needs a keepalive: lag.%d\n",ep->symbol,ep,(int32_t)(time(NULL) - ep->keepalive)); + if ( (retjson= electrum_donation(ep->symbol,ep,&retjson)) != 0 ) + free_json(retjson); + } + ep = ep->prev; + } continue; } if ( coin->firstrefht == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 55e30ade7..16da1a0c3 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -245,7 +245,7 @@ struct electrum_info struct electrum_info *prev; int32_t bufsize,sock,*heightp,numerrors; struct iguana_info *coin; - uint32_t stratumid,lasttime,pending,*heighttimep; + uint32_t stratumid,lasttime,keepalive,pending,*heighttimep; char ipaddr[64],symbol[16]; uint16_t port; uint8_t buf[]; @@ -931,6 +931,7 @@ void LP_dedicatedloop(void *arg) ep->sock = -1; break; } + ep->keepalive = (uint32_t)time(NULL); if ( sitem->expiration != 0 ) sitem->expiration += (uint32_t)time(NULL); else sitem->expiration = (uint32_t)time(NULL) + ELECTRUM_TIMEOUT; From e8172dcb0e742fa837757f7a23ff793c6a58bb2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 14:39:03 +0200 Subject: [PATCH 1876/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d8ff7961c..58f14293b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,7 +18,6 @@ // LP_nativeDEX.c // marketmaker // -// electrum keepalive // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -551,7 +550,7 @@ void LP_coinsloop(void *_coins) { if ( time(NULL) > ep->keepalive+LP_ELECTRUM_KEEPALIVE ) { - printf("%s electrum.%p needs a keepalive: lag.%d\n",ep->symbol,ep,(int32_t)(time(NULL) - ep->keepalive)); + //printf("%s electrum.%p needs a keepalive: lag.%d\n",ep->symbol,ep,(int32_t)(time(NULL) - ep->keepalive)); if ( (retjson= electrum_donation(ep->symbol,ep,&retjson)) != 0 ) free_json(retjson); } From 8ea9f5b14a4fecbd357cd235c7e708e415b20ad9 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 2 Nov 2017 16:42:10 +0400 Subject: [PATCH 1877/2732] dexscripts for Windows samples (see how_to_use.md) --- iguana/dexscripts.win32/1-client.cmd | 16 ++++++++++++ iguana/dexscripts.win32/2-getuserpass.cmd | 7 +++++ iguana/dexscripts.win32/balance.cmd | 4 +++ iguana/dexscripts.win32/curl.exe | Bin 0 -> 2803200 bytes iguana/dexscripts.win32/enable.cmd | 4 +++ iguana/dexscripts.win32/getcoin.cmd | 4 +++ iguana/dexscripts.win32/getutxos.cmd | 4 +++ iguana/dexscripts.win32/how_to_use.md | 24 ++++++++++++++++++ iguana/dexscripts.win32/images/userpass.png | Bin 0 -> 17834 bytes .../images/userpass_usage.png | Bin 0 -> 10940 bytes iguana/dexscripts.win32/inventory.cmd | 4 +++ iguana/dexscripts.win32/listunspent.cmd | 4 +++ iguana/dexscripts.win32/orderbook.cmd | 4 +++ iguana/dexscripts.win32/passphrase | 1 + iguana/dexscripts.win32/portfolio.cmd | 4 +++ iguana/dexscripts.win32/snapshot.cmd | 5 ++++ iguana/dexscripts.win32/userpass | 0 17 files changed, 85 insertions(+) create mode 100644 iguana/dexscripts.win32/1-client.cmd create mode 100644 iguana/dexscripts.win32/2-getuserpass.cmd create mode 100644 iguana/dexscripts.win32/balance.cmd create mode 100644 iguana/dexscripts.win32/curl.exe create mode 100644 iguana/dexscripts.win32/enable.cmd create mode 100644 iguana/dexscripts.win32/getcoin.cmd create mode 100644 iguana/dexscripts.win32/getutxos.cmd create mode 100644 iguana/dexscripts.win32/how_to_use.md create mode 100644 iguana/dexscripts.win32/images/userpass.png create mode 100644 iguana/dexscripts.win32/images/userpass_usage.png create mode 100644 iguana/dexscripts.win32/inventory.cmd create mode 100644 iguana/dexscripts.win32/listunspent.cmd create mode 100644 iguana/dexscripts.win32/orderbook.cmd create mode 100644 iguana/dexscripts.win32/passphrase create mode 100644 iguana/dexscripts.win32/portfolio.cmd create mode 100644 iguana/dexscripts.win32/snapshot.cmd create mode 100644 iguana/dexscripts.win32/userpass diff --git a/iguana/dexscripts.win32/1-client.cmd b/iguana/dexscripts.win32/1-client.cmd new file mode 100644 index 000000000..21bec2717 --- /dev/null +++ b/iguana/dexscripts.win32/1-client.cmd @@ -0,0 +1,16 @@ +@echo off +set USERHOME=%APPDATA:\=\\% +rem [!] Coins config now taked from coins.json file, no need to put in environment variable +rem --------------------------------------------------------------------------------------- +rem set COINS=[{\"coin\":\"REVS\",\"active\":1,\"asset\":\"REVS\",\"rpcport\":10196}] +rem marketmaker "{\"gui\":\"nogui\",\"client\":1, \"userhome\":\"%USERHOME%\", \"passphrase\":\"mypassphrase\", \"coins\":%COINS%}" + +set COINS=\"\" +set /p PASSPHRASE= marketmaker.log 2>&1 +marketmaker "{\"gui\":\"nogui\",\"client\":1, \"userhome\":\"%USERHOME%\", \"passphrase\":\"%PASSPHRASE%\"}" + + + + diff --git a/iguana/dexscripts.win32/2-getuserpass.cmd b/iguana/dexscripts.win32/2-getuserpass.cmd new file mode 100644 index 000000000..87e633339 --- /dev/null +++ b/iguana/dexscripts.win32/2-getuserpass.cmd @@ -0,0 +1,7 @@ +@echo off +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":null,\"method\":\"enable\",\"coin\":\" \"}" -s > userpass.json +for /f "tokens=2 delims=:," %%a in (' find "userpass" "userpass.json" ') do ( +echo UserPass: %%~a +echo %%~a > userpass +) +del userpass.json \ No newline at end of file diff --git a/iguana/dexscripts.win32/balance.cmd b/iguana/dexscripts.win32/balance.cmd new file mode 100644 index 000000000..551d1234a --- /dev/null +++ b/iguana/dexscripts.win32/balance.cmd @@ -0,0 +1,4 @@ +@echo off +set /p TMPUSERPASS=wv!f(vfAFYMqlfI7J13jg=}+!+`aO?!I2zvuh?KfHLKd+xbs`JB)BoX`23 z<=zQ@I8EiPQmK4^+FF%rIj;QE3-{8F+DoNs-+g6!)sL+=_E_#^+1O+F^ck_5=oss? zn2EDAlPAueZH?1RnyQJ3pRJiOTVotDOf$KvS$DFpd}HX+?Ky6Y-W`@> z#{GTgcB~(U>t{|aIu0xmZ$oU%A{R8^vj2Gd# z>wkZLdrtDX-1SAcPd*ov6CtiU*Yo<&jLFkkX5$)0gsN0ip7B-rzcXi~`&pIh236Y@ z?NzGpyQ);i01<5Y0)Dmd>cIxZ-$JEoC4%a&s)!(kxd``GMJBluxzf54)?b)h$(BBq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@rlK_rE|BJ_od#)?(EKHKe`v`@^+cK?>6f?*I88@df08*$4Lh?D}6mEf-`0gWH4h wIk&&>{w(_c-1+sow?XYZ;G$)_=imO;KaPIjQ{wRj)S_eXboFyt=akR{0HCEfS^xk5 literal 0 HcmV?d00001 diff --git a/iguana/dexscripts.win32/images/userpass_usage.png b/iguana/dexscripts.win32/images/userpass_usage.png new file mode 100644 index 0000000000000000000000000000000000000000..157251a4b8b29ca9769f3ee4cb9b7db7f389a652 GIT binary patch literal 10940 zcmbVycT`i~wk|3PC`uIs1f&T_6KT?=NR=W;FOiN^BPBoz3L-UtQ~~KANbfBaL8MAk zT4+&1CkYZD5Fqg4@11+c8+V*>#(VFdz1N;&mA%TG^ZVvp(Z+__*RQf)rJ$g=uB)SI zLP2ry6S-VVeUbdkFx%*%ptwV!tEu)Z=p!~8;BGsUygrN!P9h~z&BMD(ofPRZPY3#( zmunxDbBo=l?W6Cbou$21u*mJI^Cz5JE6D!iuOk;Y>$K=v^DQT>3mP>5+6xX$7d?0> z@j>^8GJ`sLfiN-Jf}3K!6-5yd#24IE$6NdI0bA3pp>4j~Fx6Xp*)}DHX4wiQIMsk1 z-nJ+EZUv!y$5In_-@GX#B|JNkAjw{&pf_v?g6hxuH7uTK^Ogm$j{pjD?Yxr^Q56xj#Cr@vM2V}m9aNyE$y21rvpfsi7}JzK?tTNa`8#Ra`{#SA z5{L7YyaipSf}MF1r!}W66I}88=QJ0TL;jX9UQ0b9U~=Kn&7gABmA|4q*1VNV zXiDU1-0%LJ4LAQv)Yd@Kk>-hmMQ|ZXE{p1NMIxTLcM4ML^EQn;mYxs_dedmS5 zR~0`?3fa3}9!oPk{-$y)4`>iL&pls7QEieELP@GU@C)S1WjeM8Xh7^OfnR-R(OvSJ zCx=~W=efjChIe7G8sK3pazesdpVZ`}UAO;daAU=59kthrDI=`(Shg_&qgR=Ppa`deB9M!?y~%q2~h~ z{T9v3UBJUZ+(|aUbZ_h~x6jHBHO1{+0T_ePF5ktR)$;@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y6tC5&{vpN>=qLuVS7r{$+CWir>Hj5s{XdlCUroEusc;Td VoX7qKOn Date: Thu, 2 Nov 2017 15:44:27 +0300 Subject: [PATCH 1878/2732] Update how_to_use.md --- iguana/dexscripts.win32/how_to_use.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/dexscripts.win32/how_to_use.md b/iguana/dexscripts.win32/how_to_use.md index 0332e145a..82eb5b7e5 100644 --- a/iguana/dexscripts.win32/how_to_use.md +++ b/iguana/dexscripts.win32/how_to_use.md @@ -1,15 +1,15 @@ ## DexScripts for Windows. How to use? ## -**1. ** Before start you should put scripts and following binaries into one folder: +**1.** Before start you should put scripts and following binaries into one folder: - curl.exe (required for all scripts) - marketmaker.exe - libcurl.dll (required to run marketmaker) - nanomsg.dll (required to run marketmaker) -**2. ** Don't forget to put `coins.json` file into a same folder. This file is available it this repo. +**2.** Don't forget to put `coins.json` file into a same folder. This file is available it this repo. -**3. ** Type your passphrase into passphrase file in this folder (you should create file with name `passphrase` and without extension) and run `1-client.cmd`. This will run marketmaker. Next step is to obtain userpass needed for other scripts, you can simply copy and paste it from marketmaker output on startup into userpass file. +**3.** Type your passphrase into passphrase file in this folder (you should create file with name `passphrase` and without extension) and run `1-client.cmd`. This will run marketmaker. Next step is to obtain userpass needed for other scripts, you can simply copy and paste it from marketmaker output on startup into userpass file. ![](./images/userpass.png) @@ -21,4 +21,4 @@ Sample output of correct `2-getuserpass.cmd` usage is: You should see your userpass on screen, and after it will automatically copied in userpass file. It's important to all other scripts to have this password in userpass file. If output of `2-getuserpass.cmd` is not same as showed on screen above - wait some seconds and run `2-getuserpass.cmd` again. Also make sure that you have allowed marketmaker to accept incoming connections in your Windows Firewall (first time launched system should automatically asked for it). -**4.** For using other scripts please refer to barterDEX API. Or **barterDEX API Summary by Category** document by *shossain*. \ No newline at end of file +**4.** For using other scripts please refer to barterDEX API. Or **barterDEX API Summary by Category** document by *shossain*. From 8ff6f8e3936353edf418fa1a0d04c42a0f6395ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:10:06 +0200 Subject: [PATCH 1879/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index c44c86dbe..7e97391c0 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -190,18 +190,22 @@ double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxpri if ( relvolume < mp->minvol ) { metric *= (mp->minvol / relvolume); + printf("relvolume < minvol %.8f\n",(mp->minvol / relvolume)); } else if ( relvolume > mp->maxvol ) { metric *= (relvolume / mp->maxvol); + printf("relvolume > minvol %.8f\n",(relvolume / mp->maxvol)); } if ( relvolume < mp->balance/LP_MINVOL ) { metric *= (mp->balance / relvolume); + printf("relvolume < balance %.8f\n",(mp->balance / relvolume)); } else if ( relvolume > mp->balance/mp->numutxos ) { metric *= (relvolume / (mp->balance/mp->numutxos)); + printf("relvolume < ave %.8f\n",(relvolume / (mp->balance/mp->numutxos))); } if ( mp->age > LP_ORDERBOOK_DURATION*0.8 ) metric *= 2; From dd4c32d78d828a5a44e1670079d3d59289cff9e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:20:46 +0200 Subject: [PATCH 1880/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 7e97391c0..023ae343f 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -233,6 +233,19 @@ void LP_RTmetric_calc(struct LP_metricinfo *sortbuf,int32_t ind,cJSON *item,doub sortbuf[ind].metric = _LP_RTmetric_calc(&sortbuf[ind],bestprice,maxprice,relvolume); } +int _increasing_metrics(const void *a,const void *b) +{ +#define ptr_a (*(struct LP_metricinfo **)a) +#define ptr_b (*(struct LP_metricinfo **)b) + if ( ptr_b->metric > ptr_a->metric ) + return(-1); + else if ( ptr_b->metric < ptr_a->metric ) + return(1); + return(0); +#undef ptr_a +#undef ptr_b +} + cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,double maxprice,double relvolume) { cJSON *array=rawasks,*item; int32_t i,num,groupi; double price,prevdepth,bestprice; struct LP_metricinfo *sortbuf; @@ -259,8 +272,9 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou item = jitem(rawasks,i); LP_RTmetric_calc(sortbuf,i,item,bestprice,maxprice,relvolume,prevdepth); prevdepth = jdouble(item,"depth"); + printf("%.8f ",sortbuf[i].metric); } - revsortds(&sortbuf[0].metric,groupi+1,sizeof(*sortbuf)); + qsort(&sortbuf[0].metric,groupi+1,sizeof(*sortbuf),_increasing_metrics); array = cJSON_CreateArray(); for (i=0; i<=groupi; i++) { From 5ac74b73ae50cd8c31748baecdbbbb4e9e3e19ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:25:30 +0200 Subject: [PATCH 1881/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 023ae343f..31479b8ce 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -235,8 +235,8 @@ void LP_RTmetric_calc(struct LP_metricinfo *sortbuf,int32_t ind,cJSON *item,doub int _increasing_metrics(const void *a,const void *b) { -#define ptr_a (*(struct LP_metricinfo **)a) -#define ptr_b (*(struct LP_metricinfo **)b) +#define ptr_a ((struct LP_metricinfo *)a) +#define ptr_b ((struct LP_metricinfo *)b) if ( ptr_b->metric > ptr_a->metric ) return(-1); else if ( ptr_b->metric < ptr_a->metric ) From 897afd3a6be99d052faf42e700f33803ea3cade4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:36:31 +0200 Subject: [PATCH 1882/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 4 ++-- iguana/exchanges/LP_tradebots.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 31479b8ce..e38ed8861 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -272,13 +272,13 @@ cJSON *LP_RTmetrics_sort(char *base,char *rel,cJSON *rawasks,int32_t numasks,dou item = jitem(rawasks,i); LP_RTmetric_calc(sortbuf,i,item,bestprice,maxprice,relvolume,prevdepth); prevdepth = jdouble(item,"depth"); - printf("%.8f ",sortbuf[i].metric); + //printf("%.8f ",sortbuf[i].metric); } qsort(&sortbuf[0].metric,groupi+1,sizeof(*sortbuf),_increasing_metrics); array = cJSON_CreateArray(); for (i=0; i<=groupi; i++) { - printf("(%d -> %d %.3f) ",i,sortbuf[i].ind,sortbuf[i].metric); + printf("(%d <- %d %.3f) ",i,sortbuf[i].ind,sortbuf[i].metric); item = jitem(rawasks,sortbuf[i].ind); jaddi(array,jduplicate(item)); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index fc7cc2cb9..f3b5b35fb 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -259,7 +259,7 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { - double remaining; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; + double remaining; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { @@ -272,7 +272,8 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) remaining = bot->totalrelvolume - (bot->relsum + bot->pendrelsum); printf("try autobuy %s/%s remaining %.8f maxprice %.8f\n",bot->base,bot->rel,remaining,bot->maxprice); tradeid = rand(); - if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) + for (i=1; i<=maxiters; i++) + if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining/i,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr)) != 0 ) { @@ -285,7 +286,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->pause = (uint32_t)time(NULL); } else printf("didnt get any trade pending %s %s\n\n",bot->name,retstr); free_json(retjson2); - } else printf("%s\n",retstr); + } else printf("iter.%d/%d %s\n",i,maxiters,retstr); free(retstr); } } From fc1d374ed1e45aeaca7da85c68d7a995e5a1b784 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:50:11 +0200 Subject: [PATCH 1883/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 10 +++++----- iguana/exchanges/LP_tradebots.c | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index e38ed8861..e8d0ba09e 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -184,28 +184,28 @@ double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxpri metric = origmetric; if ( mp->numutxos == 0 || relvolume == 0. || mp->maxvol == 0. || mp->balance == 0. ) { - printf("skip i.%d as no info\n",mp->ind); + //printf("skip i.%d as no info\n",mp->ind); return(metric * 100.); } if ( relvolume < mp->minvol ) { metric *= (mp->minvol / relvolume); - printf("relvolume < minvol %.8f\n",(mp->minvol / relvolume)); + //printf("relvolume < minvol %.8f\n",(mp->minvol / relvolume)); } else if ( relvolume > mp->maxvol ) { metric *= (relvolume / mp->maxvol); - printf("relvolume > minvol %.8f\n",(relvolume / mp->maxvol)); + //printf("relvolume > minvol %.8f\n",(relvolume / mp->maxvol)); } if ( relvolume < mp->balance/LP_MINVOL ) { metric *= (mp->balance / relvolume); - printf("relvolume < balance %.8f\n",(mp->balance / relvolume)); + //printf("relvolume < balance %.8f\n",(mp->balance / relvolume)); } else if ( relvolume > mp->balance/mp->numutxos ) { metric *= (relvolume / (mp->balance/mp->numutxos)); - printf("relvolume < ave %.8f\n",(relvolume / (mp->balance/mp->numutxos))); + //printf("relvolume < ave %.8f\n",(relvolume / (mp->balance/mp->numutxos))); } if ( mp->age > LP_ORDERBOOK_DURATION*0.8 ) metric *= 2; diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f3b5b35fb..69ada5bd1 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -273,21 +273,23 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) printf("try autobuy %s/%s remaining %.8f maxprice %.8f\n",bot->base,bot->rel,remaining,bot->maxprice); tradeid = rand(); for (i=1; i<=maxiters; i++) - if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining/i,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { - if ( (retjson2= cJSON_Parse(retstr)) != 0 ) + if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining/i,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { - if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) + if ( (retjson2= cJSON_Parse(retstr)) != 0 ) { - bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending,tradeid); - if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) - bot->dead = (uint32_t)time(NULL); - else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) - bot->pause = (uint32_t)time(NULL); - } else printf("didnt get any trade pending %s %s\n\n",bot->name,retstr); - free_json(retjson2); - } else printf("iter.%d/%d %s\n",i,maxiters,retstr); - free(retstr); + if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) + { + bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending,tradeid); + if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) + bot->dead = (uint32_t)time(NULL); + else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) + bot->pause = (uint32_t)time(NULL); + } else printf("iter.%d/%d %.8f didnt get any trade pending %s %s\n\n",i,maxiters,remaining/i,bot->name,retstr); + free_json(retjson2); + } else printf("iter.%d/%d %.8f %s\n",i,maxiters,remaining/i,retstr); + free(retstr); + } } } free_json(retjson); From 8ff41a367b723a9fb1ffc15a16c2f0ac0625c975 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:51:33 +0200 Subject: [PATCH 1884/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 69ada5bd1..eee996965 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -315,7 +315,7 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; bot->numpending--, bot->completed++; - printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid); + printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u, numpending.%d completed.%d\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid,bot->numpending,bot->completed); tp->finished = (uint32_t)time(NULL); break; } From 1389cfe1003abac1ae3a0072facb56c31bc1cfb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 17:56:10 +0200 Subject: [PATCH 1885/2732] Test --- iguana/exchanges/LP_tradebots.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index eee996965..60bdcf986 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -285,6 +285,10 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); + printf("issued bot trade.%u\n",tradeid); + free_json(retjson2); + free(retstr); + break; } else printf("iter.%d/%d %.8f didnt get any trade pending %s %s\n\n",i,maxiters,remaining/i,bot->name,retstr); free_json(retjson2); } else printf("iter.%d/%d %.8f %s\n",i,maxiters,remaining/i,retstr); @@ -367,7 +371,7 @@ char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { - struct LP_tradebot *bot; double shortfall; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0,abalance=0; struct iguana_info *basecoin,*relcoin; + struct LP_tradebot *bot; char *retstr; double shortfall; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0,abalance=0; struct iguana_info *basecoin,*relcoin; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 || basecoin->inactive != 0 || relcoin->inactive != 0 ) @@ -384,6 +388,8 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl } free_json(array); } + if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) + free(retstr); txfees = 10 * relcoin->txfee; printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees)); if ( dstr(abalance) < relvolume + dstr(txfees) ) From 14adbda69d9c3894189d0f02e5d683df9928b3cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 18:04:42 +0200 Subject: [PATCH 1886/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_tradebots.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6becabca6..4ae2274a7 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -304,7 +304,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** } } } //else printf("cant find targetval2 %.8f\n",dstr(targetval2)); - } else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); + } //else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } //else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 60bdcf986..f340ac6f6 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -285,7 +285,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); - printf("issued bot trade.%u\n",tradeid); + printf("issued bot trade.%u %s\n",tradeid,retstr); free_json(retjson2); free(retstr); break; From e5f7f667230dfae994307aaf0d55b510206411b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 18:18:41 +0200 Subject: [PATCH 1887/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_transaction.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index e8d0ba09e..54d9300bd 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -175,7 +175,7 @@ void LP_RTmetrics_update(char *base,char *rel) char str[65]; printf("%s has %d pending swaps! which is more than %d\n",bits256_str(str,LP_RTmetrics.pending_pubkeys[i]),LP_RTmetrics.pending_swaps[i],LP_MAXPENDING_SWAPS); LP_RTmetrics_blacklistadd(LP_RTmetrics.pending_pubkeys[i]); } - printf("%d pubkeys have pending swaps, whitelist.%d blacklist.%d avoidtxids.%d\n",LP_RTmetrics.numpendings,LP_RTmetrics.numwhitelist,LP_RTmetrics.numblacklist,LP_RTmetrics.numavoidtxids); + //printf("%d pubkeys have pending swaps, whitelist.%d blacklist.%d avoidtxids.%d\n",LP_RTmetrics.numpendings,LP_RTmetrics.numwhitelist,LP_RTmetrics.numblacklist,LP_RTmetrics.numavoidtxids); } double _LP_RTmetric_calc(struct LP_metricinfo *mp,double bestprice,double maxprice,double relvolume) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4ae2274a7..f035fc7d0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -915,7 +915,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel { destsatoshis -= 2*desttxfee; autxo->S.satoshis = destsatoshis; - printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); + //printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } else if ( autxo->S.satoshis - 2*desttxfee < destsatoshis ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 50fee8dcb..95b999e72 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -643,10 +643,10 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { if ( value < satoshis+txfee ) { - if ( satoshis > value-txfee/2 ) + if ( (value-satoshis) > 3*txfee/4 ) { - satoshis = value - txfee; - printf("reduce satoshis by txfee %.8f to %.8f\n",dstr(txfee),dstr(satoshis)); + satoshis = value - 3*txfee/4; + printf("reduce satoshis %.8f by txfee %.8f to value %.8f\n",dstr(satoshis),dstr(txfee),dstr(value)); } else { From 3854c1081cd78a952d053a256e0d89393e8b86ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 18:32:48 +0200 Subject: [PATCH 1888/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f035fc7d0..cc1307485 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -292,7 +292,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { - if ( (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,targetval2 * 1.01)) >= 0 ) + if ( (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,(targetval2+2*txfee) * 1.01)) >= 0 ) { if ( up != 0 && (up2= utxos[mini]) != 0 ) { From 1c0f84c4af5334ceb7dbc43f35c9794f64c2bed6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 18:51:02 +0200 Subject: [PATCH 1889/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f340ac6f6..d758e6350 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -353,7 +353,7 @@ void LP_tradebots_timeslice(void *ctx) } } } - else if ( bot->numpending == 0 ) + else //if ( bot->numpending == 0 ) LP_tradebot_timeslice(ctx,bot); } lastnumfinished = LP_numfinished; From 73ab11303dd8185ebbeefdb3ba08a230fbf36755 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 18:58:34 +0200 Subject: [PATCH 1890/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_tradebots.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cc1307485..1b66f4180 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -965,6 +965,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel continue; else return(clonestr("{\"error\":\"cant ordermatch to destpubkey\"}")); } + printf("i.%d maxiters.%d qprice %.8f vs maxprice %.8f\n",i,maxiters,dstr(qprice),dstr(maxprice)); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); } return(clonestr("{\"error\":\"cant get here\"}")); diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index d758e6350..f340ac6f6 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -353,7 +353,7 @@ void LP_tradebots_timeslice(void *ctx) } } } - else //if ( bot->numpending == 0 ) + else if ( bot->numpending == 0 ) LP_tradebot_timeslice(ctx,bot); } lastnumfinished = LP_numfinished; From f6ee03aa51adbf1f97339f352a556a0526d82443 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 19:42:16 +0200 Subject: [PATCH 1891/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 58f14293b..64f0a152a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -690,9 +690,12 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) printf("%s ",activecoins[i]); LP_coinfind(activecoins[i]); LP_priceinfoadd(activecoins[i]); - if ( (coin= LP_coinfind(activecoins[i])) != 0 && LP_getheight(coin) <= 0 ) - coin->inactive = (uint32_t)time(NULL); - LP_unspents_load(coin->symbol,coin->smartaddr); + if ( (coin= LP_coinfind(activecoins[i])) != 0 ) + { + if ( LP_getheight(coin) <= 0 ) + coin->inactive = (uint32_t)time(NULL); + LP_unspents_load(coin->symbol,coin->smartaddr); + } } if ( (n= cJSON_GetArraySize(coins)) > 0 ) { @@ -704,9 +707,12 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) printf("%s ",jstr(item,"coin")); LP_coincreate(item); LP_priceinfoadd(jstr(item,"coin")); - if ( (coin= LP_coinfind(symbol)) != 0 && LP_getheight(coin) <= 0 ) - coin->inactive = (uint32_t)time(NULL); - LP_unspents_load(coin->symbol,coin->smartaddr); + if ( (coin= LP_coinfind(symbol)) != 0 ) + { + if ( LP_getheight(coin) <= 0 ) + coin->inactive = (uint32_t)time(NULL); + LP_unspents_load(coin->symbol,coin->smartaddr); + } } } } From 1067640169aac3ea95ea884139a5950302579f7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 20:10:51 +0200 Subject: [PATCH 1892/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 64f0a152a..6597389f0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -765,9 +765,9 @@ void LP_pubkeysloop(void *ctx) while ( 1 ) { LP_counter += 100; - //printf("LP_pubkeysloop %d\n",LP_counter); + printf("LP_pubkeysloop %d\n",LP_counter); LP_notify_pubkeys(ctx,LP_mypubsock); - sleep(LP_ORDERBOOK_DURATION * .777); + sleep(60); } } From f478e4c893d0ee06595907b50a9f78a906200c56 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 20:18:32 +0200 Subject: [PATCH 1893/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6597389f0..aea16362d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -765,7 +765,7 @@ void LP_pubkeysloop(void *ctx) while ( 1 ) { LP_counter += 100; - printf("LP_pubkeysloop %d\n",LP_counter); + //printf("LP_pubkeysloop %d\n",LP_counter); LP_notify_pubkeys(ctx,LP_mypubsock); sleep(60); } From 25a2a7df5135f59e871ef03a618c4ba7e395b04f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 20:29:16 +0200 Subject: [PATCH 1894/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index aea16362d..4ddda76f3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -761,13 +761,17 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LP_pubkeysloop(void *ctx) { + static uint32_t lasttime; sleep(10); while ( 1 ) { - LP_counter += 100; - //printf("LP_pubkeysloop %d\n",LP_counter); - LP_notify_pubkeys(ctx,LP_mypubsock); - sleep(60); + if ( time(NULL) > lasttime+60 ) + { + printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); + LP_notify_pubkeys(ctx,LP_mypubsock); + lasttime = (uint32_t)time(NULL); + } + sleep(3); } } From 0a764e40c53ffebe161f90585dfb826942f69658 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 20:39:15 +0200 Subject: [PATCH 1895/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4ddda76f3..83dae1016 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -767,7 +767,7 @@ void LP_pubkeysloop(void *ctx) { if ( time(NULL) > lasttime+60 ) { - printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); + //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); lasttime = (uint32_t)time(NULL); } From a2188d77ed374a93ff029eefe51bac58746f2d2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 20:49:34 +0200 Subject: [PATCH 1896/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 83dae1016..665bc3cb9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -514,6 +514,8 @@ void LP_coinsloop(void *_coins) memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; + if ( coin->longestchain == 1 ) // special init value + coin->longestchain = LP_getheight(coin); if ( (ep= coin->electrum) != 0 ) { if ( (backupep= ep->prev) == 0 ) From 6e48a5372777af1fb33180f1d292ea68b86728bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 21:06:28 +0200 Subject: [PATCH 1897/2732] Test --- iguana/exchanges/LP_swap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 41c65f031..bedec1175 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1090,32 +1090,32 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin.taddr,swap->alicecoin.taddr); if ( swap->I.iambob != 0 ) { - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + swap->bobcoin.txfee,0,0,jumblrflag); - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + swap->alicecoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin.txfee,0,0,jumblrflag); bobpub33 = pubkey33; } else { - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + swap->bobcoin.txfee,0,0,jumblrflag); - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + swap->alicecoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin.txfee,0,0,jumblrflag); alicepub33 = pubkey33; } swap->myfee.I.locktime = swap->I.started + 1; swap->otherfee.I.locktime = swap->I.started + 1; - basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin.txfee,4,0,jumblrflag); + basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + 0*swap->bobcoin.txfee,4,0,jumblrflag); basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); swap->bobrefund.I.suppress_pubkeys = 1; basilisk_rawtx_setparms("aliceclaim",swap->I.req.quoteid,&swap->aliceclaim,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,alicepub33,jumblrflag); swap->aliceclaim.I.suppress_pubkeys = 1; swap->aliceclaim.I.locktime = swap->I.started + swap->I.putduration+swap->I.callduration + 1; - basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,&swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + swap->bobcoin.txfee,3,0,jumblrflag); + basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,&swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + 0*swap->bobcoin.txfee,3,0,jumblrflag); basilisk_rawtx_setparms("alicespend",swap->I.req.quoteid,&swap->alicespend,&swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,alicepub33,jumblrflag); swap->alicespend.I.suppress_pubkeys = 1; basilisk_rawtx_setparms("bobreclaim",swap->I.req.quoteid,&swap->bobreclaim,&swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,bobpub33,jumblrflag); swap->bobreclaim.I.suppress_pubkeys = 1; swap->bobreclaim.I.locktime = swap->I.started + swap->I.putduration + 1; - basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,&swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis+swap->alicecoin.txfee,2,0,jumblrflag); + basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,&swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + 0*swap->alicecoin.txfee,2,0,jumblrflag); basilisk_rawtx_setparms("bobspend",swap->I.req.quoteid,&swap->bobspend,&swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,bobpub33,jumblrflag); swap->bobspend.I.suppress_pubkeys = 1; basilisk_rawtx_setparms("alicereclaim",swap->I.req.quoteid,&swap->alicereclaim,&swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,alicepub33,jumblrflag); From b83df06c3f47f5b8549d14dd6fc50f610273c28f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 21:12:27 +0200 Subject: [PATCH 1898/2732] Test --- crypto777/iguana_OS.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index c8a7c888f..2000651a9 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -901,11 +901,15 @@ void *OS_loadfile(char *fname,char **bufp,long *lenp,long *allocsizep) return(buf); } -void *OS_filestr(long *allocsizep,char *fname) +void *OS_filestr(long *allocsizep,char *_fname) { - long filesize = 0; char *buf = 0; + long filesize = 0; char *fname,*buf = 0; void *retptr; *allocsizep = 0; - return(OS_loadfile(fname,&buf,&filesize,allocsizep)); + fname = malloc(strlen(_fname)+1); + strcpy(fname,_fname); + retptr = OS_loadfile(fname,&buf,&filesize,allocsizep); + free(fname); + return(retptr); } // following functions cant be fully implemented in one or more OS From 120f2b857d2a574bcb2f130bcc8dd8e70dd13b77 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 21:24:20 +0200 Subject: [PATCH 1899/2732] Test --- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/LP_transaction.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index bedec1175..b631f22e6 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -626,7 +626,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } - if ( j64bits(vout,"satoshis") >= rawtx->I.amount && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( j64bits(vout,"satoshis") >= rawtx->I.amount-txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 95b999e72..1071bf878 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -648,6 +648,11 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch satoshis = value - 3*txfee/4; printf("reduce satoshis %.8f by txfee %.8f to value %.8f\n",dstr(satoshis),dstr(txfee),dstr(value)); } + else if ( value == satoshis && (double)txfee/value < 0.001 ) + { + satoshis = value - txfee; + printf("emergency txfee allocation from value %.8f identical to satoshis: %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); + } else { printf("utxo %.8f too small for %.8f + %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); From 7c8ad66d8d6599d38770cbc133879fda0987d500 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 21:50:23 +0200 Subject: [PATCH 1900/2732] Test --- iguana/exchanges/LP_tradebots.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f340ac6f6..9e5e9fd12 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -257,9 +257,35 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen return(tp); } +double LP_orderbook_maxrel(char *base,char *rel,double maxprice) +{ + char *retstr; int32_t i,numasks; cJSON *retjson,*asks,*item; double maxvol,maxrel = 0.; + if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (asks= jarray(&numasks,retjson,"asks")) != 0 ) + { + for (i=0; i maxprice ) + break; + maxvol = jdouble(item,"maxvolume"); + if ( maxvol > maxrel ) + maxrel = maxvol; + } + } + free_json(retjson); + } + free(retstr); + } + return(maxrel); +} + void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { - double remaining; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; + double remaining,maxrel; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { @@ -271,9 +297,14 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { remaining = bot->totalrelvolume - (bot->relsum + bot->pendrelsum); printf("try autobuy %s/%s remaining %.8f maxprice %.8f\n",bot->base,bot->rel,remaining,bot->maxprice); + maxrel = LP_orderbook_maxrel(bot->base,bot->rel,bot->maxprice); + if ( maxrel < remaining ) + remaining = maxrel; tradeid = rand(); for (i=1; i<=maxiters; i++) { + if ( remaining < 0.001 ) + break; if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining/i,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr)) != 0 ) From e38498bb753a97cfe0c5041f91c4075ad1f63eb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 21:58:17 +0200 Subject: [PATCH 1901/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 9e5e9fd12..defd5e695 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -296,8 +296,8 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) if ( jobj(retjson,"pending") == 0 ) { remaining = bot->totalrelvolume - (bot->relsum + bot->pendrelsum); - printf("try autobuy %s/%s remaining %.8f maxprice %.8f\n",bot->base,bot->rel,remaining,bot->maxprice); maxrel = LP_orderbook_maxrel(bot->base,bot->rel,bot->maxprice); + printf("try autobuy %s/%s remaining %.8f maxprice %.8f maxrel %.8f\n",bot->base,bot->rel,remaining,bot->maxprice,maxrel); if ( maxrel < remaining ) remaining = maxrel; tradeid = rand(); From 16d618499436e6b7fcb89d1fdcbd3e43a33cd50d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:04:10 +0200 Subject: [PATCH 1902/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_tradebots.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 665bc3cb9..4e55cb270 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -585,7 +585,7 @@ void LP_coinsloop(void *_coins) continue; } nonz++; - //if ( (coin->lastscanht % 1000) == 0 ) + if ( coin->lastscanht < coin->longestchain-3 ) printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); for (j=0; j<100; j++) { diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index defd5e695..878bd8beb 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -262,6 +262,8 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice) char *retstr; int32_t i,numasks; cJSON *retjson,*asks,*item; double maxvol,maxrel = 0.; if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) { + + printf("maxprice %.8f %s/%s obook.(%s)\n",maxprice,base,rel,retstr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (asks= jarray(&numasks,retjson,"asks")) != 0 ) @@ -272,6 +274,7 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice) if ( jdouble(item,"price") > maxprice ) break; maxvol = jdouble(item,"maxvolume"); + printf("%.8f ",maxvol); if ( maxvol > maxrel ) maxrel = maxvol; } From b055b37b0361dbfd0a278d90ec9aff01e7b6e2fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:07:22 +0200 Subject: [PATCH 1903/2732] Test --- iguana/exchanges/LP_tradebots.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 878bd8beb..aa59fc8ba 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -263,18 +263,18 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice) if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) { - printf("maxprice %.8f %s/%s obook.(%s)\n",maxprice,base,rel,retstr); + printf("maxprice %.8f %s/%s\n",maxprice,base,rel); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (asks= jarray(&numasks,retjson,"asks")) != 0 ) { for (i=0; i maxprice ) break; maxvol = jdouble(item,"maxvolume"); - printf("%.8f ",maxvol); + printf("(%s) -> %.8f\n",jprint(item,0),maxvol); if ( maxvol > maxrel ) maxrel = maxvol; } From e2023878e41c76d6639ec8f16429462afdd71d75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:16:53 +0200 Subject: [PATCH 1904/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 +++++--- iguana/exchanges/LP_tradebots.c | 5 ++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1b66f4180..6496038b0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -803,7 +803,9 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { item = jitem(asks,i); price = jdouble(item,"price"); - price *= 1.005; + if ( price/maxprice < .9 ) + price *= 1.025; + else price *= 1.001; pubkey = jbits256(item,"pubkey"); if ( bits256_nonz(destpubkey) != 0 && bits256_cmp(destpubkey,pubkey) != 0 ) continue; @@ -824,8 +826,8 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); asatoshis = autxo->S.satoshis; - LP_listunspent_query(base,coinaddr); - LP_listunspent_both(base,coinaddr,1); + LP_listunspent_query(base,coinaddr); + //LP_listunspent_both(base,coinaddr,1); for (j=0; jpubkey,gui)) != 0 ) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index aa59fc8ba..af5f385f8 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -262,8 +262,7 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice) char *retstr; int32_t i,numasks; cJSON *retjson,*asks,*item; double maxvol,maxrel = 0.; if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) { - - printf("maxprice %.8f %s/%s\n",maxprice,base,rel); + //printf("maxprice %.8f %s/%s\n",maxprice,base,rel); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (asks= jarray(&numasks,retjson,"asks")) != 0 ) @@ -274,7 +273,7 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice) if ( jdouble(item,"price") > maxprice ) break; maxvol = jdouble(item,"maxvolume"); - printf("(%s) -> %.8f\n",jprint(item,0),maxvol); + //printf("(%s) -> %.8f\n",jprint(item,0),maxvol); if ( maxvol > maxrel ) maxrel = maxvol; } From 58c9b201a42019966a1329244144c99972dc66d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:30:08 +0200 Subject: [PATCH 1905/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index efce3fe4b..44f92218c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -38,7 +38,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAGICBITS 8 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 15 +#define LP_AUTOTRADE_TIMEOUT 20 #define ELECTRUM_TIMEOUT 10 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6496038b0..2792902c4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -887,13 +887,13 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel timeout = LP_AUTOTRADE_TIMEOUT; if ( basecoin->electrum != 0 && relcoin->electrum != 0 ) { - if ( timeout < 3*LP_AUTOTRADE_TIMEOUT ) - timeout = 3*LP_AUTOTRADE_TIMEOUT; + if ( timeout < 2*LP_AUTOTRADE_TIMEOUT ) + timeout = 2*LP_AUTOTRADE_TIMEOUT; } else if ( basecoin->electrum != 0 || relcoin->electrum != 0 ) { - if ( timeout < 2*LP_AUTOTRADE_TIMEOUT ) - timeout = 2*LP_AUTOTRADE_TIMEOUT; + if ( timeout < 1.5*LP_AUTOTRADE_TIMEOUT ) + timeout = 1.5*LP_AUTOTRADE_TIMEOUT; } if ( time(NULL) < Alice_expiration ) return(clonestr("{\"error\":\"only one pending request at a time\"}")); From b6c5a83771731dcb295e168779282c5b57ccd04a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:42:28 +0200 Subject: [PATCH 1906/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 37 ++++++++++++++++++++------------ iguana/exchanges/LP_ordermatch.c | 16 ++++++++++---- iguana/exchanges/LP_peers.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_remember.c | 6 ++++-- iguana/exchanges/LP_signatures.c | 10 ++++----- 7 files changed, 47 insertions(+), 28 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 44f92218c..c9d15c3b3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -387,7 +387,7 @@ int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); uint64_t LP_RTsmartbalance(struct iguana_info *coin); int32_t LP_getheight(struct iguana_info *coin); -int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg); +int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,char *msg); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4e55cb270..bf30e3be5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -27,8 +27,8 @@ #include "LP_include.h" portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex; int32_t LP_canbind; -char *Broadcaststr,*Reserved_msgs[1000]; -int32_t num_Reserved_msgs,max_Reserved_msgs; +char *Broadcaststr,*Reserved_msgs[2][1000]; +int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; @@ -237,7 +237,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, memset(zero.bytes,0,sizeof(zero)); /*if ( (method= jstr(reqjson,"method")) != 0 && (strcmp(method,"request") == 0 || strcmp(method,"requested") == 0 || strcmp(method,"connect") == 0 || strcmp(method,"connected") == 0) ) printf("broadcast.(%s)\n",Broadcaststr);*/ - LP_reserved_msg("","",zero,jprint(reqjson,0)); + LP_reserved_msg(0,"","",zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); free_json(reqjson); @@ -809,7 +809,7 @@ void LP_reserved_msgs(void *ignore) memset(zero.bytes,0,sizeof(zero)); while ( 1 ) { - if ( num_Reserved_msgs > 0 ) + if ( num_Reserved_msgs[0] > 0 || num_Reserved_msgs[1] > 0 ) { flag = 0; if ( LP_mypubsock >= 0 ) @@ -823,9 +823,18 @@ void LP_reserved_msgs(void *ignore) if ( flag == 1 ) { portable_mutex_lock(&LP_reservedmutex); - num_Reserved_msgs--; - LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[num_Reserved_msgs]); - Reserved_msgs[num_Reserved_msgs] = 0; + if ( num_Reserved_msgs[1] > 0 ) + { + num_Reserved_msgs[1]--; + LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); + Reserved_msgs[1][num_Reserved_msgs[1]] = 0; + } + else if ( num_Reserved_msgs[0] > 0 ) + { + num_Reserved_msgs[0]--; + LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); + Reserved_msgs[0][num_Reserved_msgs[0]] = 0; + } portable_mutex_unlock(&LP_reservedmutex); } } @@ -835,20 +844,20 @@ void LP_reserved_msgs(void *ignore) } } -int32_t LP_reserved_msg(char *base,char *rel,bits256 pubkey,char *msg) +int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,char *msg) { int32_t n = 0; portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs) ) + if ( num_Reserved_msgs[priority] < sizeof(Reserved_msgs[priority])/sizeof(*Reserved_msgs[priority]) ) { - Reserved_msgs[num_Reserved_msgs++] = msg; - n = num_Reserved_msgs; + Reserved_msgs[priority][num_Reserved_msgs[priority]++] = msg; + n = num_Reserved_msgs[priority]; } else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); portable_mutex_unlock(&LP_reservedmutex); - if ( num_Reserved_msgs > max_Reserved_msgs ) + if ( num_Reserved_msgs[priority] > max_Reserved_msgs[priority] ) { - max_Reserved_msgs = num_Reserved_msgs; - printf("New max_Reserved_msgs.%d\n",max_Reserved_msgs); + max_Reserved_msgs[priority] = num_Reserved_msgs[priority]; + printf("New priority.%d max_Reserved_msgs.%d\n",priority,max_Reserved_msgs[priority]); } return(n); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2792902c4..c91082471 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -375,8 +375,12 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ //jaddnum(retjson,"quoteid",qp->R.quoteid); // LP_addsig char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); - LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,0)); - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->desthash,jprint(retjson,0)); + LP_reserved_msg(1,base,rel,utxo->S.otherpubkey,jprint(retjson,0)); + sleep(1); + bits256 zero; + memset(zero.bytes,0,sizeof(zero)); + LP_reserved_msg(1,base,rel,zero,jprint(retjson,0)); + //LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->desthash,jprint(retjson,0)); free_json(retjson); retval = 0; } else printf("error launching swaploop\n"); @@ -734,8 +738,12 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); // LP_addsig //msg2 = clonestr(msg); - LP_reserved_msg(Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); - LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + sleep(1); + bits256 zero; + memset(zero.bytes,0,sizeof(zero)); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); + //LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); free_json(retjson); return(retval); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 8539fef27..4aaae086d 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -153,7 +153,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char struct iguana_info *coin,*ctmp; bits256 zero; char busaddr[64]; memset(zero.bytes,0,sizeof(zero)); //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); - LP_reserved_msg("","",zero,jprint(LP_peerjson(peer),1)); + LP_reserved_msg(0,"","",zero,jprint(LP_peerjson(peer),1)); if ( 0 ) { HASH_ITER(hh,LP_coins,coin,ctmp) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6cc110671..404cd4f9e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -713,7 +713,7 @@ void LP_pubkeys_query() jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); //printf("LP_pubkeys_query %s\n",jprint(reqjson,0)); - LP_reserved_msg("","",zero,jprint(reqjson,1)); + LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); } } } diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index e27a13aab..9fa8cfbd3 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1118,8 +1118,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); LP_tradecommand_log(item); - LP_reserved_msg(rswap.src,rswap.dest,zero,clonestr(itemstr)); - LP_broadcast_message(LP_mypubsock,rswap.src,rswap.dest,zero,itemstr); + LP_reserved_msg(1,rswap.src,rswap.dest,zero,clonestr(itemstr)); + sleep(1); + LP_reserved_msg(0,rswap.src,rswap.dest,zero,clonestr(itemstr)); + //LP_broadcast_message(LP_mypubsock,rswap.src,rswap.dest,zero,itemstr); fclose(fp); } } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 32d02000b..bc1ad2e81 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -348,7 +348,7 @@ void LP_postutxos(char *symbol,char *coinaddr) //char str[65]; printf("utxoshash add %s\n",bits256_str(str,utxoshash)); LP_utxos_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,utxoshash); //printf("post (%s) -> %d\n",msg,LP_mypubsock); - LP_reserved_msg(symbol,symbol,zero,jprint(reqjson,1)); + LP_reserved_msg(0,symbol,symbol,zero,jprint(reqjson,1)); } } } @@ -463,7 +463,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",pubsecpstr); LP_price_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,base,rel,price64); - LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); + LP_reserved_msg(0,base,rel,zero,jprint(reqjson,1)); return(clonestr("{\"result\":\"success\"}")); } else return(clonestr("{\"error\":\"electrum node cant post bob asks\"}")); } @@ -569,7 +569,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) timestamp = (uint32_t)time(NULL); jaddnum(reqjson,"timestamp",timestamp); LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); - LP_reserved_msg("","",zero,jprint(reqjson,1)); + LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); } char *LP_notify_recv(cJSON *argjson) @@ -624,7 +624,7 @@ void LP_smartutxos_push(struct iguana_info *coin) jaddnum(req,"ht",height); jadd64bits(req,"value",value); //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_reserved_msg("","",zero,jprint(req,1)); + LP_reserved_msg(0,"","",zero,jprint(req,1)); #endif } } @@ -657,7 +657,7 @@ void LP_listunspent_query(char *symbol,char *coinaddr) jaddstr(reqjson,"method","addr_unspents"); jaddstr(reqjson,"coin",symbol); jaddstr(reqjson,"address",coinaddr); - LP_reserved_msg("","",zero,jprint(reqjson,1)); + LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); } void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) From d434c073b46fb95587f4ab78d557b5b7588c02e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:44:00 +0200 Subject: [PATCH 1907/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index bc1ad2e81..298a856cd 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -684,9 +684,9 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ //printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs < sizeof(Reserved_msgs)/sizeof(*Reserved_msgs)-2 ) + if ( num_Reserved_msgs[1] < sizeof(Reserved_msgs[1])/sizeof(*Reserved_msgs[1])-2 ) { - Reserved_msgs[num_Reserved_msgs++] = msg; + Reserved_msgs[1][num_Reserved_msgs[1]++] = msg; //Reserved_msgs[num_Reserved_msgs++] = msg2; } LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg2); From 5849f83cadaa56bcfadf9f8c3543c281709a8c7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:51:21 +0200 Subject: [PATCH 1908/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_remember.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c91082471..6dd5837a9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -738,7 +738,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); // LP_addsig //msg2 = clonestr(msg); - LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); sleep(1); bits256 zero; memset(zero.bytes,0,sizeof(zero)); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 9fa8cfbd3..22b05ece7 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1120,7 +1120,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti LP_tradecommand_log(item); LP_reserved_msg(1,rswap.src,rswap.dest,zero,clonestr(itemstr)); sleep(1); - LP_reserved_msg(0,rswap.src,rswap.dest,zero,clonestr(itemstr)); + LP_reserved_msg(0,rswap.src,rswap.dest,zero,itemstr); //LP_broadcast_message(LP_mypubsock,rswap.src,rswap.dest,zero,itemstr); fclose(fp); } From 23b101bc7cbdafadf7505f01d76f302a9ceb144a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Nov 2017 22:58:40 +0200 Subject: [PATCH 1909/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 1071bf878..9f0fdfa69 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -651,7 +651,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch else if ( value == satoshis && (double)txfee/value < 0.001 ) { satoshis = value - txfee; - printf("emergency txfee allocation from value %.8f identical to satoshis: %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); + printf("txfee allocation from value %.8f identical to satoshis: %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); } else { From 8eddae1940804361f7d6a2175e6999fb8a66fedd Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 3 Nov 2017 02:55:41 +0400 Subject: [PATCH 1910/2732] added small F.A.Q. in how_to_use.md, based on questions in #tradebots --- iguana/dexscripts.win32/how_to_use.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/iguana/dexscripts.win32/how_to_use.md b/iguana/dexscripts.win32/how_to_use.md index 82eb5b7e5..29fdcc537 100644 --- a/iguana/dexscripts.win32/how_to_use.md +++ b/iguana/dexscripts.win32/how_to_use.md @@ -1,15 +1,15 @@ ## DexScripts for Windows. How to use? ## -**1.** Before start you should put scripts and following binaries into one folder: +**1. ** Before start you should put scripts and following binaries into one folder: - curl.exe (required for all scripts) - marketmaker.exe - libcurl.dll (required to run marketmaker) - nanomsg.dll (required to run marketmaker) -**2.** Don't forget to put `coins.json` file into a same folder. This file is available it this repo. +**2. ** Don't forget to put `coins.json` file into a same folder. This file is available it this repo. -**3.** Type your passphrase into passphrase file in this folder (you should create file with name `passphrase` and without extension) and run `1-client.cmd`. This will run marketmaker. Next step is to obtain userpass needed for other scripts, you can simply copy and paste it from marketmaker output on startup into userpass file. +**3. ** Type your passphrase into passphrase file in this folder (you should create file with name `passphrase` and without extension) and run `1-client.cmd`. This will run marketmaker. Next step is to obtain userpass needed for other scripts, you can simply copy and paste it from marketmaker output on startup into userpass file. ![](./images/userpass.png) @@ -22,3 +22,23 @@ Sample output of correct `2-getuserpass.cmd` usage is: You should see your userpass on screen, and after it will automatically copied in userpass file. It's important to all other scripts to have this password in userpass file. If output of `2-getuserpass.cmd` is not same as showed on screen above - wait some seconds and run `2-getuserpass.cmd` again. Also make sure that you have allowed marketmaker to accept incoming connections in your Windows Firewall (first time launched system should automatically asked for it). **4.** For using other scripts please refer to barterDEX API. Or **barterDEX API Summary by Category** document by *shossain*. + +## F.A.Q. ## + +**Q.** Is any simple way how i can display JSON results returned by all scripts, like orderbook and others, in human readable form? +**A.** Yes, you can use this service [JSON Editor Online](http://jsoneditoronline.org/), just copy and paste output of script in left column and see structured output in right. + +**Q.** I see an output like this when i'm start `1-client.cmd` : + + bind(0.0.0.0) port.7783 failed: No error sock.1468. errno.0 + bind(0.0.0.0) port.7783 failed: No error sock.1516. errno.0 + bind(0.0.0.0) port.7783 failed: No error sock.1444. errno.0 + bind(0.0.0.0) port.7783 failed: No error sock.1484. errno.0 + bind(0.0.0.0) port.7783 failed: No error sock.1412. errno.0 + bind(0.0.0.0) port.7783 failed: No error sock.1524. errno.0 + bind(0.0.0.0) port.7783 failed: No error sock.1008. errno.0 + +And nothing works. + +**A.** Before run `1-client.cmd` make sure in Task Manager that you haven't already running `marketmaker.exe`. If have - kill this process via Task Manager or via command line command `taskkill /f /im taskkill.exe` . + From 19adc5d25dcb1368ed6fc03361efbdb29b7753f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 17:55:11 +0200 Subject: [PATCH 1911/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- iguana/exchanges/LP_remember.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bf30e3be5..7eb20c8a9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -165,6 +165,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( duplicate != 0 ) dup++; else uniq++; + portable_mutex_lock(&LP_commandmutex); if ( (rand() % 10000) == 0 ) printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); if ( duplicate == 0 ) @@ -245,17 +246,16 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { - portable_mutex_lock(&LP_commandmutex); if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - portable_mutex_unlock(&LP_commandmutex); //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); } free_json(argjson); } } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); + portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && encrypted == 0 ) free(jsonstr); if ( ptr != 0 ) @@ -322,13 +322,13 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) printf("self.(%s)\n",str); + portable_mutex_lock(&LP_commandmutex); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { - portable_mutex_lock(&LP_commandmutex); if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) free(retstr); - portable_mutex_unlock(&LP_commandmutex); } + portable_mutex_unlock(&LP_commandmutex); free_json(argjson); } free(str); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 22b05ece7..927af1771 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -839,7 +839,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti srcAdest = srcBdest = destAdest = destBdest = 0; if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) { - printf("legacy DB SWAPS files BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); + printf("legacy DB SWAPS.(%u %u) %llu files BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.requestid,rswap.quoteid,(long long)rswap.aliceid,rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); return(cJSON_Parse("{\"error\":\"mismatched bob/alice vs src/dest coins??\"}")); } alice = LP_coinfind(rswap.alicecoin); From 04bfb59f37e41c1e16a6f0142b6ea6d015f83d4f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 18:01:31 +0200 Subject: [PATCH 1912/2732] Test --- iguana/exchanges/stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2cb647dde..e8112a2ae 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -729,6 +729,7 @@ void LP_rpc_processreq(void *_ptr) free(space); free(jsonbuf); closesocket(sock); + free(_ptr); } void stats_rpcloop(void *args) @@ -759,10 +760,10 @@ void stats_rpcloop(void *args) arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); memcpy(arg64ptr,&arg64,sizeof(arg64)); - if ( 1 ) + if ( 0 ) { LP_rpc_processreq((void *)&arg64); - free(arg64ptr); + //free(arg64ptr); } else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { From 3e004c63971ab582767e64c4b575ef8a6b833cc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 19:48:33 +0200 Subject: [PATCH 1913/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 26 ++++++++++++++++++++++++++ iguana/exchanges/LP_network.c | 3 +++ iguana/exchanges/LP_signatures.c | 4 ++-- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c9d15c3b3..c8cfa1bc2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -54,7 +54,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define DPOW_MIN_ASSETCHAIN_SIGS 11 #define LP_ENCRYPTED_MAXSIZE (4096 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) -#define LP_MAXPUBKEY_ERRORS 3 +#define LP_MAXPUBKEY_ERRORS 10 #define PSOCK_KEEPALIVE 3600 #define MAINLOOP_PERSEC 100 #define MAX_PSOCK_PORT 60000 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7eb20c8a9..ce66dc219 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -33,6 +33,32 @@ struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; struct LP_pubkeyinfo *LP_pubkeyinfos; + +struct LP_millistats +{ + double lastmilli,millisum,threshold; + uint32_t count; + char name[64]; +} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,stats_rpcloop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloop_statsBTC,LP_coinsloop_statsKMD,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; + +void LP_millistats_update(struct LP_millistats *mp) +{ + double elapsed,millis; + if ( mp->lastmilli == 0. ) + mp->lastmilli = OS_milliseconds(); + else + { + mp->count++; + millis = OS_milliseconds(); + elapsed = (millis - mp->lastmilli); + mp->millisum += elapsed; + if ( mp->threshold != 0. && elapsed > mp->threshold ) + { + printf("%s elapsed %.3f millis > threshold %.3f, ave %.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + } + } +} + #include "LP_network.c" char *activecoins[] = { "BTC", "KMD" }; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index e936e8fc8..3fb64e5d6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -474,8 +474,11 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w { static struct nn_pollfd *pfds; int32_t i,n,nonz,iter,retval,sentbytes,size=0,sendsock = -1; uint32_t now; struct psock *ptr=0; void *buf=0; char keepalive[512]; + strcpy(LP_psockloop_stats.name,"LP_psockloop"); + LP_psockloop_stats.threshold = 100.; while ( 1 ) { + LP_millistats_update(&LP_psockloop_stats); now = (uint32_t)time(NULL); if ( buf != 0 && ptr != 0 && sendsock >= 0 ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 298a856cd..e47e56d81 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -286,11 +286,11 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 if ( memcmp(pub33,pubsecp,33) != 0 || retval != 0 ) { static uint32_t counter; - if ( counter++ < 10 ) + if ( counter++ <= LP_MAXPUBKEY_ERRORS ) { if ( pubp != 0 ) pubp->numerrors++; - if ( pubp != 0 && pubp->numerrors > 1 ) + if ( pubp != 0 && pubp->numerrors > LP_MAXPUBKEY_ERRORS/2 ) printf("LP_utxos_sigcheck failure.%d, probably from %s with older version\n",pubp!=0?pubp->numerrors:-1,bits256_str(str,pubkey)); } retval = -1; From bbcd36d6328e7d6bdeb94a3da052acff835d1488 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 19:56:19 +0200 Subject: [PATCH 1914/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ce66dc219..ff2ee0fa4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -56,6 +56,7 @@ void LP_millistats_update(struct LP_millistats *mp) { printf("%s elapsed %.3f millis > threshold %.3f, ave %.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); } + mp->lastmilli = millis; } } From 81837de1b45e75383f8115c19ff3ca44faeaf2a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 19:57:40 +0200 Subject: [PATCH 1915/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 3fb64e5d6..32692a61e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -475,7 +475,7 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w static struct nn_pollfd *pfds; int32_t i,n,nonz,iter,retval,sentbytes,size=0,sendsock = -1; uint32_t now; struct psock *ptr=0; void *buf=0; char keepalive[512]; strcpy(LP_psockloop_stats.name,"LP_psockloop"); - LP_psockloop_stats.threshold = 100.; + LP_psockloop_stats.threshold = 110.; while ( 1 ) { LP_millistats_update(&LP_psockloop_stats); From 5b794df668cebe95463d3d8b6ce42372aedd4cce Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:03:00 +0200 Subject: [PATCH 1916/2732] Test --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 5b0ce5743..153cd4529 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -303,7 +303,7 @@ struct iguana_thread *iguana_launch(struct iguana_info *coin,char *name,iguana_f coin->Launched[t->type]++; retval = OS_thread_create(&t->handle,NULL,(void *)iguana_launcher,(void *)t); if ( retval != 0 ) - printf("error launching %s\n",t->name); + printf("error launching %s retval.%d errno.%d\n",t->name,retval,errno); while ( (t= queue_dequeue(&TerminateQ)) != 0 ) { if ( (rand() % 100000) == 0 && coin != 0 ) From 129c32b36cf03a6693006c296cff5c907aa040b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:14:02 +0200 Subject: [PATCH 1917/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 26 ++++++++++++++++---------- iguana/exchanges/stats.c | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ff2ee0fa4..6a1f9adca 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -24,16 +24,6 @@ // BCH signing #include -#include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex; -int32_t LP_canbind; -char *Broadcaststr,*Reserved_msgs[2][1000]; -int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; -struct LP_peerinfo *LP_peerinfos,*LP_mypeer; -struct LP_forwardinfo *LP_forwardinfos; -struct iguana_info *LP_coins; -struct LP_pubkeyinfo *LP_pubkeyinfos; - struct LP_millistats { double lastmilli,millisum,threshold; @@ -60,6 +50,16 @@ void LP_millistats_update(struct LP_millistats *mp) } } +#include "LP_include.h" +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex; +int32_t LP_canbind; +char *Broadcaststr,*Reserved_msgs[2][1000]; +int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; +struct LP_peerinfo *LP_peerinfos,*LP_mypeer; +struct LP_forwardinfo *LP_forwardinfos; +struct iguana_info *LP_coins; +struct LP_pubkeyinfo *LP_pubkeyinfos; + #include "LP_network.c" char *activecoins[] = { "BTC", "KMD" }; @@ -427,8 +427,11 @@ void command_rpcloop(void *myipaddr) void utxosQ_loop(void *myipaddr) { + strcpy(utxosQ_loop_stats.name,"utxosQ_loop"); + utxosQ_loop_stats.threshold = 20.; while ( 1 ) { + LP_millistats_update(&utxosQ_loop_stats); if ( LP_utxosQ_process() == 0 ) usleep(10000); } @@ -834,8 +837,11 @@ void LP_reserved_msgs(void *ignore) { bits256 zero; int32_t flag; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); + strcpy(LP_reserved_msgs_stats.name,"LP_reserved_msgs"); + LP_reserved_msgs_stats.threshold = 10.; while ( 1 ) { + LP_millistats_update(&LP_reserved_msgs_stats); if ( num_Reserved_msgs[0] > 0 || num_Reserved_msgs[1] > 0 ) { flag = 0; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index e8112a2ae..e206f37b8 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -760,7 +760,7 @@ void stats_rpcloop(void *args) arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); memcpy(arg64ptr,&arg64,sizeof(arg64)); - if ( 0 ) + if ( 1 ) { LP_rpc_processreq((void *)&arg64); //free(arg64ptr); From 7b3c0b4aafc043916ab49f4d599121b0627c9ec0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:17:25 +0200 Subject: [PATCH 1918/2732] Test --- iguana/exchanges/stats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index e206f37b8..2cb647dde 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -729,7 +729,6 @@ void LP_rpc_processreq(void *_ptr) free(space); free(jsonbuf); closesocket(sock); - free(_ptr); } void stats_rpcloop(void *args) @@ -763,7 +762,7 @@ void stats_rpcloop(void *args) if ( 1 ) { LP_rpc_processreq((void *)&arg64); - //free(arg64ptr); + free(arg64ptr); } else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { From 6c76ad6eecf2405dc305398d254c0a74cb2ff487 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:20:55 +0200 Subject: [PATCH 1919/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/stats.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6a1f9adca..74c0ca200 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -29,7 +29,7 @@ struct LP_millistats double lastmilli,millisum,threshold; uint32_t count; char name[64]; -} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,stats_rpcloop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloop_statsBTC,LP_coinsloop_statsKMD,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; +} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloop_statsBTC,LP_coinsloop_statsKMD,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; void LP_millistats_update(struct LP_millistats *mp) { @@ -838,7 +838,7 @@ void LP_reserved_msgs(void *ignore) bits256 zero; int32_t flag; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); strcpy(LP_reserved_msgs_stats.name,"LP_reserved_msgs"); - LP_reserved_msgs_stats.threshold = 10.; + LP_reserved_msgs_stats.threshold = 20.; while ( 1 ) { LP_millistats_update(&LP_reserved_msgs_stats); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2cb647dde..94e024f26 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -728,7 +728,6 @@ void LP_rpc_processreq(void *_ptr) } free(space); free(jsonbuf); - closesocket(sock); } void stats_rpcloop(void *args) @@ -755,7 +754,6 @@ void stats_rpcloop(void *args) continue; } memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); - //printf("remote RPC request from (%s) %x\n",remoteaddr,ipbits); arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); memcpy(arg64ptr,&arg64,sizeof(arg64)); @@ -763,6 +761,10 @@ void stats_rpcloop(void *args) { LP_rpc_processreq((void *)&arg64); free(arg64ptr); + closesocket(sock); + char remoteaddr[64]; + expand_ipbits(remoteaddr,ipbits); + printf("finished RPC request from (%s) %x\n",remoteaddr,ipbits); } else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { From fe0dbba840f39267d1d1692585351ecaadfef05e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:31:27 +0200 Subject: [PATCH 1920/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 25 ++++++++++++++++++++++++- iguana/exchanges/stats.c | 6 +++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 74c0ca200..3baa96b7d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -29,7 +29,7 @@ struct LP_millistats double lastmilli,millisum,threshold; uint32_t count; char name[64]; -} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloop_statsBTC,LP_coinsloop_statsKMD,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; +} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; void LP_millistats_update(struct LP_millistats *mp) { @@ -409,8 +409,11 @@ void command_rpcloop(void *myipaddr) { int32_t nonz = 0; void *ctx; ctx = bitcoin_ctx(); + strcpy(command_rpcloop_stats.name,"command_rpcloop"); + command_rpcloop_stats.threshold = 20.; while ( 1 ) { + LP_millistats_update(&command_rpcloop_stats); nonz = LP_nanomsg_recvs(ctx); //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); @@ -523,8 +526,28 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) void LP_coinsloop(void *_coins) { struct LP_address *ap=0,*atmp; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + if ( strcmp("BTC",coins) == 0 ) + { + strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); + LP_coinsloopBTC_stats.threshold = 20.; + } + else if ( strcmp("KMD",coins) == 0 ) + { + strcpy(LP_coinsloopKMD_stats.name,"KMD coin loop"); + LP_coinsloopKMD_stats.threshold = 20.; + } + else + { + strcpy(LP_coinsloop_stats.name,"other coins loop"); + LP_coinsloop_stats.threshold = 20.; + } while ( 1 ) { + if ( strcmp("BTC",coins) == 0 ) + LP_millistats_update(&LP_coinsloopBTC_stats); + else if ( strcmp("KMD",coins) == 0 ) + LP_millistats_update(&LP_coinsloopKMD_stats); + else LP_millistats_update(&LP_coinsloop_stats); nonz = 0; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 94e024f26..0996d3ede 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -762,9 +762,9 @@ void stats_rpcloop(void *args) LP_rpc_processreq((void *)&arg64); free(arg64ptr); closesocket(sock); - char remoteaddr[64]; - expand_ipbits(remoteaddr,ipbits); - printf("finished RPC request from (%s) %x\n",remoteaddr,ipbits); + //char remoteaddr[64]; + //expand_ipbits(remoteaddr,ipbits); + //printf("finished RPC request from (%s) %x\n",remoteaddr,ipbits); } else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { From fd14c9c88d43052b1e8dbdf1a047c043be240ff0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:39:14 +0200 Subject: [PATCH 1921/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 17 +++++++++++++---- iguana/exchanges/LP_network.c | 3 +++ iguana/exchanges/LP_portfolio.c | 3 +++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3baa96b7d..9a9075c5f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -410,7 +410,7 @@ void command_rpcloop(void *myipaddr) int32_t nonz = 0; void *ctx; ctx = bitcoin_ctx(); strcpy(command_rpcloop_stats.name,"command_rpcloop"); - command_rpcloop_stats.threshold = 20.; + command_rpcloop_stats.threshold = 1000.; while ( 1 ) { LP_millistats_update(&command_rpcloop_stats); @@ -529,17 +529,17 @@ void LP_coinsloop(void *_coins) if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); - LP_coinsloopBTC_stats.threshold = 20.; + LP_coinsloopBTC_stats.threshold = 200.; } else if ( strcmp("KMD",coins) == 0 ) { strcpy(LP_coinsloopKMD_stats.name,"KMD coin loop"); - LP_coinsloopKMD_stats.threshold = 20.; + LP_coinsloopKMD_stats.threshold = 200.; } else { strcpy(LP_coinsloop_stats.name,"other coins loop"); - LP_coinsloop_stats.threshold = 20.; + LP_coinsloop_stats.threshold = 200.; } while ( 1 ) { @@ -817,9 +817,12 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LP_pubkeysloop(void *ctx) { static uint32_t lasttime; + strcpy(LP_pubkeysloop_stats.name,"LP_pubkeysloop"); + LP_pubkeysloop_stats.threshold = 3100.; sleep(10); while ( 1 ) { + LP_millistats_update(&LP_pubkeysloop_stats); if ( time(NULL) > lasttime+60 ) { //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); @@ -832,9 +835,12 @@ void LP_pubkeysloop(void *ctx) void LP_privkeysloop(void *ctx) { + strcpy(LP_privkeysloop_stats.name,"LP_privkeysloop"); + LP_privkeysloop_stats.threshold = (LP_ORDERBOOK_DURATION * .777 * 1000) + 1000; sleep(20); while ( 1 ) { + LP_millistats_update(&LP_privkeysloop_stats); LP_counter += 1000; //printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); @@ -845,9 +851,12 @@ void LP_privkeysloop(void *ctx) void LP_swapsloop(void *ignore) { char *retstr; + strcpy(LP_swapsloop_stats.name,"LP_swapsloop"); + LP_swapsloop_stats.threshold = 605000.; sleep(50); while ( 1 ) { + LP_millistats_update(&LP_swapsloop_stats); LP_counter += 10000; //printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 32692a61e..c241d0eae 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -268,8 +268,11 @@ int32_t LP_peerindsock(int32_t *peerindp) void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; + strcpy(queue_loop_stats.name,"queue_loop"); + queue_loop_stats.threshold = 20.; while ( 1 ) { + LP_millistats_update(&queue_loop_stats); nonz = 0; //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); n = 0; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 38fe3ba69..8c86683c9 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -589,8 +589,11 @@ int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *a void prices_loop(void *ctx) { char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; + strcpy(prices_loop_stats.name,"prices_loop"); + prices_loop_stats.threshold = 61000.; while ( 1 ) { + LP_millistats_update(&prices_loop_stats); LP_tradebots_timeslice(ctx); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) { From 3cb3fa8a0f6cfd845b104fb1ade51d0645ef760b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:50:36 +0200 Subject: [PATCH 1922/2732] Mills --- crypto777/bitcoind_RPC.c | 4 +++- iguana/exchanges/LP_commands.c | 5 +++++ iguana/exchanges/LP_nativeDEX.c | 38 ++++++++++++++++++++++++--------- iguana/exchanges/millis | 3 +++ 4 files changed, 39 insertions(+), 11 deletions(-) create mode 100755 iguana/exchanges/millis diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index bc87b61f2..4f0a9cdd4 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -55,7 +55,9 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * long i,j,len; char *retstr = 0; cJSON *json,*result,*error; - usleep(2500); +#ifdef FROM_MARKETMAKER + usleep(5000); +#endif //printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,rpcstr); if ( command == 0 || rpcstr == 0 || rpcstr[0] == 0 ) { diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 515138f3f..7e4c9b249 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -199,6 +199,11 @@ bot_resume(botid)\n\ printf("DEBUG stop\n"); exit(0); } + else if ( strcmp(method,"millis") == 0 ) + { + LP_millistats_update(0); + return(clonestr("{\"result\":\"success\"}")); + } else if ( strcmp(method,"getmessages") == 0 ) { if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9a9075c5f..dc5bddc03 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -34,19 +34,37 @@ struct LP_millistats void LP_millistats_update(struct LP_millistats *mp) { double elapsed,millis; - if ( mp->lastmilli == 0. ) - mp->lastmilli = OS_milliseconds(); + if ( mp == 0 ) + { + mp = &LP_psockloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_reserved_msgs_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &utxosQ_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &command_rpcloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &queue_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &prices_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloopBTC_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloopKMD_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_pubkeysloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_privkeysloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_swapsloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + } else { - mp->count++; - millis = OS_milliseconds(); - elapsed = (millis - mp->lastmilli); - mp->millisum += elapsed; - if ( mp->threshold != 0. && elapsed > mp->threshold ) + if ( mp->lastmilli == 0. ) + mp->lastmilli = OS_milliseconds(); + else { - printf("%s elapsed %.3f millis > threshold %.3f, ave %.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + mp->count++; + millis = OS_milliseconds(); + elapsed = (millis - mp->lastmilli); + mp->millisum += elapsed; + if ( mp->threshold != 0. && elapsed > mp->threshold ) + { + printf("%s elapsed %.3f millis > threshold %.3f, ave %.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + } + mp->lastmilli = millis; } - mp->lastmilli = millis; } } @@ -431,7 +449,7 @@ void command_rpcloop(void *myipaddr) void utxosQ_loop(void *myipaddr) { strcpy(utxosQ_loop_stats.name,"utxosQ_loop"); - utxosQ_loop_stats.threshold = 20.; + utxosQ_loop_stats.threshold = 50.; while ( 1 ) { LP_millistats_update(&utxosQ_loop_stats); diff --git a/iguana/exchanges/millis b/iguana/exchanges/millis new file mode 100755 index 000000000..025f581cd --- /dev/null +++ b/iguana/exchanges/millis @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"millis\"}" From 44fd39c1518f762248d182a45e1409d2c7b277fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:54:10 +0200 Subject: [PATCH 1923/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index dc5bddc03..ea342430b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -30,13 +30,17 @@ struct LP_millistats uint32_t count; char name[64]; } LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; +extern int32_t IAMLP; void LP_millistats_update(struct LP_millistats *mp) { double elapsed,millis; if ( mp == 0 ) { - mp = &LP_psockloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + if ( IAMLP != 0 ) + { + mp = &LP_psockloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + } mp = &LP_reserved_msgs_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); mp = &utxosQ_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); mp = &command_rpcloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); @@ -61,7 +65,7 @@ void LP_millistats_update(struct LP_millistats *mp) mp->millisum += elapsed; if ( mp->threshold != 0. && elapsed > mp->threshold ) { - printf("%s elapsed %.3f millis > threshold %.3f, ave %.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + printf("%32s elapsed %8.3f millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); } mp->lastmilli = millis; } From 9a4c8d1171894855c7e42f6d295d5728074998a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 20:57:36 +0200 Subject: [PATCH 1924/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ea342430b..256757083 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -39,19 +39,19 @@ void LP_millistats_update(struct LP_millistats *mp) { if ( IAMLP != 0 ) { - mp = &LP_psockloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_psockloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); } - mp = &LP_reserved_msgs_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &utxosQ_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &command_rpcloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &queue_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &prices_loop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_coinsloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_coinsloopBTC_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_coinsloopKMD_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_pubkeysloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_privkeysloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_swapsloop_stats, printf("%s threshold %.3f, ave %.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_reserved_msgs_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &utxosQ_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &command_rpcloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &queue_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &prices_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloopBTC_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloopKMD_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_pubkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_privkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_swapsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); } else { From af3b62443a0118384dbbdeb5a9fa3dd2a62d25bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 21:03:01 +0200 Subject: [PATCH 1925/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 24 ++++++++++++------------ iguana/exchanges/LP_network.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 256757083..6f12b497a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -39,19 +39,19 @@ void LP_millistats_update(struct LP_millistats *mp) { if ( IAMLP != 0 ) { - mp = &LP_psockloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_psockloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); } - mp = &LP_reserved_msgs_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &utxosQ_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &command_rpcloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &queue_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &prices_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_coinsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_coinsloopBTC_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_coinsloopKMD_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_pubkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_privkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); - mp = &LP_swapsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_reserved_msgs_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &utxosQ_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &command_rpcloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &queue_loop_stats, printf("%32s millis > threshold %8.2f, ave %8.2f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &prices_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_coinsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_coinsloopBTC_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_coinsloopKMD_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_pubkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_privkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_swapsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); } else { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c241d0eae..c96975a68 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 20.; + queue_loop_stats.threshold = 50.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); From e048de471b91ddde94d2913b27fe96d442cb7519 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 21:09:40 +0200 Subject: [PATCH 1926/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6f12b497a..d330e531a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -39,19 +39,19 @@ void LP_millistats_update(struct LP_millistats *mp) { if ( IAMLP != 0 ) { - mp = &LP_psockloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_psockloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); } - mp = &LP_reserved_msgs_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &utxosQ_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &command_rpcloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &queue_loop_stats, printf("%32s millis > threshold %8.2f, ave %8.2f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &prices_loop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &LP_coinsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &LP_coinsloopBTC_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &LP_coinsloopKMD_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &LP_pubkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &LP_privkeysloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); - mp = &LP_swapsloop_stats, printf("%32s millis > threshold %8.3f, ave %8.3f millis, count.%u | lag %.3f\n",mp->name,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count,OS_milliseconds() - mp->lastmilli); + mp = &LP_reserved_msgs_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &utxosQ_loop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &command_rpcloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &queue_loop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &prices_loop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloopBTC_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_coinsloopKMD_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_pubkeysloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_privkeysloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_swapsloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); } else { @@ -65,7 +65,7 @@ void LP_millistats_update(struct LP_millistats *mp) mp->millisum += elapsed; if ( mp->threshold != 0. && elapsed > mp->threshold ) { - printf("%32s elapsed %8.3f millis > threshold %8.3f, ave %8.3f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + printf("%32s elapsed %10.2 millis > threshold %10.2, ave %10.2 millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); } mp->lastmilli = millis; } From 2b08388992432df52654d25a8f96d4047aba45a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 21:20:35 +0200 Subject: [PATCH 1927/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d330e531a..9b74dee95 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -65,7 +65,7 @@ void LP_millistats_update(struct LP_millistats *mp) mp->millisum += elapsed; if ( mp->threshold != 0. && elapsed > mp->threshold ) { - printf("%32s elapsed %10.2 millis > threshold %10.2, ave %10.2 millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); } mp->lastmilli = millis; } From c7e9c48e34c1d84946703da73b9754547b413dd9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 21:30:02 +0200 Subject: [PATCH 1928/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9b74dee95..a3665268a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -883,6 +883,7 @@ void LP_swapsloop(void *ignore) //printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); + LP_millistats_update(0); sleep(600); } } From e32015711faffd2409c766637d92b41e31c0d642 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 21:37:56 +0200 Subject: [PATCH 1929/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a3665268a..51699b4d2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -893,7 +893,7 @@ void LP_reserved_msgs(void *ignore) bits256 zero; int32_t flag; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); strcpy(LP_reserved_msgs_stats.name,"LP_reserved_msgs"); - LP_reserved_msgs_stats.threshold = 20.; + LP_reserved_msgs_stats.threshold = 50.; while ( 1 ) { LP_millistats_update(&LP_reserved_msgs_stats); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c96975a68..522abd999 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 50.; + queue_loop_stats.threshold = 200.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); @@ -478,7 +478,7 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w static struct nn_pollfd *pfds; int32_t i,n,nonz,iter,retval,sentbytes,size=0,sendsock = -1; uint32_t now; struct psock *ptr=0; void *buf=0; char keepalive[512]; strcpy(LP_psockloop_stats.name,"LP_psockloop"); - LP_psockloop_stats.threshold = 110.; + LP_psockloop_stats.threshold = 200.; while ( 1 ) { LP_millistats_update(&LP_psockloop_stats); From 34b524a356a831977c6c48899ae040e444848ec6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 21:44:09 +0200 Subject: [PATCH 1930/2732] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 8c86683c9..8e8dc23ca 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -590,7 +590,7 @@ void prices_loop(void *ctx) { char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; strcpy(prices_loop_stats.name,"prices_loop"); - prices_loop_stats.threshold = 61000.; + prices_loop_stats.threshold = 91000.; while ( 1 ) { LP_millistats_update(&prices_loop_stats); From e621b4b90d108efef0c47b138fd479c79b5f88e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 22:03:12 +0200 Subject: [PATCH 1931/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++++- iguana/exchanges/install | 2 +- iguana/exchanges/mnzservers | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100755 iguana/exchanges/mnzservers diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 51699b4d2..42e41cfba 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -89,7 +89,10 @@ char GLOBAL_DBDIR[] = { "DB" }; char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; -char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", };//"5.9.253.204" }; // +char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", + "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", +};//"5.9.253.204" }; // + //uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; diff --git a/iguana/exchanges/install b/iguana/exchanges/install index ef6617a55..2f4946484 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp bot_buy bot_list bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp stop millis mnzservers bot_buy bot_list bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/mnzservers b/iguana/exchanges/mnzservers new file mode 100755 index 000000000..40f904b49 --- /dev/null +++ b/iguana/exchanges/mnzservers @@ -0,0 +1,12 @@ +#!/bin/bash +source userpass + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"b4a6361506d847817205a8e51374eb129fc33c3b5466235afdbc65f2291ffb4c\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"bd0c69da4ec3ed61613734f9f681f846fde5d8efc894c82dafbeeb7a01844872\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"8f7782b532808a30a1fe6ffc1fa3c55fea6d734f000763fa88d42ccfed60d213\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"d80a74847cd60899afdd673570f8b698e4089e5ad4d6e9e205b5e5891ec0c84f\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"322e236db07484b31aea9400a6f3f5ed972e29c6d4115c63aaedaa541d41e758\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"8579b74435093690d3d7680ecdac0dd1b892dc5ecd4fb603f0e22fd003176342\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"c4e3c95bd9612cce3fe1cfcc0a0e9c625bab7e4b83bc68f0ede73633e6a8c17f\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"43467b51e07fae3b19101fca7fe1bf250d34c8deecfd493c723f87d5eda1a64b\",\"method\":\"trust\",\"trust\":1}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"e900c42a0d883d098f382b59cf5655dd1d92b2c94f6580095a4f6382514f7a59\",\"method\":\"trust\",\"trust\":1}" From a48f952622c50f4b8745ddb669e8bcfc7a87737a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 22:06:41 +0200 Subject: [PATCH 1932/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 +++++----- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 42e41cfba..a24f6f8a1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -554,17 +554,17 @@ void LP_coinsloop(void *_coins) if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); - LP_coinsloopBTC_stats.threshold = 200.; + LP_coinsloopBTC_stats.threshold = 2000.; } else if ( strcmp("KMD",coins) == 0 ) { strcpy(LP_coinsloopKMD_stats.name,"KMD coin loop"); - LP_coinsloopKMD_stats.threshold = 200.; + LP_coinsloopKMD_stats.threshold = 1000.; } else { strcpy(LP_coinsloop_stats.name,"other coins loop"); - LP_coinsloop_stats.threshold = 200.; + LP_coinsloop_stats.threshold = 500.; } while ( 1 ) { @@ -843,7 +843,7 @@ void LP_pubkeysloop(void *ctx) { static uint32_t lasttime; strcpy(LP_pubkeysloop_stats.name,"LP_pubkeysloop"); - LP_pubkeysloop_stats.threshold = 3100.; + LP_pubkeysloop_stats.threshold = 5000.; sleep(10); while ( 1 ) { @@ -861,7 +861,7 @@ void LP_pubkeysloop(void *ctx) void LP_privkeysloop(void *ctx) { strcpy(LP_privkeysloop_stats.name,"LP_privkeysloop"); - LP_privkeysloop_stats.threshold = (LP_ORDERBOOK_DURATION * .777 * 1000) + 1000; + LP_privkeysloop_stats.threshold = (LP_ORDERBOOK_DURATION * .8 * 1000) + 10000; sleep(20); while ( 1 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 522abd999..df8eab0f6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 200.; + queue_loop_stats.threshold = 500.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); From 24ae83e907e483ddca3f4160535bcd437f5691c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 22:20:37 +0200 Subject: [PATCH 1933/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a24f6f8a1..c952af9db 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -90,7 +90,7 @@ char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", - "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", + //"51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // From 2d10e5ff7ce8c2f9338ff7d281eea52681417737 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 22:27:04 +0200 Subject: [PATCH 1934/2732] Test --- iguana/exchanges/stats.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 0996d3ede..af730f70b 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -750,7 +750,11 @@ void stats_rpcloop(void *args) sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); if ( sock < 0 ) { - //printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); + printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); + close(bindsock); + while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + sleep(3); + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); continue; } memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); From 17edf22bd815e178e9592392fb06168c8dcaed7f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 22:57:04 +0200 Subject: [PATCH 1935/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 26 ++++---------------------- iguana/exchanges/LP_prices.c | 3 --- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c952af9db..1b7f0a5bf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -310,8 +310,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && encrypted == 0 ) free(jsonstr); - if ( ptr != 0 ) - nn_freemsg(ptr), ptr = 0; return(retstr); } @@ -323,21 +321,16 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int while ( nonz < maxdepth && recvlen > 0 ) { nonz++; -#ifndef FROM_JS memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) break; -#endif if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { methodstr[0] = 0; - if ( 1 ) + if ( 0 ) { -#ifdef FROM_JS - printf("%s RECV.(%s)\n",typestr,(char *)ptr); -#endif cJSON *recvjson; char *mstr;//,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) { @@ -349,10 +342,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } -#ifdef FROM_JS - else printf("%s got recv.%d\n",typestr,recvlen); -#endif - int32_t validreq = 0; double millis = OS_milliseconds(); + int32_t validreq = 0; if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) @@ -372,8 +362,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int Broadcaststr = 0; if ( (argjson= cJSON_Parse(str)) != 0 ) { - if ( jobj(argjson,"method") != 0 && strcmp("connect",jstr(argjson,"method")) == 0 ) - printf("self.(%s)\n",str); portable_mutex_lock(&LP_commandmutex); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { @@ -385,9 +373,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - if ( OS_milliseconds()-millis > 1000 ) - printf("%.3f LP_process_message (%s)\n",OS_milliseconds()-millis,methodstr); } + if ( ptr != 0 ) + nn_freemsg(ptr), ptr = 0; } } } @@ -713,9 +701,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; -#ifdef FROM_JS - if ( (rand() % 100) == 0 ) -#endif LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); peer->diduquery = 0; LP_peer_pricesquery(peer); @@ -728,9 +713,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { peer->diduquery = now; nonz++; -#ifdef FROM_JS - if ( (rand() % 100) == 0 ) -#endif if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) free(retstr); peer->needping = 0; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 404cd4f9e..f8cb07d77 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -366,9 +366,6 @@ void LP_peer_pricesquery(struct LP_peerinfo *peer) peer->needping = (uint32_t)time(NULL); if ( (retstr= issue_LP_getprices(peer->ipaddr,peer->port)) != 0 ) { -#ifdef FROM_JS - printf("%s\n",retstr); -#endif if ( (array= cJSON_Parse(retstr)) != 0 ) { if ( is_cJSON_Array(array) && (n= cJSON_GetArraySize(array)) > 0 ) From 13699e717af9222bbd8af16c564218153fc57d8f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 22:58:07 +0200 Subject: [PATCH 1936/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1b7f0a5bf..86309dcd8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -342,7 +342,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - int32_t validreq = 0; + int32_t validreq = 1; if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) From 3abc82bbef462bb1fbd54fc337ae5d8cd7c62e15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 23:16:39 +0200 Subject: [PATCH 1937/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_rpc.c | 1 + iguana/exchanges/stats.c | 22 ++++++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 86309dcd8..1b7f0a5bf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -342,7 +342,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free_json(recvjson); } } - int32_t validreq = 1; + int32_t validreq = 0; if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9a546dd8d..1ae9fa023 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -25,6 +25,7 @@ char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) maxerrs = LP_MAXPEER_ERRORS; if ( peer == 0 || (peer->errors < maxerrs || peer->good >= LP_MINPEER_GOOD) ) { + printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) == 0 ) { if ( peer != 0 ) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index af730f70b..d62bbe407 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -732,29 +732,33 @@ void LP_rpc_processreq(void *_ptr) void stats_rpcloop(void *args) { - uint16_t port; int32_t sock,bindsock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; void *arg64ptr; + uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; void *arg64ptr; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; - while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + /*while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) { //if ( coin->MAXPEERS == 1 ) // break; //exit(-1); sleep(3); } - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); - while ( bindsock >= 0 ) + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock);*/ + while ( 1 ) { + if ( bindsock < 0 ) + { + while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + sleep(3); + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); + } clilen = sizeof(cli_addr); sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); close(bindsock); - while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) - sleep(3); - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); + bindsock = -1; continue; } memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); @@ -773,8 +777,10 @@ void stats_rpcloop(void *args) else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { printf("error launching rpc handler on port %d\n",port); + // yes, small leak per command } - // yes, small leak per command + close(bindsock); + bindsock = -1; } } From 1e01debee187470a7addbb13de3c085f073b569b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 23:24:41 +0200 Subject: [PATCH 1938/2732] Test --- iguana/exchanges/stats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index d62bbe407..ac33e4d55 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -732,6 +732,7 @@ void LP_rpc_processreq(void *_ptr) void stats_rpcloop(void *args) { + static uint32_t counter; uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; void *arg64ptr; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; @@ -750,7 +751,8 @@ void stats_rpcloop(void *args) { while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) sleep(3); - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); + if ( counter++ < 1 ) + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); } clilen = sizeof(cli_addr); sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); From 9ae0816f714d47af009af36e8a83524f76c55199 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 23:25:54 +0200 Subject: [PATCH 1939/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1ae9fa023..2bdb4f807 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -25,7 +25,7 @@ char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) maxerrs = LP_MAXPEER_ERRORS; if ( peer == 0 || (peer->errors < maxerrs || peer->good >= LP_MINPEER_GOOD) ) { - printf("issue.(%s)\n",url); + //printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) == 0 ) { if ( peer != 0 ) From 777c5d7d30408a898946aa713e11145044ca6858 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 23:43:26 +0200 Subject: [PATCH 1940/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index ac33e4d55..a3df24a30 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -750,7 +750,7 @@ void stats_rpcloop(void *args) if ( bindsock < 0 ) { while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) - sleep(3); + usleep(10000); if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); } From e74a8596470b5008e3c17bc65ad6397af06aa91c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 23:44:08 +0200 Subject: [PATCH 1941/2732] Test --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index a3df24a30..0552e32ff 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -763,6 +763,8 @@ void stats_rpcloop(void *args) bindsock = -1; continue; } + close(bindsock); + bindsock = -1; memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); @@ -781,8 +783,6 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - close(bindsock); - bindsock = -1; } } From fa4bd37395431946cfec57ddb88d39e40ac96a2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 3 Nov 2017 23:46:30 +0200 Subject: [PATCH 1942/2732] Test --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 0552e32ff..2d93e296e 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -219,7 +219,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } - if ( listen(sock,64) != 0 ) + if ( listen(sock,512) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); if ( sock >= 0 ) @@ -764,7 +764,7 @@ void stats_rpcloop(void *args) continue; } close(bindsock); - bindsock = -1; + bindsock = iguana_socket(1,"0.0.0.0",port); memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); From 4acaac35490d38316a6ba6f73054b9a6347bf89b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:01:43 +0200 Subject: [PATCH 1943/2732] Test --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2d93e296e..c58a6f0ca 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -763,8 +763,6 @@ void stats_rpcloop(void *args) bindsock = -1; continue; } - close(bindsock); - bindsock = iguana_socket(1,"0.0.0.0",port); memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); arg64ptr = malloc(sizeof(arg64)); @@ -783,6 +781,8 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } + close(bindsock); + bindsock = iguana_socket(1,"0.0.0.0",port); } } From 66856863ff6155856dd14ba0d87762150e183159 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:10:34 +0200 Subject: [PATCH 1944/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index c58a6f0ca..09f54d8c7 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -771,7 +771,6 @@ void stats_rpcloop(void *args) { LP_rpc_processreq((void *)&arg64); free(arg64ptr); - closesocket(sock); //char remoteaddr[64]; //expand_ipbits(remoteaddr,ipbits); //printf("finished RPC request from (%s) %x\n",remoteaddr,ipbits); @@ -782,6 +781,7 @@ void stats_rpcloop(void *args) // yes, small leak per command } close(bindsock); + closesocket(sock); bindsock = iguana_socket(1,"0.0.0.0",port); } } From 7f3723c894b36a5fa548ab6b8c6175e83d012914 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:36:58 +0200 Subject: [PATCH 1945/2732] Test --- iguana/exchanges/LP_rpc.c | 4 +++- iguana/exchanges/LP_socket.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2bdb4f807..15175e95f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -111,7 +111,7 @@ char *LP_apicall(struct iguana_info *coin,char *method,char *params) { if ( (retjson= electrum_submit(coin->symbol,coin->electrum,&retjson,method,params,ELECTRUM_TIMEOUT)) != 0 ) { - retstr = jprint(retjson,0); + retstr = jprint(retjson,1); //printf("got.%p (%s)\n",retjson,retstr); return(retstr); } return(clonestr("{\"error\":\"electrum no response\"}")); @@ -808,6 +808,8 @@ double _LP_getestimatedrate(struct iguana_info *coin) sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { + if ( coin->electrum != 0 ) + printf("estimatefee.(%s)\n",retstr); if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) { if ( jobj(errjson,"error") != 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 16da1a0c3..8907be909 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -592,6 +592,7 @@ cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,c cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } + cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) From 66945feec7572f438a7b7fe951a52fe863fd4e8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:39:02 +0200 Subject: [PATCH 1946/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 09f54d8c7..c75bee6f2 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -219,7 +219,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } - if ( listen(sock,512) != 0 ) + if ( listen(sock,1) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); if ( sock >= 0 ) From 714bfc992c03a01e9a1d63a1389a343e3f2261a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:46:55 +0200 Subject: [PATCH 1947/2732] Test --- iguana/exchanges/stats.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index c75bee6f2..979ed57da 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -733,10 +733,11 @@ void LP_rpc_processreq(void *_ptr) void stats_rpcloop(void *args) { static uint32_t counter; - uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits; uint64_t arg64; void *arg64ptr; + uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; uint64_t arg64; void *arg64ptr; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; + localhostbits = calc_ipbits("127.0.0.1"); /*while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) { //if ( coin->MAXPEERS == 1 ) @@ -771,18 +772,18 @@ void stats_rpcloop(void *args) { LP_rpc_processreq((void *)&arg64); free(arg64ptr); - //char remoteaddr[64]; - //expand_ipbits(remoteaddr,ipbits); - //printf("finished RPC request from (%s) %x\n",remoteaddr,ipbits); + closesocket(sock); } else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) { printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - close(bindsock); - closesocket(sock); - bindsock = iguana_socket(1,"0.0.0.0",port); + if ( ipbits != localhostbits ) + { + close(bindsock); + bindsock = iguana_socket(1,"0.0.0.0",port); + } else printf("skip close and rebind\n"); } } From e9195392925764f4ed382e33c4fa20b1b89d8934 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:47:37 +0200 Subject: [PATCH 1948/2732] Test --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 979ed57da..7351c6f5a 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -737,7 +737,7 @@ void stats_rpcloop(void *args) if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; - localhostbits = calc_ipbits("127.0.0.1"); + localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); /*while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) { //if ( coin->MAXPEERS == 1 ) @@ -783,7 +783,7 @@ void stats_rpcloop(void *args) { close(bindsock); bindsock = iguana_socket(1,"0.0.0.0",port); - } else printf("skip close and rebind\n"); + } //else printf("skip close and rebind\n"); } } From d4a6e190dd838b1c7a6ee768a01f319d9e952659 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 01:54:21 +0200 Subject: [PATCH 1949/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 15175e95f..eb9abe808 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -830,7 +830,7 @@ double _LP_getestimatedrate(struct iguana_info *coin) coin->ratetime = (uint32_t)time(NULL); } free(retstr); - } + } else rate = coin->rate; } else rate = coin->rate; return(rate); } From 22ae89f43781ef5a87de374f7a3208d8d67dd5f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 06:09:34 +0200 Subject: [PATCH 1950/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 7351c6f5a..27b44c8c1 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -779,7 +779,7 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - if ( ipbits != localhostbits ) + ///if ( ipbits != localhostbits ) { close(bindsock); bindsock = iguana_socket(1,"0.0.0.0",port); From b81df95c222402044899e8d79e10f95b2daf9499 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 06:39:53 +0200 Subject: [PATCH 1951/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 27b44c8c1..7351c6f5a 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -779,7 +779,7 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - ///if ( ipbits != localhostbits ) + if ( ipbits != localhostbits ) { close(bindsock); bindsock = iguana_socket(1,"0.0.0.0",port); From 68173f049dd1d84ec787b839b269dc5259b708eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 14:30:19 +0200 Subject: [PATCH 1952/2732] Test --- iguana/exchanges/stats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 7351c6f5a..65e2f4208 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -730,6 +730,7 @@ void LP_rpc_processreq(void *_ptr) free(jsonbuf); } +extern int32_t IAMLP; void stats_rpcloop(void *args) { static uint32_t counter; @@ -779,7 +780,7 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - if ( ipbits != localhostbits ) + if ( IAMLP != 0 && ipbits != localhostbits ) { close(bindsock); bindsock = iguana_socket(1,"0.0.0.0",port); From 5b99aaf585ce4e2991bc60c1b0a2d592935c5606 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 15:21:44 +0200 Subject: [PATCH 1953/2732] Increase listen --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 65e2f4208..3c9bf0636 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -219,7 +219,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } - if ( listen(sock,1) != 0 ) + if ( listen(sock,32) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); if ( sock >= 0 ) From d11f48d2d6afd44b9e398d1d6f8324af8d6c96a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 15:22:11 +0200 Subject: [PATCH 1954/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 65e2f4208..3f0f5784f 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -219,7 +219,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } - if ( listen(sock,1) != 0 ) + if ( listen(sock,64) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); if ( sock >= 0 ) From 42462bd9c0a1305a7ad03e66fa3ee5b8b48bf42f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 20:43:27 +0200 Subject: [PATCH 1955/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/stats.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1b7f0a5bf..6ab35be68 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1095,7 +1095,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 3f0f5784f..e3ee8a3b5 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -780,7 +780,7 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - if ( IAMLP != 0 && ipbits != localhostbits ) + if ( 0 && IAMLP != 0 && ipbits != localhostbits ) { close(bindsock); bindsock = iguana_socket(1,"0.0.0.0",port); From de82ba78ada29813b8f96b998bf4967a09e094f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 20:51:33 +0200 Subject: [PATCH 1956/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6ab35be68..aeb6c8801 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -926,12 +926,12 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha Reserved_msgs[priority][num_Reserved_msgs[priority]++] = msg; n = num_Reserved_msgs[priority]; } else LP_broadcast_message(LP_mypubsock,base,rel,pubkey,msg); - portable_mutex_unlock(&LP_reservedmutex); if ( num_Reserved_msgs[priority] > max_Reserved_msgs[priority] ) { max_Reserved_msgs[priority] = num_Reserved_msgs[priority]; printf("New priority.%d max_Reserved_msgs.%d\n",priority,max_Reserved_msgs[priority]); } + portable_mutex_unlock(&LP_reservedmutex); return(n); } @@ -1095,7 +1095,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index e47e56d81..1933f50a3 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -685,11 +685,10 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs[1] < sizeof(Reserved_msgs[1])/sizeof(*Reserved_msgs[1])-2 ) - { Reserved_msgs[1][num_Reserved_msgs[1]++] = msg; - //Reserved_msgs[num_Reserved_msgs++] = msg2; - } - LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg2); + if ( num_Reserved_msgs[0] < sizeof(Reserved_msgs[0])/sizeof(*Reserved_msgs[0])-2 ) + Reserved_msgs[0][num_Reserved_msgs[0]++] = msg2; + //LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,zero,msg2); portable_mutex_unlock(&LP_reservedmutex); } From dbda4bac05bb95026c2b4d8b7ea107c18d8aa992 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 21:17:45 +0200 Subject: [PATCH 1957/2732] Test --- iguana/exchanges/LP_portfolio.c | 5 ++++- iguana/exchanges/stats.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 8e8dc23ca..c7ada04db 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -298,7 +298,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); - //printf("autoprice changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); + printf("autoprice changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); if ( changed != 0 || time(NULL) > lasttime+LP_ORDERBOOK_DURATION*.777) { lasttime = (uint32_t)time(NULL); @@ -468,7 +468,10 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) basepp = LP_priceinfofind(LP_autorefs[i].base); relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) + { + printf("check ref-autoprice %s/%s\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel); LP_autopriceset(ctx,1,basepp,relpp,0,LP_autorefs[i].refbase,LP_autorefs[i].refrel); + } } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index e3ee8a3b5..aa2067e0b 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -780,11 +780,11 @@ void stats_rpcloop(void *args) printf("error launching rpc handler on port %d\n",port); // yes, small leak per command } - if ( 0 && IAMLP != 0 && ipbits != localhostbits ) + /*if ( 0 && IAMLP != 0 && ipbits != localhostbits ) { close(bindsock); bindsock = iguana_socket(1,"0.0.0.0",port); - } //else printf("skip close and rebind\n"); + } //else printf("skip close and rebind\n");*/ } } From dfa52e84d7f8494376175d5130bfafc0f60ef5b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 21:34:08 +0200 Subject: [PATCH 1958/2732] Test --- iguana/exchanges/stats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index aa2067e0b..21558ce18 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -651,7 +651,7 @@ void LP_rpc_processreq(void *_ptr) else { usleep(10000); - //printf("got.(%s) %d remains.%d of total.%d\n",jsonbuf,recvlen,remains,len); + printf("got.(%s) %d remains.%d of total.%d\n",jsonbuf,recvlen,remains,len); //retstr = iguana_rpcparse(space,size,&postflag,jsonbuf); if ( flag == 0 ) break; @@ -662,11 +662,11 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; - portable_mutex_lock(&LP_commandmutex); + //portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); //if ( strcmp("5.9.253.195",remoteaddr) == 0 ) // printf("RPC.(%s)%s\n",jsonbuf,retstr); - portable_mutex_unlock(&LP_commandmutex); + //portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; From 1c541ac34d3c2daa6a440f49a2d1c326e2cda429 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 21:45:43 +0200 Subject: [PATCH 1959/2732] Test --- iguana/exchanges/LP_portfolio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index c7ada04db..5c94b9695 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -293,12 +293,10 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( dir > 0 ) newprice = (1. / price) * (1. + margin); else newprice = (price * (1. + margin)); - - //newprice = 1. / (price * (1. - margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); - printf("autoprice changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); + //printf("autoprice changed.%d %s/%s <- %.8f\n",changed,basepp->symbol,relpp->symbol,price); if ( changed != 0 || time(NULL) > lasttime+LP_ORDERBOOK_DURATION*.777) { lasttime = (uint32_t)time(NULL); @@ -469,8 +467,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) { - printf("check ref-autoprice %s/%s\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel); - LP_autopriceset(ctx,1,basepp,relpp,0,LP_autorefs[i].refbase,LP_autorefs[i].refrel); + //printf("check ref-autoprice %s/%s\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel); + LP_autopriceset(ctx,1,basepp,relpp,0.,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } } @@ -600,6 +598,7 @@ void prices_loop(void *ctx) LP_tradebots_timeslice(ctx); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) { + printf("prices_loop BTC not in LP_priceinfofind\n"); sleep(60); continue; } From ac1f7c6eee02268949cdca9a3ee12b76732a1f2a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 21:47:45 +0200 Subject: [PATCH 1960/2732] Test --- iguana/exchanges/stats.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 21558ce18..9028beaab 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -662,11 +662,9 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; - //portable_mutex_lock(&LP_commandmutex); + portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); - //if ( strcmp("5.9.253.195",remoteaddr) == 0 ) - // printf("RPC.(%s)%s\n",jsonbuf,retstr); - //portable_mutex_unlock(&LP_commandmutex); + portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; From 9c44f55fa742a439d1fe58f7a113d2bd5440d4ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 22:15:45 +0200 Subject: [PATCH 1961/2732] Test --- iguana/exchanges/stats.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 9028beaab..02dac05a6 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -590,17 +590,17 @@ int32_t iguana_getheadersize(char *buf,int32_t recvlen) uint16_t RPC_port; extern portable_mutex_t LP_commandmutex; +struct rpcrequest_info { pthread_t T; int32_t sock; uint32_t ipbits; }; void LP_rpc_processreq(void *_ptr) { - uint64_t arg64 = *(uint64_t *)_ptr; char filetype[128],content_type[128]; int32_t recvlen,flag,postflag=0,contentlen,remains,sock,numsent,jsonflag=0,hdrsize,len; - char helpname[512],remoteaddr[64],*buf,*retstr,*space,*jsonbuf; + char helpname[512],remoteaddr[64],*buf,*retstr,*space,*jsonbuf; struct rpcrequest_info *req = _ptr; uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; - ipbits = (arg64 >> 32); + ipbits = req->ipbits;; expand_ipbits(remoteaddr,ipbits); - sock = (arg64 & 0xffffffff); + sock = req->sock; recvlen = flag = 0; retstr = 0; space = calloc(1,size); @@ -652,7 +652,6 @@ void LP_rpc_processreq(void *_ptr) { usleep(10000); printf("got.(%s) %d remains.%d of total.%d\n",jsonbuf,recvlen,remains,len); - //retstr = iguana_rpcparse(space,size,&postflag,jsonbuf); if ( flag == 0 ) break; } @@ -726,13 +725,15 @@ void LP_rpc_processreq(void *_ptr) } free(space); free(jsonbuf); + closesocket(sock); + free(_ptr); } extern int32_t IAMLP; void stats_rpcloop(void *args) { static uint32_t counter; - uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; uint64_t arg64; void *arg64ptr; + uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; @@ -764,19 +765,18 @@ void stats_rpcloop(void *args) continue; } memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); - arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff); - arg64ptr = malloc(sizeof(arg64)); - memcpy(arg64ptr,&arg64,sizeof(arg64)); - if ( 1 ) + req = calloc(1,sizeof(*req)); + req->sock = sock; + req->ipbits = ipbits; + if ( 0 ) { - LP_rpc_processreq((void *)&arg64); - free(arg64ptr); - closesocket(sock); + //LP_rpc_processreq((void *)&arg64); + //free(arg64ptr); + //closesocket(sock); } - else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 ) + else if ( OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req) != 0 ) { printf("error launching rpc handler on port %d\n",port); - // yes, small leak per command } /*if ( 0 && IAMLP != 0 && ipbits != localhostbits ) { From 9b11cc612ef18a08fed73a40f1d71b3993681e8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 22:56:47 +0200 Subject: [PATCH 1962/2732] Test --- crypto777/OS_portable.h | 8 ++++++++ iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 11 ++++++++++- iguana/exchanges/stats.c | 18 +++++++++++++++--- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 77e6ec5bc..6c4a3ecbc 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -143,6 +143,14 @@ typedef struct queue char name[64],initflag; } queue_t; +struct rpcrequest_info +{ + struct rpcrequest_info *next,*prev; + pthread_t T; + int32_t sock; + uint32_t ipbits; +}; + struct OS_mappedptr { char fname[512]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index aeb6c8801..1787e300d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -81,6 +81,7 @@ struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; struct LP_pubkeyinfo *LP_pubkeyinfos; +struct rpcrequest_info *LP_garbage_collector; #include "LP_network.c" diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index df8eab0f6..14cae1f3a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -267,12 +267,21 @@ int32_t LP_peerindsock(int32_t *peerindp) void queue_loop(void *arg) { - struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; + struct rpcrequest_info *req,*rtmp; struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); queue_loop_stats.threshold = 500.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); + portable_mutex_lock(&LP_networkmutex); + DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) + { + DL_DELETE(LP_garbage_collector,req); + printf("garbage collect ipbits.%x\n",req->ipbits); + free(req); + } + portable_mutex_unlock(&LP_networkmutex); + nonz = 0; //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); n = 0; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 02dac05a6..ab82d9f53 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -589,11 +589,12 @@ int32_t iguana_getheadersize(char *buf,int32_t recvlen) } uint16_t RPC_port; -extern portable_mutex_t LP_commandmutex; -struct rpcrequest_info { pthread_t T; int32_t sock; uint32_t ipbits; }; +extern portable_mutex_t LP_commandmutex,LP_networkmutex; +extern struct rpcrequest_info *LP_garbage_collector; void LP_rpc_processreq(void *_ptr) { + static uint32_t spawned,maxspawned; char filetype[128],content_type[128]; int32_t recvlen,flag,postflag=0,contentlen,remains,sock,numsent,jsonflag=0,hdrsize,len; char helpname[512],remoteaddr[64],*buf,*retstr,*space,*jsonbuf; struct rpcrequest_info *req = _ptr; @@ -607,6 +608,14 @@ void LP_rpc_processreq(void *_ptr) jsonbuf = calloc(1,size); remains = size-1; buf = jsonbuf; + portable_mutex_lock(&LP_networkmutex); + spawned++; + portable_mutex_unlock(&LP_networkmutex); + if ( spawned > maxspawned ) + { + printf("max rpc threads spawned and alive %d <- %d\n",maxspawned,spawned); + spawned = maxspawned; + } while ( remains > 0 ) { //printf("flag.%d remains.%d recvlen.%d\n",flag,remains,recvlen); @@ -726,7 +735,10 @@ void LP_rpc_processreq(void *_ptr) free(space); free(jsonbuf); closesocket(sock); - free(_ptr); + portable_mutex_lock(&LP_networkmutex); + DL_APPEND(LP_garbage_collector,req); + spawned--; + portable_mutex_unlock(&LP_networkmutex); } extern int32_t IAMLP; From be41509919035da700e9933b1cc18107b6dea1e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 22:58:32 +0200 Subject: [PATCH 1963/2732] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/stats.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 14cae1f3a..f36b31749 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -277,7 +277,7 @@ void queue_loop(void *arg) DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) { DL_DELETE(LP_garbage_collector,req); - printf("garbage collect ipbits.%x\n",req->ipbits); + //printf("garbage collect ipbits.%x\n",req->ipbits); free(req); } portable_mutex_unlock(&LP_networkmutex); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index ab82d9f53..4eea97b8e 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -614,7 +614,7 @@ void LP_rpc_processreq(void *_ptr) if ( spawned > maxspawned ) { printf("max rpc threads spawned and alive %d <- %d\n",maxspawned,spawned); - spawned = maxspawned; + maxspawned = spawned; } while ( remains > 0 ) { From 0b9b34120852d64c125ddf625c80e017161be29c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 23:24:13 +0200 Subject: [PATCH 1964/2732] Test --- iguana/exchanges/LP_prices.c | 14 +++++++------- iguana/exchanges/processfiles | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100755 iguana/exchanges/processfiles diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f8cb07d77..a51aff113 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -34,7 +34,7 @@ struct LP_priceinfo double factors[LP_MAXPRICEINFOS]; //double maxprices[LP_MAXPRICEINFOS]; // autofill of base/rel //double relvols[LP_MAXPRICEINFOS]; - FILE *fps[LP_MAXPRICEINFOS]; + //FILE *fps[LP_MAXPRICEINFOS]; } LP_priceinfos[LP_MAXPRICEINFOS]; int32_t LP_numpriceinfos; @@ -1033,10 +1033,10 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - if ( (fp= basepp->fps[relpp->ind]) == 0 ) + //if ( (fp= basepp->fps[relpp->ind]) == 0 ) { LP_pricefname(fname,base,rel); - fp = basepp->fps[relpp->ind] = OS_appendfile(fname); + fp = OS_appendfile(fname); //basepp->fps[relpp->ind] = } if ( fp != 0 ) { @@ -1044,12 +1044,12 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) price64 = price * SATOSHIDEN; fwrite(&now,1,sizeof(now),fp); fwrite(&price64,1,sizeof(price64),fp); - fflush(fp); + fclose(fp); } - if ( (fp= relpp->fps[basepp->ind]) == 0 ) + //if ( (fp= relpp->fps[basepp->ind]) == 0 ) { sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,rel,base); - fp = relpp->fps[basepp->ind] = OS_appendfile(fname); + fp = OS_appendfile(fname); //relpp->fps[basepp->ind] = } if ( fp != 0 ) { @@ -1057,7 +1057,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) price64 = (1. / price) * SATOSHIDEN; fwrite(&now,1,sizeof(now),fp); fwrite(&price64,1,sizeof(price64),fp); - fflush(fp); + fclose(fp); } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { diff --git a/iguana/exchanges/processfiles b/iguana/exchanges/processfiles new file mode 100755 index 000000000..518d335ab --- /dev/null +++ b/iguana/exchanges/processfiles @@ -0,0 +1 @@ +`ls -l /proc/$1/fd From 09ccaadd2e073b42082f75561cd5876c04207e32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 23:29:01 +0200 Subject: [PATCH 1965/2732] Test --- iguana/exchanges/processfiles | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/processfiles b/iguana/exchanges/processfiles index 518d335ab..9404f967a 100755 --- a/iguana/exchanges/processfiles +++ b/iguana/exchanges/processfiles @@ -1 +1,3 @@ -`ls -l /proc/$1/fd +ls -l /proc/$1/fd +echo sockstat +cat /proc/$1/net/sockstat From 3757b996da6dbed00cc56acd49c7d6b61c0c8fb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 23:52:15 +0200 Subject: [PATCH 1966/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 ++++++++---- iguana/exchanges/LP_network.c | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1787e300d..17d54e5e7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,7 +17,7 @@ // // LP_nativeDEX.c // marketmaker -// +// bots to do bobs // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -669,7 +669,7 @@ void LP_coinsloop(void *_coins) if ( coins == 0 ) return; if ( nonz == 0 ) - usleep(1000); + usleep(100000); } } @@ -876,15 +876,17 @@ void LP_swapsloop(void *ignore) void LP_reserved_msgs(void *ignore) { - bits256 zero; int32_t flag; struct nn_pollfd pfd; + bits256 zero; int32_t flag,nonz; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); strcpy(LP_reserved_msgs_stats.name,"LP_reserved_msgs"); LP_reserved_msgs_stats.threshold = 50.; while ( 1 ) { + nonz = 0; LP_millistats_update(&LP_reserved_msgs_stats); if ( num_Reserved_msgs[0] > 0 || num_Reserved_msgs[1] > 0 ) { + nonz++; flag = 0; if ( LP_mypubsock >= 0 ) { @@ -914,7 +916,9 @@ void LP_reserved_msgs(void *ignore) } if ( ignore == 0 ) break; - usleep(3000); + if ( nonz != 0 ) + usleep(3000); + else usleep(25000); } } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f36b31749..199e327fb 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -341,9 +341,10 @@ void queue_loop(void *arg) //if ( n != 0 ) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) - usleep(5000); + usleep(25000); else if ( IAMLP == 0 ) - usleep(1000); + usleep(10000); + else usleep(1000); } } From 124df0f23f37ee9c8c15cdc78db1d497083a4204 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 23:53:14 +0200 Subject: [PATCH 1967/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 17d54e5e7..99b536cd8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -434,11 +434,11 @@ void command_rpcloop(void *myipaddr) if ( nonz == 0 ) { if ( IAMLP != 0 ) - usleep(1000); - else usleep(10000); + usleep(10000); + else usleep(50000); } else if ( IAMLP == 0 ) - usleep(100); + usleep(1000); } } From bf6da962454f3161a437efe57dc83021ce66fa1b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Nov 2017 23:57:23 +0200 Subject: [PATCH 1968/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 99b536cd8..a48b4eff1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -697,7 +697,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+60 || (rand() % 10000) == 0 ) + if ( now > peer->lastpeers+LP_ORDERBOOK_DURATION*.777 || (rand() % 100000) == 0 ) { if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { @@ -722,7 +722,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+60 ) + if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); coin->lastpushtime = (uint32_t)time(NULL); From 325c3db68f7c69e54e26d99e538554ebb1440744 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 00:19:57 +0200 Subject: [PATCH 1969/2732] Other lp nodes --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a48b4eff1..ae96d1aeb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -91,6 +91,7 @@ char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", + "24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", //"51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // From 32a9c0f10849b3ec929c95b18ee6656dd0cb9116 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 00:35:15 +0200 Subject: [PATCH 1970/2732] test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_include.h | 5 ++++- iguana/exchanges/LP_peers.c | 6 ++++-- iguana/exchanges/LP_prices.c | 5 ++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7e4c9b249..417d91b51 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -523,7 +523,7 @@ bot_resume(botid)\n\ bits256 pub; static uint32_t lastnotify; pub = jbits256(argjson,"pub"); //char str[65]; printf("got wantnotify.(%s) vs %s\n",jprint(argjson,0),bits256_str(str,G.LP_mypub25519)); - if ( bits256_cmp(pub,G.LP_mypub25519) == 0 && time(NULL) > lastnotify+30 ) + if ( bits256_cmp(pub,G.LP_mypub25519) == 0 && time(NULL) > lastnotify+60 ) { lastnotify = (uint32_t)time(NULL); //printf("wantnotify for me!\n"); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c8cfa1bc2..e17bb5baa 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,6 +44,9 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 +#define LP_OPTIONAL_PEERS 16 +#define LP_MAX_PEERS 100 + // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 #define LP_MAXPENDING_SWAPS 13 @@ -350,7 +353,7 @@ struct LP_pubkeyinfo bits256 pubkey; float matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; //uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; - uint32_t timestamp,numerrors; + uint32_t timestamp,numerrors,lasttime; int32_t istrusted; uint8_t rmd160[20],sig[65],pubsecp[33],siglen; }; diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 4aaae086d..12a234a95 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -204,7 +204,7 @@ int32_t LP_coinbus(uint16_t coin_busport) int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) { - struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; + struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t numpeers,i,n=0; if ( (array= cJSON_Parse(retstr)) != 0 ) { if ( (n= cJSON_GetArraySize(array)) > 0 ) @@ -221,7 +221,9 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa argipbits = (uint32_t)calc_ipbits(argipaddr); if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) { - peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); + numpeers = LP_numpeers(); + if ( IAMLP != 0 || (IAMLP == 0 && numpeers > LP_OPTIONAL_PEERS && (rand() % LP_MAX_PEERS) > numpeers) ) + peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); } if ( peer != 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a51aff113..84a699410 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -697,15 +697,14 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d void LP_pubkeys_query() { - static uint32_t lasttime; uint8_t zeroes[20]; bits256 zero; cJSON *reqjson; struct LP_pubkeyinfo *pubp=0,*tmp; memset(zero.bytes,0,sizeof(zero)); memset(zeroes,0,sizeof(zeroes)); HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) { - if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 && time(NULL) > lasttime+30 ) + if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 && time(NULL) > pubp->lasttime+60 ) { - lasttime = (uint32_t)time(NULL); + pubp->lasttime = (uint32_t)time(NULL); reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","wantnotify"); jaddbits256(reqjson,"pub",pubp->pubkey); From 2256c36d07c26983e751b234625d02a69a49c341 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 00:45:00 +0200 Subject: [PATCH 1971/2732] Test --- iguana/exchanges/LP_peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 12a234a95..04ee5331e 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -222,7 +222,7 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) { numpeers = LP_numpeers(); - if ( IAMLP != 0 || (IAMLP == 0 && numpeers > LP_OPTIONAL_PEERS && (rand() % LP_MAX_PEERS) > numpeers) ) + if ( IAMLP != 0 || numpeers < LP_OPTIONAL_PEERS || (IAMLP == 0 && (rand() % LP_MAX_PEERS) > numpeers) ) peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); } if ( peer != 0 ) From beecd13a1016f2e948dc699edaf22f1cb38a0bdd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 00:45:52 +0200 Subject: [PATCH 1972/2732] test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_peers.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e17bb5baa..29c06f6ba 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -44,8 +44,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 -#define LP_OPTIONAL_PEERS 16 -#define LP_MAX_PEERS 100 +#define LP_MIN_PEERS 8 +#define LP_MAX_PEERS 32 // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 04ee5331e..9412ae298 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -222,7 +222,7 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) { numpeers = LP_numpeers(); - if ( IAMLP != 0 || numpeers < LP_OPTIONAL_PEERS || (IAMLP == 0 && (rand() % LP_MAX_PEERS) > numpeers) ) + if ( IAMLP != 0 || numpeers < LP_MIN_PEERS || (IAMLP == 0 && (rand() % LP_MAX_PEERS) > numpeers) ) peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); } if ( peer != 0 ) From 21164e36c07fb1559a88ba983a3f4f8474b3b7f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 01:00:59 +0200 Subject: [PATCH 1973/2732] Test --- iguana/exchanges/LP_network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 199e327fb..831daf83f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -390,6 +390,7 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON if ( IAMLP == 0 ) { free(msg); +printf("broadcast %s\n",jstr(argjson,"method")); jdelete(argjson,"method"); jaddstr(argjson,"method","broadcast"); if ( jobj(argjson,"timestamp") == 0 ) From 6712f480bb4b5eae23fac91dc0c3e39ce0925a6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 01:03:52 +0200 Subject: [PATCH 1974/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 831daf83f..797c31d04 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -390,7 +390,7 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON if ( IAMLP == 0 ) { free(msg); -printf("broadcast %s\n",jstr(argjson,"method")); +//printf("broadcast %s\n",jstr(argjson,"method")); jdelete(argjson,"method"); jaddstr(argjson,"method","broadcast"); if ( jobj(argjson,"timestamp") == 0 ) From 51a90bc5becab863b3696b70c01772264aba189c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 11:41:33 +0200 Subject: [PATCH 1975/2732] bot_statuslist --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_tradebots.c | 12 ++++++++++++ iguana/exchanges/bot_statuslist | 3 +++ 3 files changed, 16 insertions(+) create mode 100755 iguana/exchanges/bot_statuslist diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 417d91b51..831675653 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -142,6 +142,7 @@ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ stop()\n\ bot_list()\n\ +bot_statuslist()\n\ bot_buy(base, rel, maxprice, relvolume) -> botid\n\ bot_sell(base, rel, minprice, basevolume) -> botid\n\ bot_settings(botid, newprice, newvolume)\n\ diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index af5f385f8..359e65c4a 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -402,6 +402,16 @@ char *LP_tradebot_list(void *ctx,int32_t pubsock,cJSON *argjson) return(jprint(array,1)); } +char *LP_tradebot_statuslist(void *ctx,int32_t pubsock,cJSON *argjson) +{ + struct LP_tradebot *bot,*tmp; cJSON *array = cJSON_CreateArray(); + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + { + jaddi(array,LP_tradebot_json(bot)); + } + return(jprint(array,1)); +} + char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { struct LP_tradebot *bot; char *retstr; double shortfall; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0,abalance=0; struct iguana_info *basecoin,*relcoin; @@ -599,6 +609,8 @@ char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjs return(0); if ( strcmp(method,"bot_list") == 0 ) return(LP_tradebot_list(ctx,pubsock,argjson)); + else if ( strcmp(method,"bot_statuslist") == 0 ) + return(LP_tradebot_statuslist(ctx,pubsock,argjson)); else if ( strcmp(method,"bot_buy") == 0 ) return(LP_tradebot_limitbuy(ctx,pubsock,argjson)); else if ( strcmp(method,"bot_sell") == 0 ) diff --git a/iguana/exchanges/bot_statuslist b/iguana/exchanges/bot_statuslist new file mode 100755 index 000000000..14b7e3522 --- /dev/null +++ b/iguana/exchanges/bot_statuslist @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_statuslist\"}" From db5666a967d58f5a14a81af34614e026e07e85e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 12:01:41 +0200 Subject: [PATCH 1976/2732] Test --- iguana/exchanges/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 2f4946484..342089ce3 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp stop millis mnzservers bot_buy bot_list bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp processlist stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From ff808f857a6ab4cd4962f7ff44f6370a002b9538 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 15:28:54 +0200 Subject: [PATCH 1977/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ae96d1aeb..fe8e56c94 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -446,7 +446,7 @@ void command_rpcloop(void *myipaddr) void utxosQ_loop(void *myipaddr) { strcpy(utxosQ_loop_stats.name,"utxosQ_loop"); - utxosQ_loop_stats.threshold = 50.; + utxosQ_loop_stats.threshold = 150.; while ( 1 ) { LP_millistats_update(&utxosQ_loop_stats); @@ -880,7 +880,7 @@ void LP_reserved_msgs(void *ignore) bits256 zero; int32_t flag,nonz; struct nn_pollfd pfd; memset(zero.bytes,0,sizeof(zero)); strcpy(LP_reserved_msgs_stats.name,"LP_reserved_msgs"); - LP_reserved_msgs_stats.threshold = 50.; + LP_reserved_msgs_stats.threshold = 150.; while ( 1 ) { nonz = 0; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 9f0fdfa69..e9f140178 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -648,7 +648,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch satoshis = value - 3*txfee/4; printf("reduce satoshis %.8f by txfee %.8f to value %.8f\n",dstr(satoshis),dstr(txfee),dstr(value)); } - else if ( value == satoshis && (double)txfee/value < 0.001 ) + else if ( value == satoshis && (double)txfee/value < 0.1 ) { satoshis = value - txfee; printf("txfee allocation from value %.8f identical to satoshis: %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); From 164e7c7ebc3f436d0cb9d6d573a3bc16694e9158 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 15:47:20 +0200 Subject: [PATCH 1978/2732] Test --- iguana/exchanges/stats.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 4eea97b8e..6ada27290 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -745,7 +745,7 @@ extern int32_t IAMLP; void stats_rpcloop(void *args) { static uint32_t counter; - uint16_t port; int32_t sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req; + uint16_t port; int32_t retval,sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; @@ -780,21 +780,15 @@ void stats_rpcloop(void *args) req = calloc(1,sizeof(*req)); req->sock = sock; req->ipbits = ipbits; - if ( 0 ) + if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { - //LP_rpc_processreq((void *)&arg64); - //free(arg64ptr); - //closesocket(sock); - } - else if ( OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req) != 0 ) - { - printf("error launching rpc handler on port %d\n",port); - } - /*if ( 0 && IAMLP != 0 && ipbits != localhostbits ) - { - close(bindsock); - bindsock = iguana_socket(1,"0.0.0.0",port); - } //else printf("skip close and rebind\n");*/ + printf("error launching rpc handler on port %d, retval.%d\n",port,retval); + if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) + { + printf("error2 launching rpc handler on port %d, retval.%d\n",port,retval); + LP_rpc_processreq(req); + } + } } } From 42d25e36cdbb5eed4aac51c017cf8fad7dcf297d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 15:50:42 +0200 Subject: [PATCH 1979/2732] Test --- iguana/exchanges/stats.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 6ada27290..dc550354b 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -745,19 +745,11 @@ extern int32_t IAMLP; void stats_rpcloop(void *args) { static uint32_t counter; - uint16_t port; int32_t retval,sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req; + uint16_t port; int32_t retval,sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); - /*while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) - { - //if ( coin->MAXPEERS == 1 ) - // break; - //exit(-1); - sleep(3); - } - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock);*/ while ( 1 ) { if ( bindsock < 0 ) @@ -783,6 +775,15 @@ void stats_rpcloop(void *args) if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); + close(bindsock); + bindsock = -1; + portable_mutex_lock(&LP_networkmutex); + DL_FOREACH_SAFE(LP_garbage_collector,req2,rtmp) + { + DL_DELETE(LP_garbage_collector,req2); + free(req2); + } + portable_mutex_unlock(&LP_networkmutex); if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error2 launching rpc handler on port %d, retval.%d\n",port,retval); From 54c7540e4c4b673c1f39624d23543d1962ad45e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 17:13:38 +0200 Subject: [PATCH 1980/2732] Test --- iguana/exchanges/stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index dc550354b..37514e596 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -772,6 +772,8 @@ void stats_rpcloop(void *args) req = calloc(1,sizeof(*req)); req->sock = sock; req->ipbits = ipbits; + LP_rpc_processreq(req); +continue; if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); From 9fa58ccdb5d8f60f73c4145cd5fdb2a8dadca772 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 17:38:07 +0200 Subject: [PATCH 1981/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fe8e56c94..32a484a39 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -65,7 +65,8 @@ void LP_millistats_update(struct LP_millistats *mp) mp->millisum += elapsed; if ( mp->threshold != 0. && elapsed > mp->threshold ) { - printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + if ( IAMLP == 0 ) + printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); } mp->lastmilli = millis; } From c6a832c1bad7c7ae8f4fb2c160314d482419ff47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 17:50:12 +0200 Subject: [PATCH 1982/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 32a484a39..907f790c0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -724,9 +724,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) + if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+10 ) { - //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); coin->lastpushtime = (uint32_t)time(NULL); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; From 5470b73651aca09cb9bbb594c9a9dba957ffa8eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 18:02:10 +0200 Subject: [PATCH 1983/2732] Test --- iguana/exchanges/LP_commands.c | 8 +++++++- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 831675653..6a80ff7ed 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -342,9 +342,15 @@ bot_resume(botid)\n\ if ( LP_conflicts_find(ptr) == 0 ) { ptr->inactive = 0; - cJSON *array = cJSON_CreateArray(); + cJSON *array; if ( ptr->smartaddr[0] != 0 ) LP_unspents_load(coin,ptr->smartaddr); + if ( LP_getheight(ptr) <= 0 ) + { + ptr->inactive = (uint32_t)time(NULL); + return(clonestr("{\"error\":\"coin cant be activated till synced\"}")); + } else LP_unspents_load(coin,ptr->smartaddr); + array = cJSON_CreateArray(); jaddi(array,LP_coinjson(ptr,0)); return(jprint(array,1)); } else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 907f790c0..09cb57a93 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -726,7 +726,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+10 ) { - printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); coin->lastpushtime = (uint32_t)time(NULL); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; @@ -759,7 +759,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) { if ( LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); - LP_unspents_load(coin->symbol,coin->smartaddr); + else LP_unspents_load(coin->symbol,coin->smartaddr); } } if ( (n= cJSON_GetArraySize(coins)) > 0 ) @@ -776,7 +776,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) { if ( LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); - LP_unspents_load(coin->symbol,coin->smartaddr); + else LP_unspents_load(coin->symbol,coin->smartaddr); } } } From 3dea6e34d067a68b549de8e6acbd27f2662cc9fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 18:45:26 +0200 Subject: [PATCH 1984/2732] Test --- iguana/exchanges/LP_commands.c | 3 ++- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6a80ff7ed..fe60a38a3 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -554,10 +554,11 @@ bot_resume(botid)\n\ //printf("network invoked\n"); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); + return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); } else { - + return(clonestr("{\"error\":\"not my address\"}")); } } return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 09cb57a93..8a4109323 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -724,7 +724,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+10 ) + if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); coin->lastpushtime = (uint32_t)time(NULL); From 6e2e7118303213aa84d02b51c672852d0104fa9c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 19:13:34 +0200 Subject: [PATCH 1985/2732] Resubmit electrum version --- iguana/exchanges/LP_socket.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8907be909..7fb553fc8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -360,6 +360,9 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep return(flag); } +cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp); +cJSON *electrum_headers_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp); + cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -393,6 +396,11 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch printf("error RE-connecting to %s:%u\n",ep->ipaddr,ep->port); else { + cJSON *retjson; + if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) + printf("electrum_version %s\n",jprint(retjson,1)); + if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) + free_json(retjson); printf("ep.%p %s numerrors.%d too big -> new %s:%u sock.%d\n",ep,ep->symbol,ep->numerrors,ep->ipaddr,ep->port,ep->sock); ep->numerrors = 0; } From 1d429795559bc487aae9b7c7d061ce439f9aedc2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:11:08 +0200 Subject: [PATCH 1986/2732] Test --- iguana/exchanges/LP_rpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index eb9abe808..9f0fde29f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -291,10 +291,9 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; msgstr = "encryptedMessage";//jstr(encjson,"data"); if ( (decjson= LP_NXT_decrypt(txnum,account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) { - //printf("%s\n",jprint(decjson,0)); + printf("%s\n",jprint(decjson,0)); msgstr = jstr(decjson,"decryptedMessage"); } - } } } From d591bd67bed8dd35f134bfffed434a547b609eb5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:12:41 +0200 Subject: [PATCH 1987/2732] Test --- iguana/exchanges/LP_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9f0fde29f..aed9a5d25 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -291,8 +291,9 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; msgstr = "encryptedMessage";//jstr(encjson,"data"); if ( (decjson= LP_NXT_decrypt(txnum,account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) { - printf("%s\n",jprint(decjson,0)); - msgstr = jstr(decjson,"decryptedMessage"); + //printf("%s\n",jprint(decjson,0)); + if ( jstr(decjson,"decryptedMessage") != 0 ) + msgstr = jstr(decjson,"decryptedMessage"); } } } From 6de034731b2f748d5240237f0704dfff9b13904c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:20:50 +0200 Subject: [PATCH 1988/2732] Test --- iguana/exchanges/LP_rpc.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index aed9a5d25..0efa274db 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -187,6 +187,24 @@ static char *assetids[][4] = { "10524562908394749924", "MGW", "1", "100000000" }, }; +void LP_sendtoaddress_line(char *validaddress,char *assetname,uint64_t satoshis) +{ + char line[1024],lowerstr[64]; + if ( strcmp(assetname,"SUPERNETx2") == 0 ) + { + sprintf(line,"fiat/supernet sendtoaddress %s %.8f",validaddress,dstr(satoshis)); + printf("%s\n",line); + sprintf(line,"fiat/revs sendtoaddress %s %.8f",validaddress,dstr(satoshis)); + } + else + { + strcpy(lowerstr,assetname); + tolowercase(lowerstr); + sprintf(line,"fiat/%s sendtoaddress %s %.8f",lowerstr,validaddress,dstr(satoshis)); + } + printf("%s\n",line); +} + uint64_t LP_assetid_mult(int32_t *assetindp,char *name,uint64_t assetid) { int32_t i; uint64_t mult = 0; @@ -319,7 +337,7 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; } else printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); if ( past_marker == 0 ) { - + LP_sendtoaddress_line(validaddress,assetname,dstr(qty * mult)); } } if ( msgjson != 0 ) From eaf4981b50b23b3422cbf1766e093298f904f238 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:22:08 +0200 Subject: [PATCH 1989/2732] Test --- iguana/exchanges/LP_rpc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0efa274db..2db576c3c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -187,20 +187,20 @@ static char *assetids[][4] = { "10524562908394749924", "MGW", "1", "100000000" }, }; -void LP_sendtoaddress_line(char *validaddress,char *assetname,uint64_t satoshis) +void LP_sendtoaddress_line(char *validaddress,char *assetname,uint64_t satoshis,uint64_t txnum) { char line[1024],lowerstr[64]; if ( strcmp(assetname,"SUPERNETx2") == 0 ) { - sprintf(line,"fiat/supernet sendtoaddress %s %.8f",validaddress,dstr(satoshis)); + sprintf(line,"fiat/supernet sendtoaddress %s %.8f # txnum.%llu",validaddress,dstr(satoshis),(long long_txnum)); printf("%s\n",line); - sprintf(line,"fiat/revs sendtoaddress %s %.8f",validaddress,dstr(satoshis)); + sprintf(line,"fiat/revs sendtoaddress %s %.8f # txnum.%llu",validaddress,dstr(satoshis),(long long_txnum); } else { strcpy(lowerstr,assetname); tolowercase(lowerstr); - sprintf(line,"fiat/%s sendtoaddress %s %.8f",lowerstr,validaddress,dstr(satoshis)); + sprintf(line,"fiat/%s sendtoaddress %s %.8f # txnum.%llu",lowerstr,validaddress,dstr(satoshis),(long long_txnum); } printf("%s\n",line); } @@ -337,7 +337,7 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; } else printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); if ( past_marker == 0 ) { - LP_sendtoaddress_line(validaddress,assetname,dstr(qty * mult)); + LP_sendtoaddress_line(validaddress,assetname,dstr(qty * mult),txnum); } } if ( msgjson != 0 ) From ef5a5731898615001cf0f33703897ef13fd5f2e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:24:51 +0200 Subject: [PATCH 1990/2732] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2db576c3c..5e96df3dc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -192,15 +192,15 @@ void LP_sendtoaddress_line(char *validaddress,char *assetname,uint64_t satoshis, char line[1024],lowerstr[64]; if ( strcmp(assetname,"SUPERNETx2") == 0 ) { - sprintf(line,"fiat/supernet sendtoaddress %s %.8f # txnum.%llu",validaddress,dstr(satoshis),(long long_txnum)); + sprintf(line,"fiat/supernet sendtoaddress %s %.8f # txnum.%llu",validaddress,dstr(satoshis),(long long)txnum); printf("%s\n",line); - sprintf(line,"fiat/revs sendtoaddress %s %.8f # txnum.%llu",validaddress,dstr(satoshis),(long long_txnum); + sprintf(line,"fiat/revs sendtoaddress %s %.8f # txnum.%llu",validaddress,dstr(satoshis),(long long)txnum); } else { strcpy(lowerstr,assetname); tolowercase(lowerstr); - sprintf(line,"fiat/%s sendtoaddress %s %.8f # txnum.%llu",lowerstr,validaddress,dstr(satoshis),(long long_txnum); + sprintf(line,"fiat/%s sendtoaddress %s %.8f # txnum.%llu",lowerstr,validaddress,dstr(satoshis),(long long)txnum); } printf("%s\n",line); } From 902aaf9475ef33233611bb98a78242a3fc1bebbf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:27:51 +0200 Subject: [PATCH 1991/2732] Test --- iguana/exchanges/LP_rpc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5e96df3dc..77d334024 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -333,12 +333,12 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; strncpy(validaddress,&msgstr[z],34); if ( strlen(validaddress) == 34 || strlen(validaddress) == 33 ) { - printf("%-4d: (%34s) <- %13.5f %10s tx.%llu past_marker.%d\n",i,validaddress,dstr(qty * mult),assetname,(long long)txnum,past_marker); + //printf("%-4d: (%34s) <- %13.5f %10s tx.%llu past_marker.%d\n",i,validaddress,dstr(qty * mult),assetname,(long long)txnum,past_marker); + if ( past_marker == 0 ) + { + LP_sendtoaddress_line(validaddress,assetname,(qty * mult),txnum); + } } else printf("%-4d: (%34s) <- %13.5f %10s tx.%llu\n",i,msgstr!=0?msgstr:jprint(item,0),dstr(qty * mult),assetname,(long long)txnum); - if ( past_marker == 0 ) - { - LP_sendtoaddress_line(validaddress,assetname,dstr(qty * mult),txnum); - } } if ( msgjson != 0 ) free_json(msgjson); From 13f4a616e4515b3c0495f6b9709c08e2408c24d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 20:57:16 +0200 Subject: [PATCH 1992/2732] Test --- iguana/exchanges/LP_socket.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7fb553fc8..f66aaf218 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -599,7 +599,10 @@ cJSON *electrum_address_getbalance(char *symbol,struct electrum_info *ep,cJSON * cJSON *electrum_addpeer(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *endpoint) { return(electrum_strarg(symbol,ep,retjsonp,"server.add_peer",endpoint,ELECTRUM_TIMEOUT)); } cJSON *electrum_sendrawtransaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *rawtx) { return(electrum_strarg(symbol,ep,retjsonp,"blockchain.transaction.broadcast",rawtx,ELECTRUM_TIMEOUT)); } -cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); } +cJSON *electrum_estimatefee(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t numblocks) +{ + return(electrum_intarg(symbol,ep,retjsonp,"blockchain.estimatefee",numblocks,ELECTRUM_TIMEOUT)); +} cJSON *electrum_getchunk(char *symbol,struct electrum_info *ep,cJSON **retjsonp,int32_t n) { return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_chunk",n,ELECTRUM_TIMEOUT)); } @@ -840,9 +843,19 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; + cJSON *strjson,*resitem,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; + if ( str == 0 || len == 0 ) + return(-1); ep->lasttime = (uint32_t)time(NULL); - if ( (strjson= cJSON_Parse(str)) != 0 ) + if ( (strjson= cJSON_Parse(str)) == 0 ) + { + strjson = cJSON_CreateObject(); + resitem = cJSON_CreateObject(); + jaddstr(resitem,"string",str); + jadd(strjson,"result",resitem); + printf("mapped.(%s) -> %s\n",str,jprint(strjson,0)); + } + if ( 1 ) { resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); From 380491be626014dc69490d564a2cd6ade0a049fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:01:45 +0200 Subject: [PATCH 1993/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f66aaf218..7dd644f6a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -858,7 +858,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( 1 ) { resultjson = jobj(strjson,"result"); - //printf("strjson.(%s)\n",jprint(strjson,0)); + printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From 5a7a77e10bb0e5e2e329129e69653c7815c12621 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:07:19 +0200 Subject: [PATCH 1994/2732] Test --- iguana/exchanges/LP_socket.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7dd644f6a..e9147c443 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -843,19 +843,19 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { - cJSON *strjson,*resitem,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; + cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; if ( str == 0 || len == 0 ) return(-1); ep->lasttime = (uint32_t)time(NULL); - if ( (strjson= cJSON_Parse(str)) == 0 ) + /*if ( (strjson= cJSON_Parse(str)) == 0 ) { strjson = cJSON_CreateObject(); resitem = cJSON_CreateObject(); jaddstr(resitem,"string",str); jadd(strjson,"result",resitem); - printf("mapped.(%s) -> %s\n",str,jprint(strjson,0)); - } - if ( 1 ) + printf("mapped.(%s) -> %s\n",str,jprint(strjson,0)); + }*/ + if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); printf("strjson.(%s)\n",jprint(strjson,0)); @@ -899,7 +899,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { //printf("matched idnum.%d result.%p\n",idnum,resultjson); DL_DELETE(ep->pendingQ.list,item); - *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : strjson); + *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); resultjson = strjson = 0; free(item); break; From 6dc03dad4ab5c8b1cf96a26d8d776dc00bc78ce4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:12:45 +0200 Subject: [PATCH 1995/2732] Test --- iguana/exchanges/LP_rpc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 77d334024..3b8e5fdd4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -826,8 +826,6 @@ double _LP_getestimatedrate(struct iguana_info *coin) sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) { - if ( coin->electrum != 0 ) - printf("estimatefee.(%s)\n",retstr); if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) { if ( jobj(errjson,"error") != 0 ) @@ -847,7 +845,8 @@ double _LP_getestimatedrate(struct iguana_info *coin) coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); } - free(retstr); + if ( coin->electrum == 0 ) + free(retstr); } else rate = coin->rate; } else rate = coin->rate; return(rate); From 4720c6d5f745d3021773beb18d9e1954c01483e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:16:45 +0200 Subject: [PATCH 1996/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e9147c443..f1a02583c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -858,7 +858,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); - printf("strjson.(%s)\n",jprint(strjson,0)); + //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) { if ( strcmp(method,"blockchain.headers.subscribe") == 0 ) From f153903b3277697ce1a412401c03ae34b72582af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:23:20 +0200 Subject: [PATCH 1997/2732] Test --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f1a02583c..6a2903ea9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -897,9 +897,9 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) stritem = (struct stritem *)item; if ( item->type == idnum ) { - //printf("matched idnum.%d result.%p\n",idnum,resultjson); DL_DELETE(ep->pendingQ.list,item); *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); + printf("matched idnum.%d result.(%s)\n",idnum,jprint(*((cJSON **)stritem->retptrp),0)); resultjson = strjson = 0; free(item); break; @@ -916,6 +916,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) *((cJSON **)stritem->retptrp) = errjson; } free(item); + item = 0; } } } From c685d032e4144ef58c6510359e9e5f7256642fcb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:33:09 +0200 Subject: [PATCH 1998/2732] Test --- iguana/exchanges/LP_socket.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6a2903ea9..75529b2e7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -892,15 +892,26 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { + cJSON *tmpjson; char *tmpstr; DL_FOREACH_SAFE(ep->pendingQ.list,item,tmp) { stritem = (struct stritem *)item; if ( item->type == idnum ) { DL_DELETE(ep->pendingQ.list,item); - *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); - printf("matched idnum.%d result.(%s)\n",idnum,jprint(*((cJSON **)stritem->retptrp),0)); - resultjson = strjson = 0; + if ( resultjson != 0 ) + { + tmpstr = jprint(resultjson,0); + if ( (tmpjson= cJSON_Parse(tmpstr)) == 0 ) + { + tmpjson = cJSON_CreateObject(); + jadd(tmpjson,"result",jduplicate(resultjson)); + } + free(tmpstr); + } else tmpjson = cJSON_CreateObject(); + //*((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); + *((cJSON **)stritem->retptrp) = tmpjson; + printf("matched idnum.%d result.(%s)\n",idnum,jprint(tmpjson,0)); free(item); break; } From 788f761c20f7a896179d8fbe4b03181f3ec85a8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:38:41 +0200 Subject: [PATCH 1999/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 75529b2e7..b1b04b5d0 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -902,7 +902,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( resultjson != 0 ) { tmpstr = jprint(resultjson,0); - if ( (tmpjson= cJSON_Parse(tmpstr)) == 0 ) + if ( (tmpstr[0] != '[' && tmpstr[0] != '{') || (tmpjson= cJSON_Parse(tmpstr)) == 0 ) { tmpjson = cJSON_CreateObject(); jadd(tmpjson,"result",jduplicate(resultjson)); From 18aafde22db18fa4c9ce2247edc3f559717011fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:51:49 +0200 Subject: [PATCH 2000/2732] Test --- iguana/exchanges/LP_rpc.c | 19 ++++++++++++++----- iguana/exchanges/LP_socket.c | 18 +++--------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3b8e5fdd4..9b3345ab6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -820,11 +820,21 @@ int32_t LP_importaddress(char *symbol,char *address) double _LP_getestimatedrate(struct iguana_info *coin) { - char buf[512],*retstr; cJSON *errjson; double rate = 0.00000020; + char buf[512],*retstr=0; int32_t numblocks; cJSON *errjson,*retjson; double rate = 0.00000020; if ( coin->rate < 0. || time(NULL) > coin->ratetime+30 ) { - sprintf(buf,"[%d]",strcmp(coin->symbol,"BTC") == 0 ? 6 : 2); - if ( (retstr= LP_apicall(coin,coin->electrum==0?"estimatefee" : "blockchain.estimatefee",buf)) != 0 ) + numblocks = strcmp(coin->symbol,"BTC") == 0 ? 6 : 2; + if ( coin->electrum == 0 ) + { + sprintf(buf,"[%d]",numblocks); + retstr = LP_apicall(coin,"estimatefee",buf); + } + else + { + if ( (retjson= electrum_estimatefee(coin->symbol,coin->electrum,&retjson,numblocks)) != 0 ) + retstr = jprint(retjson,1); + } + if ( retstr != 0 ) { if ( retstr[0] == '{' && (errjson= cJSON_Parse(retstr)) != 0 ) { @@ -845,8 +855,7 @@ double _LP_getestimatedrate(struct iguana_info *coin) coin->rate = rate; coin->ratetime = (uint32_t)time(NULL); } - if ( coin->electrum == 0 ) - free(retstr); + free(retstr); } else rate = coin->rate; } else rate = coin->rate; return(rate); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b1b04b5d0..55e40f3fe 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -892,26 +892,15 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) portable_mutex_lock(&ep->pendingQ.mutex); if ( ep->pendingQ.list != 0 ) { - cJSON *tmpjson; char *tmpstr; DL_FOREACH_SAFE(ep->pendingQ.list,item,tmp) { stritem = (struct stritem *)item; if ( item->type == idnum ) { DL_DELETE(ep->pendingQ.list,item); - if ( resultjson != 0 ) - { - tmpstr = jprint(resultjson,0); - if ( (tmpstr[0] != '[' && tmpstr[0] != '{') || (tmpjson= cJSON_Parse(tmpstr)) == 0 ) - { - tmpjson = cJSON_CreateObject(); - jadd(tmpjson,"result",jduplicate(resultjson)); - } - free(tmpstr); - } else tmpjson = cJSON_CreateObject(); - //*((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); - *((cJSON **)stritem->retptrp) = tmpjson; - printf("matched idnum.%d result.(%s)\n",idnum,jprint(tmpjson,0)); + *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); + resultjson = strjson = 0; + printf("matched idnum.%d result.%p\n",idnum,resultjson); free(item); break; } @@ -927,7 +916,6 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) *((cJSON **)stritem->retptrp) = errjson; } free(item); - item = 0; } } } From c926c02ad6e8bdc9bc33a500f36dbcc2a4085166 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 21:59:13 +0200 Subject: [PATCH 2001/2732] Test --- iguana/exchanges/LP_socket.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 55e40f3fe..5e1bfdc9a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -899,8 +899,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { DL_DELETE(ep->pendingQ.list,item); *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); - resultjson = strjson = 0; printf("matched idnum.%d result.%p\n",idnum,resultjson); + resultjson = strjson = 0; free(item); break; } @@ -936,6 +936,12 @@ void LP_dedicatedloop(void *arg) printf("electrum_version %s\n",jprint(retjson,1)); if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) free_json(retjson); + for (i=0; i<3; i++) + if ( (retjson= electrum_estimatefee(coin->symbol,coin->electrum,&retjson,2)) != 0 ) + { + printf("estimate fee (%s)\n",jprint(retjson,0)); + free_json(retjson); + } printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { From 19b23b378609cb15d3d0153ad19c7524c64a245b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:01:38 +0200 Subject: [PATCH 2002/2732] Test --- iguana/exchanges/LP_socket.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5e1bfdc9a..d08ba1e1d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -937,10 +937,13 @@ void LP_dedicatedloop(void *arg) if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) free_json(retjson); for (i=0; i<3; i++) - if ( (retjson= electrum_estimatefee(coin->symbol,coin->electrum,&retjson,2)) != 0 ) { - printf("estimate fee (%s)\n",jprint(retjson,0)); - free_json(retjson); + printf("call estimatefee\n"); + if ( (retjson= electrum_estimatefee(coin->symbol,coin->electrum,&retjson,2)) != 0 ) + { + printf("estimate fee (%s)\n",jprint(retjson,0)); + free_json(retjson); + } else printf("null value from electrum_estimatefee\n"); } printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) From ac2f5ac86bdd3c041b79486a44b6004b5614fbc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:06:30 +0200 Subject: [PATCH 2003/2732] Test --- iguana/exchanges/LP_socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d08ba1e1d..eda80712b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -932,10 +932,6 @@ void LP_dedicatedloop(void *arg) if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; sleep(2); - if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) - printf("electrum_version %s\n",jprint(retjson,1)); - if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) - free_json(retjson); for (i=0; i<3; i++) { printf("call estimatefee\n"); @@ -945,6 +941,10 @@ void LP_dedicatedloop(void *arg) free_json(retjson); } else printf("null value from electrum_estimatefee\n"); } + if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) + printf("electrum_version %s\n",jprint(retjson,1)); + if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) + free_json(retjson); printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { From fc05d424a1759b887170e621097e25a3f4389f33 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:09:12 +0200 Subject: [PATCH 2004/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index eda80712b..9b5e22bcd 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -931,6 +931,8 @@ void LP_dedicatedloop(void *arg) struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; + if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) + free_json(retjson); sleep(2); for (i=0; i<3; i++) { @@ -943,8 +945,6 @@ void LP_dedicatedloop(void *arg) } if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) printf("electrum_version %s\n",jprint(retjson,1)); - if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) - free_json(retjson); printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { From 89efa12c76ddd26e52e211f4dfb7829850f64146 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:22:08 +0200 Subject: [PATCH 2005/2732] Test --- iguana/exchanges/LP_socket.c | 50 +++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9b5e22bcd..d8829ac22 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -363,6 +363,16 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep cJSON *electrum_version(char *symbol,struct electrum_info *ep,cJSON **retjsonp); cJSON *electrum_headers_subscribe(char *symbol,struct electrum_info *ep,cJSON **retjsonp); +struct stritem *electrum_sitem(struct electrum_info *ep,char *stratumreq,int32_t timeout,cJSON **retjsonp) +{ + struct stritem *sitem = (struct stritem *)queueitem(stratumreq); + sitem->expiration = timeout; + sitem->DL.type = ep->stratumid++; + sitem->retptrp = (void **)retjsonp; + queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); + return(sitem); +} + cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -377,12 +387,13 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); //printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); - sitem = (struct stritem *)queueitem(stratumreq); + sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); + /*sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; - sitem->retptrp = (void **)retjsonp; + sitem->retptrp = (void **)retjsonp;*/ portable_mutex_lock(&ep->mutex); - queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); + //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(5000); @@ -928,23 +939,26 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { - struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg; + char stratumreq[1024]; struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson=0; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; - if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) - free_json(retjson); - sleep(2); - for (i=0; i<3; i++) - { - printf("call estimatefee\n"); - if ( (retjson= electrum_estimatefee(coin->symbol,coin->electrum,&retjson,2)) != 0 ) - { - printf("estimate fee (%s)\n",jprint(retjson,0)); - free_json(retjson); - } else printf("null value from electrum_estimatefee\n"); - } - if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) - printf("electrum_version %s\n",jprint(retjson,1)); + retjson = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"blockchain.headers.subscribe","[]"); + electrum_sitem(ep,stratumreq,3,&retjson); + + retjson = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"server.version","[\"barterDEX\", [\"1.1\", \"1.1\"]]"); + electrum_sitem(ep,stratumreq,3,&retjson); + + retjson = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"blockchain.estimatefee","[2]"); + electrum_sitem(ep,stratumreq,3,&retjson); + + + //if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) + // free_json(retjson); + //if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) + // printf("electrum_version %s\n",jprint(retjson,1)); printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { From 982e9097953be34cde7560e6777446c2e19d3766 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:24:36 +0200 Subject: [PATCH 2006/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index d8829ac22..500239802 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -910,7 +910,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { DL_DELETE(ep->pendingQ.list,item); *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); - printf("matched idnum.%d result.%p\n",idnum,resultjson); + printf("matched idnum.%d result.(%s)\n",idnum,jprint(*((cJSON **)stritem->retptrp),0)); resultjson = strjson = 0; free(item); break; From fb535fb7e20aa7b3668341cd34ec49d58bd69757 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:26:09 +0200 Subject: [PATCH 2007/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 500239802..5eca7fd1c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -910,7 +910,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) { DL_DELETE(ep->pendingQ.list,item); *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); - printf("matched idnum.%d result.(%s)\n",idnum,jprint(*((cJSON **)stritem->retptrp),0)); + //printf("matched idnum.%d result.(%s)\n",idnum,jprint(*((cJSON **)stritem->retptrp),0)); resultjson = strjson = 0; free(item); break; From 3bb803f23752dcb07f6642a8e4b330a077c11c22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 22:34:55 +0200 Subject: [PATCH 2008/2732] Test --- iguana/exchanges/LP_socket.c | 43 +++++++++++++++++------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5eca7fd1c..dafac13b2 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -373,6 +373,22 @@ struct stritem *electrum_sitem(struct electrum_info *ep,char *stratumreq,int32_t return(sitem); } +void electrum_initial_requests(struct electrum_info *ep) +{ + cJSON *retjson; char stratumreq[1024]; + retjson = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"blockchain.headers.subscribe","[]"); + electrum_sitem(ep,stratumreq,3,&retjson); + + retjson = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"server.version","[\"barterDEX\", [\"1.1\", \"1.1\"]]"); + electrum_sitem(ep,stratumreq,3,&retjson); + + retjson = 0; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"blockchain.estimatefee","[2]"); + electrum_sitem(ep,stratumreq,3,&retjson); +} + cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -407,11 +423,8 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch printf("error RE-connecting to %s:%u\n",ep->ipaddr,ep->port); else { - cJSON *retjson; - if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) - printf("electrum_version %s\n",jprint(retjson,1)); - if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) - free_json(retjson); + ep->stratumid = 0; + electrum_initial_requests(ep); printf("ep.%p %s numerrors.%d too big -> new %s:%u sock.%d\n",ep,ep->symbol,ep->numerrors,ep->ipaddr,ep->port,ep->sock); ep->numerrors = 0; } @@ -939,26 +952,10 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) void LP_dedicatedloop(void *arg) { - char stratumreq[1024]; struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson=0; struct stritem *sitem; struct electrum_info *ep = arg; + struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; struct stritem *sitem; struct electrum_info *ep = arg; if ( (coin= LP_coinfind(ep->symbol)) != 0 ) ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime; - retjson = 0; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"blockchain.headers.subscribe","[]"); - electrum_sitem(ep,stratumreq,3,&retjson); - - retjson = 0; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"server.version","[\"barterDEX\", [\"1.1\", \"1.1\"]]"); - electrum_sitem(ep,stratumreq,3,&retjson); - - retjson = 0; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,"blockchain.estimatefee","[2]"); - electrum_sitem(ep,stratumreq,3,&retjson); - - - //if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,&retjson)) != 0 ) - // free_json(retjson); - //if ( (retjson= electrum_version(ep->symbol,ep,&retjson)) != 0 ) - // printf("electrum_version %s\n",jprint(retjson,1)); + electrum_initial_requests(ep); printf("LP_dedicatedloop ep.%p sock.%d for %s:%u num.%d %p %s ht.%d\n",ep,ep->sock,ep->ipaddr,ep->port,Num_electrums,&Num_electrums,ep->symbol,*ep->heightp); while ( ep->sock >= 0 ) { From 053bb32ce7bf881216e7293389ee63ea61b3edc3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 06:32:38 +0200 Subject: [PATCH 2009/2732] Pub key -> destpubkey --- iguana/exchanges/LP_bitcoin.c | 12 ++++++++++++ iguana/exchanges/LP_commands.c | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 1c2c5d0c5..0eef539d1 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -1959,6 +1959,18 @@ int32_t bitcoin_timelockspend(uint8_t *script,int32_t n,uint8_t rmd160[20],uint3 return(n); } +int32_t bitcoin_performancebond(uint8_t p2sh_rmd160[20],uint8_t *script,int32_t n,uint32_t unlocktimestamp,uint8_t cltv_rmd160[20],uint8_t anytime_rmd160[20]) +{ + script[n++] = SCRIPT_OP_IF; + n = bitcoin_checklocktimeverify(script,n,unlocktimestamp); + n = bitcoin_standardspend(script,n,cltv_rmd160); + script[n++] = SCRIPT_OP_ELSE; + n = bitcoin_standardspend(script,n,anytime_rmd160); + script[n++] = SCRIPT_OP_ENDIF; + calc_rmd160_sha256(p2sh_rmd160,script,n); + return(n); +} + int32_t bitcoin_MofNspendscript(uint8_t p2sh_rmd160[20],uint8_t *script,int32_t n,const struct vin_info *vp) { int32_t i,plen; diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index fe60a38a3..831f81ccb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -111,8 +111,8 @@ getrawtransaction(coin, txid)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ -buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce, pubkey="")\n\ -sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce, pubkey="")\n\ +buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce, destpubkey="")\n\ +sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce, destpubkey="")\n\ withdraw(coin, outputs[])\n\ sendrawtransaction(coin, signedtx)\n\ swapstatus()\n\ @@ -306,7 +306,7 @@ bot_resume(botid)\n\ //* if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"),0)); + return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"destpubkey"),0)); } else return(clonestr("{\"error\":\"no price set\"}")); } else if ( strcmp(method,"sell") == 0 ) @@ -314,7 +314,7 @@ bot_resume(botid)\n\ //* if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"pubkey"),0)); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"destpubkey"),0)); } else return(clonestr("{\"error\":\"no price set\"}")); } } From ef30184405157ccf78b77d670b858c386653e6ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 10:50:26 +0200 Subject: [PATCH 2010/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +++++++- iguana/exchanges/LP_network.c | 26 ++++++++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8a4109323..9a6809a04 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -29,7 +29,7 @@ struct LP_millistats double lastmilli,millisum,threshold; uint32_t count; char name[64]; -} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats; +} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats,LP_gcloop_stats; extern int32_t IAMLP; void LP_millistats_update(struct LP_millistats *mp) @@ -52,6 +52,7 @@ void LP_millistats_update(struct LP_millistats *mp) mp = &LP_pubkeysloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); mp = &LP_privkeysloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); mp = &LP_swapsloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); + mp = &LP_gcloop_stats, printf("%32s lag %10.2f millis, threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,OS_milliseconds() - mp->lastmilli,mp->threshold,mp->millisum/(mp->count > 0 ? mp->count: 1),mp->count); } else { @@ -1112,6 +1113,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching queue_loop for port.%u\n",myport); exit(-1); } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + { + printf("error launching gc_loop for port.%u\n",myport); + exit(-1); + } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 797c31d04..1e207c2dc 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -265,23 +265,37 @@ int32_t LP_peerindsock(int32_t *peerindp) return(-1); } -void queue_loop(void *arg) +void gc_loop(void *arg) { - struct rpcrequest_info *req,*rtmp; struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; - strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 500.; + struct rpcrequest_info *req,*rtmp; int32_t flag = 0; + strcpy(queue_loop_stats.name,"gc_loop"); + queue_loop_stats.threshold = 50.; while ( 1 ) { - LP_millistats_update(&queue_loop_stats); + flag = 0; + LP_millistats_update(&LP_gcloop_stats); portable_mutex_lock(&LP_networkmutex); DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) { DL_DELETE(LP_garbage_collector,req); //printf("garbage collect ipbits.%x\n",req->ipbits); free(req); + flag++; } portable_mutex_unlock(&LP_networkmutex); + if ( flag == 0 ) + usleep(25000); + } +} +void queue_loop(void *arg) +{ + struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; + strcpy(queue_loop_stats.name,"queue_loop"); + queue_loop_stats.threshold = 500.; + while ( 1 ) + { + LP_millistats_update(&queue_loop_stats); nonz = 0; //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); n = 0; @@ -291,7 +305,7 @@ void queue_loop(void *arg) flag = 0; if ( ptr->sock >= 0 ) { - if ( LP_sockcheck(ptr->sock) > 0 ) + //if ( LP_sockcheck(ptr->sock) > 0 ) { bits256 magic; magic = LP_calc_magic(ptr->msg,(int32_t)(ptr->msglen - sizeof(bits256))); From eb1207676cbc8a09e096881f5495805e117bf44b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 10:50:58 +0200 Subject: [PATCH 2011/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1e207c2dc..fa803467d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(queue_loop_stats.name,"gc_loop"); - queue_loop_stats.threshold = 50.; + queue_loop_stats.threshold = 27.; while ( 1 ) { flag = 0; From 84475181967899fd98a6826d0c55decd6fadfd7d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 10:51:27 +0200 Subject: [PATCH 2012/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index fa803467d..9d8bbb46d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(queue_loop_stats.name,"gc_loop"); - queue_loop_stats.threshold = 27.; + queue_loop_stats.threshold = 26.; while ( 1 ) { flag = 0; @@ -292,7 +292,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 500.; + queue_loop_stats.threshold = 50.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); From e73be6059706d121d7ca89c5a486ec5447915cee Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 10:52:58 +0200 Subject: [PATCH 2013/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9d8bbb46d..a2d4ae860 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -305,7 +305,7 @@ void queue_loop(void *arg) flag = 0; if ( ptr->sock >= 0 ) { - //if ( LP_sockcheck(ptr->sock) > 0 ) + if ( LP_sockcheck(ptr->sock) > 0 ) { bits256 magic; magic = LP_calc_magic(ptr->msg,(int32_t)(ptr->msglen - sizeof(bits256))); From 2e036b4873247db8128c9b99ef36c9204ac819fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 10:58:12 +0200 Subject: [PATCH 2014/2732] Test --- iguana/exchanges/LP_network.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a2d4ae860..bccc03ce0 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(queue_loop_stats.name,"gc_loop"); - queue_loop_stats.threshold = 26.; + queue_loop_stats.threshold = 6.; while ( 1 ) { flag = 0; @@ -284,7 +284,8 @@ void gc_loop(void *arg) } portable_mutex_unlock(&LP_networkmutex); if ( flag == 0 ) - usleep(25000); + usleep(5000); + else printf("gc_loop.%d\n",flag); } } @@ -292,15 +293,15 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 50.; + queue_loop_stats.threshold = 11.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); - nonz = 0; //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); - n = 0; + n = nonz = 0; DL_FOREACH_SAFE(LP_Q,ptr,tmp) { + nonz = 0; n++; flag = 0; if ( ptr->sock >= 0 ) @@ -348,6 +349,7 @@ void queue_loop(void *arg) portable_mutex_unlock(&LP_networkmutex); free(ptr); ptr = 0; + break; } } if ( arg == 0 ) @@ -355,10 +357,7 @@ void queue_loop(void *arg) //if ( n != 0 ) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) - usleep(25000); - else if ( IAMLP == 0 ) usleep(10000); - else usleep(1000); } } From 8dadab25e5dcb4ae2e49532f418e71135da6c869 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:00:13 +0200 Subject: [PATCH 2015/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index bccc03ce0..6aee50faf 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(queue_loop_stats.name,"gc_loop"); - queue_loop_stats.threshold = 6.; + queue_loop_stats.threshold = 12.; while ( 1 ) { flag = 0; From a1316241883868afbad3e19b618561124622bd40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:19:01 +0200 Subject: [PATCH 2016/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_network.c | 15 +++++++-------- iguana/exchanges/stats.c | 12 +++++------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9a6809a04..24f1cf450 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -75,7 +75,7 @@ void LP_millistats_update(struct LP_millistats *mp) } #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex; int32_t LP_canbind; char *Broadcaststr,*Reserved_msgs[2][1000]; int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; @@ -995,6 +995,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_swaplistmutex); portable_mutex_init(&LP_cachemutex); portable_mutex_init(&LP_networkmutex); + portable_mutex_init(&LP_gcmutex); portable_mutex_init(&LP_forwardmutex); portable_mutex_init(&LP_psockmutex); portable_mutex_init(&LP_coinmutex); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 6aee50faf..596f7ba75 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -274,7 +274,7 @@ void gc_loop(void *arg) { flag = 0; LP_millistats_update(&LP_gcloop_stats); - portable_mutex_lock(&LP_networkmutex); + portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) { DL_DELETE(LP_garbage_collector,req); @@ -282,10 +282,10 @@ void gc_loop(void *arg) free(req); flag++; } - portable_mutex_unlock(&LP_networkmutex); + portable_mutex_unlock(&LP_gcmutex); if ( flag == 0 ) usleep(5000); - else printf("gc_loop.%d\n",flag); + //else printf("gc_loop.%d\n",flag); } } @@ -301,7 +301,6 @@ void queue_loop(void *arg) n = nonz = 0; DL_FOREACH_SAFE(LP_Q,ptr,tmp) { - nonz = 0; n++; flag = 0; if ( ptr->sock >= 0 ) @@ -313,10 +312,10 @@ void queue_loop(void *arg) memcpy(&ptr->msg[ptr->msglen - sizeof(bits256)],&magic,sizeof(magic)); if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); + else flag++; ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); - else flag = 1; } //else printf("sock not ready to send.%d\n",ptr->msglen); } else if ( 0 && time(NULL) > ptr->starttime+13 ) @@ -327,7 +326,7 @@ void queue_loop(void *arg) LP_Qfound++; if ( (LP_Qfound % 100) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); - flag = 1; + flag++; } else if ( 0 ) // too much beyond duplicate filter when network is busy { @@ -336,7 +335,7 @@ void queue_loop(void *arg) if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("%d no more peers to try at peerind.%d %p Q_LP.%p\n",n,ptr->peerind,ptr,LP_Q); - flag = 1; + flag++; LP_Qerrors++; } } @@ -349,7 +348,6 @@ void queue_loop(void *arg) portable_mutex_unlock(&LP_networkmutex); free(ptr); ptr = 0; - break; } } if ( arg == 0 ) @@ -358,6 +356,7 @@ void queue_loop(void *arg) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(10000); + else printf("queue_loop nonz.%d flag.%d n.%d\n",nonz,flag,n); } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 37514e596..2cc747ae0 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -589,7 +589,7 @@ int32_t iguana_getheadersize(char *buf,int32_t recvlen) } uint16_t RPC_port; -extern portable_mutex_t LP_commandmutex,LP_networkmutex; +extern portable_mutex_t LP_commandmutex,LP_gcmutex; extern struct rpcrequest_info *LP_garbage_collector; void LP_rpc_processreq(void *_ptr) @@ -608,9 +608,7 @@ void LP_rpc_processreq(void *_ptr) jsonbuf = calloc(1,size); remains = size-1; buf = jsonbuf; - portable_mutex_lock(&LP_networkmutex); spawned++; - portable_mutex_unlock(&LP_networkmutex); if ( spawned > maxspawned ) { printf("max rpc threads spawned and alive %d <- %d\n",maxspawned,spawned); @@ -735,10 +733,10 @@ void LP_rpc_processreq(void *_ptr) free(space); free(jsonbuf); closesocket(sock); - portable_mutex_lock(&LP_networkmutex); + portable_mutex_lock(&LP_gcmutex); DL_APPEND(LP_garbage_collector,req); spawned--; - portable_mutex_unlock(&LP_networkmutex); + portable_mutex_unlock(&LP_gcmutex); } extern int32_t IAMLP; @@ -779,13 +777,13 @@ continue; printf("error launching rpc handler on port %d, retval.%d\n",port,retval); close(bindsock); bindsock = -1; - portable_mutex_lock(&LP_networkmutex); + portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req2,rtmp) { DL_DELETE(LP_garbage_collector,req2); free(req2); } - portable_mutex_unlock(&LP_networkmutex); + portable_mutex_unlock(&LP_gcmutex); if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error2 launching rpc handler on port %d, retval.%d\n",port,retval); From 1b363373b7ee389e66597747ed0073f22162886a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:25:24 +0200 Subject: [PATCH 2017/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 24f1cf450..395ba7ffc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -66,7 +66,7 @@ void LP_millistats_update(struct LP_millistats *mp) mp->millisum += elapsed; if ( mp->threshold != 0. && elapsed > mp->threshold ) { - if ( IAMLP == 0 ) + //if ( IAMLP == 0 ) printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); } mp->lastmilli = millis; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 596f7ba75..5284bac2c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -298,7 +298,7 @@ void queue_loop(void *arg) { LP_millistats_update(&queue_loop_stats); //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); - n = nonz = 0; + n = nonz = flag = 0; DL_FOREACH_SAFE(LP_Q,ptr,tmp) { n++; @@ -356,7 +356,7 @@ void queue_loop(void *arg) // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(10000); - else printf("queue_loop nonz.%d flag.%d n.%d\n",nonz,flag,n); + else printf("queue_loop nonz.%d n.%d\n",nonz,n); } } From 5219d88727a03efe0a5b317bdfc191a449994783 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:28:05 +0200 Subject: [PATCH 2018/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 5284bac2c..eb3c0d7ea 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -275,7 +275,7 @@ void gc_loop(void *arg) flag = 0; LP_millistats_update(&LP_gcloop_stats); portable_mutex_lock(&LP_gcmutex); - DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) + DL_FOREACH(LP_garbage_collector,req) { DL_DELETE(LP_garbage_collector,req); //printf("garbage collect ipbits.%x\n",req->ipbits); @@ -285,7 +285,7 @@ void gc_loop(void *arg) portable_mutex_unlock(&LP_gcmutex); if ( flag == 0 ) usleep(5000); - //else printf("gc_loop.%d\n",flag); + else printf("gc_loop.%d\n",flag); } } From 7aabcd1ae94ded0872462ddbcc841ec2ffc8efa3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:30:47 +0200 Subject: [PATCH 2019/2732] test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eb3c0d7ea..eef7658b7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -275,7 +275,7 @@ void gc_loop(void *arg) flag = 0; LP_millistats_update(&LP_gcloop_stats); portable_mutex_lock(&LP_gcmutex); - DL_FOREACH(LP_garbage_collector,req) + DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) { DL_DELETE(LP_garbage_collector,req); //printf("garbage collect ipbits.%x\n",req->ipbits); From 3d49071cb011a88f5abdae1cdbad0f0e04e0f653 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:33:10 +0200 Subject: [PATCH 2020/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- iguana/exchanges/stats.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eef7658b7..38f03ede7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -274,7 +274,7 @@ void gc_loop(void *arg) { flag = 0; LP_millistats_update(&LP_gcloop_stats); - portable_mutex_lock(&LP_gcmutex); + //portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) { DL_DELETE(LP_garbage_collector,req); @@ -282,7 +282,7 @@ void gc_loop(void *arg) free(req); flag++; } - portable_mutex_unlock(&LP_gcmutex); + //portable_mutex_unlock(&LP_gcmutex); if ( flag == 0 ) usleep(5000); else printf("gc_loop.%d\n",flag); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2cc747ae0..b4d680e03 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -733,10 +733,10 @@ void LP_rpc_processreq(void *_ptr) free(space); free(jsonbuf); closesocket(sock); - portable_mutex_lock(&LP_gcmutex); + //portable_mutex_lock(&LP_gcmutex); DL_APPEND(LP_garbage_collector,req); spawned--; - portable_mutex_unlock(&LP_gcmutex); + //portable_mutex_unlock(&LP_gcmutex); } extern int32_t IAMLP; From 9452e4c9891ae01c18e2e9627278057177c85a64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:35:20 +0200 Subject: [PATCH 2021/2732] Test --- iguana/exchanges/LP_network.c | 8 ++++---- iguana/exchanges/stats.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 38f03ede7..e869759b2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,12 +269,12 @@ void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(queue_loop_stats.name,"gc_loop"); - queue_loop_stats.threshold = 12.; + queue_loop_stats.threshold = 1001.; while ( 1 ) { flag = 0; LP_millistats_update(&LP_gcloop_stats); - //portable_mutex_lock(&LP_gcmutex); + portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req,rtmp) { DL_DELETE(LP_garbage_collector,req); @@ -282,9 +282,9 @@ void gc_loop(void *arg) free(req); flag++; } - //portable_mutex_unlock(&LP_gcmutex); + portable_mutex_unlock(&LP_gcmutex); if ( flag == 0 ) - usleep(5000); + sleep(1); else printf("gc_loop.%d\n",flag); } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index b4d680e03..2cc747ae0 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -733,10 +733,10 @@ void LP_rpc_processreq(void *_ptr) free(space); free(jsonbuf); closesocket(sock); - //portable_mutex_lock(&LP_gcmutex); + portable_mutex_lock(&LP_gcmutex); DL_APPEND(LP_garbage_collector,req); spawned--; - //portable_mutex_unlock(&LP_gcmutex); + portable_mutex_unlock(&LP_gcmutex); } extern int32_t IAMLP; From f8651e0e312105f785be05e115a45c012640a4b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:37:32 +0200 Subject: [PATCH 2022/2732] Test --- iguana/exchanges/LP_network.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index e869759b2..64f1905bc 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -283,9 +283,9 @@ void gc_loop(void *arg) flag++; } portable_mutex_unlock(&LP_gcmutex); - if ( flag == 0 ) - sleep(1); - else printf("gc_loop.%d\n",flag); + if ( flag != 0 ) + printf("gc_loop.%d\n",flag); + sleep(1); } } From be8d3eae2d1bdd51b4bc9f1a48ffc5a6a5dc9a54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:40:08 +0200 Subject: [PATCH 2023/2732] Test --- iguana/exchanges/LP_network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 64f1905bc..8896a8c70 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -293,7 +293,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 11.; + queue_loop_stats.threshold = 51.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); @@ -354,9 +354,9 @@ void queue_loop(void *arg) break; //if ( n != 0 ) // printf("LP_Q.[%d]\n",n); - if ( nonz == 0 ) - usleep(10000); - else printf("queue_loop nonz.%d n.%d\n",nonz,n); + if ( n != 0 ) + printf("queue_loop nonz.%d n.%d\n",nonz,n); + usleep(50000); } } From f8253540feca225b96c08a6db6f65c35be51307c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:45:34 +0200 Subject: [PATCH 2024/2732] Test --- iguana/exchanges/LP_network.c | 38 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 8896a8c70..d314b3d85 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -140,7 +140,7 @@ struct LP_queue { struct LP_queue *next,*prev; int32_t sock,peerind,msglen; - uint32_t starttime,crc32; + uint32_t starttime,crc32,notready; uint8_t msg[]; } *LP_Q; int32_t LP_Qenqueued,LP_Qerrors,LP_Qfound; @@ -305,18 +305,26 @@ void queue_loop(void *arg) flag = 0; if ( ptr->sock >= 0 ) { - if ( LP_sockcheck(ptr->sock) > 0 ) + if ( ptr->notready == 0 || (rand() % ptr->notready) == 0 ) { - bits256 magic; - magic = LP_calc_magic(ptr->msg,(int32_t)(ptr->msglen - sizeof(bits256))); - memcpy(&ptr->msg[ptr->msglen - sizeof(bits256)],&magic,sizeof(magic)); - if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) - printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - else flag++; - ptr->sock = -1; - if ( ptr->peerind > 0 ) - ptr->starttime = (uint32_t)time(NULL); - } //else printf("sock not ready to send.%d\n",ptr->msglen); + if ( LP_sockcheck(ptr->sock) > 0 ) + { + bits256 magic; + magic = LP_calc_magic(ptr->msg,(int32_t)(ptr->msglen - sizeof(bits256))); + memcpy(&ptr->msg[ptr->msglen - sizeof(bits256)],&magic,sizeof(magic)); + if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) + printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); + else flag++; + ptr->sock = -1; + if ( ptr->peerind > 0 ) + ptr->starttime = (uint32_t)time(NULL); + } + else + { + if ( ptr->notready++ > 1000 ) + flag = 1; + } + } } else if ( 0 && time(NULL) > ptr->starttime+13 ) { @@ -352,11 +360,9 @@ void queue_loop(void *arg) } if ( arg == 0 ) break; - //if ( n != 0 ) - // printf("LP_Q.[%d]\n",n); - if ( n != 0 ) + if ( n+nonz != 0 ) printf("queue_loop nonz.%d n.%d\n",nonz,n); - usleep(50000); + else usleep(50000); } } From 97ba511f73c943ba887bbae13128468a95fbc30f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:48:25 +0200 Subject: [PATCH 2025/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d314b3d85..12b626bb7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -360,7 +360,7 @@ void queue_loop(void *arg) } if ( arg == 0 ) break; - if ( n+nonz != 0 ) + if ( nonz != 0 ) printf("queue_loop nonz.%d n.%d\n",nonz,n); else usleep(50000); } From 17a822dc9f646ce53d20bdba7918c67e2a0b9079 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:50:59 +0200 Subject: [PATCH 2026/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 12b626bb7..bf212278b 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -268,8 +268,8 @@ int32_t LP_peerindsock(int32_t *peerindp) void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; - strcpy(queue_loop_stats.name,"gc_loop"); - queue_loop_stats.threshold = 1001.; + strcpy(LP_gcloop_stats.name,"gc_loop"); + LP_gcloop_stats.threshold = 1001.; while ( 1 ) { flag = 0; From 957d87387953c4a9ada808303d345bf20bff3114 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 11:54:36 +0200 Subject: [PATCH 2027/2732] Test --- iguana/exchanges/LP_network.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index bf212278b..9bf43463c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -283,7 +283,7 @@ void gc_loop(void *arg) flag++; } portable_mutex_unlock(&LP_gcmutex); - if ( flag != 0 ) + if ( 0 && flag != 0 ) printf("gc_loop.%d\n",flag); sleep(1); } @@ -293,7 +293,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 51.; + queue_loop_stats.threshold = 100.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); @@ -360,9 +360,12 @@ void queue_loop(void *arg) } if ( arg == 0 ) break; - if ( nonz != 0 ) - printf("queue_loop nonz.%d n.%d\n",nonz,n); - else usleep(50000); + if ( nonz == 0 ) + { + if ( IAMLP == 0 ) + usleep(50000); + else usleep(10000); + } } } From 4c2897ea4ea2cac6d35cee2de033e5b848571b6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 12:08:38 +0200 Subject: [PATCH 2028/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9bf43463c..9a52b86d4 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void gc_loop(void *arg) { struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(LP_gcloop_stats.name,"gc_loop"); - LP_gcloop_stats.threshold = 1001.; + LP_gcloop_stats.threshold = 1100.; while ( 1 ) { flag = 0; From e5052cf17b64df02161af4ef7e845fcfa84deed4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 12:18:17 +0200 Subject: [PATCH 2029/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 395ba7ffc..fd41a9857 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -453,7 +453,7 @@ void utxosQ_loop(void *myipaddr) { LP_millistats_update(&utxosQ_loop_stats); if ( LP_utxosQ_process() == 0 ) - usleep(10000); + usleep(50000); } } From abbd42ced7dae88e0b98171715e390d14955fa5e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 14:20:32 +0200 Subject: [PATCH 2030/2732] Test --- iguana/exchanges/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 342089ce3..e67ab5bc0 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp processlist stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From 9db4d96d0858f2c27b31a6cceaacc2ba1d99e845 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 16:59:34 +0200 Subject: [PATCH 2031/2732] Null symbol crash fixed --- iguana/exchanges/LP_coins.c | 62 ++++++++++++++++++++-------------- iguana/exchanges/LP_commands.c | 9 +++-- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index c2771e308..fe9c20f34 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -23,9 +23,12 @@ char *portstrs[][3] = { { "BTC", "8332" }, { "KMD", "7771" } }; uint16_t LP_rpcport(char *symbol) { int32_t i; - for (i=0; iinactive != 0 || coin->electrum != 0 || coin == refcoin ) - continue; - if ( strcmp(coin->serverport,refcoin->serverport) == 0 ) - break; + HASH_ITER(hh,LP_coins,coin,tmp) + { + if ( coin->inactive != 0 || coin->electrum != 0 || coin == refcoin ) + continue; + if ( strcmp(coin->serverport,refcoin->serverport) == 0 ) + break; + } } return(coin); } @@ -254,31 +260,37 @@ cJSON *LP_coinsjson(int32_t showwif) char *LP_getcoin(char *symbol) { int32_t numenabled,numdisabled; struct iguana_info *coin,*tmp; cJSON *item=0,*retjson; - numenabled = numdisabled = 0; retjson = cJSON_CreateObject(); - HASH_ITER(hh,LP_coins,coin,tmp) + if ( symbol != 0 && symbol[0] != 0 ) { - if ( strcmp(symbol,coin->symbol) == 0 ) - item = LP_coinjson(coin,0); - if ( coin->inactive == 0 ) - numenabled++; - else numdisabled++; + numenabled = numdisabled = 0; + HASH_ITER(hh,LP_coins,coin,tmp) + { + if ( strcmp(symbol,coin->symbol) == 0 ) + item = LP_coinjson(coin,0); + if ( coin->inactive == 0 ) + numenabled++; + else numdisabled++; + } + jaddstr(retjson,"result","success"); + jaddnum(retjson,"enabled",numenabled); + jaddnum(retjson,"disabled",numdisabled); + if ( item == 0 ) + item = cJSON_CreateObject(); + jadd(retjson,"coin",item); } - jaddstr(retjson,"result","success"); - jaddnum(retjson,"enabled",numenabled); - jaddnum(retjson,"disabled",numdisabled); - if ( item == 0 ) - item = cJSON_CreateObject(); - jadd(retjson,"coin",item); return(jprint(retjson,1)); } struct iguana_info *LP_coinsearch(char *symbol) { - struct iguana_info *coin; - portable_mutex_lock(&LP_coinmutex); - HASH_FIND(hh,LP_coins,symbol,strlen(symbol),coin); - portable_mutex_unlock(&LP_coinmutex); + struct iguana_info *coin = 0; + if ( symbol != 0 && symbol[0] != 0 ) + { + portable_mutex_lock(&LP_coinmutex); + HASH_FIND(hh,LP_coins,symbol,strlen(symbol),coin); + portable_mutex_unlock(&LP_coinmutex); + } return(coin); } diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 831f81ccb..740c156c6 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -153,9 +153,12 @@ bot_resume(botid)\n\ \"}")); //sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ - base = jstr(argjson,"base"); - rel = jstr(argjson,"rel"); - coin = jstr(argjson,"coin"); + if ( (base= jstr(argjson,"base")) == 0 ) + base = ""; + if ((rel= jstr(argjson,"rel")) == 0 ) + rel = ""; + if ( (coin= jstr(argjson,"coin")) == 0 ) + coin = ""; if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) // protected localhost { if ( G.USERPASS_COUNTER == 0 ) From 62d80ea648c0680651254715e81eb28531751ab5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 17:11:54 +0200 Subject: [PATCH 2032/2732] Fix --- iguana/exchanges/LP_commands.c | 10 +++++----- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 740c156c6..4e86095b8 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -190,7 +190,7 @@ bot_resume(botid)\n\ { if ( jobj(argjson,"method2") == 0 ) { - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); + LP_broadcast_message(LP_mypubsock,base!=0?base:coin,rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); } return(clonestr("{\"result\":\"success\"}")); } @@ -328,7 +328,7 @@ bot_resume(botid)\n\ return(LP_bestfit(rel,relvolume)); else return(clonestr("{\"error\":\"no relvolume set\"}")); } - else if ( (coin= jstr(argjson,"coin")) != 0 ) + else if ( coin[0] != 0 ) { if ( strcmp(method,"enable") == 0 ) { @@ -506,7 +506,7 @@ bot_resume(botid)\n\ } else if ( strcmp(method,"balance") == 0 ) { - if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + if ( (ptr= LP_coinsearch(coin)) != 0 ) return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); else return(clonestr("{\"error\":\"cant find coind\"}")); } @@ -543,7 +543,7 @@ bot_resume(botid)\n\ } else if ( strcmp(method,"listunspent") == 0 ) { - if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + if ( (ptr= LP_coinsearch(coin)) != 0 ) { char *coinaddr; if ( (coinaddr= jstr(argjson,"address")) != 0 ) @@ -571,7 +571,7 @@ bot_resume(botid)\n\ else if ( strcmp(method,"addr_unspents") == 0 ) { //printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); - if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + if ( (ptr= LP_coinsearch(coin)) != 0 ) { char *coinaddr; if ( (coinaddr= jstr(argjson,"address")) != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9a52b86d4..0a6812890 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -293,7 +293,7 @@ void queue_loop(void *arg) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; strcpy(queue_loop_stats.name,"queue_loop"); - queue_loop_stats.threshold = 100.; + queue_loop_stats.threshold = 1000.; while ( 1 ) { LP_millistats_update(&queue_loop_stats); From d9e15e536aaec2439f54afee6ffdc167a8254b73 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 17:15:06 +0200 Subject: [PATCH 2033/2732] Test --- iguana/exchanges/LP_commands.c | 10 +++++----- iguana/exchanges/mm.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4e86095b8..f7927ba8a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -260,15 +260,15 @@ bot_resume(botid)\n\ uint32_t requestid,quoteid; if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) return(basilisk_swapentry(requestid,quoteid)); - else if ( coin != 0 && coin[0] != 0 ) + else if ( coin[0] != 0 ) return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); - else if ( base != 0 && base[0] != 0 && rel != 0 && rel[0] != 0 ) + else if ( base[0] != 0 && rel[0] != 0 ) return(basilisk_swapentries(base,rel,jint(argjson,"limit"))); else return(basilisk_swaplist(0,0)); } else if ( (retstr= LP_istradebots_command(ctx,pubsock,method,argjson)) != 0 ) return(retstr); - if ( base != 0 && rel != 0 ) + if ( base[0] != 0 && rel[0] != 0 ) { double price,bid,ask; if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) @@ -321,7 +321,7 @@ bot_resume(botid)\n\ } else return(clonestr("{\"error\":\"no price set\"}")); } } - else if ( rel != 0 && strcmp(method,"bestfit") == 0 ) + else if ( rel[0] != 0 && strcmp(method,"bestfit") == 0 ) { double relvolume; if ( (relvolume= jdouble(argjson,"relvolume")) > SMALLVAL ) @@ -513,7 +513,7 @@ bot_resume(botid)\n\ else if ( strcmp(method,"pricearray") == 0 ) { uint32_t firsttime; - if ( base != 0 && rel != 0 ) + if ( base[0] != 0 && rel[0] != 0 ) { if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) firsttime = (uint32_t)(time(NULL)-30*24*3600); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index b5cc4404e..7aafd9055 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -907,7 +907,7 @@ int main(int argc, const char * argv[]) } //else printf("(%s) launched.(%s)\n",argv[1],passphrase); incr = 100.; while ( (1) ) - sleep(1); + sleep(100000); profitmargin = jdouble(retjson,"profitmargin"); minask = jdouble(retjson,"minask"); maxbid = jdouble(retjson,"maxbid"); From fa4419fa0a8bc2d7a0df238355225888dbf3a228 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 18:03:08 +0200 Subject: [PATCH 2034/2732] PURA --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 60511920f..d81e18c4d 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,4 +1,4 @@ -export coins="[{\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" #{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, #{\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, From 5efe3188acc1a50b69a64c73f39f4fc3fd0117dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 18:03:36 +0200 Subject: [PATCH 2035/2732] coins.json --- iguana/exchanges/coins.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/coins.json b/iguana/exchanges/coins.json index cadc82f08..2fad617b6 100644 --- a/iguana/exchanges/coins.json +++ b/iguana/exchanges/coins.json @@ -1,2 +1,4 @@ -[{\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" -#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}] +[{\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}] +#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +#{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, +#{\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, From ec0f7f22aed7e96f3d987acf6d850a865a5eccad Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 21:21:46 +0200 Subject: [PATCH 2036/2732] Test --- iguana/exchanges/LP_include.h | 5 ++- iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_remember.c | 8 ++--- iguana/exchanges/LP_rpc.c | 1 + iguana/exchanges/LP_transaction.c | 42 +++++++++++++++++++------ iguana/exchanges/LP_utxo.c | 52 +++++++++++++++++++++++++++++++ iguana/exchanges/LP_utxos.c | 1 + iguana/exchanges/stats.c | 2 +- 8 files changed, 98 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 29c06f6ba..70dc2248b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -47,6 +47,9 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_PEERS 8 #define LP_MAX_PEERS 32 +#define LP_MAXDESIRED_UTXOS 128 +#define LP_MINDESIRED_UTXOS 64 + // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 #define LP_MAXPENDING_SWAPS 13 @@ -250,7 +253,7 @@ struct iguana_info UT_hash_handle hh; portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; - int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; + int32_t numutxos,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; uint32_t importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fd41a9857..1a92188a8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,7 +17,8 @@ // // LP_nativeDEX.c // marketmaker -// bots to do bobs +// +// autoadd dust utxo to vin for initial atomic tx // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 927af1771..594b1fd03 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -937,7 +937,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } for (j=0; j<32; j++) rev.bytes[j] = rswap.myprivs[0].bytes[31 - j]; - if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]); } LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); @@ -967,7 +967,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( bits256_nonz(rswap.privBn) != 0 ) { len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); } } @@ -1042,7 +1042,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[1],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) { int32_t z; for (z=0; z<20; z++) @@ -1073,7 +1073,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti vcalc_sha256(0,rswap.secretBn256,rswap.privBn.bytes,sizeof(rswap.privBn)); redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); len = basilisk_swapuserdata(userdata,rswap.privBn,0,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9b3345ab6..25f2c9b7d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -709,6 +709,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) if ( strcmp(coin->smartaddr,coinaddr) == 0 ) { retjson = LP_listunspent(symbol,coinaddr); + coin->numutxos = cJSON_GetArraySize(retjson); //printf("SELF_LISTUNSPENT.(%s %s)\n",symbol,coinaddr); } else if ( IAMLP == 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index e9f140178..87b395b8a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -603,9 +603,9 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ return(complete); } -char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys,int32_t zcash) +char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys,int32_t zcash) { - char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *items[2],*txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t i,completed,spendlen,n,ignore_cltverr=1; struct vin_info V[8]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; LP_mark_spent(symbol,utxotxid,utxovout); if ( txfee > 0 && txfee < 10000 ) txfee = 10000; @@ -617,9 +617,9 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch if ( redeemlen < 0 ) return(0); value = 0; -#ifndef BASILISK_DISABLESENDTX if ( (coin= LP_coinfind(symbol)) != 0 ) { +#ifndef BASILISK_DISABLESENDTX if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 ) { if ( (vouts= jarray(&n,txobj,"vout")) != 0 && utxovout < n ) @@ -629,16 +629,30 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch //printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0)); } free_json(txobj); - //if ( value != 0 ) - // gettxout } else printf("cant gettx\n"); if ( value == 0 ) { printf("basilisk_swap_bobtxspend.%s %s utxo.(%s).v%d already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid),utxovout); return(0); } - } + if ( coin->electrum != 0 || coin->numutxos < LP_MINDESIRED_UTXOS ) + dustcombine = 0; + else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) + dustcombine = 2; + if ( dustcombine != 0 ) + { + uint64_t more; + if ( privkey2p != 0 ) + dustcombine = 1; + memset(items,0,sizeof(items)); + more = LP_dustcombine(items,dustcombine,coin); + if ( more != 0 ) + printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); + value += more; + dustcombine = (items[0] != 0) + (items[1] != 0); + } #endif + } if ( satoshis != 0 ) { if ( value < satoshis+txfee ) @@ -696,6 +710,13 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch jaddistr(privkeys,wifstr); V[0].suppress_pubkeys = suppress_pubkeys; V[0].ignore_cltverr = ignore_cltverr; + for (i=0; iI.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys,coin->zcash)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(1,&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys,coin->zcash)) != 0 ) { rawtx->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( rawtx->I.datalen <= sizeof(rawtx->txbytes) ) @@ -1148,7 +1172,7 @@ int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t } for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys,zcash)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(0,&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys,zcash)) != 0 ) { dest->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( dest->I.datalen <= sizeof(dest->txbytes) ) @@ -1208,7 +1232,7 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wifta txfee = LP_MIN_TXFEE; } //txfee = LP_txfee(symbol); - signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1,zcash); + signedtx = basilisk_swap_bobtxspend(0,&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1,zcash); LP_mark_spent(symbol,utxotxid,utxovout); } return(signedtx); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 30f6a0ab7..9c226160d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -957,6 +957,58 @@ int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vo return(0); } +cJSON *LP_dustcombine_item(struct LP_address_utxo *up) +{ + cJSON *item = cJSON_CreateObject(); + jaddbits256(item,"txid",up->U.txid); + jaddnum(item,"vout",up->U.vout); + return(item); +} + +uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info *coin) +{ + struct LP_address *ap=0; struct LP_address_utxo *up,*tmp,*min0,*min1; cJSON *txobj; + if ( coin == 0 || coin->electrum != 0 || dustcombine <= 0 || dustcombine > 2 ) + return(0); + min1 = min0 = 0; + if ( (ap= _LP_addressfind(coin,coin->smartaddr)) != 0 ) + { + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->spendheight <= 0 && up->U.height > 0 && up->U.value != 0 ) + { + if ( (txobj= LP_gettxout(coin->symbol,coin->smartaddr,up->U.txid,up->U.vout)) == 0 ) + up->spendheight = 1; + else + { + free_json(txobj); + if ( LP_inventory_prevent(0,coin->symbol,up->U.txid,up->U.vout) == 0 && LP_inventory_prevent(1,coin->symbol,up->U.txid,up->U.vout) == 0 ) + { + if ( min1 == 0 || up->U.value < min1->U.value ) + { + if ( min0 == 0 || up->U.value < min0->U.value ) + { + min1 = min0; + min0 = up; + } else min1 = up; + } + } + } + } + } + } + if ( min0 != 0 ) + { + items[0] = LP_dustcombine_item(min0); + if ( dustcombine == 2 && min1 != 0 ) + { + items[1] = LP_dustcombine_item(min1); + return(min0->U.value + min1->U.value); + } else return(min0->U.value); + } + return(0); +} + int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) { int32_t i,ht,num = 0; struct LP_transaction *tx,*tmp; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 590ebcb30..6425637e8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -512,6 +512,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri txfee = LP_txfeecalc(coin,0,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { + coin->numutxos = n; //printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); for (iambob=0; iambob<=1; iambob++) { diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2cc747ae0..e56227223 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -598,7 +598,7 @@ void LP_rpc_processreq(void *_ptr) char filetype[128],content_type[128]; int32_t recvlen,flag,postflag=0,contentlen,remains,sock,numsent,jsonflag=0,hdrsize,len; char helpname[512],remoteaddr[64],*buf,*retstr,*space,*jsonbuf; struct rpcrequest_info *req = _ptr; - uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; + uint32_t ipbits,i,size = IGUANA_MAXPACKETSIZE + 512; ipbits = req->ipbits;; expand_ipbits(remoteaddr,ipbits); sock = req->sock; From 5179fa01001d53a025097b0cc235f43844f24c46 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 21:31:13 +0200 Subject: [PATCH 2037/2732] Test --- iguana/exchanges/LP_utxo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9c226160d..760641da8 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -970,6 +970,7 @@ uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info * struct LP_address *ap=0; struct LP_address_utxo *up,*tmp,*min0,*min1; cJSON *txobj; if ( coin == 0 || coin->electrum != 0 || dustcombine <= 0 || dustcombine > 2 ) return(0); +return(0); min1 = min0 = 0; if ( (ap= _LP_addressfind(coin,coin->smartaddr)) != 0 ) { From c1654d3710230608a8f1401c993ce3d2a3faabfb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:02:30 +0200 Subject: [PATCH 2038/2732] Test --- iguana/exchanges/LP_transaction.c | 4 ++++ iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 87b395b8a..fce01d038 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -647,7 +647,11 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t memset(items,0,sizeof(items)); more = LP_dustcombine(items,dustcombine,coin); if ( more != 0 ) + { printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); +memset(items,0,sizeof(items)); +more = 0 ; + } value += more; dustcombine = (items[0] != 0) + (items[1] != 0); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 760641da8..a1e6ce758 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -970,8 +970,8 @@ uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info * struct LP_address *ap=0; struct LP_address_utxo *up,*tmp,*min0,*min1; cJSON *txobj; if ( coin == 0 || coin->electrum != 0 || dustcombine <= 0 || dustcombine > 2 ) return(0); -return(0); min1 = min0 = 0; + printf("LP_dustcombine\n"); if ( (ap= _LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) From d7a9dc306e7d23dca5ce0f58e1472ac621f40037 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:08:45 +0200 Subject: [PATCH 2039/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 70dc2248b..cd39393ff 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -47,8 +47,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_PEERS 8 #define LP_MAX_PEERS 32 -#define LP_MAXDESIRED_UTXOS 128 -#define LP_MINDESIRED_UTXOS 64 +#define LP_MAXDESIRED_UTXOS 8 +#define LP_MINDESIRED_UTXOS 16 // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 From 8308444e64f037da3762c71ef8ad3a78bc2b7b5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:21:54 +0200 Subject: [PATCH 2040/2732] Activate dust combine --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index fce01d038..0c55bc5fd 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -649,8 +649,8 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t if ( more != 0 ) { printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); -memset(items,0,sizeof(items)); -more = 0 ; +//memset(items,0,sizeof(items)); +//more = 0 ; } value += more; dustcombine = (items[0] != 0) + (items[1] != 0); From 7d3bff1544286b25dcf1e108184b3f741c3f3e8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:42:17 +0200 Subject: [PATCH 2041/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + iguana/exchanges/LP_utxo.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 0c55bc5fd..7a8ec872b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -720,6 +720,7 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t V[i+1].suppress_pubkeys = 0; V[i+1].ignore_cltverr = 0; V[i+1].N = V[i+1].M = 1; + jaddistr(privkeys,wifstr); } if ( redeemlen != 0 ) memcpy(V[0].p2shscript,redeemscript,redeemlen), V[0].p2shlen = redeemlen; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a1e6ce758..2ccef6517 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1061,9 +1061,7 @@ void LP_unspents_load(char *symbol,char *addr) if ( (retjson= cJSON_Parse(arraystr)) != 0 ) { printf("PROCESS UNSPENTS %s\n",arraystr); - if ( electrum_process_array(coin,coin->electrum,coin->smartaddr,retjson,1) == 0 ) - printf("error electrum_process_array\n"); - else printf("processed %s\n",arraystr); + electrum_process_array(coin,coin->electrum,coin->smartaddr,retjson,1); free_json(retjson); } free(arraystr); From c97b78bf89b786d70b052aa1cf1db4ea67c80ea4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:51:15 +0200 Subject: [PATCH 2042/2732] Test --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 7a8ec872b..ec1f2549e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -649,8 +649,8 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t if ( more != 0 ) { printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); -//memset(items,0,sizeof(items)); -//more = 0 ; +memset(items,0,sizeof(items)); +more = 0 ; } value += more; dustcombine = (items[0] != 0) + (items[1] != 0); From aec5287830934d654b29ca4a9c84b5b313553c97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 02:28:39 +0200 Subject: [PATCH 2043/2732] Disable disabling electrum --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index dafac13b2..28b7d2e16 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1024,7 +1024,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) struct electrum_info *ep; int32_t already; cJSON *retjson; if ( ipaddr == 0 || ipaddr[0] == 0 || port == 0 ) { - coin->electrum = 0; + //coin->electrum = 0; + printf("would have disabled %s electrum here\n",coin->symbol); return(cJSON_Parse("{\"result\":\"success\",\"status\":\"electrum mode disabled, now in native coin mode\"}")); } retjson = cJSON_CreateObject(); From 26b6ba84ba1a1a767250154d88d73dff33937ec7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 03:38:25 +0200 Subject: [PATCH 2044/2732] Fixed price --- iguana/exchanges/LP_portfolio.c | 13 +++++++++++-- iguana/exchanges/LP_prices.c | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 5c94b9695..62b50d9d2 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -222,7 +222,7 @@ struct LP_autoprice_ref int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { //curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" - struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor; + struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor,fixedprice; //printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { @@ -232,6 +232,8 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) margin = jdouble(argjson,"margin"); offset = jdouble(argjson,"offset"); factor = jdouble(argjson,"factor"); + fixedprice = jdouble(argjson,"fixed"); + basepp->fixedprices[relpp->ind] = fixedprice; basepp->minprices[relpp->ind] = minprice; basepp->margins[relpp->ind] = margin; basepp->offsets[relpp->ind] = offset; @@ -267,9 +269,16 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP_priceinfo *relpp,double price,char *refbase,char *refrel) { static uint32_t lasttime; - double margin,minprice,newprice,oppomargin,factor,offset; double bid,ask; int32_t changed; + double margin,minprice,newprice,oppomargin,fixedprice,factor,offset; double bid,ask; int32_t changed; margin = basepp->margins[relpp->ind]; oppomargin = relpp->margins[basepp->ind]; + if ( (fixedprice= relpp->fixedprices[basepp->ind]) > SMALLVAL ) + { + LP_mypriceset(&changed,relpp->symbol,basepp->symbol,fixedprice); + printf("autoprice FIXED %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,fixedprice); + return; + } if ( margin != 0. || oppomargin != 0. ) { offset = basepp->offsets[relpp->ind]; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 84a699410..ae78a770d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -29,6 +29,7 @@ struct LP_priceinfo double relvals[LP_MAXPRICEINFOS]; double myprices[LP_MAXPRICEINFOS]; double minprices[LP_MAXPRICEINFOS]; // autoprice + double fixedprices[LP_MAXPRICEINFOS]; // fixedprices double margins[LP_MAXPRICEINFOS]; double offsets[LP_MAXPRICEINFOS]; double factors[LP_MAXPRICEINFOS]; From 60cc6c199f4448955cb7e3bc155fb253c348a18c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 11:24:33 +0200 Subject: [PATCH 2045/2732] QTUM --- iguana/exchanges/coins | 2 +- iguana/exchanges/coins.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index d81e18c4d..9b5789e13 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,4 +1,4 @@ -export coins="[{\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" #{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, #{\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, diff --git a/iguana/exchanges/coins.json b/iguana/exchanges/coins.json index 2fad617b6..320b6ccaf 100644 --- a/iguana/exchanges/coins.json +++ b/iguana/exchanges/coins.json @@ -1,4 +1,4 @@ -[{\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}] -#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +[{\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}] #{\"coin\":\"ZEN\",\"name\":\"zen\",\"rpcport\":8231,\"pubtype\":137,\"taddr\":32,\"p2shtype\":150,\"wiftype\":128,\"txfee\":10000}, #{\"coin\":\"BLK\",\"name\":\"blackcoin\",\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, From 43f663f388078a3c17b01584a83ddfa2b8eb15d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 12:52:05 +0200 Subject: [PATCH 2046/2732] Dustcombine in withdraw --- iguana/exchanges/LP_remember.c | 8 +- iguana/exchanges/LP_transaction.c | 156 +++++++++++++++++------------- iguana/exchanges/LP_utxo.c | 10 +- 3 files changed, 96 insertions(+), 78 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 594b1fd03..927af1771 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -937,7 +937,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } for (j=0; j<32; j++) rev.bytes[j] = rswap.myprivs[0].bytes[31 - j]; - if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"alicespend",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_ALICESPEND],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]); } LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]); @@ -967,7 +967,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( bits256_nonz(rswap.privBn) != 0 ) { len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICECLAIM]); } } @@ -1042,7 +1042,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[1],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[1],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBPAYMENT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_BOBRECLAIM],0,0,rswap.bobpaymentaddr,1,bob->zcash)) != 0 ) { int32_t z; for (z=0; z<20; z++) @@ -1073,7 +1073,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti vcalc_sha256(0,rswap.secretBn256,rswap.privBn.bytes,sizeof(rswap.privBn)); redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,rswap.privBn,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256); len = basilisk_swapuserdata(userdata,rswap.privBn,0,rswap.myprivs[0],redeemscript,redeemlen); - if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(0,&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) + if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 ) printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]); } LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ec1f2549e..4fc950db8 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -603,9 +603,9 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ return(complete); } -char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys,int32_t zcash) +char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys,int32_t zcash) { - char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *items[2],*txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t i,completed,spendlen,n,ignore_cltverr=1; struct vin_info V[8]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; + char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[8]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; LP_mark_spent(symbol,utxotxid,utxovout); if ( txfee > 0 && txfee < 10000 ) txfee = 10000; @@ -635,26 +635,6 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t printf("basilisk_swap_bobtxspend.%s %s utxo.(%s).v%d already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid),utxovout); return(0); } - if ( coin->electrum != 0 || coin->numutxos < LP_MINDESIRED_UTXOS ) - dustcombine = 0; - else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) - dustcombine = 2; - if ( dustcombine != 0 ) - { - uint64_t more; - if ( privkey2p != 0 ) - dustcombine = 1; - memset(items,0,sizeof(items)); - more = LP_dustcombine(items,dustcombine,coin); - if ( more != 0 ) - { - printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); -memset(items,0,sizeof(items)); -more = 0 ; - } - value += more; - dustcombine = (items[0] != 0) + (items[1] != 0); - } #endif } if ( satoshis != 0 ) @@ -714,14 +694,14 @@ more = 0 ; jaddistr(privkeys,wifstr); V[0].suppress_pubkeys = suppress_pubkeys; V[0].ignore_cltverr = ignore_cltverr; - for (i=0; iwiftaddr,wifstr,privkey,coin->wiftype); - for (i=n=0; iU.vout && bits256_cmp(utxotxid,up->U.txid) == 0 ) { - printf("error finding unspent i.%d of %d, %.8f vs %.8f\n",i,numunspents,dstr(remains),dstr(amount)); - return(0); + preselected[numpre++] = up; + utxos[j] = 0; + continue; } - if ( belowi < 0 || abovei >= 0 ) - ind = abovei; - else ind = belowi; - if ( ind < 0 ) + if ( up->spendheight <= 0 && up->U.height > 0 && up->U.value != 0 ) { - printf("error finding unspent i.%d of %d, %.8f vs %.8f, abovei.%d belowi.%d ind.%d\n",i,numunspents,dstr(remains),dstr(amount),abovei,belowi,ind); - return(0); + if ( (txobj= LP_gettxout(coin->symbol,coin->smartaddr,up->U.txid,up->U.vout)) == 0 ) + { + up->spendheight = 1; + utxos[j] = 0; + } + else + { + free_json(txobj); + if ( LP_inventory_prevent(1,coin->symbol,up->U.txid,up->U.vout) == 0 ) + { + if ( min1 == 0 || up->U.value < min1->U.value ) + { + if ( min0 == 0 || up->U.value < min0->U.value ) + { + min1 = min0; + min0 = up; + } else min1 = up; + } + } else utxos[j] = 0; + } + } + } + if ( dustcombine >= 1 && min0 != 0 ) + preselected[numpre++] = min0; + if ( dustcombine >= 2 && min1 != 0 ) + preselected[numpre++] = min1; + for (i=0; iU.txid),up->U.vout,dstr(up->U.value)); + } + else + { + below = above = 0; + abovei = belowi = -1; + if ( LP_vin_select(&abovei,&above,&belowi,&below,utxos,numunspents,remains,maxmode) < 0 ) + { + printf("error finding unspent i.%d of %d, %.8f vs %.8f\n",i,numunspents,dstr(remains),dstr(amount)); + return(0); + } + if ( belowi < 0 || abovei >= 0 ) + ind = abovei; + else ind = belowi; + if ( ind < 0 ) + { + printf("error finding unspent i.%d of %d, %.8f vs %.8f, abovei.%d belowi.%d ind.%d\n",i,numunspents,dstr(remains),dstr(amount),abovei,belowi,ind); + return(0); + } + up = utxos[ind]; + utxos[ind] = utxos[--numunspents]; + utxos[numunspents] = 0; } - up = utxos[ind]; - utxos[ind] = utxos[--numunspents]; - utxos[numunspents] = 0; total += up->U.value; remains -= up->U.value; if ( up->U.height < 7777777 && strcmp(coin->symbol,"KMD") == 0 ) @@ -929,8 +956,6 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ vp->suppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); - //printf("wif.%s i.%d privkeys.%s vins.%s %p %p\n",wifstr,i,jprint(privkeys,0),jprint(vins,0),privkeys,vins); - //printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains)); if ( remains <= 0 ) break; if ( numunspents == 0 ) @@ -943,10 +968,10 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(n); } -char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee) +char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout) { static void *ctx; - cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp,locktime; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp,locktime; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; @@ -961,6 +986,11 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf printf("LP_createrawtransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); return(0); } + if ( coin->electrum != 0 || coin->numutxos < LP_MINDESIRED_UTXOS ) + dustcombine = 0; + else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) + dustcombine = 2; + else dustcombine = 1; amount = txfee; for (i=0; itxfee; if ( ctx == 0 ) ctx = bitcoin_ctx(); @@ -1076,7 +1108,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); memset(V,0,sizeof(*V) * maxV); - if ( (rawtx= LP_createrawtransaction(&txobj,&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee)) != 0 ) + if ( (rawtx= LP_createrawtransaction(&txobj,&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee,utxotxid,utxovout)) != 0 ) { completed = 0; memset(&msgtx,0,sizeof(msgtx)); @@ -1138,7 +1170,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub txfee = LP_MIN_TXFEE; for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(1,&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys,coin->zcash)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys,coin->zcash)) != 0 ) { rawtx->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( rawtx->I.datalen <= sizeof(rawtx->txbytes) ) @@ -1177,7 +1209,7 @@ int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t } for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(0,&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys,zcash)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys,zcash)) != 0 ) { dest->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( dest->I.datalen <= sizeof(dest->txbytes) ) @@ -1224,20 +1256,12 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wifta //printf("pubAm.(%s)\n",bits256_str(str,pubAm)); //printf("pubBn.(%s)\n",bits256_str(str,pubBn)); spendlen = basilisk_alicescript(redeemscript,&redeemlen,spendscript,0,msigaddr,taddr,p2shtype,pubAm,pubBn); - //char str[65]; printf("%s utxo.(%s) redeemlen.%d spendlen.%d\n",msigaddr,bits256_str(str,utxotxid),redeemlen,spendlen); - /*rev = privAm; - for (i=0; i<32; i++) - privAm.bytes[i] = rev.bytes[31 - i]; - rev = privBn; - for (i=0; i<32; i++) - privBn.bytes[i] = rev.bytes[31 - i];*/ if ( (txfee= Atxfee) == 0 ) { if ( (txfee= LP_getestimatedrate(LP_coinfind(symbol)) * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; } - //txfee = LP_txfee(symbol); - signedtx = basilisk_swap_bobtxspend(0,&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1,zcash); + signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,utxovout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1,zcash); LP_mark_spent(symbol,utxotxid,utxovout); } return(signedtx); @@ -1656,12 +1680,6 @@ void basilisk_alicepayment(struct basilisk_swap *swap,struct iguana_info *coin,s { char coinaddr[64]; alicepayment->I.spendlen = basilisk_alicescript(alicepayment->redeemscript,&alicepayment->I.redeemlen,alicepayment->spendscript,0,alicepayment->I.destaddr,coin->taddr,coin->p2shtype,pubAm,pubBn); - /*for (i=0; i<33; i++) - printf("%02x",swap->persistent_pubkey33[i]); - printf(" pubkey33, "); - for (i=0; i<20; i++) - printf("%02x",swap->changermd160[i]); - printf(" rmd160, ");*/ bitcoin_address(coinaddr,coin->taddr,coin->pubtype,swap->changermd160,20); //printf("%s suppress.%d fee.%d\n",coinaddr,alicepayment->I.suppress_pubkeys,swap->myfee.I.suppress_pubkeys); basilisk_rawtx_gen(swap->ctx,"alicepayment",swap->I.started,swap->persistent_pubkey33,0,1,alicepayment,alicepayment->I.locktime,alicepayment->spendscript,alicepayment->I.spendlen,swap->I.Atxfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2ccef6517..bb9e9b224 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -965,13 +965,13 @@ cJSON *LP_dustcombine_item(struct LP_address_utxo *up) return(item); } -uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info *coin) +uint64_t LP_dustcombine(struct LP_address_utxo *ups[2],int32_t dustcombine,struct iguana_info *coin) { struct LP_address *ap=0; struct LP_address_utxo *up,*tmp,*min0,*min1; cJSON *txobj; if ( coin == 0 || coin->electrum != 0 || dustcombine <= 0 || dustcombine > 2 ) return(0); min1 = min0 = 0; - printf("LP_dustcombine\n"); + ups[0] = ups[1] = 0; if ( (ap= _LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -983,7 +983,7 @@ uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info * else { free_json(txobj); - if ( LP_inventory_prevent(0,coin->symbol,up->U.txid,up->U.vout) == 0 && LP_inventory_prevent(1,coin->symbol,up->U.txid,up->U.vout) == 0 ) + if ( LP_inventory_prevent(1,coin->symbol,up->U.txid,up->U.vout) == 0 ) { if ( min1 == 0 || up->U.value < min1->U.value ) { @@ -1000,10 +1000,10 @@ uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info * } if ( min0 != 0 ) { - items[0] = LP_dustcombine_item(min0); + ups[0] = min0; if ( dustcombine == 2 && min1 != 0 ) { - items[1] = LP_dustcombine_item(min1); + ups[1] = min1; return(min0->U.value + min1->U.value); } else return(min0->U.value); } From 165de053ae61fbe81ef93c5a2a2655a8cec20057 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 12:57:24 +0200 Subject: [PATCH 2047/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1a92188a8..23d598e95 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +// selftest and fix rpc port // autoadd dust utxo to vin for initial atomic tx // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 4fc950db8..ce2e973cb 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -986,7 +986,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf printf("LP_createrawtransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); return(0); } - if ( coin->electrum != 0 || coin->numutxos < LP_MINDESIRED_UTXOS ) + if ( coin->numutxos < LP_MINDESIRED_UTXOS ) dustcombine = 0; else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; From 2a112a68bb75836835abaeaf951d0528e88d174c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 13:00:33 +0200 Subject: [PATCH 2048/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ce2e973cb..b84434f93 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -991,6 +991,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; +dustcombine = 2; amount = txfee; for (i=0; i Date: Tue, 7 Nov 2017 13:41:40 +0200 Subject: [PATCH 2049/2732] Test --- iguana/exchanges/LP_transaction.c | 66 +++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b84434f93..d7acd2d44 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -968,10 +968,10 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(n); } -char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout) +char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout,uint32_t locktime) { static void *ctx; - cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp,locktime; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; @@ -991,7 +991,6 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; -dustcombine = 2; amount = txfee; for (i=0; isymbol) == 0 ) + if ( locktime == 0 && strcmp("KMD",coin->symbol) == 0 ) locktime = timestamp - 777; - else locktime = 0; txobj = bitcoin_txcreate(coin->symbol,coin->isPoS,locktime,1,timestamp); jdelete(txobj,"vin"); jadd(txobj,"vin",jduplicate(vins)); @@ -1084,7 +1082,9 @@ dustcombine = 2; char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t iter,utxovout,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; cJSON *retjson,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 utxotxid,signedtxid; uint64_t txfee,newtxfee=10000; + int32_t iter,utxovout,autofee,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signedtx=0,*rawtx=0; struct vin_info *V; uint32_t locktime; cJSON *retjson,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 utxotxid,signedtxid; uint64_t txfee,newtxfee=10000; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); if ( (outputs= jarray(&numvouts,argjson,"outputs")) == 0 ) { printf("no outputs in argjson (%s)\n",jprint(argjson,0)); @@ -1092,11 +1092,16 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) } utxotxid = jbits256(argjson,"utxotxid"); utxovout = jint(argjson,"utxovout"); - txfee = coin->txfee; - if ( ctx == 0 ) - ctx = bitcoin_ctx(); - if ( txfee > 0 && txfee < 10000 ) - txfee = 10000; + locktime = juint(argjson,"locktime"); + txfee = juint(argjson,"txfee"); + autofee = (strcmp(coin->symbol,"BTC") == 0); + if ( txfee == 0 ) + { + autofee = 1; + txfee = coin->txfee; + if ( txfee > 0 && txfee < 10000 ) + txfee = 10000; + } else autofee = 0; suppress_pubkeys = 0; memset(signedtxid.bytes,0,sizeof(signedtxid)); safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); @@ -1109,7 +1114,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); memset(V,0,sizeof(*V) * maxV); - if ( (rawtx= LP_createrawtransaction(&txobj,&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee,utxotxid,utxovout)) != 0 ) + if ( (rawtx= LP_createrawtransaction(&txobj,&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee,utxotxid,utxovout,locktime)) != 0 ) { completed = 0; memset(&msgtx,0,sizeof(msgtx)); @@ -1156,6 +1161,42 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pubkey33,int32_t iambob,int32_t lockinputs,struct basilisk_rawtx *rawtx,uint32_t locktime,uint8_t *script,int32_t scriptlen,int64_t txfee,int32_t minconf,int32_t delay,bits256 privkey,uint8_t *changermd160,char *vinaddr) { + struct iguana_info *coin; int32_t len,retval=-1; char *retstr,*hexstr; cJSON *argjson,*outputs,*item,*retjson,*obj; + if ( (coin= rawtx->coin) == 0 ) + return(-1); + if ( strcmp(coin->smartaddr,vinaddr) != 0 ) + { + printf("basilisk_rawtx_gen mismatched vinaddr.%s != %s\n",vinaddr,coin->smartaddr); + return(-1); + } + argjson = cJSON_CreateObject(); + jaddbits256(argjson,"utxotxid",rawtx->utxotxid); + jaddnum(argjson,"utxovout",rawtx->utxovout); + jadd64bits(argjson,"txfee",txfee); + outputs = cJSON_CreateArray(); + item = cJSON_CreateObject(); + jaddnum(item,rawtx->I.destaddr,dstr(rawtx->I.amount)); + jaddi(outputs,item); + jadd(argjson,"outputs",outputs); + if ( (retstr= LP_withdraw(coin,argjson)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (obj= jobj(retjson,"complete")) != 0 && is_cJSON_True(obj) != 0 && (hexstr= jstr(retjson,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 16 ) + { + rawtx->I.datalen = len >> 1; + decode_hex(rawtx->txbytes,rawtx->I.datalen,hexstr); + rawtx->I.completed = 1; + rawtx->I.signedtxid = jbits256(retjson,"txid"); + retval = 0; + } + free_json(retjson); + } + free(retstr); + } + free_json(argjson); + return(retval); +#ifdef old int32_t retval=-1,iter; char *signedtx,*changeaddr = 0,_changeaddr[64]; struct iguana_info *coin; int64_t newtxfee=0,destamount; char str2[65]; printf("%s rawtxgen.(%s/v%d)\n",rawtx->name,bits256_str(str2,rawtx->utxotxid),rawtx->utxovout); if ( (coin= rawtx->coin) == 0 ) @@ -1190,6 +1231,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub break; } return(retval); +#endif } int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,struct basilisk_swap *swap,struct basilisk_rawtx *dest,struct basilisk_rawtx *rawtx,bits256 privkey,bits256 *privkey2,uint8_t *userdata,int32_t userdatalen,int32_t ignore_cltverr,uint8_t *changermd160,char *vinaddr,int32_t zcash) From fdc0800201a149634b30ce0391911812c2f4af69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 13:50:13 +0200 Subject: [PATCH 2050/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 23d598e95..749dd11ae 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -602,7 +602,7 @@ void LP_coinsloop(void *_coins) { nonz++; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( 0 && up->SPV > 0 ) + if ( 1 && up->SPV > 0 ) printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } else if ( up->SPV == -1 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bb9e9b224..d66fe074e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -179,7 +179,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( up->SPV <= 0 || up->U.height == 0 ) { - printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); + //printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; continue; From 786fdddcaaba09ea606b83cf567abf2bc3e0d244 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 13:54:20 +0200 Subject: [PATCH 2051/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d66fe074e..1c2f158e8 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -177,7 +177,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a } else { - if ( up->SPV <= 0 || up->U.height == 0 ) + if ( up->SPV < 0 || up->U.height == 0 ) { //printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) From 0c864ae373df029ed97376a7f3b47b8314a793c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 13:57:54 +0200 Subject: [PATCH 2052/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 749dd11ae..59908163d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // selftest and fix rpc port +// quotevalidate to do SPV // autoadd dust utxo to vin for initial atomic tx // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections @@ -602,7 +603,7 @@ void LP_coinsloop(void *_coins) { nonz++; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( 1 && up->SPV > 0 ) + if ( 0 && up->SPV > 0 ) printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } else if ( up->SPV == -1 ) From e67abb39e8a6aae66cbd1c11ee327ac54cdb871c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 18:20:06 +0200 Subject: [PATCH 2053/2732] test --- iguana/exchanges/LP_include.h | 4 +-- iguana/exchanges/LP_ordermatch.c | 60 +++++++++++++++++++------------ iguana/exchanges/LP_transaction.c | 6 +++- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index cd39393ff..1920c475e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -47,8 +47,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_PEERS 8 #define LP_MAX_PEERS 32 -#define LP_MAXDESIRED_UTXOS 8 -#define LP_MINDESIRED_UTXOS 16 +#define LP_MAXDESIRED_UTXOS 128 +#define LP_MINDESIRED_UTXOS 32 // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6dd5837a9..d54e955e8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -654,32 +654,48 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); - printf("utxopairfind\n"); - if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) - butxo = &B; + //printf("utxopairfind\n"); + //if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) + // butxo = &B; //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; printf("request.(%s)\n",jprint(argjson,0)); - if ( 1 )//LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) > SMALLVAL ) { - LP_RTmetrics_update(Q.srccoin,Q.destcoin); - if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) + value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) { - printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); - return(retval); + LP_RTmetrics_update(Q.srccoin,Q.destcoin); + if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) + { + printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); + return(retval); + } + printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); + LP_listunspent_both(Q.srccoin,Q.coinaddr,0); + if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) + { + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; + printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); + } + else + { + printf("cant find utxopair\n"); + } } - printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); - LP_listunspent_both(Q.srccoin,Q.coinaddr,0); - if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) - { - Q.txid = butxo->payment.txid; - Q.vout = butxo->payment.vout; - Q.txid2 = butxo->deposit.txid; - Q.vout2 = butxo->deposit.vout; - printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); - } else printf("cant find utxopair\n"); + } + else + { + butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + } + /*if ( 1 )//LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + { //LP_abutxo_set(0,butxo,&Q); //LP_butxo_swapfields(butxo); } @@ -691,17 +707,17 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) printf("couldnt create bob's utxopair\n"); else printf("created butxo.(%s %s)\n",bits256_str(str,butxo->payment.txid),bits256_str(str2,butxo->deposit.txid)); - } + }*/ } - if ( butxo == 0 || butxo == &B ) - butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + /*if ( butxo == 0 || butxo == &B ) + / butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); if ( butxo == 0 || bits256_cmp(Q.txid,butxo->payment.txid) != 0 || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 ) { printf("%s %s null butxo.%p case\n",Q.srccoin,Q.coinaddr,butxo); value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); - } + }*/ char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d7acd2d44..6a9c15c1d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1776,12 +1776,16 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { + int32_t diff; if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) { printf("otherfee amount %.8f -> %s vs %s locktime %u vs %u\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr,swap->otherfee.I.locktime,swap->I.started+1); if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) { - if ( swap->otherfee.I.locktime == swap->I.started+1 ) + diff = swap->otherfee.I.locktime - (swap->I.started+1); + if ( diff < 0 ) + diff = -diff; + if ( diff < 30 ) printf("dexfee verified\n"); else printf("locktime mismatch in otherfee, reject %u vs %u\n",swap->otherfee.I.locktime,swap->I.started+1); return(0); From a9a23c86116c63925588f3fe8825d637869ca7f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 18:36:41 +0200 Subject: [PATCH 2054/2732] Test --- iguana/exchanges/LP_ordermatch.c | 87 ++++++++++++-------------------- 1 file changed, 33 insertions(+), 54 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d54e955e8..5bbf46545 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -596,7 +596,7 @@ int32_t LP_aliceonly(char *symbol) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,recalc,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { // LP_checksig @@ -633,6 +633,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } + price = ask; /*if ( coin->electrum != 0 ) { printf("electrum can only be for alice\n"); @@ -648,76 +649,54 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("bob is patching Q.coinaddr %s mismatch != %s\n",Q.coinaddr,coin->smartaddr); strcpy(Q.coinaddr,coin->smartaddr); } - price = ask; autxo = &A; butxo = &B; memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); - //printf("utxopairfind\n"); - //if ( (butxo= LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) - // butxo = &B; - //LP_butxo_swapfields(butxo); if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; - printf("request.(%s)\n",jprint(argjson,0)); - if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) > SMALLVAL ) + printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); + recalc = 0; + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) + recalc = 1; + else { value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) - { - LP_RTmetrics_update(Q.srccoin,Q.destcoin); - if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) - { - printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); - return(retval); - } - printf("butxo.%p replace path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); - LP_listunspent_both(Q.srccoin,Q.coinaddr,0); - if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) - { - Q.txid = butxo->payment.txid; - Q.vout = butxo->payment.vout; - Q.txid2 = butxo->deposit.txid; - Q.vout2 = butxo->deposit.vout; - printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); - } - else - { - printf("cant find utxopair\n"); - } - } - } - else - { - butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + recalc = 1; } - /*if ( 1 )//LP_allocated(butxo->payment.txid,butxo->payment.vout) != 0 || LP_allocated(butxo->deposit.txid,butxo->deposit.vout) != 0 || (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + if ( recalc != 0 ) { - //LP_abutxo_set(0,butxo,&Q); - //LP_butxo_swapfields(butxo); + LP_RTmetrics_update(Q.srccoin,Q.destcoin); + if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) + { + printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); + return(retval); + } + printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); + LP_listunspent_both(Q.srccoin,Q.coinaddr,0); + if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) + { + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; + printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); + } + else + { + printf("cant find utxopair\n"); + return(retval); + } } - else - { - printf("other path %p %p %.8f\n",LP_allocated(butxo->payment.txid,butxo->payment.vout),LP_allocated(butxo->deposit.txid,butxo->deposit.vout), LP_quote_validate(autxo,butxo,&Q,1)); - value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,G.LP_mypub25519,G.gui,0)) == 0 ) - printf("couldnt create bob's utxopair\n"); - else printf("created butxo.(%s %s)\n",bits256_str(str,butxo->payment.txid),bits256_str(str2,butxo->deposit.txid)); - }*/ } - /*if ( butxo == 0 || butxo == &B ) - / butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); - if ( butxo == 0 || bits256_cmp(Q.txid,butxo->payment.txid) != 0 || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 ) + else // "connect" { - printf("%s %s null butxo.%p case\n",Q.srccoin,Q.coinaddr,butxo); - value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); - butxo = LP_utxoadd(1,Q.srccoin,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,LP_gui,0); - }*/ + butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); + } char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { From d0470cff6e5a3e71693a9ac25874fcb52a195f92 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 18:40:33 +0200 Subject: [PATCH 2055/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5bbf46545..f3fd7d56d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -665,6 +665,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) recalc = 1; } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6425637e8..762315b04 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -292,7 +292,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { - char str[65],str2[65]; printf("REJECT %s iambob.%d %s utxoadd.(%.8f %.8f) %s/v%d %s/v%d\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); + char str[65],str2[65]; printf("REJECT (%s) iambob.%d %s utxoadd.(%.8f %.8f) %s/v%d %s/v%d\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); printf("session.%u addutxo %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } From 8ea8ed8abb699f0ac46839e1fe55f208bcb2372c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 19:01:03 +0200 Subject: [PATCH 2056/2732] Test --- iguana/exchanges/LP_transaction.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6a9c15c1d..2fa93648b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -865,7 +865,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value) int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine) { - char wifstr[128],spendscriptstr[128]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t interest,interestsum,above,below,remains = amount,total = 0; + char wifstr[128],spendscriptstr[128]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; *totalp = 0; interestsum = 0; init_hexbytes_noT(spendscriptstr,script,scriptlen); @@ -879,6 +879,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ if ( utxovout == up->U.vout && bits256_cmp(utxotxid,up->U.txid) == 0 ) { preselected[numpre++] = up; + printf("found utxotxid in slot.%d\n",j); utxos[j] = 0; continue; } @@ -906,6 +907,24 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } } } + if ( bits256_nonz(utxotxid) != 0 && numpre == 0 ) + { + up = LP_address_utxofind(coin,coin->smartaddr,utxotxid,utxovout); + printf("have utxotxid but wasnt found up.%p\n",up); + if ( up == 0 ) + { + value = LP_txvalue(coin->smartaddr,coin->symbol,utxotxid,utxovout); + LP_address_utxoadd("withdraw",coin,coin->smartaddr,utxotxid,utxovout,value,1,-1); + printf("added after not finding\n"); + } + if ( (up= LP_address_utxofind(coin,coin->smartaddr,utxotxid,utxovout)) != 0 ) + preselected[numpre++] = up; + else + { + printf("couldnt add address_utxo after not finding\n"); + return(0); + } + } if ( dustcombine >= 1 && min0 != 0 ) preselected[numpre++] = min0; if ( dustcombine >= 2 && min1 != 0 ) From 978f687a6797c2f6a5c5d7cb900b744c1682e254 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 19:07:12 +0200 Subject: [PATCH 2057/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f3fd7d56d..d73ff53f5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -663,8 +663,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; else { - value = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(Q.coinaddr,Q.srccoin,Q.txid2,Q.vout2); + char tmp[64]; + value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) recalc = 1; From e595ef7c13daf89fe64828c4174661c647507b1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 19:16:58 +0200 Subject: [PATCH 2058/2732] Test --- iguana/exchanges/LP_utxo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1c2f158e8..b66f73930 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -886,13 +886,25 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( coin != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) + { + printf("txid spent\n"); return(0); + } if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 ) + { + printf("txid2 spent\n"); return(0); + } if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) + { + printf("txid %s spentB\n",destaddr); return(0); + } if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) + { + printf("txid2 %s spentB\n",destaddr); return(0); + } } return(1); } From c81f33264340ddfcff9b2a871b1bab09c5487706 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 19:18:52 +0200 Subject: [PATCH 2059/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d73ff53f5..582dc3733 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -83,7 +83,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str { if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { - printf("bob not eligible %s\n",jprint(LP_quotejson(qp),1)); + printf("bob not eligible %s (%.8f %.8f)\n",jprint(LP_quotejson(qp),1),dstr(srcvalue),dstr(srcvalue2)); return(-2); } if ( (txout= LP_gettxout(qp->srccoin,qp->coinaddr,qp->txid,qp->vout)) != 0 ) From 8f0d139bb371cfd20a0bcb155bfed73209f70bc1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 19:25:50 +0200 Subject: [PATCH 2060/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 2fa93648b..017f8455e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -929,6 +929,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ preselected[numpre++] = min0; if ( dustcombine >= 2 && min1 != 0 ) preselected[numpre++] = min1; + printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d\n",dustcombine,numpre,min0,min1,numunspents); for (i=0; i Date: Tue, 7 Nov 2017 19:45:00 +0200 Subject: [PATCH 2061/2732] Test --- iguana/exchanges/LP_transaction.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 017f8455e..d5b3db7cd 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -930,7 +930,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ if ( dustcombine >= 2 && min1 != 0 ) preselected[numpre++] = min1; printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d\n",dustcombine,numpre,min0,min1,numunspents); - for (i=0; isuppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); - if ( remains <= 0 ) + if ( remains <= 0 && i >= numpre ) break; if ( numunspents == 0 ) { @@ -991,7 +991,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout,uint32_t locktime) { static void *ctx; - cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[64]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; @@ -1081,7 +1081,9 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } bitcoin_addr2rmd160(coin->taddr,&addrtype,rmd160,coinaddr); - spendlen = bitcoin_standardspend(spendscript,0,rmd160); + if ( addrtype == coin->pubtype ) + spendlen = bitcoin_standardspend(spendscript,0,rmd160); + else spendlen = bitcoin_p2shspend(spendscript,0,rmd160); txobj = bitcoin_txoutput(txobj,spendscript,spendlen,value + adjust); } else From 8d987a697956954cd151ec934e54bdfffb83fdfd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 19:53:10 +0200 Subject: [PATCH 2062/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d5b3db7cd..cd81192cc 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1194,6 +1194,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub argjson = cJSON_CreateObject(); jaddbits256(argjson,"utxotxid",rawtx->utxotxid); jaddnum(argjson,"utxovout",rawtx->utxovout); + jaddnum(argjson,"locktime",locktime); jadd64bits(argjson,"txfee",txfee); outputs = cJSON_CreateArray(); item = cJSON_CreateObject(); From 89a7dce8dc8ec73b31530df8ed28fa3850a23874 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 20:10:57 +0200 Subject: [PATCH 2063/2732] Test --- iguana/exchanges/LP_transaction.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index cd81192cc..bea8733c9 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -905,7 +905,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } } else utxos[j] = 0; } - } + } else utxos[j] = 0; } if ( bits256_nonz(utxotxid) != 0 && numpre == 0 ) { @@ -1011,6 +1011,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; +dustcombine = 2; amount = txfee; for (i=0; imyfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); bitcoin_address(coinaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->changermd160,20); - if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,0,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) + if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,swap->myfee.I.locktime,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) { printf("rawtxsend %s %.8f\n",swap->myfee.coin->symbol,dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); swap->I.statebits |= LP_swapdata_rawtxsend(pairsock,swap,0x80,data,maxlen,&swap->myfee,0x40,0); From 153fdbfbc6f629e1a287e071b1cd5f89d38a5486 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 20:20:05 +0200 Subject: [PATCH 2064/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index bea8733c9..a2537ba16 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1011,7 +1011,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; -dustcombine = 2; +dustcombine = 0; amount = txfee; for (i=0; i Date: Tue, 7 Nov 2017 20:30:31 +0200 Subject: [PATCH 2065/2732] Test --- iguana/exchanges/LP_transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a2537ba16..eceb35d2a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -892,7 +892,6 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } else { - free_json(txobj); if ( LP_inventory_prevent(1,coin->symbol,up->U.txid,up->U.vout) == 0 ) { if ( min1 == 0 || up->U.value < min1->U.value ) @@ -904,6 +903,9 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } else min1 = up; } } else utxos[j] = 0; + if ( utxos[j] != 0 ) + printf("gettxout j.%d (%s)\n",j,jprint(txobj,0)); + free_json(txobj); } } else utxos[j] = 0; } @@ -976,7 +978,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ vp->suppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); - if ( remains <= 0 && i >= numpre ) + if ( remains <= 0 && i >= numpre-1 ) break; if ( numunspents == 0 ) { From 22f4e2d0e14febc78f2ac28c5bc6ca0998285508 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 20:40:25 +0200 Subject: [PATCH 2066/2732] Test --- iguana/exchanges/LP_transaction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index eceb35d2a..8c3796eee 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -865,7 +865,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value) int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine) { - char wifstr[128],spendscriptstr[128]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; + char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; *totalp = 0; interestsum = 0; init_hexbytes_noT(spendscriptstr,script,scriptlen); @@ -904,7 +904,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } } else utxos[j] = 0; if ( utxos[j] != 0 ) - printf("gettxout j.%d (%s)\n",j,jprint(txobj,0)); + printf("gettxout j.%d %s/v%d (%s)\n",j,bits256_str(str,up->U.txid),up->U.vout,jprint(txobj,0)); free_json(txobj); } } else utxos[j] = 0; @@ -1013,7 +1013,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; -dustcombine = 0; +dustcombine = 2; amount = txfee; for (i=0; i Date: Tue, 7 Nov 2017 20:43:10 +0200 Subject: [PATCH 2067/2732] Test --- iguana/exchanges/LP_transaction.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 8c3796eee..b23e44d96 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -694,14 +694,6 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch jaddistr(privkeys,wifstr); V[0].suppress_pubkeys = suppress_pubkeys; V[0].ignore_cltverr = ignore_cltverr; - /*for (i=0; iotherfee.I.locktime - (swap->I.started+1); if ( diff < 0 ) diff = -diff; - if ( diff < 30 ) + if ( diff == 0 ) printf("dexfee verified\n"); else printf("locktime mismatch in otherfee, reject %u vs %u\n",swap->otherfee.I.locktime,swap->I.started+1); return(0); From 25883e2a1cbdf291423a98b4fe30e8cdb7c3adee Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 20:48:17 +0200 Subject: [PATCH 2068/2732] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b23e44d96..7d616fd4b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -949,6 +949,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ utxos[ind] = utxos[--numunspents]; utxos[numunspents] = 0; } + up->spendheight = 1; total += up->U.value; remains -= up->U.value; if ( up->U.height < 7777777 && strcmp(coin->symbol,"KMD") == 0 ) From 0022c5b86c669fdeb55a960982ee84bc95c58e86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 20:54:47 +0200 Subject: [PATCH 2069/2732] Test --- iguana/exchanges/LP_transaction.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 7d616fd4b..d6c9407ac 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -916,9 +916,9 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(0); } } - if ( dustcombine >= 1 && min0 != 0 ) + if ( dustcombine >= 1 && min0 != 0 && min0->U.value < SATOSHIDEN ) preselected[numpre++] = min0; - if ( dustcombine >= 2 && min1 != 0 ) + if ( dustcombine >= 2 && min1 != 0 && min1->U.value < SATOSHIDEN ) preselected[numpre++] = min1; printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d\n",dustcombine,numpre,min0,min1,numunspents); for (i=0; inumutxos >= LP_MINDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; -dustcombine = 2; amount = txfee; for (i=0; i Date: Tue, 7 Nov 2017 21:04:07 +0200 Subject: [PATCH 2070/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d6c9407ac..ee7d28a07 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1037,7 +1037,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) { printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); - return(0); + //return(0); } ignore_cltverr = 0; suppress_pubkeys = 1; From 3b48785e8ce4cdf6a73cac166a7c2c7d168b5269 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 21:27:53 +0200 Subject: [PATCH 2071/2732] Test --- iguana/exchanges/LP_commands.c | 12 ++++++------ iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f7927ba8a..af12cb1c2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -69,12 +69,12 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r printf("stats_JSON no method: (%s) (%s:%u)\n",jprint(argjson,0),ipaddr,argport); return(0); } - /*if ( strcmp(method,"hello") == 0 ) - { - //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); - return(0); - } - else*/ if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) + if ( strcmp(method,"hello") == 0 ) + { + //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); + return(clonestr("{\"result\":\"success\",\"status\":\"got hello\"}")); + } + else if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ee7d28a07..595f505b0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -892,7 +892,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } else min1 = up; } } else utxos[j] = 0; - if ( utxos[j] != 0 ) + if ( 0 && utxos[j] != 0 ) printf("gettxout j.%d %s/v%d (%s)\n",j,bits256_str(str,up->U.txid),up->U.vout,jprint(txobj,0)); free_json(txobj); } From c05c7629be6fc387791911beb0399568dac24d64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 21:41:41 +0200 Subject: [PATCH 2072/2732] Test --- iguana/exchanges/LP_transaction.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 595f505b0..6e2b4db1d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -854,7 +854,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value) int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine) { - char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; + char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; struct electrum_info *ep,*backupep; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; *totalp = 0; interestsum = 0; init_hexbytes_noT(spendscriptstr,script,scriptlen); @@ -916,10 +916,12 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(0); } } - if ( dustcombine >= 1 && min0 != 0 && min0->U.value < SATOSHIDEN ) + if ( dustcombine >= 1 && min0 != 0 && min0->U.value < SATOSHIDEN && (coin->electrum == 0 || min0->SPV > 0) ) preselected[numpre++] = min0; - if ( dustcombine >= 2 && min1 != 0 && min1->U.value < SATOSHIDEN ) + else min0 = 0; + if ( dustcombine >= 2 && min1 != 0 && min1->U.value < SATOSHIDEN && (coin->electrum == 0 || min1->SPV > 0) ) preselected[numpre++] = min1; + else min1 = 0; printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d\n",dustcombine,numpre,min0,min1,numunspents); for (i=0; ielectrum) != 0 && up->SPV <= 0 ) + { + if ( up->SPV < 0 ) + continue; + if ( (backupep= ep->prev) == 0 ) + backupep = ep; + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV <= 0 ) + continue; + } } + up->spendheight = 1; total += up->U.value; remains -= up->U.value; From 59e0222ef07aadd400026cc0502e0c617c180bf1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 21:59:46 +0200 Subject: [PATCH 2073/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1920c475e..d0d2d282b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -39,7 +39,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 20 -#define ELECTRUM_TIMEOUT 10 +#define ELECTRUM_TIMEOUT 20 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 From 2f5cb12eddc48e0ade407d2068e21ba7a99c1e10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 22:12:27 +0200 Subject: [PATCH 2074/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 59908163d..b9ecb4f8a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -595,6 +595,7 @@ void LP_coinsloop(void *_coins) backupep = ep; HASH_ITER(hh,coin->addresses,ap,atmp) { + break; DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->U.height > 0 && up->spendheight < 0 ) From b018ee6374b1ea1156b534adb425cd6dfd73cb18 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 22:29:04 +0200 Subject: [PATCH 2075/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 54 +++++++++++++++++++++++++++++-- iguana/exchanges/LP_transaction.c | 14 ++------ 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d0d2d282b..bafcc2950 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -408,6 +408,7 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_destaddr(char *destaddr,cJSON *item); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey); +int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); int32_t LP_mempoolscan(char *symbol,bits256 searchtxid); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b9ecb4f8a..86bb4fcdd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -595,7 +595,7 @@ void LP_coinsloop(void *_coins) backupep = ep; HASH_ITER(hh,coin->addresses,ap,atmp) { - break; + break; // causes timeouts probably due to too much usage, SPV validation done on tx spending DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->U.height > 0 && up->spendheight < 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 582dc3733..8130706bf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -246,7 +246,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a //printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); if ( up->spendheight <= 0 ) { - if ( (coin->electrum == 0 || up->SPV > 0) && dist >= 0 && dist < mindist ) + if ( dist >= 0 && dist < mindist ) //(coin->electrum == 0 || up->SPV > 0) && { //printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); mini = i; @@ -594,6 +594,26 @@ int32_t LP_aliceonly(char *symbol) else return(0); } +int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) +{ + struct electrum_info *ep,*backupep; struct LP_address_utxo *up; struct iguana_info *coin; + coin = LP_coinfind(symbol); + if ( coin != 0 && (ep= coin->electrum) != 0 ) + { + if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) + { + if ( up->SPV < 0 ) + return(-1); + if ( (backupep= ep->prev) == 0 ) + backupep = ep; + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV <= 0 ) + return(-1); + } + } + return(0); +} + int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,recalc,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); @@ -605,8 +625,28 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_tradecommand_log(argjson); //printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); retval = 1; + if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) + { + printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); + return(retval); + } + else if (LP_validSPV(Q.destcoin,Q.destaddr,Q.feetxid,Q.feevout) < 0 ) + { + printf("%s dexfee %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.feetxid)); + return(retval); + } if ( strcmp(method,"reserved") == 0 ) { + if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) + { + printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); + return(retval); + } + else if (LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid2,Q.vout2) < 0 ) + { + printf("%s src2 %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid2)); + return(retval); + } if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); @@ -620,7 +660,17 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { - //printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); + if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) + { + printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); + return(retval); + } + else if (LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid2,Q.vout2) < 0 ) + { + printf("%s src2 %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid2)); + return(retval); + } + //printf("alice %s received CONNECTED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_connectedalice(argjson)) != 0 ) free(retstr); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6e2b4db1d..48e710878 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -854,7 +854,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value) int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine) { - char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; struct electrum_info *ep,*backupep; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; + char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; *totalp = 0; interestsum = 0; init_hexbytes_noT(spendscriptstr,script,scriptlen); @@ -955,16 +955,8 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ break; if ( j < numpre ) continue; - if ( (ep= coin->electrum) != 0 && up->SPV <= 0 ) - { - if ( up->SPV < 0 ) - continue; - if ( (backupep= ep->prev) == 0 ) - backupep = ep; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV <= 0 ) - continue; - } + if ( LP_validSPV(coin->symbol,coin->smartaddr,up->U.txid,up->U.vout) < 0 ) + continue; } up->spendheight = 1; From 821ed9528e0e6d77aecfa008c391723fe5f0aa62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 22:35:26 +0200 Subject: [PATCH 2076/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 25f2c9b7d..959000fee 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -578,7 +578,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) return(retjson); } } - printf("couldnt find %s/v%d\n",bits256_str(str,txid),vout); + printf("couldnt find %s (%s) %s/v%d\n",symbol,coinaddr,bits256_str(str,txid),vout); return(cJSON_Parse("{\"error\":\"couldnt get tx\"}")); } } From 31b600ea2c1ee7d54f634e600bcac7158b3e9c04 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 22:49:40 +0200 Subject: [PATCH 2077/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 28b7d2e16..c609a62d4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -602,7 +602,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON if ( strcmp(addr,coin->smartaddr) == 0 ) { retstr = jprint(retjson,0); - LP_unspents_cache(coin->symbol,coin->smartaddr,retstr,updatedflag); + LP_unspents_cache(coin->symbol,coin->smartaddr,retstr,1); free(retstr); } if ( ap != 0 ) From 47817e762c8bb13c3ad58d9ea3065f8a5ef5106d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:02:32 +0200 Subject: [PATCH 2078/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_utxo.c | 50 +++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index bafcc2950..1f63d7f2d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -408,6 +408,7 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_destaddr(char *destaddr,cJSON *item); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey); +uint64_t LP_unspents_load(char *symbol,char *addr); int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b66f73930..4cbe86e58 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -472,13 +472,38 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*retjson; int32_t i,n; uint64_t balance = 0; - if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + cJSON *array,*retjson,*item; int32_t i,n; uint64_t balance = 0; + if ( coin->electrum == 0 ) { - if ( (n= cJSON_GetArraySize(array)) > 0 ) + if ( (array= LP_listunspent(coin->symbol,coinaddr)) != 0 ) { - for (i=0; i 0 ) + { + for (i=0; ismartaddr,coinaddr) == 0 ) + balance = LP_unspents_load(coin->symbol,coinaddr); + else + { + if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i 0 ) + { + for (i=0; ielectrum,coin->smartaddr,retjson,1); free_json(retjson); } free(arraystr); } } + return(balance); } From 039476f993ddb83a6cbf257264eafdf3202914ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:06:07 +0200 Subject: [PATCH 2079/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1f63d7f2d..4ccfa4d71 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -49,6 +49,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAXDESIRED_UTXOS 128 #define LP_MINDESIRED_UTXOS 32 +#define LP_DUSTCOMBINE_THRESHOLD 1000000 // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 48e710878..3148e9f0f 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -916,10 +916,10 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(0); } } - if ( dustcombine >= 1 && min0 != 0 && min0->U.value < SATOSHIDEN && (coin->electrum == 0 || min0->SPV > 0) ) + if ( dustcombine >= 1 && min0 != 0 && min0->U.value < LP_DUSTCOMBINE_THRESHOLD && (coin->electrum == 0 || min0->SPV > 0) ) preselected[numpre++] = min0; else min0 = 0; - if ( dustcombine >= 2 && min1 != 0 && min1->U.value < SATOSHIDEN && (coin->electrum == 0 || min1->SPV > 0) ) + if ( dustcombine >= 2 && min1 != 0 && min1->U.value < LP_DUSTCOMBINE_THRESHOLD && (coin->electrum == 0 || min1->SPV > 0) ) preselected[numpre++] = min1; else min1 = 0; printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d\n",dustcombine,numpre,min0,min1,numunspents); From b4ba8618654e1b22e9312e38fba0a9f9d54ae7da Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:10:54 +0200 Subject: [PATCH 2080/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 86bb4fcdd..97b9e042a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -627,7 +627,7 @@ void LP_coinsloop(void *_coins) if ( time(NULL) > ep->keepalive+LP_ELECTRUM_KEEPALIVE ) { //printf("%s electrum.%p needs a keepalive: lag.%d\n",ep->symbol,ep,(int32_t)(time(NULL) - ep->keepalive)); - if ( (retjson= electrum_donation(ep->symbol,ep,&retjson)) != 0 ) + if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,1)) != 0 ) free_json(retjson); } ep = ep->prev; From 34d129f955541e961c1debb69a1df4531abc035d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:19:11 +0200 Subject: [PATCH 2081/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 8 ++++++-- iguana/exchanges/stats.c | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4ccfa4d71..0e7ce20b1 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -255,7 +255,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t numutxos,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; + uint32_t lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 97b9e042a..0294018d3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,8 +19,6 @@ // marketmaker // // selftest and fix rpc port -// quotevalidate to do SPV -// autoadd dust utxo to vin for initial atomic tx // verify portfolio, interest to KMD withdraw // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -622,6 +620,12 @@ void LP_coinsloop(void *_coins) } } } + if ( time(NULL) > coin->lastunspent+30 ) + { + if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,1)) != 0 ) + free_json(retjson); + coin->lastunspent = (uint32_t)time(NULL); + } while ( ep != 0 ) { if ( time(NULL) > ep->keepalive+LP_ELECTRUM_KEEPALIVE ) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index e56227223..cd1249c0b 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -740,30 +740,31 @@ void LP_rpc_processreq(void *_ptr) } extern int32_t IAMLP; +int32_t LP_bindsock = -1; void stats_rpcloop(void *args) { static uint32_t counter; - uint16_t port; int32_t retval,sock,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; + uint16_t port; int32_t retval,sock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); while ( 1 ) { - if ( bindsock < 0 ) + if ( LP_bindsock < 0 ) { - while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); if ( counter++ < 1 ) - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); } clilen = sizeof(cli_addr); - sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); + sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); - close(bindsock); - bindsock = -1; + close(LP_bindsock); + LP_bindsock = -1; continue; } memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); @@ -775,8 +776,8 @@ continue; if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); - close(bindsock); - bindsock = -1; + close(LP_bindsock); + LP_bindsock = -1; portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req2,rtmp) { From 52e69dfba5291773ee441be20a269d3e5928bde6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:22:42 +0200 Subject: [PATCH 2082/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0294018d3..3d16e7dba 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -622,6 +622,7 @@ void LP_coinsloop(void *_coins) } if ( time(NULL) > coin->lastunspent+30 ) { + printf("call electrum listunspent.%s\n",coin->symbol); if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,1)) != 0 ) free_json(retjson); coin->lastunspent = (uint32_t)time(NULL); From db32a9faf2a04993cabaa30c4eb6cdaf97dd923f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:25:42 +0200 Subject: [PATCH 2083/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3d16e7dba..8c877aec4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -623,7 +623,7 @@ void LP_coinsloop(void *_coins) if ( time(NULL) > coin->lastunspent+30 ) { printf("call electrum listunspent.%s\n",coin->symbol); - if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,1)) != 0 ) + if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,2)) != 0 ) free_json(retjson); coin->lastunspent = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c609a62d4..c759c764d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -591,11 +591,11 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON usecache = 0; } //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); - if ( usecache == 0 ) + if ( usecache == 0 || electrumflag > 1 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); + printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr), updatedflag = 1; From c655a72ed37c083d33d935ca56142a4167f64228 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:27:42 +0200 Subject: [PATCH 2084/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8c877aec4..0ba43d0b2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -622,7 +622,7 @@ void LP_coinsloop(void *_coins) } if ( time(NULL) > coin->lastunspent+30 ) { - printf("call electrum listunspent.%s\n",coin->symbol); + //printf("call electrum listunspent.%s\n",coin->symbol); if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,2)) != 0 ) free_json(retjson); coin->lastunspent = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c759c764d..1670591f9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -595,7 +595,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); + //printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr), updatedflag = 1; From 0da65da7b0ebaa0129f91fd797f30c4c022bbbbd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:33:14 +0200 Subject: [PATCH 2085/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++++ iguana/exchanges/stats.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0ba43d0b2..76e348c68 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,6 +1179,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); + if ( (rand() % 10000) == 0 ) + { + printf("rpc port reset test\n"); + closesocket(LP_bindsock); + LP_bindsock = -1; + } } #endif } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index cd1249c0b..24f78f5bf 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -743,7 +743,7 @@ extern int32_t IAMLP; int32_t LP_bindsock = -1; void stats_rpcloop(void *args) { - static uint32_t counter; + //static uint32_t counter; uint16_t port; int32_t retval,sock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; @@ -755,7 +755,7 @@ void stats_rpcloop(void *args) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); - if ( counter++ < 1 ) + //if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); } clilen = sizeof(cli_addr); @@ -763,7 +763,7 @@ void stats_rpcloop(void *args) if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); - close(LP_bindsock); + closesocket(LP_bindsock); LP_bindsock = -1; continue; } @@ -776,7 +776,7 @@ continue; if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); - close(LP_bindsock); + closesocket(LP_bindsock); LP_bindsock = -1; portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req2,rtmp) From 1b8bc2269e7fafb1cd835f4cfbbcd8894e940591 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:35:20 +0200 Subject: [PATCH 2086/2732] Test --- iguana/exchanges/LP_socket.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 1670591f9..3eef131f4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -595,23 +595,33 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) { - //printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); - updatedflag = 0; - if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) - LP_postutxos(coin->symbol,addr), updatedflag = 1; - if ( strcmp(addr,coin->smartaddr) == 0 ) + if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - retstr = jprint(retjson,0); - LP_unspents_cache(coin->symbol,coin->smartaddr,retstr,1); - free(retstr); + //printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); + updatedflag = 0; + if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) + LP_postutxos(coin->symbol,addr), updatedflag = 1; + if ( strcmp(addr,coin->smartaddr) == 0 ) + { + retstr = jprint(retjson,0); + LP_unspents_cache(coin->symbol,coin->smartaddr,retstr,1); + free(retstr); + } + if ( ap != 0 ) + { + ap->unspenttime = (uint32_t)time(NULL); + ap->unspentheight = height; + } } - if ( ap != 0 ) + else { - ap->unspenttime = (uint32_t)time(NULL); - ap->unspentheight = height; + free_json(retjson); + retjson = 0; } } - } else retjson = LP_address_utxos(coin,addr,1); + } + if ( retjson == 0 ) + retjson = LP_address_utxos(coin,addr,1); return(retjson); } From 6121f31a274c8244bd7fff98f8ca55ff9bf455ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:35:59 +0200 Subject: [PATCH 2087/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 76e348c68..960c5ffd3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,7 +1179,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( (rand() % 10000) == 0 ) + if ( (rand() % 100) == 0 ) { printf("rpc port reset test\n"); closesocket(LP_bindsock); From 1ca201edcbbab6f52641f38d3afc1d2afa697afa Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:38:06 +0200 Subject: [PATCH 2088/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 960c5ffd3..526b3d9db 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,12 +1179,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( (rand() % 100) == 0 ) - { - printf("rpc port reset test\n"); - closesocket(LP_bindsock); - LP_bindsock = -1; - } + printf("mainloop\n"); } #endif } From 9f2bd77cd4c5827370afcde8128fb1d7051fe080 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:43:52 +0200 Subject: [PATCH 2089/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +++++++- iguana/exchanges/LP_utxos.c | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 526b3d9db..da0bd67fd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,7 +1179,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - printf("mainloop\n"); + if ( (rand() % 10000) == 0 ) + { + int32_t sock = LP_bindsock; + printf("bindsock reset test\n"); + LP_bindsock = -1; + closesocket(sock); + } } #endif } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 762315b04..a162aab5a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -826,6 +826,7 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) G.LP_sessionid = (uint32_t)time(NULL); safecopy(G.gui,gui,sizeof(G.gui)); G.USERPASS_COUNTER = counter; + G.initializing = 0; return(0); } From 5843dafb781e1a78fec52144149a281854f5bd10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:51:55 +0200 Subject: [PATCH 2090/2732] Test --- iguana/exchanges/LP_commands.c | 5 ++++- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/stats.c | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index af12cb1c2..b6cb2291c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -375,7 +375,10 @@ bot_resume(botid)\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { ptr->inactive = 0; - return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); + retstr = jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1); + if ( ptr->electrum != 0 && (retjson= electrum_address_listunspent(ptr->symbol,ptr->electrum,&retjson,ptr->smartaddr,2)) != 0 ) + free_json(retjson); + return(retstr); } else return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"sendrawtransaction") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index da0bd67fd..4c4c8a7ee 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,13 +1179,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( (rand() % 10000) == 0 ) + /*if ( (rand() % 1000) == 0 ) { int32_t sock = LP_bindsock; printf("bindsock reset test\n"); LP_bindsock = -1; closesocket(sock); - } + }*/ } #endif } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 24f78f5bf..0c5cab321 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -751,6 +751,7 @@ void stats_rpcloop(void *args) localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); while ( 1 ) { + printf("LP_bindsock.%d\n",LP_bindsock); if ( LP_bindsock < 0 ) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) From a327d58dbb8703643e0c1f2d6671f98a5f0eb810 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:52:06 +0200 Subject: [PATCH 2091/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 0c5cab321..fe31d3888 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -751,7 +751,7 @@ void stats_rpcloop(void *args) localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); while ( 1 ) { - printf("LP_bindsock.%d\n",LP_bindsock); + //printf("LP_bindsock.%d\n",LP_bindsock); if ( LP_bindsock < 0 ) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) From 771bbf1d9fb9c98de71e8117e0baac2b1b9b88b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:54:11 +0200 Subject: [PATCH 2092/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/stats.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4c4c8a7ee..8fbb2de08 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,13 +1179,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - /*if ( (rand() % 1000) == 0 ) + if ( (rand() % 1000) == 0 ) { int32_t sock = LP_bindsock; printf("bindsock reset test\n"); LP_bindsock = -1; closesocket(sock); - }*/ + } } #endif } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index fe31d3888..0c5cab321 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -751,7 +751,7 @@ void stats_rpcloop(void *args) localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); while ( 1 ) { - //printf("LP_bindsock.%d\n",LP_bindsock); + printf("LP_bindsock.%d\n",LP_bindsock); if ( LP_bindsock < 0 ) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) From e8343f63509ba58b211db4e02dcd704054e7a490 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:04:35 +0200 Subject: [PATCH 2093/2732] Test --- iguana/exchanges/LP_commands.c | 5 +---- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b6cb2291c..af12cb1c2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -375,10 +375,7 @@ bot_resume(botid)\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { ptr->inactive = 0; - retstr = jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1); - if ( ptr->electrum != 0 && (retjson= electrum_address_listunspent(ptr->symbol,ptr->electrum,&retjson,ptr->smartaddr,2)) != 0 ) - free_json(retjson); - return(retstr); + return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); } else return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"sendrawtransaction") == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3eef131f4..25ccc79c5 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1055,7 +1055,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) } else { - printf("launched electrum.(%s:%u)\n",ep->ipaddr,ep->port); + printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); ep->prev = coin->electrum; coin->electrum = ep; From 69591d1f8cff9ec64513c3510061f731a6f93200 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:08:49 +0200 Subject: [PATCH 2094/2732] Test --- iguana/exchanges/stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 0c5cab321..30eeb71fd 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -741,6 +741,7 @@ void LP_rpc_processreq(void *_ptr) extern int32_t IAMLP; int32_t LP_bindsock = -1; + void stats_rpcloop(void *args) { //static uint32_t counter; @@ -759,6 +760,7 @@ void stats_rpcloop(void *args) //if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); } + printf("after LP_bindsock.%d\n",LP_bindsock); clilen = sizeof(cli_addr); sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); if ( sock < 0 ) From 902bd2e1c55a14b487c5b1e49ee69766ada66303 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:10:43 +0200 Subject: [PATCH 2095/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/stats.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8fbb2de08..c461997b6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,13 +1179,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( (rand() % 1000) == 0 ) + /*if ( (rand() % 10000) == 0 ) { int32_t sock = LP_bindsock; printf("bindsock reset test\n"); LP_bindsock = -1; closesocket(sock); - } + }*/ } #endif } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 30eeb71fd..1ebed2aec 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -744,7 +744,7 @@ int32_t LP_bindsock = -1; void stats_rpcloop(void *args) { - //static uint32_t counter; + static uint32_t counter; uint16_t port; int32_t retval,sock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; @@ -752,15 +752,15 @@ void stats_rpcloop(void *args) localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); while ( 1 ) { - printf("LP_bindsock.%d\n",LP_bindsock); + //printf("LP_bindsock.%d\n",LP_bindsock); if ( LP_bindsock < 0 ) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); - //if ( counter++ < 1 ) + if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); } - printf("after LP_bindsock.%d\n",LP_bindsock); + //printf("after LP_bindsock.%d\n",LP_bindsock); clilen = sizeof(cli_addr); sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); if ( sock < 0 ) From 4f0446b564f1a4cdae63b297768aa6932fe2d2a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:28:37 +0200 Subject: [PATCH 2096/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 45 +++++++++++++++++++++++---------- iguana/exchanges/LP_rpc.c | 8 ++++++ iguana/exchanges/LP_socket.c | 3 ++- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 0e7ce20b1..843ace61b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -255,7 +255,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t numutxos,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; + uint32_t electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c461997b6..3190d9475 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -620,13 +620,6 @@ void LP_coinsloop(void *_coins) } } } - if ( time(NULL) > coin->lastunspent+30 ) - { - //printf("call electrum listunspent.%s\n",coin->symbol); - if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,coin->smartaddr,2)) != 0 ) - free_json(retjson); - coin->lastunspent = (uint32_t)time(NULL); - } while ( ep != 0 ) { if ( time(NULL) > ep->keepalive+LP_ELECTRUM_KEEPALIVE ) @@ -836,13 +829,23 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LP_pubkeysloop(void *ctx) { - static uint32_t lasttime; + static uint32_t lasttime; cJSON *retjson; struct iguana_info *coin,*tmp; strcpy(LP_pubkeysloop_stats.name,"LP_pubkeysloop"); LP_pubkeysloop_stats.threshold = 5000.; sleep(10); while ( 1 ) { LP_millistats_update(&LP_pubkeysloop_stats); + HASH_ITER(hh,LP_coins,coin,tmp) // firstrefht,firstscanht,lastscanht + { + if ( coin->electrum != 0 && time(NULL) > coin->lastunspent+30 ) + { + //printf("call electrum listunspent.%s\n",coin->symbol); + if ( (retjson= electrum_address_listunspent(coin->symbol,coin->electrum,&retjson,coin->smartaddr,2)) != 0 ) + free_json(retjson); + coin->lastunspent = (uint32_t)time(NULL); + } + } if ( time(NULL) > lasttime+60 ) { //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); @@ -1179,13 +1182,27 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - /*if ( (rand() % 10000) == 0 ) + if ( (rand() % 10000) == 0 ) { - int32_t sock = LP_bindsock; - printf("bindsock reset test\n"); - LP_bindsock = -1; - closesocket(sock); - }*/ + char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; + allgood = 0; + if ( (retstr= issue_hello(myport)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"") == 0 ) + allgood = 1, printf("allgood.(%s)\n",retstr); + free_json(retjson); + } else printf("couldnt parse hello return.(%s)\n",retstr); + free(retstr); + } else printf("issue_hello NULL return\n"); + if ( allgood == 0 ) + { + printf("RPC port got stuck, kick it\n"); + LP_bindsock = -1; + closesocket(sock); + } + } } #endif } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 959000fee..535b93264 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -93,6 +93,14 @@ char *issue_LP_getprices(char *destip,uint16_t destport) //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } +char *issue_hello(uint16_t port) +{ + char url[512]; + sprintf(url,"http://127.0.0.1:%u/api/stats/getprices",port); + //printf("getutxo.(%s)\n",url); + return(LP_issue_curl("hello","127.0.0.1",port,url)); +} + char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) { char url[512],*retstr; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 25ccc79c5..036ef0ed7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -597,7 +597,8 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - //printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); + if ( electrumflag > 1 ) + printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) LP_postutxos(coin->symbol,addr), updatedflag = 1; From e744037026317ea01c559b15ede9d2b3b45282f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:36:07 +0200 Subject: [PATCH 2097/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3190d9475..b54ba272f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1192,11 +1192,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu { if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"") == 0 ) allgood = 1, printf("allgood.(%s)\n",retstr); + else printf("strange return.(%s)\n",jprint(retjson,0)); free_json(retjson); } else printf("couldnt parse hello return.(%s)\n",retstr); free(retstr); } else printf("issue_hello NULL return\n"); - if ( allgood == 0 ) + if ( 0 && allgood == 0 ) { printf("RPC port got stuck, kick it\n"); LP_bindsock = -1; From 3dcde456c3642d3a4f7b22d73223e020b0ba35bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:44:24 +0200 Subject: [PATCH 2098/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 535b93264..b76416c5a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -96,7 +96,7 @@ char *issue_LP_getprices(char *destip,uint16_t destport) char *issue_hello(uint16_t port) { char url[512]; - sprintf(url,"http://127.0.0.1:%u/api/stats/getprices",port); + sprintf(url,"http://127.0.0.1:%u/api/stats/hello",port); //printf("getutxo.(%s)\n",url); return(LP_issue_curl("hello","127.0.0.1",port,url)); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 036ef0ed7..30dd047b5 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -597,7 +597,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( electrumflag > 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 37eaf4b54b9d3c8573595d3573f747de90d68617 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:50:21 +0200 Subject: [PATCH 2099/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 +++++++++--- iguana/exchanges/stats.c | 9 +++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b54ba272f..803b1928c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1190,18 +1190,24 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu { if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"") == 0 ) + if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"got hello") == 0 ) allgood = 1, printf("allgood.(%s)\n",retstr); else printf("strange return.(%s)\n",jprint(retjson,0)); free_json(retjson); } else printf("couldnt parse hello return.(%s)\n",retstr); free(retstr); } else printf("issue_hello NULL return\n"); - if ( 0 && allgood == 0 ) + if ( allgood == 0 ) { - printf("RPC port got stuck, kick it\n"); + printf("RPC port got stuck, start a new thread\n"); LP_bindsock = -1; closesocket(sock); + LP_bindsock_reset++; + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } } } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 1ebed2aec..436c0b32d 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -740,17 +740,17 @@ void LP_rpc_processreq(void *_ptr) } extern int32_t IAMLP; -int32_t LP_bindsock = -1; +int32_t LP_bindsock_reset,LP_bindsock = -1; void stats_rpcloop(void *args) { - static uint32_t counter; - uint16_t port; int32_t retval,sock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; + uint16_t port; int32_t retval,sock,initial_bindsock_reset; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits,counter=0; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); - while ( 1 ) + initial_bindsock_reset = LP_bindsock_reset; + while ( LP_bindsock_reset == initial_bindsock_reset ) { //printf("LP_bindsock.%d\n",LP_bindsock); if ( LP_bindsock < 0 ) @@ -776,6 +776,7 @@ void stats_rpcloop(void *args) req->ipbits = ipbits; LP_rpc_processreq(req); continue; + // this leads to cant open file errors if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); From 16cff05525a5ae5270884da18afba36004986c1d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 00:57:41 +0200 Subject: [PATCH 2100/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 9 +++++---- iguana/exchanges/stats.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 803b1928c..984d98705 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1166,7 +1166,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - int32_t nonz; + int32_t nonz; uint32_t lasthello = 0; while ( 1 ) { nonz = 0; @@ -1182,7 +1182,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( (rand() % 10000) == 0 ) + if ( time(NULL) > lasthello+60 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; allgood = 0; @@ -1191,13 +1191,14 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"got hello") == 0 ) - allgood = 1, printf("allgood.(%s)\n",retstr); + allgood = 1; else printf("strange return.(%s)\n",jprint(retjson,0)); free_json(retjson); } else printf("couldnt parse hello return.(%s)\n",retstr); free(retstr); } else printf("issue_hello NULL return\n"); - if ( allgood == 0 ) + lasthello = (uint32_t)time(NULL); + if ( 1 || allgood == 0 ) { printf("RPC port got stuck, start a new thread\n"); LP_bindsock = -1; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 436c0b32d..3561773b9 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -796,6 +796,7 @@ continue; } } } + printf("i got killed\n"); } #ifndef FROM_MARKETMAKER From 0d869866ada72d8cd45e72b44378fda9c15cee6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:00:30 +0200 Subject: [PATCH 2101/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 843ace61b..444858583 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -39,7 +39,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 20 -#define ELECTRUM_TIMEOUT 20 +#define ELECTRUM_TIMEOUT 5 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 30dd047b5..c459e725a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -408,12 +408,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ - portable_mutex_lock(&ep->mutex); + //portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(5000); - portable_mutex_unlock(&ep->mutex); + //portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) From c3105acf1d59f6a3dc59c7f063c0126ef79ec1bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:01:47 +0200 Subject: [PATCH 2102/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 984d98705..f31e39421 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1198,7 +1198,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu free(retstr); } else printf("issue_hello NULL return\n"); lasthello = (uint32_t)time(NULL); - if ( 1 || allgood == 0 ) + if ( allgood == 0 ) { printf("RPC port got stuck, start a new thread\n"); LP_bindsock = -1; From bcff592f3a93b5ee17ab526fd6861f2e409378c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:16:04 +0200 Subject: [PATCH 2103/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ------ iguana/exchanges/stats.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f31e39421..394d422a2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1203,12 +1203,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("RPC port got stuck, start a new thread\n"); LP_bindsock = -1; closesocket(sock); - LP_bindsock_reset++; - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) - { - printf("error launching stats rpcloop for port.%u\n",myport); - exit(-1); - } } } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 3561773b9..896234485 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -23,6 +23,9 @@ #include #include +#include /* See NOTES */ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include #include "../../crypto777/OS_portable.h" #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define STATS_DESTDIR "/var/www/html" @@ -762,7 +765,20 @@ void stats_rpcloop(void *args) } //printf("after LP_bindsock.%d\n",LP_bindsock); clilen = sizeof(cli_addr); +#ifdef _WIN32 sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); +#else +#ifdef __APPLE__ + sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); +#else + sock = accept4(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen,SOCK_NONBLOCK); + if ( sock < 0 ) + { + usleep(50000); + continue; + } +#endif +#endif if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); From e4fee8e52bbfd9d6ae8baf669e60026d7d41b1fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:19:45 +0200 Subject: [PATCH 2104/2732] Test --- iguana/exchanges/stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 896234485..9b6b47575 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -26,6 +26,7 @@ #include /* See NOTES */ #define _GNU_SOURCE /* See feature_test_macros(7) */ #include +int32_t accept4(int fildes, struct sockaddr *sock_addr, socklen_t *sock_addr_size, int flags); #include "../../crypto777/OS_portable.h" #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define STATS_DESTDIR "/var/www/html" @@ -747,7 +748,7 @@ int32_t LP_bindsock_reset,LP_bindsock = -1; void stats_rpcloop(void *args) { - uint16_t port; int32_t retval,sock,initial_bindsock_reset; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits,counter=0; struct rpcrequest_info *req,*req2,*rtmp; + uint16_t port; int32_t retval,sock,initial_bindsock_reset; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; @@ -760,7 +761,7 @@ void stats_rpcloop(void *args) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); - if ( counter++ < 1 ) + //if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); } //printf("after LP_bindsock.%d\n",LP_bindsock); @@ -774,6 +775,7 @@ void stats_rpcloop(void *args) sock = accept4(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen,SOCK_NONBLOCK); if ( sock < 0 ) { + fprintf(stderr,"."); usleep(50000); continue; } From 807e83acf2af6b616907b0f4d0e1bf2d007dc70e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:29:44 +0200 Subject: [PATCH 2105/2732] Test --- iguana/exchanges/stats.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 9b6b47575..1a73926f8 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -23,10 +23,6 @@ #include #include -#include /* See NOTES */ -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -int32_t accept4(int fildes, struct sockaddr *sock_addr, socklen_t *sock_addr_size, int flags); #include "../../crypto777/OS_portable.h" #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define STATS_DESTDIR "/var/www/html" @@ -761,26 +757,23 @@ void stats_rpcloop(void *args) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); +#ifndef _WIN32 + fcntl(LP_bindsock, F_SETFL, fcntl(LP_bindsock, F_GETFL, 0) | O_NONBLOCK); +#endif //if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); } //printf("after LP_bindsock.%d\n",LP_bindsock); clilen = sizeof(cli_addr); -#ifdef _WIN32 - sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); -#else -#ifdef __APPLE__ sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); -#else - sock = accept4(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen,SOCK_NONBLOCK); +#ifdef _WIN32 if ( sock < 0 ) { fprintf(stderr,"."); usleep(50000); continue; } -#endif -#endif +#else if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); @@ -788,6 +781,7 @@ void stats_rpcloop(void *args) LP_bindsock = -1; continue; } +#endif memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); req = calloc(1,sizeof(*req)); req->sock = sock; From 009f69ecf673593208b29a6039dbfaf99ac373d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:32:58 +0200 Subject: [PATCH 2106/2732] Test --- iguana/exchanges/stats.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 1a73926f8..c7edbfeda 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -769,16 +769,16 @@ void stats_rpcloop(void *args) #ifdef _WIN32 if ( sock < 0 ) { - fprintf(stderr,"."); - usleep(50000); + printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); + closesocket(LP_bindsock); + LP_bindsock = -1; continue; } #else if ( sock < 0 ) { - printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); - closesocket(LP_bindsock); - LP_bindsock = -1; + fprintf(stderr,"."); + usleep(50000); continue; } #endif From 2a05b019c2da1bfeb6571f675d6a9f73e4ed098e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:35:26 +0200 Subject: [PATCH 2107/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index c7edbfeda..3b5c53248 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -777,7 +777,7 @@ void stats_rpcloop(void *args) #else if ( sock < 0 ) { - fprintf(stderr,"."); + //fprintf(stderr,"."); usleep(50000); continue; } From 0f8ad4504f04f2300a50c729c6f3df6babdd651c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:38:27 +0200 Subject: [PATCH 2108/2732] Test --- iguana/exchanges/stats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 3b5c53248..872f7b332 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -778,7 +778,9 @@ void stats_rpcloop(void *args) if ( sock < 0 ) { //fprintf(stderr,"."); - usleep(50000); + if ( IAMLP == 0 ) + usleep(50000); + else usleep(2500); continue; } #endif From 6e93ea1e4100ad1ad9bd654c9cb3491eb14eba4a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 01:47:34 +0200 Subject: [PATCH 2109/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++---- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 394d422a2..27c15480b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,11 +18,9 @@ // LP_nativeDEX.c // marketmaker // -// selftest and fix rpc port -// verify portfolio, interest to KMD withdraw +// BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs -// BCH signing #include struct LP_millistats @@ -1200,7 +1198,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu lasthello = (uint32_t)time(NULL); if ( allgood == 0 ) { - printf("RPC port got stuck, start a new thread\n"); + printf("RPC port got stuck, close bindsocket\n"); LP_bindsock = -1; closesocket(sock); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b76416c5a..343106e90 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -98,7 +98,7 @@ char *issue_hello(uint16_t port) char url[512]; sprintf(url,"http://127.0.0.1:%u/api/stats/hello",port); //printf("getutxo.(%s)\n",url); - return(LP_issue_curl("hello","127.0.0.1",port,url)); + return(issue_curlt(url,60)); // might be starting a trade } char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) From 8cd733469a00f60536503170226d702248be25d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 02:14:39 +0200 Subject: [PATCH 2110/2732] Test --- iguana/exchanges/LP_commands.c | 4 +++- iguana/exchanges/LP_utxo.c | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index af12cb1c2..7de090f22 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -557,7 +557,9 @@ bot_resume(botid)\n\ //printf("network invoked\n"); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); - return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); + if ( ptr->electrum != 0 ) + return(LP_unspents_filestr(coin,ptr->smartaddr)); + else return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); } else { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4cbe86e58..161e19502 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1087,13 +1087,19 @@ void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedfla } } +char *LP_unspents_filestr(char *symbol,char *addr) +{ + char fname[1024]; long fsize; + sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + return(OS_filestr(&fsize,fname)); +} + uint64_t LP_unspents_load(char *symbol,char *addr) { - char fname[1024],*arraystr; uint64_t balance = 0; int32_t i,n; long fsize; struct iguana_info *coin; cJSON *retjson,*item; + char *arraystr; uint64_t balance = 0; int32_t i,n; cJSON *retjson,*item; struct iguana_info *coin; if ( (coin= LP_coinfind(symbol)) != 0 ) { - sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - if ( (arraystr= OS_filestr(&fsize,fname)) != 0 ) + if ( (arraystr= LP_unspents_filestr(symbol,addr)) != 0 ) { if ( (retjson= cJSON_Parse(arraystr)) != 0 ) { From 348b63705f73949e1e8893bf0e88dc23e8a0d92c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 02:27:03 +0200 Subject: [PATCH 2111/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 343106e90..975b25cd7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -694,7 +694,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } else return(LP_address_utxos(coin,coinaddr,0)); - } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,2)); } int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) From 3ecfc1abc6b5bdc14b8749c8acb3d8a84236bc98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 02:30:10 +0200 Subject: [PATCH 2112/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_socket.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 444858583..517786bc9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -425,6 +425,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag); uint16_t LP_randpeer(char *destip); +char *LP_unspents_filestr(char *symbol,char *addr); cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash); //int32_t LP_butxo_findeither(bits256 txid,int32_t vout); cJSON *LP_listunspent(char *symbol,char *coinaddr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c459e725a..2024d0deb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -622,7 +622,13 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON } } if ( retjson == 0 ) - retjson = LP_address_utxos(coin,addr,1); + { + if ( strcmp(addr,coin->smartaddr) == 0 && (retstr= LP_unspents_filestr(symbol,coin->smartaddr)) != 0 ) + { + retjson = LP_address_utxos(coin,addr,1); + free(retstr); + } else retjson = LP_address_utxos(coin,addr,1); + } return(retjson); } From 1e4e6b41e71bb00f07e3cef9dac1a4edd6c85090 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 02:51:07 +0200 Subject: [PATCH 2113/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7de090f22..ddd95bc15 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -99,7 +99,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r available localhost RPC commands: \n \ pricearray(base, rel, starttime=0, endtime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ setprice(base, rel, price)\n\ -autoprice(base, rel, minprice, margin, refbase, refrel, factor, offset)*\n\ +autoprice(base, rel, fixed, minprice, margin, refbase, refrel, factor, offset)*\n\ goal(coin=*, val=)\n\ myprice(base, rel)\n\ enable(coin)\n\ From b33ce9dec274549ae4fc7e886d1877b593441cd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 03:31:00 +0200 Subject: [PATCH 2114/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_tradebots.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 27c15480b..a5a8677e9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +// bot status 1600% ? // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 359e65c4a..fa7ab0292 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -445,7 +445,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*(shortfall+relvolume/77.) ) + if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*(shortfall+relvolume/777.) ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; outputjson = cJSON_CreateObject(); From 805b228599dba7b684c32d38c0f14e44bd19e279 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 03:35:03 +0200 Subject: [PATCH 2115/2732] Test --- iguana/exchanges/LP_tradebots.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index fa7ab0292..83369a3b2 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -445,7 +445,10 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*(shortfall+relvolume/777.) ) + if ( relcoin->electrum != 0 ) + balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr); + else balance = LP_RTsmartbalance(relcoin); + if ( balance > abalance+SATOSHIDEN*(shortfall+relvolume/777.) ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; outputjson = cJSON_CreateObject(); From 82735661798beee0a77c676475b3a5e4aac04119 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 03:38:44 +0200 Subject: [PATCH 2116/2732] Test --- iguana/exchanges/LP_coins.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index fe9c20f34..38c62ac64 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -201,7 +201,9 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) if ( coin->userpass[0] != 0 ) { jaddnum(item,"height",LP_getheight(coin)); - balance = LP_RTsmartbalance(coin); + if ( coin->electrum != 0 ) + balance = LP_unspents_load(coin->symbol,coin->smartaddr); + else balance = LP_RTsmartbalance(coin); jaddnum(item,"balance",dstr(balance)); jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance))); } From eb6db9acd1d5a5621f238b62633806139e5dbc03 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 03:55:37 +0200 Subject: [PATCH 2117/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_tradebots.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 975b25cd7..5b5791239 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -1040,7 +1040,7 @@ bits256 LP_getbestblockhash(struct iguana_info *coin) decode_hex(blockhash.bytes,sizeof(blockhash),retstr); free(retstr); } - } + } else printf("electrum mode doesnt support block level scanning\n"); return(blockhash); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 83369a3b2..32db8dc62 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -438,17 +438,18 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl if ( dstr(abalance) < relvolume + dstr(txfees) ) { retjson = cJSON_CreateObject(); + if ( relcoin->electrum != 0 ) + balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr); + else balance = LP_RTsmartbalance(relcoin); jaddstr(retjson,"error","not enough funds"); jaddstr(retjson,"coin",rel); + jaddnum(retjson,"abalance",dstr(abalance)); jaddnum(retjson,"balance",dstr(abalance)); jaddnum(retjson,"relvolume",relvolume); jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - if ( relcoin->electrum != 0 ) - balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr); - else balance = LP_RTsmartbalance(relcoin); - if ( balance > abalance+SATOSHIDEN*(shortfall+relvolume/777.) ) + if ( balance > (relvolume + 10*relvolume/777.) ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; outputjson = cJSON_CreateObject(); From 248cedd8f639a52b6340b3aa0cac33390dc9a77b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 03:56:23 +0200 Subject: [PATCH 2118/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 32db8dc62..d58c870eb 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -444,7 +444,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddstr(retjson,"error","not enough funds"); jaddstr(retjson,"coin",rel); jaddnum(retjson,"abalance",dstr(abalance)); - jaddnum(retjson,"balance",dstr(abalance)); + jaddnum(retjson,"balance",dstr(balance)); jaddnum(retjson,"relvolume",relvolume); jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); From 93eef2d96ce25455edf86d7ed78787559201c215 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 04:16:39 +0200 Subject: [PATCH 2119/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a5a8677e9..31742b3f9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1197,11 +1197,19 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu free(retstr); } else printf("issue_hello NULL return\n"); lasthello = (uint32_t)time(NULL); - if ( allgood == 0 ) + if ( (rand() % 10000) == 0 || allgood == 0 ) { printf("RPC port got stuck, close bindsocket\n"); LP_bindsock = -1; closesocket(sock); + LP_bindsock_reset++; + sleep(10); + printf("launch new rpcloop\n"); + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } } } } From 0a100562f7fe5f0b4fe0b2401dbb3aa6b656c0b6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 04:25:39 +0200 Subject: [PATCH 2120/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 31742b3f9..bbba34865 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1197,7 +1197,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu free(retstr); } else printf("issue_hello NULL return\n"); lasthello = (uint32_t)time(NULL); - if ( (rand() % 10000) == 0 || allgood == 0 ) + if ( LP_bindsock_reset == 0 || allgood == 0 ) { printf("RPC port got stuck, close bindsocket\n"); LP_bindsock = -1; From 4cddc89595e5c3516673e25ddac2a15dc6a10989 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 04:30:21 +0200 Subject: [PATCH 2121/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bbba34865..9d90bfa7e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1197,7 +1197,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu free(retstr); } else printf("issue_hello NULL return\n"); lasthello = (uint32_t)time(NULL); - if ( LP_bindsock_reset == 0 || allgood == 0 ) + if ( allgood == 0 ) { printf("RPC port got stuck, close bindsocket\n"); LP_bindsock = -1; From 7ce5a15bf27e374dc6bbffbddc2f033579074604 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 10:24:56 +0200 Subject: [PATCH 2122/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 38 ++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 517786bc9..86430b461 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -41,7 +41,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_AUTOTRADE_TIMEOUT 20 #define ELECTRUM_TIMEOUT 5 #define LP_ELECTRUM_KEEPALIVE 60 -#define LP_ELECTRUM_MAXERRORS 777 +#define LP_ELECTRUM_MAXERRORS 7 #define LP_MEMPOOL_TIMEINCR 10 #define LP_MIN_PEERS 8 diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2024d0deb..baeb85f58 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -389,6 +389,25 @@ void electrum_initial_requests(struct electrum_info *ep) electrum_sitem(ep,stratumreq,3,&retjson); } +int32_t electrum_kickstart(struct electrum_info *ep) +{ + closesocket(ep->sock), ep->sock = -1; + sleep(1); + if ( (ep->sock= LP_socket(0,ep->ipaddr,ep->port)) < 0 ) + { + printf("error RE-connecting to %s:%u\n",ep->ipaddr,ep->port); + return(-1); + } + else + { + ep->stratumid = 0; + electrum_initial_requests(ep); + printf("RECONNECT ep.%p %s numerrors.%d too big -> new %s:%u sock.%d\n",ep,ep->symbol,ep->numerrors,ep->ipaddr,ep->port,ep->sock); + ep->numerrors = 0; + } + return(0); +} + cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -417,20 +436,9 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) - { - closesocket(ep->sock), ep->sock = -1; - if ( (ep->sock= LP_socket(0,ep->ipaddr,ep->port)) < 0 ) - printf("error RE-connecting to %s:%u\n",ep->ipaddr,ep->port); - else - { - ep->stratumid = 0; - electrum_initial_requests(ep); - printf("ep.%p %s numerrors.%d too big -> new %s:%u sock.%d\n",ep,ep->symbol,ep->numerrors,ep->ipaddr,ep->port,ep->sock); - ep->numerrors = 0; - } - } + electrum_kickstart(ep); } else if ( ep->numerrors > 0 ) - ep->numerrors++; + ep->numerrors--; if ( ep->prev == 0 ) { if ( *retjsonp == 0 ) @@ -1038,7 +1046,7 @@ void LP_dedicatedloop(void *arg) cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { - struct electrum_info *ep; int32_t already; cJSON *retjson; + struct electrum_info *ep; int32_t kickval,already; cJSON *retjson; if ( ipaddr == 0 || ipaddr[0] == 0 || port == 0 ) { //coin->electrum = 0; @@ -1070,8 +1078,10 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) } else { + kickval = electrum_kickstart(ep); jaddstr(retjson,"result","success"); jaddstr(retjson,"status","already there"); + jaddstr(retjson,"restart",kickval); } //printf("(%s)\n",jprint(retjson,0)); return(retjson); From ac3a9649c9b2a1fb8f22c11efcfcfe0b9a82b636 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 10:31:21 +0200 Subject: [PATCH 2123/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 86430b461..517786bc9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -41,7 +41,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_AUTOTRADE_TIMEOUT 20 #define ELECTRUM_TIMEOUT 5 #define LP_ELECTRUM_KEEPALIVE 60 -#define LP_ELECTRUM_MAXERRORS 7 +#define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 #define LP_MIN_PEERS 8 From 5b590d984d150c23199533e1534c8299f40284e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 10:31:54 +0200 Subject: [PATCH 2124/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index baeb85f58..2afbef6b1 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -124,9 +124,9 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) #endif if ( bindflag == 0 ) { - printf("call connect sock.%d\n",sock); + //printf("call connect sock.%d\n",sock); result = connect(sock,(struct sockaddr *)&saddr,addrlen); - printf("called connect result.%d\n",result); + //printf("called connect result.%d\n",result); timeout.tv_sec = 2; timeout.tv_usec = 0; setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); From 6d7ede8652561db98e4f148d49f11a43e594f699 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 13:28:29 +0200 Subject: [PATCH 2125/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 2afbef6b1..69c79217c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1081,7 +1081,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) kickval = electrum_kickstart(ep); jaddstr(retjson,"result","success"); jaddstr(retjson,"status","already there"); - jaddstr(retjson,"restart",kickval); + jaddnum(retjson,"restart",kickval); } //printf("(%s)\n",jprint(retjson,0)); return(retjson); From aea6102369f1b4c60a71cc35876f1a9cef0abff8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:12:25 +0200 Subject: [PATCH 2126/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9d90bfa7e..e26ce29b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1181,7 +1181,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( time(NULL) > lasthello+60 ) + if ( time(NULL) > lasthello+600 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; allgood = 0; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5b5791239..43dd88d52 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -98,7 +98,7 @@ char *issue_hello(uint16_t port) char url[512]; sprintf(url,"http://127.0.0.1:%u/api/stats/hello",port); //printf("getutxo.(%s)\n",url); - return(issue_curlt(url,60)); // might be starting a trade + return(issue_curlt(url,600)); // might be starting a trade } char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) From c9dba66fe0a9451e4e285b2af6a6d5189b9d8917 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:15:07 +0200 Subject: [PATCH 2127/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e26ce29b5..7ea525e43 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1199,16 +1199,19 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu lasthello = (uint32_t)time(NULL); if ( allgood == 0 ) { - printf("RPC port got stuck, close bindsocket\n"); - LP_bindsock = -1; - closesocket(sock); - LP_bindsock_reset++; - sleep(10); - printf("launch new rpcloop\n"); - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + printf("RPC port got stuck, would have close bindsocket\n"); + if ( 0 ) { - printf("error launching stats rpcloop for port.%u\n",myport); - exit(-1); + LP_bindsock = -1; + closesocket(sock); + LP_bindsock_reset++; + sleep(10); + printf("launch new rpcloop\n"); + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } } } } From 68ea59584c988d41f5ccb29a3a143b2dea71bba4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:15:38 +0200 Subject: [PATCH 2128/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7ea525e43..c43655e3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1181,7 +1181,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( time(NULL) > lasthello+600 ) + if ( IAMLP != 0 && time(NULL) > lasthello+600 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; allgood = 0; From 5869ad7d9762bbb9c96517d51b86efd0129c4f6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:33:57 +0200 Subject: [PATCH 2129/2732] Test --- iguana/exchanges/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 872f7b332..fdb8de240 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -724,7 +724,7 @@ void LP_rpc_processreq(void *_ptr) remains -= numsent; i += numsent; if ( remains > 0 ) - printf("iguana sent.%d remains.%d of len.%d\n",numsent,remains,recvlen); + printf("iguana sent.%d remains.%d of recvlen.%d (%s)\n",numsent,remains,recvlen,jsonbuf); } } if ( retstr != space) From 37aef662bd030a6b824f754cc43dcd8b92b4da2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:35:09 +0200 Subject: [PATCH 2130/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c43655e3e..bfb3b9bd2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -448,7 +448,7 @@ void command_rpcloop(void *myipaddr) void utxosQ_loop(void *myipaddr) { strcpy(utxosQ_loop_stats.name,"utxosQ_loop"); - utxosQ_loop_stats.threshold = 150.; + utxosQ_loop_stats.threshold = 500.; while ( 1 ) { LP_millistats_update(&utxosQ_loop_stats); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0a6812890..198e384c6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -183,7 +183,7 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) sum += (OS_milliseconds() - millis); nsum += n; counter++; - if ( n > maxn || (rand() % 100) == 0 ) + if ( n > maxn || (rand() % 10000) == 0 ) { if ( n > maxn ) { From 0b16aae6994c2ff96a37b9fa242c693fd76012af Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:51:47 +0200 Subject: [PATCH 2131/2732] Revert to blocking sockets --- iguana/exchanges/stats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index fdb8de240..65fcb0a24 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -758,7 +758,7 @@ void stats_rpcloop(void *args) while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); #ifndef _WIN32 - fcntl(LP_bindsock, F_SETFL, fcntl(LP_bindsock, F_GETFL, 0) | O_NONBLOCK); + //fcntl(LP_bindsock, F_SETFL, fcntl(LP_bindsock, F_GETFL, 0) | O_NONBLOCK); #endif //if ( counter++ < 1 ) printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); @@ -766,7 +766,7 @@ void stats_rpcloop(void *args) //printf("after LP_bindsock.%d\n",LP_bindsock); clilen = sizeof(cli_addr); sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); -#ifdef _WIN32 +//#ifdef _WIN32 if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); @@ -774,7 +774,7 @@ void stats_rpcloop(void *args) LP_bindsock = -1; continue; } -#else +/*#else if ( sock < 0 ) { //fprintf(stderr,"."); @@ -783,7 +783,7 @@ void stats_rpcloop(void *args) else usleep(2500); continue; } -#endif +#endif*/ memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); req = calloc(1,sizeof(*req)); req->sock = sock; From e6f7f6ae036c56d639c0112f41ad8b4bb35562cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:04:23 +0200 Subject: [PATCH 2132/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bfb3b9bd2..652ed565a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -707,8 +707,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { nonz++; LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - peer->diduquery = 0; - LP_peer_pricesquery(peer); + if ( peer->diduquery == 0 ) + LP_peer_pricesquery(peer); LP_utxos_sync(peer); needpings++; } From b94d73f70c076a9d61875d2beb95307940731eef Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:20:08 +0200 Subject: [PATCH 2133/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/stats.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 517786bc9..2f03c6f75 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -59,7 +59,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_COMMAND_RECVSOCK NN_PULL #define DPOW_MIN_ASSETCHAIN_SIGS 11 -#define LP_ENCRYPTED_MAXSIZE (4096 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) +#define LP_ENCRYPTED_MAXSIZE (16384 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) #define LP_MAXPUBKEY_ERRORS 10 #define PSOCK_KEEPALIVE 3600 diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 652ed565a..0949429aa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -883,7 +883,7 @@ void LP_swapsloop(void *ignore) //printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); - LP_millistats_update(0); + //LP_millistats_update(0); sleep(600); } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 65fcb0a24..d3b286f22 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -668,9 +668,9 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; - portable_mutex_lock(&LP_commandmutex); + //portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); - portable_mutex_unlock(&LP_commandmutex); + //portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; From 10bb55f5fb993878ee3755b58de6c94935ba2f3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:22:17 +0200 Subject: [PATCH 2134/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8130706bf..30d3a8cb9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -859,8 +859,8 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i item = jitem(asks,i); price = jdouble(item,"price"); if ( price/maxprice < .9 ) - price *= 1.025; - else price *= 1.001; + price *= 1.05; + else price *= 1.01; pubkey = jbits256(item,"pubkey"); if ( bits256_nonz(destpubkey) != 0 && bits256_cmp(destpubkey,pubkey) != 0 ) continue; From d4ed64211e977aa7bdc3a1f268e357f4fa7884e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:27:37 +0200 Subject: [PATCH 2135/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3148e9f0f..dac30e51d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1053,7 +1053,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf suppress_pubkeys = 1; scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); numvins = LP_vins_select(ctx,coin,&total,amount,V,utxos,numutxos,suppress_pubkeys,ignore_cltverr,privkey,privkeys,vins,script,scriptlen,utxotxid,utxovout,dustcombine); - if ( total < amount ) + if ( numvins <= 0 || total < amount ) { printf("change %.8f = total %.8f - amount %.8f, adjust %.8f numvouts.%d, txfee %.8f\n",dstr(change),dstr(total),dstr(amount),dstr(adjust),numvouts,dstr(txfee)); printf("not enough inputs for amount %.8f < %.8f txfee %.8f\n",dstr(total),dstr(amount),dstr(txfee)); From 23106b5044b6562d88d0538dace34e28d2b79f72 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:29:38 +0200 Subject: [PATCH 2136/2732] Test --- iguana/exchanges/LP_transaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index dac30e51d..ee42d08fb 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -922,7 +922,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ if ( dustcombine >= 2 && min1 != 0 && min1->U.value < LP_DUSTCOMBINE_THRESHOLD && (coin->electrum == 0 || min1->SPV > 0) ) preselected[numpre++] = min1; else min1 = 0; - printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d\n",dustcombine,numpre,min0,min1,numunspents); + printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d amount %.8f\n",dustcombine,numpre,min0,min1,numunspents); for (i=0; ispendheight = 1; total += up->U.value; remains -= up->U.value; + interest = 0; if ( up->U.height < 7777777 && strcmp(coin->symbol,"KMD") == 0 ) { if ( (interest= LP_komodo_interest(up->U.txid,up->U.value)) > 0 ) @@ -970,6 +971,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); } } + printf("vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f\n",n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum)); vp = &V[n++]; vp->N = vp->M = 1; vp->signers[0].privkey = privkey; From ab2d0ccd81821ee8de2e1eb462e998dadf1ae626 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:30:55 +0200 Subject: [PATCH 2137/2732] Test --- iguana/exchanges/LP_transaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ee42d08fb..a2042aab3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -922,7 +922,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ if ( dustcombine >= 2 && min1 != 0 && min1->U.value < LP_DUSTCOMBINE_THRESHOLD && (coin->electrum == 0 || min1->SPV > 0) ) preselected[numpre++] = min1; else min1 = 0; - printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d amount %.8f\n",dustcombine,numpre,min0,min1,numunspents); + printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d amount %.8f\n",dustcombine,numpre,min0,min1,numunspents,dstr(amount)); for (i=0; i total %.8f\n",i,dstr(value),dstr(amount)); } else { From eec886520570e6a043e02c770c774ef6938ece1b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:32:21 +0200 Subject: [PATCH 2138/2732] Test --- iguana/exchanges/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index d3b286f22..65fcb0a24 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -668,9 +668,9 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; - //portable_mutex_lock(&LP_commandmutex); + portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); - //portable_mutex_unlock(&LP_commandmutex); + portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; From f0b264da23b498c56d58ea18ad5d321311fdcefa Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:38:05 +0200 Subject: [PATCH 2139/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0949429aa..36e903a3f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1115,6 +1115,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } + uint16_t myport2 = myport-1; + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); From dbf2b9e9a6a5739063394cfa8d471f1a10c51933 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:41:22 +0200 Subject: [PATCH 2140/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 43dd88d52..e621ac0a6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -22,6 +22,8 @@ char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) { char *retstr = 0; int32_t maxerrs; struct LP_peerinfo *peer = 0; peer = LP_peerfind((uint32_t)calc_ipbits(destip),port); + if ( strcmp(destip,"127.0.0.1") != 0 ) + port--; maxerrs = LP_MAXPEER_ERRORS; if ( peer == 0 || (peer->errors < maxerrs || peer->good >= LP_MINPEER_GOOD) ) { From 3f081ad51a001d97a2e214055fa4ab4c65dd4389 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:46:05 +0200 Subject: [PATCH 2141/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/stats.c | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 36e903a3f..307e2f682 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1171,7 +1171,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - int32_t nonz; uint32_t lasthello = 0; + int32_t nonz; //uint32_t lasthello = 0; while ( 1 ) { nonz = 0; @@ -1187,7 +1187,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( IAMLP != 0 && time(NULL) > lasthello+600 ) + /*if ( IAMLP != 0 && time(NULL) > lasthello+600 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; allgood = 0; @@ -1220,7 +1220,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } } } - } + }*/ } #endif } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 65fcb0a24..e066f87ca 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -740,38 +740,39 @@ void LP_rpc_processreq(void *_ptr) } extern int32_t IAMLP; -int32_t LP_bindsock_reset,LP_bindsock = -1; +//int32_t LP_bindsock_reset,LP_bindsock = -1; void stats_rpcloop(void *args) { - uint16_t port; int32_t retval,sock,initial_bindsock_reset; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; + uint16_t port; int32_t retval,sock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; + printf("Start stats_rpcloop.%u\n",port); localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); - initial_bindsock_reset = LP_bindsock_reset; - while ( LP_bindsock_reset == initial_bindsock_reset ) + //initial_bindsock_reset = LP_bindsock_reset; + while ( 1 )//LP_bindsock_reset == initial_bindsock_reset ) { //printf("LP_bindsock.%d\n",LP_bindsock); - if ( LP_bindsock < 0 ) + if ( sock < 0 ) { - while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + while ( (sock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); #ifndef _WIN32 - //fcntl(LP_bindsock, F_SETFL, fcntl(LP_bindsock, F_GETFL, 0) | O_NONBLOCK); + //fcntl(sock, F_SETFL, fcntl(sock, F_GETFL, 0) | O_NONBLOCK); #endif //if ( counter++ < 1 ) - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,sock); } - //printf("after LP_bindsock.%d\n",LP_bindsock); + //printf("after sock.%d\n",sock); clilen = sizeof(cli_addr); - sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); + sock = accept(sock,(struct sockaddr *)&cli_addr,&clilen); //#ifdef _WIN32 if ( sock < 0 ) { printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); - closesocket(LP_bindsock); - LP_bindsock = -1; + closesocket(sock); + sock = -1; continue; } /*#else @@ -794,8 +795,8 @@ continue; if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); - closesocket(LP_bindsock); - LP_bindsock = -1; + closesocket(sock); + sock = -1; portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(LP_garbage_collector,req2,rtmp) { From d02ad6a09e529527b4a02b0a21345352e93c9639 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 18:50:27 +0200 Subject: [PATCH 2142/2732] Test --- iguana/exchanges/stats.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index e066f87ca..6ec674426 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -744,7 +744,7 @@ extern int32_t IAMLP; void stats_rpcloop(void *args) { - uint16_t port; int32_t retval,sock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; + uint16_t port; int32_t retval,sock=-1,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; RPC_port = port; @@ -754,25 +754,25 @@ void stats_rpcloop(void *args) while ( 1 )//LP_bindsock_reset == initial_bindsock_reset ) { //printf("LP_bindsock.%d\n",LP_bindsock); - if ( sock < 0 ) + if ( bindsock < 0 ) { - while ( (sock= iguana_socket(1,"0.0.0.0",port)) < 0 ) + while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) usleep(10000); #ifndef _WIN32 - //fcntl(sock, F_SETFL, fcntl(sock, F_GETFL, 0) | O_NONBLOCK); + //fcntl(bindsock, F_SETFL, fcntl(bindsock, F_GETFL, 0) | O_NONBLOCK); #endif //if ( counter++ < 1 ) - printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,sock); + printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,bindsock); } //printf("after sock.%d\n",sock); clilen = sizeof(cli_addr); - sock = accept(sock,(struct sockaddr *)&cli_addr,&clilen); + sock = accept(bindsock,(struct sockaddr *)&cli_addr,&clilen); //#ifdef _WIN32 if ( sock < 0 ) { - printf("iguana_rpcloop ERROR on accept usock.%d errno %d %s\n",sock,errno,strerror(errno)); - closesocket(sock); - sock = -1; + printf("iguana_rpcloop ERROR on accept port.%u usock.%d errno %d %s\n",port,sock,errno,strerror(errno)); + closesocket(bindsock); + bindsock = -1; continue; } /*#else From df43263232730cee9d1571332376c30418f8ad61 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 20:07:35 +0200 Subject: [PATCH 2143/2732] Test --- iguana/exchanges/LP_commands.c | 143 +++++++++++----------- iguana/exchanges/LP_include.h | 3 +- iguana/exchanges/LP_nativeDEX.c | 108 +++-------------- iguana/exchanges/LP_network.c | 9 -- iguana/exchanges/LP_peers.c | 29 ----- iguana/exchanges/LP_prices.c | 4 +- iguana/exchanges/LP_rpc.c | 82 +++++-------- iguana/exchanges/LP_statemachine.c | 185 +++++++++++++++++++++++++++++ iguana/exchanges/stats.c | 2 +- 9 files changed, 302 insertions(+), 263 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ddd95bc15..5a45d9ee8 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -74,7 +74,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(clonestr("{\"result\":\"success\",\"status\":\"got hello\"}")); } - else if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) + /*else if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); @@ -91,7 +91,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r retstr = clonestr(laststr); } } else retstr = clonestr("{\"error\":\"duplicate message\"}"); - } + }*/ //else if ( strcmp(method,"nn_tests") == 0 ) // return(clonestr("{\"result\":\"success\"}")); else if ( strcmp(method,"help") == 0 ) @@ -132,9 +132,9 @@ trust(pubkey, trust) # positive to trust, 0 for normal, negative to blacklist\n\ balance(coin, address)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ -sendmessage(base=coin, rel="", pubkey=zero, )\n\ -getmessages(firsti=0, num=100)\n\ -deletemessages(firsti=0, num=100)\n\ +//sendmessage(base=coin, rel="", pubkey=zero, )\n\ +//getmessages(firsti=0, num=100)\n\ +//deletemessages(firsti=0, num=100)\n\ secretaddresses(prefix='secretaddress', passphrase, num=10, pubtype=60, taddr=0)\n\ electrum(coin, ipaddr, port)\n\ snapshot(coin, height)\n\ @@ -186,7 +186,7 @@ bot_resume(botid)\n\ return(jprint(retjson,1)); } } - else if ( strcmp(method,"sendmessage") == 0 ) + /*else if ( strcmp(method,"sendmessage") == 0 ) { if ( jobj(argjson,"method2") == 0 ) { @@ -194,6 +194,17 @@ bot_resume(botid)\n\ } return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"getmessages") == 0 ) + { + if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) + return(jprint(retjson,1)); + else return(clonestr("{\"error\":\"null messages\"}")); + } + else if ( strcmp(method,"deletemessages") == 0 ) + { + LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); + return(clonestr("{\"result\":\"success\"}")); + }*/ else if ( strcmp(method,"recentswaps") == 0 ) { return(LP_recent_swaps(jint(argjson,"limit"))); @@ -208,17 +219,12 @@ bot_resume(botid)\n\ LP_millistats_update(0); return(clonestr("{\"result\":\"success\"}")); } - else if ( strcmp(method,"getmessages") == 0 ) - { - if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) - return(jprint(retjson,1)); - else return(clonestr("{\"error\":\"null messages\"}")); - } - else if ( strcmp(method,"deletemessages") == 0 ) - { - LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); - return(clonestr("{\"result\":\"success\"}")); - } + else if ( strcmp(method,"getprices") == 0 ) + return(LP_prices()); + else if ( strcmp(method,"getpeers") == 0 ) + return(LP_peers()); + else if ( strcmp(method,"getcoins") == 0 ) + return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"notarizations") == 0 ) { int32_t height,bestheight; @@ -290,8 +296,20 @@ bot_resume(botid)\n\ } else if ( strcmp(method,"pricearray") == 0 ) { - return(jprint(LP_pricearray(base,rel,juint(argjson,"starttime"),juint(argjson,"endtime"),jint(argjson,"timescale")),1)); + uint32_t firsttime; + if ( base[0] != 0 && rel[0] != 0 ) + { + if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) + firsttime = (uint32_t)(time(NULL)-30*24*3600); + return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); + } else return(clonestr("{\"error\":\"pricearray needs base and rel\"}")); } + /*else if ( strcmp(method,"pricearray") == 0 ) + { + return(jprint(LP_pricearray(base,rel,juint(argjson,"starttime"),juint(argjson,"endtime"),jint(argjson,"timescale")),1)); + }*/ + else if ( strcmp(method,"orderbook") == 0 ) + return(LP_orderbook(base,rel,jint(argjson,"duration"))); else if ( strcmp(method,"myprice") == 0 ) { if ( LP_myprice(&bid,&ask,base,rel) > SMALLVAL ) @@ -370,6 +388,41 @@ bot_resume(botid)\n\ return(jprint(array,1)); } else return(clonestr("{\"error\":\"couldnt find coin\"}")); } + else if ( strcmp(method,"listunspent") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + char *coinaddr; + if ( (coinaddr= jstr(argjson,"address")) != 0 ) + { + if ( coinaddr[0] != 0 ) + { + LP_address(ptr,coinaddr); + LP_listunspent_issue(coin,coinaddr,1); + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) + { + //printf("network invoked\n"); + LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); + //LP_smartutxos_push(ptr); + if ( ptr->electrum != 0 ) + return(LP_unspents_filestr(coin,ptr->smartaddr)); + else return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); + } + else + { + return(clonestr("{\"error\":\"not my address\"}")); + } + } + return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); + } else return(clonestr("{\"error\":\"no address specified\"}")); + } else return(clonestr("{\"error\":\"cant find coind\"}")); + } + else if ( strcmp(method,"balance") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( strcmp(method,"electrum") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) @@ -497,37 +550,12 @@ bot_resume(botid)\n\ return(LP_notify_recv(argjson)); // end received response - // public access, even from http else if ( strcmp(method,"tradestatus") == 0 ) { LP_tradecommand_log(argjson); printf("GOT TRADESTATUS! %s\n",jprint(argjson,0)); retstr = clonestr("{\"result\":\"success\"}"); } - else if ( strcmp(method,"balance") == 0 ) - { - if ( (ptr= LP_coinsearch(coin)) != 0 ) - return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); - else return(clonestr("{\"error\":\"cant find coind\"}")); - } - else if ( strcmp(method,"pricearray") == 0 ) - { - uint32_t firsttime; - if ( base[0] != 0 && rel[0] != 0 ) - { - if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) - firsttime = (uint32_t)(time(NULL)-30*24*3600); - return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); - } else return(clonestr("{\"error\":\"pricearray needs base and rel\"}")); - } - else if ( strcmp(method,"getprices") == 0 ) - return(LP_prices()); - else if ( strcmp(method,"orderbook") == 0 ) - return(LP_orderbook(base,rel,jint(argjson,"duration"))); - else if ( strcmp(method,"getpeers") == 0 ) - return(LP_peers()); - else if ( strcmp(method,"getcoins") == 0 ) - return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"wantnotify") == 0 ) { bits256 pub; static uint32_t lastnotify; @@ -541,35 +569,6 @@ bot_resume(botid)\n\ } retstr = clonestr("{\"result\":\"success\"}"); } - else if ( strcmp(method,"listunspent") == 0 ) - { - if ( (ptr= LP_coinsearch(coin)) != 0 ) - { - char *coinaddr; - if ( (coinaddr= jstr(argjson,"address")) != 0 ) - { - if ( coinaddr[0] != 0 ) - { - LP_address(ptr,coinaddr); - LP_listunspent_issue(coin,coinaddr,1); - if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) - { - //printf("network invoked\n"); - LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); - //LP_smartutxos_push(ptr); - if ( ptr->electrum != 0 ) - return(LP_unspents_filestr(coin,ptr->smartaddr)); - else return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); - } - else - { - return(clonestr("{\"error\":\"not my address\"}")); - } - } - return(jprint(LP_address_utxos(ptr,coinaddr,1),1)); - } else return(clonestr("{\"error\":\"no address specified\"}")); - } else return(clonestr("{\"error\":\"cant find coind\"}")); - } else if ( strcmp(method,"addr_unspents") == 0 ) { //printf("GOT ADDR_UNSPENTS %s %s\n",jstr(argjson,"coin"),jstr(argjson,"address")); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2f03c6f75..1dfb2ce36 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -34,7 +34,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #endif //#define LP_STRICTPEERS -#define LP_BARTERDEX_VERSION 0 +#define LP_BARTERDEX_VERSION 1 #define LP_MAGICBITS 8 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) @@ -425,6 +425,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag); uint16_t LP_randpeer(char *destip); +char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired); char *LP_unspents_filestr(char *symbol,char *addr); cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash); //int32_t LP_butxo_findeither(bits256 txid,int32_t vout); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 307e2f682..834ac4061 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -457,89 +457,6 @@ void utxosQ_loop(void *myipaddr) } } -int32_t LP_utxos_sync(struct LP_peerinfo *peer) -{ - int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2; uint64_t total,total2; struct iguana_info *coin,*ctmp; char *retstr,*retstr2; - if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) - return(0); - HASH_ITER(hh,LP_coins,coin,ctmp) - { - if ( IAMLP == 0 && coin->inactive != 0 ) - continue; - if ( coin->smartaddr[0] == 0 ) - continue; - total = 0; - if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr,0)) == 0 ) - continue; - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) - { - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; i 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) - { - //printf("UTXO sync.%d %s n.%d total %.8f -> %s (%s)\n",j,coin->symbol,n,dstr(total),peer->ipaddr,retstr); - total2 = 0; - if ( (array2= cJSON_Parse(retstr)) != 0 ) - { - if ( (m= cJSON_GetArraySize(array2)) > 0 ) - { - for (i=0; iipaddr,coin->symbol,jprint(item,0)); - if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) - free(retstr2); - posted++; - } - } - if ( 0 && posted != 0 ) - printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - } //else printf("%s matches %s\n",peer->ipaddr,coin->symbol); - free_json(array2); - } else printf("parse error (%s)\n",retstr); - free(retstr); - } - else if ( n != 0 && total != 0 ) - { - //printf("no response from %s for %s %s\n",peer->ipaddr,coin->symbol,coin->smartaddr); - for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 ) - free(retstr2); - } - } - free_json(array); - } - } - return(posted); -} - void LP_coinsloop(void *_coins) { struct LP_address *ap=0,*atmp; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; @@ -680,7 +597,7 @@ void LP_coinsloop(void *_coins) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t needpings,height,nonz = 0; + struct iguana_info *coin,*ctmp; char *origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t needpings,height,nonz = 0; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -706,15 +623,16 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; - LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - if ( peer->diduquery == 0 ) - LP_peer_pricesquery(peer); - LP_utxos_sync(peer); + issue_LP_getpeers(peer->ipaddr,peer->port); + //LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + //if ( peer->diduquery == 0 ) + // LP_peer_pricesquery(peer); + //LP_utxos_sync(peer); needpings++; } peer->lastpeers = now; } - if ( peer->needping != 0 ) + /*if ( peer->needping != 0 ) { peer->diduquery = now; nonz++; @@ -722,7 +640,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; needpings++; - } + }*/ } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -803,9 +721,10 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint { //if ( (rand() % 100) > 25 ) // continue; - LP_peersquery(mypeer,pubsock,default_LPnodes[i],myport,mypeer->ipaddr,myport); + issue_LP_getpeers(default_LPnodes[i],myport); + //LP_peersquery(mypeer,pubsock,default_LPnodes[i],myport,mypeer->ipaddr,myport); } - } else LP_peersquery(mypeer,pubsock,seednode,myport,mypeer->ipaddr,myport); + } else issue_LP_getpeers(seednode,myport); //LP_peersquery(mypeer,pubsock,seednode,myport,mypeer->ipaddr,myport); } else { @@ -820,9 +739,10 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint for (j=0; jnumpeers:0)) != 0 ) - { - //printf("got.(%s)\n",retstr); - now = (uint32_t)time(NULL); - LP_peersparse(mypeer,mypubsock,destipaddr,destport,retstr,now); - free(retstr); - if ( IAMLP != 0 ) - { - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( peer->lasttime != now ) - { - printf("{%s:%u}.%d ",peer->ipaddr,peer->port,peer->lasttime - now); - flag++; - memset(&zero,0,sizeof(zero)); - if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,peer->sessionid,0,zero)) != 0 ) - free(retstr); - } - } - if ( flag != 0 ) - printf(" <- missing peers\n"); - } - } -} - int32_t LP_numpeers() { struct LP_peerinfo *peer,*tmp; int32_t numpeers = 0; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ae78a770d..219968200 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -314,7 +314,7 @@ char *LP_prices() return(jprint(array,1)); } -void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) +/*void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj) { struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; uint8_t rmd160[20]; int32_t i,n,relid,mismatch; char *base,*rel,*hexstr; double askprice; uint32_t now; now = (uint32_t)time(NULL); @@ -382,7 +382,7 @@ void LP_peer_pricesquery(struct LP_peerinfo *peer) { //printf("%s needs ping\n",peer->ipaddr); } -} +}*/ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,int32_t vout) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e621ac0a6..64719e0d5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -27,7 +27,7 @@ char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) maxerrs = LP_MAXPEER_ERRORS; if ( peer == 0 || (peer->errors < maxerrs || peer->good >= LP_MINPEER_GOOD) ) { - //printf("issue.(%s)\n",url); + printf("issue.(%s)\n",url); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) == 0 ) { if ( peer != 0 ) @@ -51,65 +51,37 @@ char *LP_isitme(char *destip,uint16_t destport) } else return(0); } -char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers) +void LP_peer_request(char *destip,uint16_t destport,cJSON *argjson) { - char url[512],*retstr; - sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d",destip,destport,ipaddr,port,numpeers); - retstr = LP_issue_curl("getpeers",destip,port,url); - //printf("%s -> getpeers.(%s)\n",destip,retstr); - return(retstr); + struct LP_peerinfo *peer; uint8_t *msg; int32_t msglen; uint32_t crc32; + peer = LP_peerfind((uint32_t)calc_ipbits(destip),destport); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + crc32 = calc_crc32(0,&msg[2],msglen - 2); + LP_queuesend(crc32,peer->pushsock,"","",msg,msglen); + free_json(argjson); } -char *issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t height,uint64_t value) +char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) { - char url[512],*retstr,str[65]; - if ( (retstr= LP_isitme(destip,destport)) != 0 ) - return(retstr); - sprintf(url,"http://%s:%u/api/stats/uitem?coin=%s&coinaddr=%s&txid=%s&vout=%d&ht=%d&value=%llu",destip,destport,symbol,coinaddr,bits256_str(str,txid),vout,height,(long long)value); - retstr = LP_issue_curl("uitem",destip,destport,url); - //printf("uitem.(%s)\n",retstr); + char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/psock?ispaired=%d",destip,destport-1,ispaired); + //return(LP_issue_curl("psock",destip,destport,url)); + retstr = issue_curlt(url,LP_HTTP_TIMEOUT*3); + printf("issue_LP_psock got (%s) from %s\n",retstr,destip); return(retstr); } -char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,uint32_t sessionid,char *rmd160str,bits256 pub) +void issue_LP_getpeers(char *destip,uint16_t destport) { - char url[512],*retstr,str[65]; - if ( (retstr= LP_isitme(destip,destport)) != 0 ) - return(retstr); - sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&session=%u",destip,destport,ipaddr,port,numpeers,sessionid); - if ( rmd160str != 0 && bits256_nonz(pub) != 0 ) - { - sprintf(url+strlen(url),"&rmd160=%s&pub=%s",rmd160str,bits256_str(str,pub)); - //printf("SEND (%s)\n",url); - } - return(LP_issue_curl("notify",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -} - -char *issue_LP_getprices(char *destip,uint16_t destport) -{ - char url[512]; - sprintf(url,"http://%s:%u/api/stats/getprices",destip,destport); - //printf("getutxo.(%s)\n",url); - return(LP_issue_curl("getprices",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -} - -char *issue_hello(uint16_t port) -{ - char url[512]; - sprintf(url,"http://127.0.0.1:%u/api/stats/hello",port); - //printf("getutxo.(%s)\n",url); - return(issue_curlt(url,600)); // might be starting a trade -} - -char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) -{ - char url[512],*retstr; - sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); - retstr = LP_issue_curl("listunspent",destip,destport,url); - //printf("listunspent.(%s) -> (%s)\n",url,retstr); - return(retstr); + cJSON *reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","getpeers"); + LP_peer_request(destip,destport,reqjson); + /*char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d",destip,destport,ipaddr,port,numpeers); + retstr = LP_issue_curl("getpeers",destip,port,url); + //printf("%s -> getpeers.(%s)\n",destip,retstr); + return(retstr);*/ } char *LP_apicall(struct iguana_info *coin,char *method,char *params) @@ -701,7 +673,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) { - struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0,destip[64]; uint16_t destport; + struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0; if ( symbol == 0 || symbol[0] == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) @@ -726,7 +698,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) { //printf("LP_listunspent_query.(%s %s)\n",symbol,coinaddr); LP_listunspent_query(coin->symbol,coin->smartaddr); - if ( fullflag != 0 ) + /*if ( fullflag != 0 ) { if ( (destport= LP_randpeer(destip)) > 0 ) { @@ -734,7 +706,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) //printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); retjson = cJSON_Parse(retstr); } else printf("LP_listunspent_issue couldnt get a random peer?\n"); - } + }*/ } if ( retjson != 0 ) { diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index f209a0737..c473d1614 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -132,6 +132,191 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil }*/ return(fp); } +#ifdef oldway +void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport) +{ + char *retstr; struct LP_peerinfo *peer,*tmp; bits256 zero; uint32_t now,flag = 0; + peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); + if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,mypeer!=0?mypeer->numpeers:0)) != 0 ) + { + //printf("got.(%s)\n",retstr); + now = (uint32_t)time(NULL); + LP_peersparse(mypeer,mypubsock,destipaddr,destport,retstr,now); + free(retstr); + if ( IAMLP != 0 ) + { + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( peer->lasttime != now ) + { + printf("{%s:%u}.%d ",peer->ipaddr,peer->port,peer->lasttime - now); + flag++; + memset(&zero,0,sizeof(zero)); + if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,peer->sessionid,0,zero)) != 0 ) + free(retstr); + } + } + if ( flag != 0 ) + printf(" <- missing peers\n"); + } + } +} +void issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,uint32_t sessionid,char *rmd160str,bits256 pub) +{ + cJSON *reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","notify"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"coinaddr",coinaddr); + jaddbits256(reqjson,"txid",txid); + jaddnum(reqjson,"vout",vout); + jaddnum(reqjson,"ht",height); + jadd64bits(reqjson,"value",value); + LP_peer_request(destip,destport,reqjson); + /*char url[512],*retstr,str[65]; + if ( (retstr= LP_isitme(destip,destport)) != 0 ) + return(retstr); + sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&session=%u",destip,destport,ipaddr,port,numpeers,sessionid); + if ( rmd160str != 0 && bits256_nonz(pub) != 0 ) + { + sprintf(url+strlen(url),"&rmd160=%s&pub=%s",rmd160str,bits256_str(str,pub)); + //printf("SEND (%s)\n",url); + } + return(LP_issue_curl("notify",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT));*/ +} + +char *issue_hello(uint16_t port) +{ + char url[512]; + sprintf(url,"http://127.0.0.1:%u/api/stats/hello",port); + //printf("getutxo.(%s)\n",url); + return(issue_curlt(url,600)); // might be starting a trade +} + + +void issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t height,uint64_t value) +{ + cJSON *reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","uitem"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"coinaddr",coinaddr); + jaddbits256(reqjson,"txid",txid); + jaddnum(reqjson,"vout",vout); + jaddnum(reqjson,"ht",height); + jadd64bits(reqjson,"value",value); + LP_peer_request(destip,destport,reqjson); + /*char url[512],*retstr,str[65]; + if ( (retstr= LP_isitme(destip,destport)) != 0 ) + return(retstr); + sprintf(url,"http://%s:%u/api/stats/uitem?coin=%s&coinaddr=%s&txid=%s&vout=%d&ht=%d&value=%llu",destip,destport,symbol,coinaddr,bits256_str(str,txid),vout,height,(long long)value); + retstr = LP_issue_curl("uitem",destip,destport,url); + //printf("uitem.(%s)\n",retstr); + return(retstr);*/ +} + +char *issue_LP_getprices(char *destip,uint16_t destport) +{ + char url[512]; + sprintf(url,"http://%s:%u/api/stats/getprices",destip,destport); + //printf("getutxo.(%s)\n",url); + return(LP_issue_curl("getprices",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT)); +} +void issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) +{ + cJSON *reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","listunspent"); + jaddstr(reqjson,"coin",symbol); + jaddstr(reqjson,"address",coinaddr); + LP_peer_request(destip,destport,reqjson); + /*char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); + retstr = LP_issue_curl("listunspent",destip,destport,url); + //printf("listunspent.(%s) -> (%s)\n",url,retstr); + return(retstr);*/ +} + + +int32_t LP_utxos_sync(struct LP_peerinfo *peer) +{ + int32_t i,j,n=0,m,v,posted=0; bits256 txid; cJSON *array,*item,*item2,*array2; uint64_t total,total2; struct iguana_info *coin,*ctmp; char *retstr,*retstr2; + if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + return(0); + HASH_ITER(hh,LP_coins,coin,ctmp) + { + if ( IAMLP == 0 && coin->inactive != 0 ) + continue; + if ( coin->smartaddr[0] == 0 ) + continue; + total = 0; + if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr,0)) == 0 ) + continue; + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) + { + //printf("UTXO sync.%d %s n.%d total %.8f -> %s (%s)\n",j,coin->symbol,n,dstr(total),peer->ipaddr,retstr); + total2 = 0; + if ( (array2= cJSON_Parse(retstr)) != 0 ) + { + if ( (m= cJSON_GetArraySize(array2)) > 0 ) + { + for (i=0; iipaddr,coin->symbol,jprint(item,0)); + issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value")); + posted++; + } + } + if ( 0 && posted != 0 ) + printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + } //else printf("%s matches %s\n",peer->ipaddr,coin->symbol); + free_json(array2); + } else printf("parse error (%s)\n",retstr); + free(retstr); + } + else if ( n != 0 && total != 0 ) + { + //printf("no response from %s for %s %s\n",peer->ipaddr,coin->symbol,coin->smartaddr); + for (i=0; iipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value")); + } + } + free_json(array); + } + } + return(posted); +} /*char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo) { char url[4096],str[65],str2[65],str3[65],*retstr; struct _LP_utxoinfo u; uint64_t val,val2; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 6ec674426..77187e067 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -33,7 +33,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char char *stats_validmethods[] = { "psock", "getprices", "listunspent", "notify", "getpeers", "uitem", // from issue_ - "orderbook", "help", "getcoins", "pricearray", "balance" + "orderbook", "help", "getcoins", "pricearray", "balance", "tradestatus" }; int32_t LP_valid_remotemethod(cJSON *argjson) From 6b32fb3382a1f72222e669021a19bf2707af4e21 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 20:16:10 +0200 Subject: [PATCH 2144/2732] Test --- crypto777/OS_portable.h | 1 + iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/stats.c | 11 ++++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 6c4a3ecbc..605eb544e 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -149,6 +149,7 @@ struct rpcrequest_info pthread_t T; int32_t sock; uint32_t ipbits; + uint16_t port,pad; }; struct OS_mappedptr diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 834ac4061..e906c3ae5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -988,6 +988,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } printf("got %s, initpeers\n",myipaddr); LP_initpeers(pubsock,mypeer,myipaddr,myport,jstr(argjson,"seednode")); + RPC_port = myport; printf("get public socket\n"); LP_mypullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); strcpy(LP_publicaddr,pushaddr); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 77187e067..51c68d9c8 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -219,7 +219,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } - if ( listen(sock,64) != 0 ) + if ( listen(sock,1) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); if ( sock >= 0 ) @@ -669,7 +669,7 @@ void LP_rpc_processreq(void *_ptr) { jsonflag = postflag = 0; portable_mutex_lock(&LP_commandmutex); - retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,RPC_port); + retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,req->port); portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { @@ -747,7 +747,6 @@ void stats_rpcloop(void *args) uint16_t port; int32_t retval,sock=-1,bindsock=-1; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; - RPC_port = port; printf("Start stats_rpcloop.%u\n",port); localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); //initial_bindsock_reset = LP_bindsock_reset; @@ -786,9 +785,15 @@ void stats_rpcloop(void *args) } #endif*/ memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); + if ( port == RPC_port && ipbits != localhostbits ) + { + closesocket(sock); + continue; + } req = calloc(1,sizeof(*req)); req->sock = sock; req->ipbits = ipbits; + req->port = port; LP_rpc_processreq(req); continue; // this leads to cant open file errors From 468a252c585211b41203060cf803aaa2fbf04827 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 20:22:02 +0200 Subject: [PATCH 2145/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e906c3ae5..93cd856a9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -736,6 +736,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint if ( seednode == 0 || seednode[0] == 0 ) { OS_randombytes((void *)&r,sizeof(r)); + issue_LP_getpeers("5.9.253.195",myport); for (j=0; j Date: Wed, 8 Nov 2017 20:29:12 +0200 Subject: [PATCH 2146/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 93cd856a9..77a844f76 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -704,7 +704,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) printf("privkey updates\n"); } -void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,char *seednode) +void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,char *seednode,uint16_t pushport,uint16_t subport) { int32_t i,j; uint32_t r; if ( IAMLP != 0 ) @@ -719,12 +719,9 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint { for (i=0; i 25 ) - // continue; - issue_LP_getpeers(default_LPnodes[i],myport); - //LP_peersquery(mypeer,pubsock,default_LPnodes[i],myport,mypeer->ipaddr,myport); + LP_addpeer(mypeer,pubsock,default_LPnodes[i],myport,pushport,subport,0,0,G.LP_sessionid); } - } else issue_LP_getpeers(seednode,myport); //LP_peersquery(mypeer,pubsock,seednode,myport,mypeer->ipaddr,myport); + } else LP_addpeer(mypeer,pubsock,seednode,myport,pushport,subport,0,0,G.LP_sessionid); } else { @@ -735,15 +732,16 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } if ( seednode == 0 || seednode[0] == 0 ) { + LP_addpeer(mypeer,pubsock,"5.9.253.195",myport,pushport,subport,0,0,G.LP_sessionid); OS_randombytes((void *)&r,sizeof(r)); - issue_LP_getpeers("5.9.253.195",myport); for (j=0; j Date: Wed, 8 Nov 2017 20:33:46 +0200 Subject: [PATCH 2147/2732] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 7aafd9055..12c8f1496 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -869,7 +869,7 @@ void LP_main(void *ptr) LP_profitratio += profitmargin; if ( (port= juint(argjson,"rpcport")) < 1000 ) port = LP_RPCPORT; - LPinit(port,LP_RPCPORT+1,LP_RPCPORT+2,LP_RPCPORT+3,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(port,LP_RPCPORT+10,LP_RPCPORT+20,LP_RPCPORT+30,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 65da7f36e7b1100d3c4fb71f7da81e31b5b1fed4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 20:40:00 +0200 Subject: [PATCH 2148/2732] test --- iguana/exchanges/LP_commands.c | 6 ++++++ iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 7 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5a45d9ee8..78acc03b1 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -548,6 +548,12 @@ bot_resume(botid)\n\ return(LP_uitem_recv(argjson)); else if ( strcmp(method,"notify") == 0 ) return(LP_notify_recv(argjson)); + else if ( strcmp(method,"getpeers") == 0 ) + { + bits256 zero; memset(zero.bytes,0,sizeof(zero)); + LP_reserved_msg(0,"","",zero,LP_peers()); + retstr = clonestr("{\"result\":\"success\"}"); + } // end received response else if ( strcmp(method,"tradestatus") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 77a844f76..6df051575 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -333,6 +333,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { methodstr[0] = 0; + printf("%s.(%s)\n",typestr,(char *)ptr); if ( 0 ) { cJSON *recvjson; char *mstr;//,*cstr; From a86474e0d502f034735294de4db507d45081ae09 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 20:50:19 +0200 Subject: [PATCH 2149/2732] Test --- iguana/exchanges/LP_commands.c | 8 ++++++-- iguana/exchanges/LP_nativeDEX.c | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 78acc03b1..e9004f4f2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -550,8 +550,12 @@ bot_resume(botid)\n\ return(LP_notify_recv(argjson)); else if ( strcmp(method,"getpeers") == 0 ) { - bits256 zero; memset(zero.bytes,0,sizeof(zero)); - LP_reserved_msg(0,"","",zero,LP_peers()); + if ( IAMLP != 0 ) + { + printf("send peers list\n"); + bits256 zero; memset(zero.bytes,0,sizeof(zero)); + LP_reserved_msg(0,"","",zero,LP_peers()); + } retstr = clonestr("{\"result\":\"success\"}"); } // end received response diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6df051575..579fd6e76 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -597,14 +597,15 @@ void LP_coinsloop(void *_coins) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { - static uint32_t counter,numpeers; - struct iguana_info *coin,*ctmp; char *origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t needpings,height,nonz = 0; - now = (uint32_t)time(NULL); + static uint32_t counter;//,numpeers; + struct iguana_info *coin,*ctmp; char *origipaddr; int32_t height,nonz = 0;//struct LP_peerinfo *peer,*tmp; uint32_t now; if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; if ( mypeer == 0 ) myipaddr = "127.0.0.1"; - numpeers = LP_numpeers(); + /* + now = (uint32_t)time(NULL); + numpeers = LP_numpeers(); needpings = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { @@ -624,7 +625,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { nonz++; - issue_LP_getpeers(peer->ipaddr,peer->port); + //issue_LP_getpeers(peer->ipaddr,peer->port); //LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); //if ( peer->diduquery == 0 ) // LP_peer_pricesquery(peer); @@ -633,7 +634,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } peer->lastpeers = now; } - /*if ( peer->needping != 0 ) + if ( peer->needping != 0 ) { peer->diduquery = now; nonz++; @@ -641,8 +642,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; needpings++; - }*/ - } + } + }*/ HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) @@ -1092,6 +1093,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } + LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr("{\"method\":\"getpeers\"}")); int32_t nonz; //uint32_t lasthello = 0; while ( 1 ) { From 92e8315eefc2a24bf8603b7c9bcac1e0c558e28c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 20:54:02 +0200 Subject: [PATCH 2150/2732] Test --- iguana/exchanges/LP_commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e9004f4f2..cdc53e662 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -550,6 +550,9 @@ bot_resume(botid)\n\ return(LP_notify_recv(argjson)); else if ( strcmp(method,"getpeers") == 0 ) { + char *tmpstr; + if ( (tmpstr= jstr(argjson,"ipaddr")) != 0 ) + LP_addpeer(LP_mypeer,LP_mypubsock,tmpstr,RPC_port,RPC_port+10,RPC_port+20,0,0,G.LP_sessionid); if ( IAMLP != 0 ) { printf("send peers list\n"); From a49b4f4e3b165de83ee71a9dd3b66e8063f6fda8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:03:20 +0200 Subject: [PATCH 2151/2732] Test --- iguana/exchanges/LP_commands.c | 17 ++++------ iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 21 ++++++++----- iguana/exchanges/LP_peers.c | 50 +++++------------------------- iguana/exchanges/LP_statemachine.c | 36 +++++++++++++++++++++ 5 files changed, 65 insertions(+), 61 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index cdc53e662..fc0d34d2b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -34,10 +34,10 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { - char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; + char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; //printf("stats_JSON(%s)\n",jprint(argjson,0)); method = jstr(argjson,"method"); - if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) + /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) { @@ -50,23 +50,18 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { if ( 0 && (otherpeers= jint(argjson,"numpeers")) > peer->numpeers ) peer->numpeers = otherpeers; - /*if ( 0 && (othernumutxos= jint(argjson,"numutxos")) > peer->numutxos ) - { - printf("change.(%s) numutxos.%d -> %d mynumutxos.%d\n",peer->ipaddr,peer->numutxos,othernumutxos,LP_mypeer != 0 ? LP_mypeer->numutxos:0); - peer->numutxos = othernumutxos; - }*/ if ( peer->sessionid == 0 ) peer->sessionid = juint(argjson,"session"); //printf("peer.(%s) found (%d %d) (%d %d) (%s)\n",peer->ipaddr,peer->numpeers,peer->numutxos,otherpeers,othernumutxos,jprint(argjson,0)); } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jint(argjson,"numpeers"),jint(argjson,"numutxos"),juint(argjson,"session")); } - } + }*/ if ( method == 0 ) { if ( is_cJSON_Array(argjson) != 0 ) printf("RAWARRAY command? %s\n",jprint(argjson,0)); if ( flag == 0 || jobj(argjson,"result") != 0 ) - printf("stats_JSON no method: (%s) (%s:%u)\n",jprint(argjson,0),ipaddr,argport); + printf("stats_JSON no method: (%s)\n",jprint(argjson,0)); return(0); } if ( strcmp(method,"hello") == 0 ) @@ -551,8 +546,8 @@ bot_resume(botid)\n\ else if ( strcmp(method,"getpeers") == 0 ) { char *tmpstr; - if ( (tmpstr= jstr(argjson,"ipaddr")) != 0 ) - LP_addpeer(LP_mypeer,LP_mypubsock,tmpstr,RPC_port,RPC_port+10,RPC_port+20,0,0,G.LP_sessionid); + if ( (tmpstr= jstr(argjson,"LPnode")) != 0 ) + LP_addpeer(LP_mypeer,LP_mypubsock,tmpstr,RPC_port,RPC_port+10,RPC_port+20,1,G.LP_sessionid); if ( IAMLP != 0 ) { printf("send peers list\n"); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1dfb2ce36..1b76e220a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -314,7 +314,7 @@ struct LP_peerinfo UT_hash_handle hh; uint64_t ip_port; uint32_t ipbits,errortime,errors,numpeers,needping,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; - int32_t pushsock,subsock; + int32_t pushsock,subsock,isLP; uint16_t port; char ipaddr[64]; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 579fd6e76..af84d3b71 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -711,7 +711,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t i,j; uint32_t r; if ( IAMLP != 0 ) { - LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,0,0,G.LP_sessionid); + LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,0,G.LP_sessionid); if ( myipaddr == 0 || mypeer == 0 ) { printf("couldnt get myipaddr or null mypeer.%p\n",mypeer); @@ -721,9 +721,9 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint { for (i=0; iipaddr); + jaddstr(item,"isLP",peer->ipaddr); jaddnum(item,"port",peer->port); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) { @@ -49,12 +49,13 @@ char *LP_peers() HASH_ITER(hh,LP_peerinfos,peer,tmp) { //if ( peer->errors < LP_MAXPEER_ERRORS ) + if ( peer->isLP != 0 ) jaddi(peersjson,LP_peerjson(peer)); } return(jprint(peersjson,1)); } -struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) +struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t isLP,uint32_t sessionid) { uint32_t ipbits; int32_t valid,pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); @@ -68,6 +69,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { if ( (peer= LP_peerfind(ipbits,port)) != 0 ) { + peer->isLP = isLP; /*if ( numpeers > peer->numpeers ) peer->numpeers = numpeers; if ( numutxos > peer->numutxos ) @@ -145,15 +147,15 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char if ( mypeer != 0 ) { mypeer->numpeers++; - printf("_LPaddpeer %s -> numpeers.%d mypubsock.%d other.(%d %d)\n",ipaddr,mypeer->numpeers,mypubsock,numpeers,numutxos); + printf("_LPaddpeer %s -> numpeers.%d mypubsock.%d other.(%d)\n",ipaddr,mypeer->numpeers,mypubsock,isLP); } else peer->numpeers = 1; // will become mypeer portable_mutex_unlock(&LP_peermutex); if ( IAMLP != 0 && mypubsock >= 0 ) { - struct iguana_info *coin,*ctmp; bits256 zero; char busaddr[64]; - memset(zero.bytes,0,sizeof(zero)); + struct iguana_info *coin,*ctmp; char busaddr[64]; // + //memset(zero.bytes,0,sizeof(zero)); //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); - LP_reserved_msg(0,"","",zero,jprint(LP_peerjson(peer),1)); + //LP_reserved_msg(0,"","",zero,jprint(LP_peerjson(peer),1)); if ( 0 ) { HASH_ITER(hh,LP_coins,coin,ctmp) @@ -202,42 +204,6 @@ int32_t LP_coinbus(uint16_t coin_busport) return(bussock); } -int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) -{ - struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t numpeers,i,n=0; - if ( (array= cJSON_Parse(retstr)) != 0 ) - { - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; i numpeers) ) - peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); - } - if ( peer != 0 ) - { - peer->lasttime = now; - if ( strcmp(argipaddr,destipaddr) == 0 && destport == argport && peer->numpeers != n ) - peer->numpeers = n; - } - } - } - } - free_json(array); - } - return(n); -} int32_t LP_numpeers() { diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index c473d1614..d518e18c3 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -133,6 +133,42 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil return(fp); } #ifdef oldway +int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) +{ + struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t numpeers,i,n=0; + if ( (array= cJSON_Parse(retstr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i numpeers) ) + peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); + } + if ( peer != 0 ) + { + peer->lasttime = now; + if ( strcmp(argipaddr,destipaddr) == 0 && destport == argport && peer->numpeers != n ) + peer->numpeers = n; + } + } + } + } + free_json(array); + } + return(n); +} void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport) { char *retstr; struct LP_peerinfo *peer,*tmp; bits256 zero; uint32_t now,flag = 0; From d32e024b4571644df08cfd0c22801c6fbf843722 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:10:33 +0200 Subject: [PATCH 2152/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index af84d3b71..64fde8eb5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1093,14 +1093,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } + char request[128]; if ( IAMLP == 0 ) - LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr("{\"method\":\"getpeers\"}")); - else - { - char request[128]; - sprintf(request,"{\"method\":\"getpeers\",\"LPnode\":\"%s\"}",myipaddr); - LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr(request)); - } + sprintf(request,"{\"method\":\"getpeers\",\"timestamp\":%u}",(uint32_t)time(NULL)); + else sprintf(request,"{\"method\":\"getpeers\",\"LPnode\":\"%s\",\"timestamp\":%u}",myipaddr,(uint32_t)time(NULL)); + LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr(request)); int32_t nonz; //uint32_t lasthello = 0; while ( 1 ) { From d216542623d496053436aa064130f93c033b6ae3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:19:14 +0200 Subject: [PATCH 2153/2732] Test --- iguana/exchanges/LP_commands.c | 6 +++--- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index fc0d34d2b..03d262bbb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -543,19 +543,19 @@ bot_resume(botid)\n\ return(LP_uitem_recv(argjson)); else if ( strcmp(method,"notify") == 0 ) return(LP_notify_recv(argjson)); - else if ( strcmp(method,"getpeers") == 0 ) + /*else if ( strcmp(method,"getpeers") == 0 ) { char *tmpstr; if ( (tmpstr= jstr(argjson,"LPnode")) != 0 ) LP_addpeer(LP_mypeer,LP_mypubsock,tmpstr,RPC_port,RPC_port+10,RPC_port+20,1,G.LP_sessionid); if ( IAMLP != 0 ) { - printf("send peers list\n"); + printf("send peers list %s\n",LP_peers()); bits256 zero; memset(zero.bytes,0,sizeof(zero)); LP_reserved_msg(0,"","",zero,LP_peers()); } retstr = clonestr("{\"result\":\"success\"}"); - } + }*/ // end received response else if ( strcmp(method,"tradestatus") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 64fde8eb5..33ea822ad 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1093,11 +1093,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - char request[128]; + /*char request[128]; if ( IAMLP == 0 ) sprintf(request,"{\"method\":\"getpeers\",\"timestamp\":%u}",(uint32_t)time(NULL)); else sprintf(request,"{\"method\":\"getpeers\",\"LPnode\":\"%s\",\"timestamp\":%u}",myipaddr,(uint32_t)time(NULL)); - LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr(request)); + LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr(request)); */ int32_t nonz; //uint32_t lasthello = 0; while ( 1 ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 1933f50a3..bb15ecfd6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -569,17 +569,22 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) timestamp = (uint32_t)time(NULL); jaddnum(reqjson,"timestamp",timestamp); LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); + if ( IAMLP != 0 ) + jaddstr(reqjson,"isLP",LP_myipaddr); + jaddnum(reqjson,"session",G.LP_sessionid); LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); } char *LP_notify_recv(cJSON *argjson) { - bits256 pub; struct LP_pubkeyinfo *pubp; + bits256 pub; struct LP_pubkeyinfo *pubp; char *ipaddr; pub = jbits256(argjson,"pub"); if ( bits256_nonz(pub) != 0 ) { if ( (pubp= LP_pubkeyadd(pub)) != 0 ) LP_pubkey_sigcheck(pubp,argjson); + if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) + LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,RPC_port,RPC_port+10,RPC_port+20,1,juint(argjson,"session")); //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); } return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); From a525e4e1b772117f8c1b136c24f00244faa2fb6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:28:13 +0200 Subject: [PATCH 2154/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 33ea822ad..a4fafcbe9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -333,7 +333,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { methodstr[0] = 0; - printf("%s.(%s)\n",typestr,(char *)ptr); + //printf("%s.(%s)\n",typestr,(char *)ptr); if ( 0 ) { cJSON *recvjson; char *mstr;//,*cstr; @@ -766,7 +766,7 @@ void LP_pubkeysloop(void *ctx) coin->lastunspent = (uint32_t)time(NULL); } } - if ( time(NULL) > lasttime+60 ) + if ( time(NULL) > lasttime+LP_ORDERBOOK_DURATION*0.5 ) { //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); From bdffba76023589c934de39998e6a0dd8b8444b33 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:31:57 +0200 Subject: [PATCH 2155/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_peers.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 03d262bbb..ae598dbfc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -543,6 +543,8 @@ bot_resume(botid)\n\ return(LP_uitem_recv(argjson)); else if ( strcmp(method,"notify") == 0 ) return(LP_notify_recv(argjson)); + else if ( strcmp(method,"getpeers") == 0 ) + retstr = clonestr("{\"error\":\"deprecated\"}"); /*else if ( strcmp(method,"getpeers") == 0 ) { char *tmpstr; diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 99f5b0da5..a7e2479b4 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -58,7 +58,6 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t isLP,uint32_t sessionid) { uint32_t ipbits; int32_t valid,pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; - printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); #ifdef LP_STRICTPEERS if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) return(0); @@ -79,6 +78,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char } else { + printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); peer = calloc(1,sizeof(*peer)); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) peer->sessionid = G.LP_sessionid; From e0b06b3ba5a7956b549fdc349e877e120bfe2785 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:33:23 +0200 Subject: [PATCH 2156/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a4fafcbe9..0a1457b7d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -574,7 +574,7 @@ void LP_coinsloop(void *_coins) continue; } nonz++; - if ( coin->lastscanht < coin->longestchain-3 ) + if ( 0 && coin->lastscanht < coin->longestchain-3 ) printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); for (j=0; j<100; j++) { From 5af0a5181e0668b938f54c355a50e7a9a0a388ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:42:33 +0200 Subject: [PATCH 2157/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 219968200..09904ce54 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1030,7 +1030,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; - //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); + printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { //if ( (fp= basepp->fps[relpp->ind]) == 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index bb15ecfd6..22b8a2460 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -471,7 +471,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postprice_recv(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); From c8a9d2ea4cebd4b1b8596b0ef9f493d1328704b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 21:46:35 +0200 Subject: [PATCH 2158/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 09904ce54..219968200 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1030,7 +1030,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; - printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); + //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { //if ( (fp= basepp->fps[relpp->ind]) == 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 22b8a2460..bb15ecfd6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -471,7 +471,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postprice_recv(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); From f26543502edf73d433d6462d3daf7b410b09e2f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:04:37 +0200 Subject: [PATCH 2159/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_rpc.c | 23 ----------------------- iguana/exchanges/LP_statemachine.c | 23 ++++++++++++++++++++++- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1b76e220a..b1fd07fe9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -38,7 +38,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAGICBITS 8 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 20 +#define LP_AUTOTRADE_TIMEOUT 30 #define ELECTRUM_TIMEOUT 5 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 62b50d9d2..c36c64d67 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -641,7 +641,7 @@ void prices_loop(void *ctx) } free(retstr); } - sleep(60); + sleep(120); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 64719e0d5..6b843316d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -51,17 +51,6 @@ char *LP_isitme(char *destip,uint16_t destport) } else return(0); } -void LP_peer_request(char *destip,uint16_t destport,cJSON *argjson) -{ - struct LP_peerinfo *peer; uint8_t *msg; int32_t msglen; uint32_t crc32; - peer = LP_peerfind((uint32_t)calc_ipbits(destip),destport); - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - crc32 = calc_crc32(0,&msg[2],msglen - 2); - LP_queuesend(crc32,peer->pushsock,"","",msg,msglen); - free_json(argjson); -} - char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) { char url[512],*retstr; @@ -72,18 +61,6 @@ char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) return(retstr); } -void issue_LP_getpeers(char *destip,uint16_t destport) -{ - cJSON *reqjson = cJSON_CreateObject(); - jaddstr(reqjson,"method","getpeers"); - LP_peer_request(destip,destport,reqjson); - /*char url[512],*retstr; - sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d",destip,destport,ipaddr,port,numpeers); - retstr = LP_issue_curl("getpeers",destip,port,url); - //printf("%s -> getpeers.(%s)\n",destip,retstr); - return(retstr);*/ -} - char *LP_apicall(struct iguana_info *coin,char *method,char *params) { cJSON *retjson; char *retstr; diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index d518e18c3..e22b7890d 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -169,7 +169,28 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa } return(n); } -void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport) +void issue_LP_getpeers(char *destip,uint16_t destport) +{ + cJSON *reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","getpeers"); + LP_peer_request(destip,destport,reqjson); + /*char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d",destip,destport,ipaddr,port,numpeers); + retstr = LP_issue_curl("getpeers",destip,port,url); + //printf("%s -> getpeers.(%s)\n",destip,retstr); + return(retstr);*/ +} + +void LP_peer_request(char *destip,uint16_t destport,cJSON *argjson) +{ + struct LP_peerinfo *peer; uint8_t *msg; int32_t msglen; uint32_t crc32; + peer = LP_peerfind((uint32_t)calc_ipbits(destip),destport); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + crc32 = calc_crc32(0,&msg[2],msglen - 2); + LP_queuesend(crc32,peer->pushsock,"","",msg,msglen); + free_json(argjson); +}void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport) { char *retstr; struct LP_peerinfo *peer,*tmp; bits256 zero; uint32_t now,flag = 0; peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); From a9763f0b7ef9ad4df662ba9b22379daf73768ffe Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:20:05 +0200 Subject: [PATCH 2160/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0a1457b7d..f9d4893cd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -711,7 +711,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t i,j; uint32_t r; if ( IAMLP != 0 ) { - LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,0,G.LP_sessionid); + LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,1,G.LP_sessionid); if ( myipaddr == 0 || mypeer == 0 ) { printf("couldnt get myipaddr or null mypeer.%p\n",mypeer); @@ -768,7 +768,7 @@ void LP_pubkeysloop(void *ctx) } if ( time(NULL) > lasttime+LP_ORDERBOOK_DURATION*0.5 ) { - //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); + printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); lasttime = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index bb15ecfd6..5c5ffdab4 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -584,7 +584,10 @@ char *LP_notify_recv(cJSON *argjson) if ( (pubp= LP_pubkeyadd(pub)) != 0 ) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) + { + printf("notify from isLP %s\n",ipaddr); LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,RPC_port,RPC_port+10,RPC_port+20,1,juint(argjson,"session")); + } //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); } return(clonestr("{\"result\":\"success\",\"notify\":\"received\"}")); From ea0aeee8ef9741168c2b3ee3536551f0c4c3a2a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:21:22 +0200 Subject: [PATCH 2161/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f9d4893cd..43ea59640 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -659,7 +659,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (height= LP_getheight(coin)) > coin->longestchain ) { coin->longestchain = height; - if ( coin->firstrefht != 0 ) + if ( 0 && coin->firstrefht != 0 ) printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); } //else LP_mempoolscan(coin->symbol,zero); coin->lastgetinfo = (uint32_t)time(NULL); From 55f8bfc35524565e44a9b01b134d9029dd69c4a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:29:19 +0200 Subject: [PATCH 2162/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 43ea59640..feb20b763 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -768,7 +768,7 @@ void LP_pubkeysloop(void *ctx) } if ( time(NULL) > lasttime+LP_ORDERBOOK_DURATION*0.5 ) { - printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); + //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); lasttime = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 5c5ffdab4..e28a1974f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -585,7 +585,7 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - printf("notify from isLP %s\n",ipaddr); + //printf("notify from isLP %s\n",ipaddr); LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,RPC_port,RPC_port+10,RPC_port+20,1,juint(argjson,"session")); } //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); From 7acc99a3c02bb5782c644ef785abf5b7c89ccacf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:35:42 +0200 Subject: [PATCH 2163/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index feb20b763..51c32dac8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -93,7 +93,8 @@ char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", - "24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", + "51.15.86.136", + //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", //"51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // @@ -734,7 +735,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } if ( seednode == 0 || seednode[0] == 0 ) { - LP_addpeer(mypeer,pubsock,"5.9.253.195",myport,pushport,subport,0,G.LP_sessionid); + LP_addpeer(mypeer,pubsock,"51.15.86.136",myport,pushport,subport,0,G.LP_sessionid); OS_randombytes((void *)&r,sizeof(r)); for (j=0; j Date: Wed, 8 Nov 2017 22:36:06 +0200 Subject: [PATCH 2164/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index e28a1974f..5c5ffdab4 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -585,7 +585,7 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - //printf("notify from isLP %s\n",ipaddr); + printf("notify from isLP %s\n",ipaddr); LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,RPC_port,RPC_port+10,RPC_port+20,1,juint(argjson,"session")); } //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); From 4f5e48ac87d525d9e8019787ed55b17ede1a081b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:43:03 +0200 Subject: [PATCH 2165/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 51c32dac8..cc9d7d69a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -93,9 +93,8 @@ char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", - "51.15.86.136", //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", - //"51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", + "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // From bcdbcd121c1a570cc7c613e7df756271912e53b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 22:53:13 +0200 Subject: [PATCH 2166/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cc9d7d69a..a0dbe10bf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,8 @@ // LP_nativeDEX.c // marketmaker // +// dynamic adding of new LP node +// withdraw too big // bot status 1600% ? // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 5c5ffdab4..e28a1974f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -585,7 +585,7 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - printf("notify from isLP %s\n",ipaddr); + //printf("notify from isLP %s\n",ipaddr); LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,RPC_port,RPC_port+10,RPC_port+20,1,juint(argjson,"session")); } //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); From 7b8cb29c9414e89e12c3d89505bddd7fa48586da Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 02:17:21 +0200 Subject: [PATCH 2167/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_remember.c | 1 + iguana/exchanges/LP_socket.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a0dbe10bf..15d76c144 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,8 @@ // marketmaker // // dynamic adding of new LP node +// swap started event for bot +// lack of full depth // withdraw too big // bot status 1600% ? // BCH signing diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 927af1771..f26467d3e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1115,6 +1115,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (fp= fopen(fname,"wb")) != 0 ) { jaddstr(item,"method","tradestatus"); + jaddstr(item,"gui",G.gui); itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); LP_tradecommand_log(item); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 69c79217c..9e8b9bbb8 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1049,8 +1049,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) struct electrum_info *ep; int32_t kickval,already; cJSON *retjson; if ( ipaddr == 0 || ipaddr[0] == 0 || port == 0 ) { - //coin->electrum = 0; - printf("would have disabled %s electrum here\n",coin->symbol); + coin->electrum = 0; + //printf("would have disabled %s electrum here\n",coin->symbol); return(cJSON_Parse("{\"result\":\"success\",\"status\":\"electrum mode disabled, now in native coin mode\"}")); } retjson = cJSON_CreateObject(); From 94dc2faa0a93e7837c3a81845c6697a3781e5f05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 10:33:52 +0200 Subject: [PATCH 2168/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 15d76c144..5fdaad251 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // dynamic adding of new LP node +// BTC swaps // swap started event for bot // lack of full depth // withdraw too big @@ -740,6 +741,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint { LP_addpeer(mypeer,pubsock,"51.15.86.136",myport,pushport,subport,0,G.LP_sessionid); OS_randombytes((void *)&r,sizeof(r)); + r = 0; for (j=0; j Date: Thu, 9 Nov 2017 11:09:13 +0200 Subject: [PATCH 2169/2732] Test --- iguana/exchanges/LP_network.c | 10 ++++++++++ iguana/exchanges/LP_rpc.c | 14 ++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9dd4ab2f6..a058f1aa6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -764,6 +764,16 @@ char *LP_psock(char *myipaddr,int32_t ispaired) */ +char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) +{ + char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/psock?ispaired=%d",destip,destport-1,ispaired); + //return(LP_issue_curl("psock",destip,destport,url)); + retstr = issue_curlt(url,LP_HTTP_TIMEOUT*3); + printf("issue_LP_psock got (%s) from %s\n",retstr,destip); + return(retstr); +} + uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) { uint16_t publicport = 0; char *retstr,*addr; cJSON *retjson; struct LP_peerinfo *peer,*tmp; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 6b843316d..f7bf6a38f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -18,7 +18,7 @@ // marketmaker // -char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) +/*char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) { char *retstr = 0; int32_t maxerrs; struct LP_peerinfo *peer = 0; peer = LP_peerfind((uint32_t)calc_ipbits(destip),port); @@ -40,7 +40,7 @@ char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url) peer->good++; } return(retstr); -} +}*/ char *LP_isitme(char *destip,uint16_t destport) { @@ -51,16 +51,6 @@ char *LP_isitme(char *destip,uint16_t destport) } else return(0); } -char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) -{ - char url[512],*retstr; - sprintf(url,"http://%s:%u/api/stats/psock?ispaired=%d",destip,destport-1,ispaired); - //return(LP_issue_curl("psock",destip,destport,url)); - retstr = issue_curlt(url,LP_HTTP_TIMEOUT*3); - printf("issue_LP_psock got (%s) from %s\n",retstr,destip); - return(retstr); -} - char *LP_apicall(struct iguana_info *coin,char *method,char *params) { cJSON *retjson; char *retstr; From dfbbc1d48fc393dde3ffe1543d84ea98e7418570 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 11:46:14 +0200 Subject: [PATCH 2170/2732] Test --- iguana/exchanges/LP_peers.c | 20 +++++++++++--------- iguana/exchanges/LP_signatures.c | 7 +++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index a7e2479b4..250fe68b2 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -210,7 +210,8 @@ int32_t LP_numpeers() struct LP_peerinfo *peer,*tmp; int32_t numpeers = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - numpeers++; + if ( peer->isLP != 0 ) + numpeers++; } return(numpeers); } @@ -218,21 +219,22 @@ int32_t LP_numpeers() uint16_t LP_randpeer(char *destip) { struct LP_peerinfo *peer,*tmp; uint16_t port = 0; int32_t n,r,numpeers = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - numpeers++; - } + destip[0] = 0; + numpeers = LP_numpeers(); if ( numpeers > 0 ) { r = rand() % numpeers; n = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( n++ == r ) + if ( peer->isLP != 0 ) { - strcpy(destip,peer->ipaddr); - port = peer->port; - break; + if ( n++ == r ) + { + strcpy(destip,peer->ipaddr); + port = peer->port; + break; + } } } } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index e28a1974f..72cbd6b43 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -559,7 +559,7 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) void LP_notify_pubkeys(void *ctx,int32_t pubsock) { - bits256 zero; uint32_t timestamp; char secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); + bits256 zero; uint32_t timestamp; char LPipaddr[64],secpstr[67]; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); jaddstr(reqjson,"method","notify"); jaddstr(reqjson,"rmd160",G.LP_myrmd160str); @@ -570,7 +570,10 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) jaddnum(reqjson,"timestamp",timestamp); LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); if ( IAMLP != 0 ) - jaddstr(reqjson,"isLP",LP_myipaddr); + { + if ( LP_randpeer(LPipaddr) != 0 ) + jaddstr(reqjson,"isLP",LPipaddr); + } jaddnum(reqjson,"session",G.LP_sessionid); LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); } From 811f01a3bad4b7c0ceea71412d44e5f5c4516609 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 12:11:03 +0200 Subject: [PATCH 2171/2732] Test --- iguana/exchanges/LP_signatures.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 72cbd6b43..c1032b823 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -571,8 +571,12 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); if ( IAMLP != 0 ) { - if ( LP_randpeer(LPipaddr) != 0 ) - jaddstr(reqjson,"isLP",LPipaddr); + if ( (rand() % 2) == 0 ) + LP_randpeer(LPipaddr); + else strcpy(LPipaddr,LP_myipaddr); + if ( LPipaddr[0] == 0 ) + strcpy(LPipaddr,LP_myipaddr); + jaddstr(reqjson,"isLP",LPipaddr); } jaddnum(reqjson,"session",G.LP_sessionid); LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); From 99195b78c4b106f40019e90de5542a350cde3ddc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 12:12:31 +0200 Subject: [PATCH 2172/2732] Test --- iguana/exchanges/LP_peers.c | 1 + iguana/exchanges/LP_signatures.c | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 250fe68b2..bd38ebd22 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -87,6 +87,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char strcpy(peer->ipaddr,ipaddr); //peer->profitmargin = profitmargin; peer->ipbits = ipbits; + peer->isLP = isLP; peer->port = port; peer->ip_port = ((uint64_t)port << 32) | ipbits; if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index c1032b823..c8552a02b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -571,12 +571,9 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); if ( IAMLP != 0 ) { - if ( (rand() % 2) == 0 ) - LP_randpeer(LPipaddr); - else strcpy(LPipaddr,LP_myipaddr); - if ( LPipaddr[0] == 0 ) - strcpy(LPipaddr,LP_myipaddr); - jaddstr(reqjson,"isLP",LPipaddr); + if ( LP_randpeer(LPipaddr) != 0 ) + jaddstr(reqjson,"isLP",LPipaddr); + else printf("no LPipaddr\n"); } jaddnum(reqjson,"session",G.LP_sessionid); LP_reserved_msg(0,"","",zero,jprint(reqjson,1)); From 82789a2380febe0df4d7e3a7b2136abe12e7d67d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 12:17:13 +0200 Subject: [PATCH 2173/2732] Test --- iguana/exchanges/LP_peers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index bd38ebd22..994880e1a 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -68,7 +68,8 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { if ( (peer= LP_peerfind(ipbits,port)) != 0 ) { - peer->isLP = isLP; + if ( isLP != 0 ) + peer->isLP = isLP; /*if ( numpeers > peer->numpeers ) peer->numpeers = numpeers; if ( numutxos > peer->numutxos ) From 6087ef3cabc3e877a61a5f53ecbc3fe44c05a42b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 12:21:52 +0200 Subject: [PATCH 2174/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5fdaad251..c5b941456 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -716,7 +716,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t i,j; uint32_t r; if ( IAMLP != 0 ) { - LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,1,G.LP_sessionid); + LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,pushport,subport,1,G.LP_sessionid); if ( myipaddr == 0 || mypeer == 0 ) { printf("couldnt get myipaddr or null mypeer.%p\n",mypeer); @@ -739,9 +739,9 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } if ( seednode == 0 || seednode[0] == 0 ) { - LP_addpeer(mypeer,pubsock,"51.15.86.136",myport,pushport,subport,0,G.LP_sessionid); + //LP_addpeer(mypeer,pubsock,"51.15.86.136",myport,pushport,subport,0,G.LP_sessionid); OS_randombytes((void *)&r,sizeof(r)); - r = 0; + //r = 0; for (j=0; j Date: Thu, 9 Nov 2017 12:46:05 +0200 Subject: [PATCH 2175/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_signatures.c | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c5b941456..ae68703a5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -121,7 +121,7 @@ struct LP_globals uint64_t LP_skipstatus[10000]; uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; - int32_t LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting,LP_numskips; + int32_t LP_IAMLP,LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting,LP_numskips; char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41],gui[16]; struct LP_privkey LP_privkeys[100]; } G; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a058f1aa6..eca82ba3c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -408,7 +408,7 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON msglen = (int32_t)strlen((char *)msg) + 1; if ( crc32 == 0 ) crc32 = calc_crc32(0,&msg[2],msglen - 2); - if ( IAMLP == 0 ) + if ( G.LP_IAMLP == 0 ) { free(msg); //printf("broadcast %s\n",jstr(argjson,"method")); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index c8552a02b..515ead03b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -589,7 +589,15 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - //printf("notify from isLP %s\n",ipaddr); + printf("notify got isLP %s\n",ipaddr); + if ( strcmp(ipaddr,LP_myipaddr) == 0 ) + { + if ( bits256_cmp(pub,G.LP_mypub25519) != 0 ) + { + char str[65]; printf("that's me! and it is from %s which isnt me\n",bits256_str(str,pub)); + G.LP_IAMLP = 1; + } + } LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,RPC_port,RPC_port+10,RPC_port+20,1,juint(argjson,"session")); } //char str[65]; printf("%.3f NOTIFIED pub %s rmd160 %s\n",OS_milliseconds()-millis,bits256_str(str,pub),rmd160str); From ceef97e9d57cf53469ef8cd129c8b76df6347717 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 12:49:51 +0200 Subject: [PATCH 2176/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ae68703a5..0750000e9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -90,18 +90,6 @@ struct iguana_info *LP_coins; struct LP_pubkeyinfo *LP_pubkeyinfos; struct rpcrequest_info *LP_garbage_collector; -#include "LP_network.c" - -char *activecoins[] = { "BTC", "KMD" }; -char GLOBAL_DBDIR[] = { "DB" }; -char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; -char LP_gui[16] = { "cli" }; - -char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", - //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", - "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", -};//"5.9.253.204" }; // - //uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; @@ -126,6 +114,19 @@ struct LP_globals struct LP_privkey LP_privkeys[100]; } G; +#include "LP_network.c" + +char *activecoins[] = { "BTC", "KMD" }; +char GLOBAL_DBDIR[] = { "DB" }; +char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; +char LP_gui[16] = { "cli" }; + +char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", + //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", + "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", +};//"5.9.253.204" }; // + + // stubs void tradebot_swap_balancingtrade(struct basilisk_swap *swap,int32_t iambob) From 559338a0bbd1a254f816ea7fd8af21d23f53f60e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 13:10:12 +0200 Subject: [PATCH 2177/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 44 ++---------------------------- iguana/exchanges/LP_peers.c | 25 +++++++++++++++++ iguana/exchanges/LP_signatures.c | 7 +++-- iguana/exchanges/LP_statemachine.c | 35 ++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 45 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b1fd07fe9..8c006a01a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -313,7 +313,7 @@ struct LP_peerinfo { UT_hash_handle hh; uint64_t ip_port; - uint32_t ipbits,errortime,errors,numpeers,needping,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; + uint32_t numrecv,ipbits,errortime,errors,numpeers,needping,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; int32_t pushsock,subsock,isLP; uint16_t port; char ipaddr[64]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0750000e9..3cd010478 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,8 +18,9 @@ // LP_nativeDEX.c // marketmaker // -// dynamic adding of new LP node +// detecting new deposits in inventory // BTC swaps +// bot progress // swap started event for bot // lack of full depth // withdraw too big @@ -1100,12 +1101,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); } - /*char request[128]; - if ( IAMLP == 0 ) - sprintf(request,"{\"method\":\"getpeers\",\"timestamp\":%u}",(uint32_t)time(NULL)); - else sprintf(request,"{\"method\":\"getpeers\",\"LPnode\":\"%s\",\"timestamp\":%u}",myipaddr,(uint32_t)time(NULL)); - LP_reserved_msg(0,"","",G.LP_mypub25519,clonestr(request)); */ - int32_t nonz; //uint32_t lasthello = 0; + int32_t nonz; while ( 1 ) { nonz = 0; @@ -1121,40 +1117,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - /*if ( IAMLP != 0 && time(NULL) > lasthello+600 ) - { - char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; - allgood = 0; - if ( (retstr= issue_hello(myport)) != 0 ) - { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"got hello") == 0 ) - allgood = 1; - else printf("strange return.(%s)\n",jprint(retjson,0)); - free_json(retjson); - } else printf("couldnt parse hello return.(%s)\n",retstr); - free(retstr); - } else printf("issue_hello NULL return\n"); - lasthello = (uint32_t)time(NULL); - if ( allgood == 0 ) - { - printf("RPC port got stuck, would have close bindsocket\n"); - if ( 0 ) - { - LP_bindsock = -1; - closesocket(sock); - LP_bindsock_reset++; - sleep(10); - printf("launch new rpcloop\n"); - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) - { - printf("error launching stats rpcloop for port.%u\n",myport); - exit(-1); - } - } - } - }*/ } #endif } diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 994880e1a..369b7618d 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -206,6 +206,12 @@ int32_t LP_coinbus(uint16_t coin_busport) return(bussock); } +void LP_peer_recv(char *ipaddr) +{ + struct LP_peerinfo *peer; + if ( (peer= LP_peerfind((uint32_t)calc_ipbits(ipaddr),RPC_port)) != 0 ) + peer->numrecv++; +} int32_t LP_numpeers() { @@ -242,3 +248,22 @@ uint16_t LP_randpeer(char *destip) } return(port); } + +uint16_t LP_rarestpeer(char *destip) +{ + struct LP_peerinfo *peer,*tmp,*rarest = 0; + destip[0] = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( peer->isLP != 0 ) + { + if ( rarest == 0 || peer->numrecv < rarest->numrecv ) + rarest = peer; + } + } + if ( rarest == 0 ) + LP_randpeer(destip); + else strcpy(destip,rarest->ipaddr); + return(rarest != 0 ? rarest->port : RPC_port); +} + diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 515ead03b..b399fd8a9 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -571,7 +571,7 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); if ( IAMLP != 0 ) { - if ( LP_randpeer(LPipaddr) != 0 ) + if ( LP_rarestpeer(LPipaddr) != 0 ) jaddstr(reqjson,"isLP",LPipaddr); else printf("no LPipaddr\n"); } @@ -589,8 +589,9 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - printf("notify got isLP %s\n",ipaddr); - if ( strcmp(ipaddr,LP_myipaddr) == 0 ) + //printf("notify got isLP %s\n",ipaddr); + LP_peer_recv(ipaddr); + if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 ) { if ( bits256_cmp(pub,G.LP_mypub25519) != 0 ) { diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index e22b7890d..5f598052d 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -132,6 +132,41 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil }*/ return(fp); } +/*if ( IAMLP != 0 && time(NULL) > lasthello+600 ) + { + char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; + allgood = 0; + if ( (retstr= issue_hello(myport)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (hellostr= jstr(retjson,"status")) != 0 && strcmp(hellostr,"got hello") == 0 ) + allgood = 1; + else printf("strange return.(%s)\n",jprint(retjson,0)); + free_json(retjson); + } else printf("couldnt parse hello return.(%s)\n",retstr); + free(retstr); + } else printf("issue_hello NULL return\n"); + lasthello = (uint32_t)time(NULL); + if ( allgood == 0 ) + { + printf("RPC port got stuck, would have close bindsocket\n"); + if ( 0 ) + { + LP_bindsock = -1; + closesocket(sock); + LP_bindsock_reset++; + sleep(10); + printf("launch new rpcloop\n"); + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } + } + } + }*/ + #ifdef oldway int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) { From a9ed99e47fbe0eb4d6f2324fd15603052cc15906 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 13:17:05 +0200 Subject: [PATCH 2178/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 45 ++---------------------------- iguana/exchanges/LP_statemachine.c | 41 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3cd010478..1b0aa2220 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -122,9 +122,9 @@ char GLOBAL_DBDIR[] = { "DB" }; char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; -char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", +char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", //"5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", - "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", + "51.15.203.171", "51.15.86.136", //"51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // @@ -610,47 +610,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int origipaddr = "127.0.0.1"; if ( mypeer == 0 ) myipaddr = "127.0.0.1"; - /* - now = (uint32_t)time(NULL); - numpeers = LP_numpeers(); - needpings = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( peer->errors >= LP_MAXPEER_ERRORS ) - { - if ( (rand() % 10000) == 0 ) - { - peer->errors--; - if ( peer->errors < LP_MAXPEER_ERRORS ) - peer->diduquery = 0; - } - if ( IAMLP == 0 ) - continue; - } - if ( now > peer->lastpeers+LP_ORDERBOOK_DURATION*.777 || (rand() % 100000) == 0 ) - { - if ( strcmp(peer->ipaddr,myipaddr) != 0 ) - { - nonz++; - //issue_LP_getpeers(peer->ipaddr,peer->port); - //LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); - //if ( peer->diduquery == 0 ) - // LP_peer_pricesquery(peer); - //LP_utxos_sync(peer); - needpings++; - } - peer->lastpeers = now; - } - if ( peer->needping != 0 ) - { - peer->diduquery = now; - nonz++; - if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) - free(retstr); - peer->needping = 0; - needpings++; - } - }*/ HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 5f598052d..6bb33ffcc 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -166,6 +166,47 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil } } }*/ +/* + now = (uint32_t)time(NULL); + numpeers = LP_numpeers(); + needpings = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( peer->errors >= LP_MAXPEER_ERRORS ) + { + if ( (rand() % 10000) == 0 ) + { + peer->errors--; + if ( peer->errors < LP_MAXPEER_ERRORS ) + peer->diduquery = 0; + } + if ( IAMLP == 0 ) + continue; + } + if ( now > peer->lastpeers+LP_ORDERBOOK_DURATION*.777 || (rand() % 100000) == 0 ) + { + if ( strcmp(peer->ipaddr,myipaddr) != 0 ) + { + nonz++; + //issue_LP_getpeers(peer->ipaddr,peer->port); + //LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + //if ( peer->diduquery == 0 ) + // LP_peer_pricesquery(peer); + //LP_utxos_sync(peer); + needpings++; + } + peer->lastpeers = now; + } + if ( peer->needping != 0 ) + { + peer->diduquery = now; + nonz++; + if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) + free(retstr); + peer->needping = 0; + needpings++; + } + }*/ #ifdef oldway int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) From bce640911609585ca8da9dc52bb46e16876a3187 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 13:46:22 +0200 Subject: [PATCH 2179/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_peers.c | 24 ++++++++++++++++++------ iguana/exchanges/LP_signatures.c | 6 +++++- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8c006a01a..12e801063 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -313,7 +313,7 @@ struct LP_peerinfo { UT_hash_handle hh; uint64_t ip_port; - uint32_t numrecv,ipbits,errortime,errors,numpeers,needping,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; + uint32_t recvtime,numrecv,ipbits,errortime,errors,numpeers,needping,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; int32_t pushsock,subsock,isLP; uint16_t port; char ipaddr[64]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1b0aa2220..afee51f50 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,6 +21,7 @@ // detecting new deposits in inventory // BTC swaps // bot progress +// will stale peers ever die? // swap started event for bot // lack of full depth // withdraw too big diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 30d3a8cb9..68f113732 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -453,7 +453,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo Alice_expiration = 0; LP_query(ctx,myipaddr,mypubsock,"connect",qp); } - } else printf("reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(),price,maxprice); + } else printf("probably a timeout, reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(),price,maxprice); } char *LP_connectedalice(cJSON *argjson) // alice diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 369b7618d..f7549a6a6 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -206,11 +206,15 @@ int32_t LP_coinbus(uint16_t coin_busport) return(bussock); } -void LP_peer_recv(char *ipaddr) +void LP_peer_recv(char *ipaddr,int32_t ismine) { struct LP_peerinfo *peer; if ( (peer= LP_peerfind((uint32_t)calc_ipbits(ipaddr),RPC_port)) != 0 ) + { peer->numrecv++; + if ( ismine != 0 ) + peer->recvtime = (uint32_t)time(NULL); + } } int32_t LP_numpeers() @@ -251,15 +255,23 @@ uint16_t LP_randpeer(char *destip) uint16_t LP_rarestpeer(char *destip) { - struct LP_peerinfo *peer,*tmp,*rarest = 0; + struct LP_peerinfo *peer,*tmp,*rarest = 0; int32_t iter; uint32_t now; + now = (uint32_t)time(NULL); destip[0] = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) + for (iter=0; iter<2; iter++) { - if ( peer->isLP != 0 ) + HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( rarest == 0 || peer->numrecv < rarest->numrecv ) - rarest = peer; + if ( iter == 0 && peer->recvtime < now-3600 ) + continue; + if ( peer->isLP != 0 ) + { + if ( rarest == 0 || peer->numrecv < rarest->numrecv ) + rarest = peer; + } } + if ( rarest != 0 ) + break; } if ( rarest == 0 ) LP_randpeer(destip); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b399fd8a9..dd099c919 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -572,7 +572,11 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) if ( IAMLP != 0 ) { if ( LP_rarestpeer(LPipaddr) != 0 ) + { jaddstr(reqjson,"isLP",LPipaddr); + if ( strcmp(LPipaddr,LP_myipaddr) == 0 ) + jaddnum(reqjson,"ismine",1); + } else printf("no LPipaddr\n"); } jaddnum(reqjson,"session",G.LP_sessionid); @@ -590,7 +594,7 @@ char *LP_notify_recv(cJSON *argjson) if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { //printf("notify got isLP %s\n",ipaddr); - LP_peer_recv(ipaddr); + LP_peer_recv(ipaddr,jint(argjson,ismine)); if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 ) { if ( bits256_cmp(pub,G.LP_mypub25519) != 0 ) From f485a93851b6c15607d78f586fd18bb225b35605 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 13:49:35 +0200 Subject: [PATCH 2180/2732] Test --- iguana/exchanges/LP_peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index f7549a6a6..f73ade5ec 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -262,7 +262,7 @@ uint16_t LP_rarestpeer(char *destip) { HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( iter == 0 && peer->recvtime < now-3600 ) + if ( iter == 0 && peer->recvtime < now-3600*24 ) continue; if ( peer->isLP != 0 ) { From 5bfa0fb4225327fe3e434f4630ba96af975c0f6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 13:51:22 +0200 Subject: [PATCH 2181/2732] Test --- iguana/exchanges/LP_signatures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index dd099c919..9e9e00520 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -593,8 +593,8 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - //printf("notify got isLP %s\n",ipaddr); - LP_peer_recv(ipaddr,jint(argjson,ismine)); + //printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"isming")); + LP_peer_recv(ipaddr,jint(argjson,"ismine")); if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 ) { if ( bits256_cmp(pub,G.LP_mypub25519) != 0 ) From 01d2480c37a6f970c4bcb4b029b82dc8769c5c0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 13:52:02 +0200 Subject: [PATCH 2182/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 9e9e00520..0182b6777 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -593,7 +593,7 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - //printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"isming")); + printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"isming")); LP_peer_recv(ipaddr,jint(argjson,"ismine")); if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 ) { From 1981dd5e00a0e5877052658a81adfbd740884ce3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 14:03:57 +0200 Subject: [PATCH 2183/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index afee51f50..16a1123ed 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,9 +21,8 @@ // detecting new deposits in inventory // BTC swaps // bot progress -// will stale peers ever die? +// will stale peers ever die? <- after a day it should // swap started event for bot -// lack of full depth // withdraw too big // bot status 1600% ? // BCH signing diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0182b6777..da0279b57 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -593,7 +593,7 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"isming")); + printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"ismine")); LP_peer_recv(ipaddr,jint(argjson,"ismine")); if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 ) { From ec01d0a02ec19c18e8b976859cb74f97cbe0656b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 14:08:48 +0200 Subject: [PATCH 2184/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index da0279b57..58590cae7 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -593,7 +593,7 @@ char *LP_notify_recv(cJSON *argjson) LP_pubkey_sigcheck(pubp,argjson); if ( (ipaddr= jstr(argjson,"isLP")) != 0 ) { - printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"ismine")); + //printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"ismine")); LP_peer_recv(ipaddr,jint(argjson,"ismine")); if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 ) { From d0941cd6a4f5e3814569208bae21dfbd40d95f5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 14:11:42 +0200 Subject: [PATCH 2185/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 16a1123ed..cc83f34a5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -124,7 +124,7 @@ char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", //"5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", - "51.15.203.171", "51.15.86.136", //"51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", + "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // From 76d202bc3e9f0d0e4e873ac9a4023061b9239bd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 14:58:37 +0200 Subject: [PATCH 2186/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a2042aab3..424925b2e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -965,7 +965,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ interest = 0; if ( up->U.height < 7777777 && strcmp(coin->symbol,"KMD") == 0 ) { - if ( (interest= LP_komodo_interest(up->U.txid,up->U.value)) > 0 ) + if ( 0 && (interest= LP_komodo_interest(up->U.txid,up->U.value)) > 0 ) { interestsum += interest; char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); From 4d47ff29eaa7003f36e2112a91e174661876665f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 15:16:21 +0200 Subject: [PATCH 2187/2732] Test --- iguana/exchanges/LP_tradebots.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index d58c870eb..0d574756f 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -414,7 +414,7 @@ char *LP_tradebot_statuslist(void *ctx,int32_t pubsock,cJSON *argjson) char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,double relvolume) { - struct LP_tradebot *bot; char *retstr; double shortfall; int32_t i,n; cJSON *array,*item,*retjson; uint64_t txfees,balance=0,abalance=0; struct iguana_info *basecoin,*relcoin; + struct LP_tradebot *bot; char *retstr; double shortfall; int32_t i,n; cJSON *array,*item,*retjson; uint64_t sum,txfee,txfees,balance=0,abalance=0; struct iguana_info *basecoin,*relcoin; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 || basecoin->inactive != 0 || relcoin->inactive != 0 ) @@ -433,7 +433,8 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl } if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) free(retstr); - txfees = 10 * relcoin->txfee; + txfee = LP_txfeecalc(relcoin,0,0); + txfees = 10 * txfee; printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees)); if ( dstr(abalance) < relvolume + dstr(txfees) ) { @@ -449,22 +450,23 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - if ( balance > (relvolume + 10*relvolume/777.) ) + sum = (relvolume+2*dstr(txfees)) + 3 * ((relvolume+2*dstr(txfees))/777); + if ( balance >= sum+txfee ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; outputjson = cJSON_CreateObject(); outputs = cJSON_CreateArray(); item = cJSON_CreateObject(); - jaddnum(item,relcoin->smartaddr,relvolume+dstr(txfees)); + jaddnum(item,relcoin->smartaddr,relvolume+2*dstr(txfees)); jaddi(outputs,item); item = cJSON_CreateObject(); - jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); + jaddnum(item,relcoin->smartaddr,(relvolume+2*dstr(txfees))/777); jaddi(outputs,item); item = cJSON_CreateObject(); - jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); + jaddnum(item,relcoin->smartaddr,(relvolume+2*dstr(txfees))/777); jaddi(outputs,item); item = cJSON_CreateObject(); - jaddnum(item,relcoin->smartaddr,(relvolume+dstr(txfees))/777); + jaddnum(item,relcoin->smartaddr,(relvolume+2*dstr(txfees))/777); jaddi(outputs,item); jadd(outputjson,"outputs",outputs); if ( (withdrawstr= LP_withdraw(relcoin,outputjson)) != 0 ) From bdc01eb1336c6b3ad88ebf2f9f0335bbef6b161a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 15:41:49 +0200 Subject: [PATCH 2188/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 -- iguana/exchanges/LP_portfolio.c | 9 +++++++-- iguana/exchanges/install | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cc83f34a5..a76bd882c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,9 +21,7 @@ // detecting new deposits in inventory // BTC swaps // bot progress -// will stale peers ever die? <- after a day it should // swap started event for bot -// withdraw too big // bot status 1600% ? // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index c36c64d67..87b50f474 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -222,7 +222,7 @@ struct LP_autoprice_ref int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { //curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" - struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor,fixedprice; + struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase="",*refrel=""; double minprice,margin,offset,factor,fixedprice; //printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { @@ -238,8 +238,13 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) basepp->margins[relpp->ind] = margin; basepp->offsets[relpp->ind] = offset; basepp->factors[relpp->ind] = factor; - if ( (refbase= jstr(argjson,"refbase")) != 0 && (refrel= jstr(argjson,"refrel")) != 0 ) + if ( fixedprice > SMALLVAL || ((refbase= jstr(argjson,"refbase")) != 0 && (refrel= jstr(argjson,"refrel")) != 0) ) { + if ( fixedprice > SMALLVAL ) + { + refbase = base; + refrel = rel; + } for (i=0; i Date: Thu, 9 Nov 2017 15:48:48 +0200 Subject: [PATCH 2189/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 87b50f474..dcbd52962 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -481,7 +481,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) { - //printf("check ref-autoprice %s/%s\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel); + printf("check ref-autoprice %s/%s\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel); LP_autopriceset(ctx,1,basepp,relpp,0.,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } @@ -646,7 +646,7 @@ void prices_loop(void *ctx) } free(retstr); } - sleep(120); + sleep(10); } } From 8b9d96dbca2cb26e472c5764aaecf4df98960e2a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 15:53:43 +0200 Subject: [PATCH 2190/2732] Test --- iguana/exchanges/LP_portfolio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index dcbd52962..f73b8f290 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -608,6 +608,7 @@ void prices_loop(void *ctx) prices_loop_stats.threshold = 91000.; while ( 1 ) { + printf("prices loop autoprices.%d autorefs.%d\n",LP_autoprices,num_LP_autorefs); LP_millistats_update(&prices_loop_stats); LP_tradebots_timeslice(ctx); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) From 51ab35521bab983c70ffce4ddd05938fdbf1f079 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 15:58:39 +0200 Subject: [PATCH 2191/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/LP_peers.c | 4 ++-- iguana/exchanges/LP_portfolio.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a76bd882c..df1033766 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -469,17 +469,17 @@ void LP_coinsloop(void *_coins) if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); - LP_coinsloopBTC_stats.threshold = 2000.; + LP_coinsloopBTC_stats.threshold = 20000.; } else if ( strcmp("KMD",coins) == 0 ) { strcpy(LP_coinsloopKMD_stats.name,"KMD coin loop"); - LP_coinsloopKMD_stats.threshold = 1000.; + LP_coinsloopKMD_stats.threshold = 10000.; } else { strcpy(LP_coinsloop_stats.name,"other coins loop"); - LP_coinsloop_stats.threshold = 500.; + LP_coinsloop_stats.threshold = 5000.; } while ( 1 ) { diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index f73ade5ec..d4fcc603a 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -79,7 +79,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char } else { - printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); + //printf("addpeer (%s:%u) pushport.%u subport.%u\n",ipaddr,port,pushport,subport); peer = calloc(1,sizeof(*peer)); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) peer->sessionid = G.LP_sessionid; @@ -143,7 +143,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); if ( peer->pushsock >= 0 && peer->subsock >= 0 ) { - printf("add peer %s\n",peer->ipaddr); + //printf("add peer %s\n",peer->ipaddr); portable_mutex_lock(&LP_peermutex); HASH_ADD(hh,LP_peerinfos,ip_port,sizeof(peer->ip_port),peer); if ( mypeer != 0 ) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index f73b8f290..60a69b860 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -481,7 +481,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) { - printf("check ref-autoprice %s/%s\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel); + printf("check ref-autoprice %s/%s %f\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind]); LP_autopriceset(ctx,1,basepp,relpp,0.,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } From 94d2507f19954c95c4d99a2ecb0e977793d349d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 16:04:37 +0200 Subject: [PATCH 2192/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index df1033766..fa233ec68 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -716,7 +716,7 @@ void LP_pubkeysloop(void *ctx) { static uint32_t lasttime; cJSON *retjson; struct iguana_info *coin,*tmp; strcpy(LP_pubkeysloop_stats.name,"LP_pubkeysloop"); - LP_pubkeysloop_stats.threshold = 5000.; + LP_pubkeysloop_stats.threshold = 15000.; sleep(10); while ( 1 ) { diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 60a69b860..3a98c01ee 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -481,7 +481,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) { - printf("check ref-autoprice %s/%s %f\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind]); + printf("check ref-autoprice %s/%s %f %f\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind],basepp->fixedprices[relpp->ind]); LP_autopriceset(ctx,1,basepp,relpp,0.,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } From e9b7dbb57177eae68094af08f2d073c1424987d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 16:11:50 +0200 Subject: [PATCH 2193/2732] Test --- iguana/exchanges/LP_peers.c | 2 +- iguana/exchanges/LP_portfolio.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index d4fcc603a..e65d4806a 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -106,7 +106,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; //nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); - printf("connected to push.(%s) pushsock.%d valid.%d\n",pushaddr,pushsock,valid); + printf("connected to push.(%s) pushsock.%d valid.%d | ",pushaddr,pushsock,valid); peer->connected = (uint32_t)time(NULL); peer->pushsock = pushsock; if ( (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 ) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 3a98c01ee..a6fb61d34 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -242,8 +242,8 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { if ( fixedprice > SMALLVAL ) { - refbase = base; - refrel = rel; + refbase = rel; + refrel = base; } for (i=0; i Date: Thu, 9 Nov 2017 16:18:09 +0200 Subject: [PATCH 2194/2732] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_portfolio.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eca82ba3c..1112532ab 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -187,7 +187,7 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) { if ( n > maxn ) { - printf("LP_calc_magic maxn.%d <- %d\n",maxn,n); + printf("LP_calc_magic maxn.%d <- %d | ",maxn,n); maxn = n; } printf("millis %.3f ave %.3f, aveiters %.1f\n",OS_milliseconds() - millis,sum/counter,(double)nsum/counter); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index a6fb61d34..607853dea 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -284,6 +284,13 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,fixedprice); return; } + else if ( (fixedprice= basepp->fixedprices[relpp->ind]) > SMALLVAL ) + { + LP_mypriceset(&changed,basepp->symbol,relpp->symbol,fixedprice); + printf("autoprice FIXED %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,fixedprice); + return; + } if ( margin != 0. || oppomargin != 0. ) { offset = basepp->offsets[relpp->ind]; From 836a2ce6ba5fe801ddd94d1894f94305133737ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 16:22:01 +0200 Subject: [PATCH 2195/2732] Test --- iguana/exchanges/LP_portfolio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 607853dea..cd9ccab14 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -242,8 +242,8 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { if ( fixedprice > SMALLVAL ) { - refbase = rel; - refrel = base; + refbase = base; + refrel = rel; } for (i=0; ifixedprices[relpp->ind]) > SMALLVAL ) { LP_mypriceset(&changed,basepp->symbol,relpp->symbol,fixedprice); - printf("autoprice FIXED %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); + printf("autoprice FIXED2 %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,fixedprice); return; } From 34edbfc270ae42fca27d1d3793324f285fe92adc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 16:27:51 +0200 Subject: [PATCH 2196/2732] Test --- iguana/exchanges/LP_portfolio.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index cd9ccab14..ff6e7709a 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -277,20 +277,13 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP double margin,minprice,newprice,oppomargin,fixedprice,factor,offset; double bid,ask; int32_t changed; margin = basepp->margins[relpp->ind]; oppomargin = relpp->margins[basepp->ind]; - if ( (fixedprice= relpp->fixedprices[basepp->ind]) > SMALLVAL ) + if ( (fixedprice= basepp->fixedprices[relpp->ind]) > SMALLVAL ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,fixedprice); printf("autoprice FIXED %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,fixedprice); return; } - else if ( (fixedprice= basepp->fixedprices[relpp->ind]) > SMALLVAL ) - { - LP_mypriceset(&changed,basepp->symbol,relpp->symbol,fixedprice); - printf("autoprice FIXED2 %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,basepp->symbol,relpp->symbol,fixedprice); - return; - } if ( margin != 0. || oppomargin != 0. ) { offset = basepp->offsets[relpp->ind]; From 698f3a76b1d835b19a339fd17c4c83fced11f38f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 16:42:08 +0200 Subject: [PATCH 2197/2732] Test --- iguana/exchanges/LP_signatures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 58590cae7..b20a26c85 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -448,7 +448,8 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re { struct iguana_info *basecoin,*relcoin; char pubsecpstr[67]; uint32_t timestamp; uint64_t price64; bits256 zero; cJSON *reqjson = cJSON_CreateObject(); // LP_addsig - if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 && relcoin->electrum == 0 ) + printf("base %s, rel %s %.8f\n",base,rel,price); + if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && relcoin->electrum == 0 )//&& basecoin->electrum == 0 ) { memset(zero.bytes,0,sizeof(zero)); jaddbits256(reqjson,"pubkey",G.LP_mypub25519); From 1410a8c285d77fe3b053a988f606f45a1f2790b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 16:47:08 +0200 Subject: [PATCH 2198/2732] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- iguana/exchanges/LP_signatures.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index ff6e7709a..2c4fad44a 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -481,7 +481,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) relpp = LP_priceinfofind(LP_autorefs[i].rel); if ( basepp != 0 && relpp != 0 ) { - printf("check ref-autoprice %s/%s %f %f\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind],basepp->fixedprices[relpp->ind]); + //printf("check ref-autoprice %s/%s %f %f\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind],basepp->fixedprices[relpp->ind]); LP_autopriceset(ctx,1,basepp,relpp,0.,LP_autorefs[i].refbase,LP_autorefs[i].refrel); } } @@ -608,7 +608,7 @@ void prices_loop(void *ctx) prices_loop_stats.threshold = 91000.; while ( 1 ) { - printf("prices loop autoprices.%d autorefs.%d\n",LP_autoprices,num_LP_autorefs); + //printf("prices loop autoprices.%d autorefs.%d\n",LP_autoprices,num_LP_autorefs); LP_millistats_update(&prices_loop_stats); LP_tradebots_timeslice(ctx); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b20a26c85..909e6bd74 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -448,8 +448,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re { struct iguana_info *basecoin,*relcoin; char pubsecpstr[67]; uint32_t timestamp; uint64_t price64; bits256 zero; cJSON *reqjson = cJSON_CreateObject(); // LP_addsig - printf("base %s, rel %s %.8f\n",base,rel,price); - if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && relcoin->electrum == 0 )//&& basecoin->electrum == 0 ) + if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 )//&& relcoin->electrum == 0 ) { memset(zero.bytes,0,sizeof(zero)); jaddbits256(reqjson,"pubkey",G.LP_mypub25519); From cf677af942d6f00e12c35745500c9f64454cc18c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 17:21:09 +0200 Subject: [PATCH 2199/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_utxo.c | 8 ++++---- iguana/exchanges/LP_utxos.c | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fa233ec68..ea330bf64 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -120,7 +120,7 @@ char GLOBAL_DBDIR[] = { "DB" }; char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; -char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", //"5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", +char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", //"5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2c4fad44a..a5b9ac1c8 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -280,7 +280,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *basepp,struct LP if ( (fixedprice= basepp->fixedprices[relpp->ind]) > SMALLVAL ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,fixedprice); - printf("autoprice FIXED %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); + //printf("autoprice FIXED %s/%s <- %.8f\n",basepp->symbol,relpp->symbol,fixedprice); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,fixedprice); return; } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 161e19502..f2a1ed020 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -912,22 +912,22 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol { if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) { - printf("txid spent\n"); + //printf("txid spent\n"); return(0); } if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 ) { - printf("txid2 spent\n"); + //printf("txid2 spent\n"); return(0); } if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) { - printf("txid %s spentB\n",destaddr); + //printf("txid %s spentB\n",destaddr); return(0); } if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) { - printf("txid2 %s spentB\n",destaddr); + //printf("txid2 %s spentB\n",destaddr); return(0); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a162aab5a..86837cc81 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -268,7 +268,6 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { - printf("not elibible\n"); //if ( utxo->T.spentflag == 0 ) // utxo->T.spentflag = (uint32_t)time(NULL); continue; From 702cc4f9065cb54c9fd969ac90e606ffef3e2d3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 17:25:15 +0200 Subject: [PATCH 2200/2732] Test --- iguana/exchanges/LP_tradebots.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 0d574756f..24769dbdf 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -611,6 +611,7 @@ char *LP_tradebot_resume(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjson) { uint32_t botid; + printf("LP_istradebots_command check %s\n",method); if ( strncmp("bot_",method,strlen("bot_")) != 0 ) return(0); if ( strcmp(method,"bot_list") == 0 ) From c6c0b0f0afa3be718dd082df6cdb47a7370ba3c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 17:44:57 +0200 Subject: [PATCH 2201/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_tradebots.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 12e801063..b81a0460e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -39,7 +39,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 30 -#define ELECTRUM_TIMEOUT 5 +#define ELECTRUM_TIMEOUT 15 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index a5b9ac1c8..43fd77c89 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -647,7 +647,7 @@ void prices_loop(void *ctx) } free(retstr); } - sleep(10); + sleep(30); } } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 24769dbdf..e42fc369c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -611,7 +611,7 @@ char *LP_tradebot_resume(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid char *LP_istradebots_command(void *ctx,int32_t pubsock,char *method,cJSON *argjson) { uint32_t botid; - printf("LP_istradebots_command check %s\n",method); + //printf("LP_istradebots_command check %s\n",method); if ( strncmp("bot_",method,strlen("bot_")) != 0 ) return(0); if ( strcmp(method,"bot_list") == 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 424925b2e..5fe90e841 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1059,7 +1059,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf if ( numvins <= 0 || total < amount ) { printf("change %.8f = total %.8f - amount %.8f, adjust %.8f numvouts.%d, txfee %.8f\n",dstr(change),dstr(total),dstr(amount),dstr(adjust),numvouts,dstr(txfee)); - printf("not enough inputs for amount %.8f < %.8f txfee %.8f\n",dstr(total),dstr(amount),dstr(txfee)); + printf("not enough inputs %.8f < for amount %.8f txfee %.8f\n",dstr(total),dstr(amount),dstr(txfee)); return(0); } change = (total - amount); From ce9d4cbf1faaf83e0e4878e11e13b2b471cbcb02 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 17:58:07 +0200 Subject: [PATCH 2202/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ea330bf64..21e85027f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,6 +23,7 @@ // bot progress // swap started event for bot // bot status 1600% ? + // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9e8b9bbb8..8f9f899e9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -427,12 +427,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ - //portable_mutex_lock(&ep->mutex); + portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(5000); - //portable_mutex_unlock(&ep->mutex); + portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) From 55af1952d244524739c2d5ee165682eaeb761698 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 18:07:20 +0200 Subject: [PATCH 2203/2732] Allow clients to auto price inactive coins --- iguana/exchanges/LP_commands.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ae598dbfc..09d50622d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -272,6 +272,12 @@ bot_resume(botid)\n\ if ( base[0] != 0 && rel[0] != 0 ) { double price,bid,ask; + if ( strcmp(method,"autoprice") == 0 ) + { + if ( LP_autoprice(base,rel,argjson) < 0 ) + return(clonestr("{\"error\":\"couldnt set autoprice\"}")); + else return(clonestr("{\"result\":\"success\"}")); + } if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"error\":\"at least one of coins disabled\"}")); price = jdouble(argjson,"price"); @@ -283,12 +289,6 @@ bot_resume(botid)\n\ // return(clonestr("{\"error\":\"couldnt set price\"}")); else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } - else if ( strcmp(method,"autoprice") == 0 ) - { - if ( LP_autoprice(base,rel,argjson) < 0 ) - return(clonestr("{\"error\":\"couldnt set autoprice\"}")); - else return(clonestr("{\"result\":\"success\"}")); - } else if ( strcmp(method,"pricearray") == 0 ) { uint32_t firsttime; From ddded08d9fce22a202243a5d4821cc12c2e736e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 19:22:32 +0200 Subject: [PATCH 2204/2732] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 86837cc81..d743fafde 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -537,11 +537,11 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri height = jint(item,"height"); } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); - if ( satoshis != 0 && satoshis != value ) - printf("%s %s unexpected privkey_init value mismatch %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); + //if ( satoshis != 0 && satoshis != value ) + printf("%s %s privkey_init value %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) { - //printf("%s\n",jprint(item,0)); + printf("PREVENT %s\n",jprint(item,0)); values[i] = satoshis; //flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; From e2e686ce41be2d4d3df9b45ea7de4c6349bf6e93 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 19:33:09 +0200 Subject: [PATCH 2205/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f2a1ed020..8993db4d0 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -987,7 +987,7 @@ int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vo } if ( utxo->T.spentflag != 0 ) { - //char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); + char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); return(1); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index d743fafde..2b96fcca4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -537,7 +537,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri height = jint(item,"height"); } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); - //if ( satoshis != 0 && satoshis != value ) + if ( satoshis != 0 && satoshis != value ) printf("%s %s privkey_init value %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) { From 828b19046c4dc8d766a97354719444049d4f3744 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 19:36:30 +0200 Subject: [PATCH 2206/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8993db4d0..f2a1ed020 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -987,7 +987,7 @@ int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vo } if ( utxo->T.spentflag != 0 ) { - char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); + //char str[65]; printf("prevent adding iambob.%d %s/v%d to inventory\n",iambob,bits256_str(str,txid),vout); return(1); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2b96fcca4..67919c2ac 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -539,7 +539,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); if ( satoshis != 0 && satoshis != value ) printf("%s %s privkey_init value %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); - if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 && height > 0 ) + if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) != 0 )//&& height > 0 ) { printf("PREVENT %s\n",jprint(item,0)); values[i] = satoshis; From 040cc18eabd4c8cf75cb5c231e7bda51ac7c57fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 19:40:12 +0200 Subject: [PATCH 2207/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxos.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b81a0460e..3265b648f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -77,7 +77,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 1000 -#define LP_MINSIZE_TXFEEMULT 10 +#define LP_MINSIZE_TXFEEMULT 3 #define LP_REQUIRED_TXFEE 0.8 #define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 67919c2ac..5df269146 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -539,9 +539,8 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); if ( satoshis != 0 && satoshis != value ) printf("%s %s privkey_init value %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); - if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) != 0 )//&& height > 0 ) + if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 )//&& height > 0 ) { - printf("PREVENT %s\n",jprint(item,0)); values[i] = satoshis; //flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); } else used++; @@ -574,7 +573,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; From 06dd41964cd772d0900f8afb98a2cde92b5a32e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 19:50:01 +0200 Subject: [PATCH 2208/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5df269146..ea7d36b52 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -573,7 +573,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; From edd6cc25ad67c93fa5ce2fde9d3496286298f60a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 20:22:12 +0200 Subject: [PATCH 2209/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_ordermatch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 09d50622d..05065beea 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -592,7 +592,7 @@ bot_resume(botid)\n\ LP_address(ptr,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - //printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); + printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 68f113732..7943e27ee 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -866,7 +866,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i continue; if ( LP_RTmetrics_blacklisted(pubkey) >= 0 ) continue; - //printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); +printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { if ( bits256_nonz(destpubkey) == 0 ) @@ -887,7 +887,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) { - //printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); + printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } asatoshis = (asatoshis / 64) * 63; From 2536b867d55ecec7404bf7e84e381c04d65d0241 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 20:29:06 +0200 Subject: [PATCH 2210/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7943e27ee..2078f6cb0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -275,7 +275,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { From d2aea4882215cf96e3c74d7c038491cf348850bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 20:37:10 +0200 Subject: [PATCH 2211/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2078f6cb0..87df64790 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -817,6 +817,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); + printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) { bestutxo->pubkey = pubkey; @@ -866,7 +867,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i continue; if ( LP_RTmetrics_blacklisted(pubkey) >= 0 ) continue; -printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice); +printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { if ( bits256_nonz(destpubkey) == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f2a1ed020..17814f4be 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -179,7 +179,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( up->SPV < 0 || up->U.height == 0 ) { - //printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); +printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; continue; From 01a3df50368105623aa2e8619fe33226efa268be Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:09:44 +0200 Subject: [PATCH 2212/2732] Test --- iguana/exchanges/LP_include.h | 6 +++--- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_swap.c | 22 +++++++++++++++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3265b648f..e273515a6 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -163,7 +163,7 @@ struct basilisk_rawtxinfo { char destaddr[64],coinstr[16]; bits256 txid,signedtxid,actualtxid; - uint64_t amount,change,inputsum; + int64_t amount,change,inputsum; int32_t redeemlen,datalen,completed,vintype,vouttype,numconfirms,spendlen,secretstart,suppress_pubkeys; uint32_t locktime,crcs[2]; uint8_t addrtype,pubkey33[33],rmd160[20]; @@ -172,7 +172,7 @@ struct basilisk_rawtxinfo struct basilisk_request { uint32_t requestid,timestamp,quoteid,quotetime; // 0 to 15 - uint64_t srcamount,unused; // 16 to 31 + int64_t srcamount,unused; // 16 to 31 bits256 srchash; // 32 to 63 bits256 desthash; char src[8],dest[8]; @@ -199,7 +199,7 @@ struct basilisk_swapinfo bits256 myhash,otherhash,orderhash; uint32_t statebits,otherstatebits,started,expiration,finished,dead,reftime,putduration,callduration; int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad,aliceistrusted,bobistrusted,otheristrusted,otherstrust,alicemaxconfirms,bobmaxconfirms; - uint64_t alicesatoshis,bobsatoshis,bobinsurance,aliceinsurance,Atxfee,Btxfee; + int64_t alicesatoshis,bobsatoshis,bobinsurance,aliceinsurance,Atxfee,Btxfee; bits256 myprivs[2],mypubs[2],otherpubs[2],pubA0,pubA1,pubB0,pubB1,privAm,pubAm,privBn,pubBn; uint32_t crcs_mypub[2],crcs_mychoosei[2],crcs_myprivs[2],crcs_mypriv[2]; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 87df64790..8002c9420 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -509,7 +509,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //timeout = 1; //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); swap->tradeid = Q.tradeid; swap->N.pair = pairsock; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index b631f22e6..68fdea1ae 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -996,15 +996,31 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 { //FILE *fp; char fname[512]; uint8_t *alicepub33=0,*bobpub33=0; int32_t jumblrflag=-2,x = -1; struct iguana_info *coin; - swap->I.Atxfee = qp->desttxfee; - swap->I.Btxfee = qp->txfee; + if ( (swap->I.Atxfee= qp->desttxfee) < 0 ) + { + printf("bitcoin_swapinit %s Atxfee %.8f rejected\n",swap->I.req.dest,dstr(swap->I.Atxfee)); + return(0); + } + if ( (swap->I.Btxfee= qp->txfee) < 0 ) + { + printf("bitcoin_swapinit %s Btxfee %.8f rejected\n",swap->I.req.src,dstr(swap->I.Btxfee)); + return(0); + } swap->I.putduration = swap->I.callduration = INSTANTDEX_LOCKTIME; if ( optionduration < 0 ) swap->I.putduration -= optionduration; else if ( optionduration > 0 ) swap->I.callduration += optionduration; - swap->I.bobsatoshis = swap->I.req.srcamount; + if ( (swap->I.bobsatoshis= swap->I.req.srcamount) <= 0 ) + { + printf("bitcoin_swapinit %s bobsatoshis %.8f rejected\n",swap->I.req.src,dstr(swap->I.bobsatoshis)); + return(0); + } swap->I.alicesatoshis = swap->I.req.destamount; + { + printf("bitcoin_swapinit %s alicesatoshis %.8f rejected\n",swap->I.req.dest,dstr(swap->I.alicesatoshis)); + return(0); + } if ( (swap->I.bobinsurance= (swap->I.bobsatoshis / INSTANTDEX_INSURANCEDIV)) < LP_MIN_TXFEE ) swap->I.bobinsurance = LP_MIN_TXFEE; if ( (swap->I.aliceinsurance= (swap->I.alicesatoshis / INSTANTDEX_INSURANCEDIV)) < LP_MIN_TXFEE ) From 53ee3c842dc1f60e696902893815c6f538458539 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:10:40 +0200 Subject: [PATCH 2213/2732] Test --- iguana/exchanges/LP_ordermatch.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8002c9420..050c0d1b5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -275,7 +275,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + //printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { @@ -817,7 +817,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); - printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); + //printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) { bestutxo->pubkey = pubkey; @@ -883,12 +883,11 @@ printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,num bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); asatoshis = autxo->S.satoshis; LP_listunspent_query(base,coinaddr); - //LP_listunspent_both(base,coinaddr,1); for (j=0; jpubkey,gui)) != 0 ) { - printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); + //printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; } asatoshis = (asatoshis / 64) * 63; From f553f6f39a59608f0aa117dcabe5db1c0732e6d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:14:12 +0200 Subject: [PATCH 2214/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 050c0d1b5..ae1358942 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -509,7 +509,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //timeout = 1; //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); swap->tradeid = Q.tradeid; swap->N.pair = pairsock; From c75deee24607003f5d86cb120a06ab82ae8c50b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:19:24 +0200 Subject: [PATCH 2215/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ae1358942..a94ed096c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -867,7 +867,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i continue; if ( LP_RTmetrics_blacklisted(pubkey) >= 0 ) continue; -printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); +//printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { if ( bits256_nonz(destpubkey) == 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 219968200..ed2a52b8f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -813,7 +813,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 ) + if ( suppress_prefetch == 0 && n < 7 && bids[i]->numutxos < 3 ) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); @@ -833,7 +833,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos == 0 ) + if ( suppress_prefetch == 0 && n < 7 && asks[i]->numutxos < 3 ) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); From b3342b33223cc6f2bd2a9f7ced4ce560abc45013 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:39:12 +0200 Subject: [PATCH 2216/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_nativeDEX.c | 13 +++++++------ iguana/exchanges/LP_signatures.c | 12 ------------ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 05065beea..0d9508a18 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -593,6 +593,8 @@ bot_resume(botid)\n\ if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); + if ( ptr->lastpushtime > 0 && ptr->addr_listunspent_requested > (uint32_t)time(NULL)-10 ) + ptr->lastpushtime -= LP_ORDERBOOK_DURATION*0.1; ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 21e85027f..28be65d12 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -603,22 +603,23 @@ void LP_coinsloop(void *_coins) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) { - static uint32_t counter;//,numpeers; - struct iguana_info *coin,*ctmp; char *origipaddr; int32_t height,nonz = 0;//struct LP_peerinfo *peer,*tmp; uint32_t now; + static uint32_t counter; + struct iguana_info *coin,*ctmp; char *origipaddr; uint32_t now; int32_t height,nonz = 0; if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; if ( mypeer == 0 ) myipaddr = "127.0.0.1"; HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) + now = (uint32_t)time(NULL); + if ( (coin->addr_listunspent_requested != 0 && now > coin->lastpushtime+LP_ORDERBOOK_DURATION*.5) || now > coin->lastpushtime+LP_ORDERBOOK_DURATION*5 ) { //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); - coin->lastpushtime = (uint32_t)time(NULL); + coin->lastpushtime = (uint32_t)now; LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; } - if ( coin->electrum == 0 && coin->inactive == 0 && time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) + if ( coin->electrum == 0 && coin->inactive == 0 && now > coin->lastgetinfo+LP_GETINFO_INCR ) { nonz++; if ( (height= LP_getheight(coin)) > coin->longestchain ) @@ -627,7 +628,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( 0 && coin->firstrefht != 0 ) printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); } //else LP_mempoolscan(coin->symbol,zero); - coin->lastgetinfo = (uint32_t)time(NULL); + coin->lastgetinfo = (uint32_t)now; } } counter++; diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 909e6bd74..1ac171c03 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -629,17 +629,6 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); -#ifdef FROM_JS - //if ( 0 && (rand() % 100) == 0 && IAMLP == 0 ) - { - struct LP_peerinfo *peer,*tmp; char *retstr; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) - free(retstr); - } - } -#else req = cJSON_CreateObject(); jaddstr(req,"method","uitem"); jaddstr(req,"coin",coin->symbol); @@ -650,7 +639,6 @@ void LP_smartutxos_push(struct iguana_info *coin) jadd64bits(req,"value",value); //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); LP_reserved_msg(0,"","",zero,jprint(req,1)); -#endif } } free_json(array); From aa991bb70b1aaf55f6e762ad4e68d8d31d793e3b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:42:36 +0200 Subject: [PATCH 2217/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a94ed096c..137216143 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -968,15 +968,15 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - if ( destsatoshis - 2*desttxfee < autxo->S.satoshis ) + if ( destsatoshis - 0*desttxfee < autxo->S.satoshis ) { - destsatoshis -= 2*desttxfee; + //destsatoshis -= 2*desttxfee; autxo->S.satoshis = destsatoshis; //printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } - else if ( autxo->S.satoshis - 2*desttxfee < destsatoshis ) + else if ( autxo->S.satoshis - 0*desttxfee < destsatoshis ) { - autxo->S.satoshis -= 2*desttxfee; + autxo->S.satoshis -= 0*desttxfee; destsatoshis = autxo->S.satoshis; printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } From 74654150792480f968612554a66cc2338b47a970 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 21:47:14 +0200 Subject: [PATCH 2218/2732] Test --- iguana/exchanges/LP_ordermatch.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 137216143..9f815a585 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -359,10 +359,14 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ privkey = LP_privkey(utxo->coinaddr,coin->taddr); if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && { + LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-2*qp->txfee,rel,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + if ( (swap= LP_swapinit(1,0,privkey,&qp->R,qp)) == 0 ) + { + printf("cant initialize swap\n"); + return(-1); + } if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { - LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-2*qp->txfee,rel,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); - swap = LP_swapinit(1,0,privkey,&qp->R,qp); swap->N.pair = pair; utxo->S.swap = swap; swap->utxo = utxo; @@ -502,6 +506,13 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_nonz(Q.privkey) != 0 )//&& Q.quotetime >= Q.timestamp-3 ) { retjson = cJSON_CreateObject(); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + if ( (swap= LP_swapinit(0,0,Q.privkey,&Q.R,&Q)) == 0 ) + { + jaddstr(retjson,"error","couldnt swapinit"); + LP_availableset(autxo); + return(jprint(retjson,1)); + } if ( (pairstr= jstr(argjson,"pair")) == 0 || (pairsock= nn_socket(AF_SP,NN_PAIR)) < 0 ) jaddstr(retjson,"error","couldnt create pairsock"); else if ( nn_connect(pairsock,pairstr) >= 0 ) @@ -509,8 +520,6 @@ char *LP_connectedalice(cJSON *argjson) // alice //timeout = 1; //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); - swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); swap->tradeid = Q.tradeid; swap->N.pair = pairsock; autxo->S.swap = swap; From 2d8702cf8f169cb5c456236d833aae345d2baaa0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 22:02:39 +0200 Subject: [PATCH 2219/2732] Test --- iguana/exchanges/LP_swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 68fdea1ae..8671759fc 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1016,7 +1016,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 printf("bitcoin_swapinit %s bobsatoshis %.8f rejected\n",swap->I.req.src,dstr(swap->I.bobsatoshis)); return(0); } - swap->I.alicesatoshis = swap->I.req.destamount; + if ( (swap->I.alicesatoshis= swap->I.req.destamount) <= 0 ) { printf("bitcoin_swapinit %s alicesatoshis %.8f rejected\n",swap->I.req.dest,dstr(swap->I.alicesatoshis)); return(0); From 9e15bbcfc4c0cca57639cfdf2776a9fbcc1973a9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 22:30:42 +0200 Subject: [PATCH 2220/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_remember.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e273515a6..314cf975a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -77,7 +77,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 1000 -#define LP_MINSIZE_TXFEEMULT 3 +#define LP_MINSIZE_TXFEEMULT 10 #define LP_REQUIRED_TXFEE 0.8 #define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f26467d3e..f8bc1a227 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -839,7 +839,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti srcAdest = srcBdest = destAdest = destBdest = 0; if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 ) { - printf("legacy DB SWAPS.(%u %u) %llu files BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.requestid,rswap.quoteid,(long long)rswap.aliceid,rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); + //printf("legacy DB SWAPS.(%u %u) %llu files BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.requestid,rswap.quoteid,(long long)rswap.aliceid,rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); return(cJSON_Parse("{\"error\":\"mismatched bob/alice vs src/dest coins??\"}")); } alice = LP_coinfind(rswap.alicecoin); From 8f4ab8a4d633f6f51cc627e79e27c64c99d9f051 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 22:40:40 +0200 Subject: [PATCH 2221/2732] Test --- iguana/exchanges/LP_network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1112532ab..f553aca6c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -356,6 +356,7 @@ void queue_loop(void *arg) portable_mutex_unlock(&LP_networkmutex); free(ptr); ptr = 0; + break; } } if ( arg == 0 ) From e655f82bfb434533aef90923bca05944d2250165 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 23:02:44 +0200 Subject: [PATCH 2222/2732] Bot status --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_ordermatch.c | 37 ++++++++++++++++++++++++++++++-- iguana/exchanges/LP_tradebots.c | 28 +++++++++++++++++++++++- 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 314cf975a..e5a045e33 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -392,6 +392,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); //void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); +void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid); uint64_t LP_RTsmartbalance(struct iguana_info *coin); int32_t LP_getheight(struct iguana_info *coin); int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,char *msg); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 28be65d12..13b14f8ee 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,6 @@ // marketmaker // // detecting new deposits in inventory -// BTC swaps // bot progress // swap started event for bot // bot status 1600% ? diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9f815a585..f6e1f325f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -464,9 +464,15 @@ char *LP_connectedalice(cJSON *argjson) // alice { cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; //uint64_t value,value2; if ( LP_quoteparse(&Q,argjson) < 0 ) + { + LP_aliceid(Q.tradeid,Q.aliceid,"error0",0,0); clonestr("{\"error\":\"cant parse quote\"}"); + } if ( bits256_cmp(Q.desthash,G.LP_mypub25519) != 0 ) + { + LP_aliceid(Q.tradeid,Q.aliceid,"error1",0,0); return(clonestr("{\"result\",\"update stats\"}")); + } printf("CONNECTED.(%s) numpending.%d tradeid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid); /*if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) { @@ -479,16 +485,22 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { printf("cant find autxo\n"); + LP_aliceid(Q.tradeid,Q.aliceid,"error2",0,0); return(clonestr("{\"error\":\"cant find autxo\"}")); } if ( autxo->S.swap != 0 ) + { + LP_aliceid(Q.tradeid,Q.aliceid,"error3",0,0); return(clonestr("{\"error\":\"ignore duplicate swap\"}")); + } + LP_aliceid(Q.tradeid,Q.aliceid,"connected",Q.R.requestid,Q.R.quoteid); butxo = &B; memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(0,butxo,&Q); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); + LP_aliceid(Q.tradeid,Q.aliceid,"error4",0,0); printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } @@ -496,12 +508,16 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); + LP_aliceid(Q.tradeid,Q.aliceid,"error5",0,0); return(clonestr("{\"error\":\"no price set\"}")); } printf("%s/%s bid %.8f ask %.8f values %.8f %.8f\n",Q.srccoin,Q.destcoin,bid,ask,dstr(butxo->payment.value),dstr(butxo->deposit.value)); price = bid; if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) + { + LP_aliceid(Q.tradeid,Q.aliceid,"error6",0,0); return(clonestr("{\"error\":\"cant get alicecoin\"}")); + } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); if ( bits256_nonz(Q.privkey) != 0 )//&& Q.quotetime >= Q.timestamp-3 ) { @@ -511,10 +527,14 @@ char *LP_connectedalice(cJSON *argjson) // alice { jaddstr(retjson,"error","couldnt swapinit"); LP_availableset(autxo); + LP_aliceid(Q.tradeid,Q.aliceid,"error7",Q.R.requestid,Q.R.quoteid); return(jprint(retjson,1)); } if ( (pairstr= jstr(argjson,"pair")) == 0 || (pairsock= nn_socket(AF_SP,NN_PAIR)) < 0 ) + { + LP_aliceid(Q.tradeid,Q.aliceid,"error8",Q.R.requestid,Q.R.quoteid); jaddstr(retjson,"error","couldnt create pairsock"); + } else if ( nn_connect(pairsock,pairstr) >= 0 ) { //timeout = 1; @@ -524,6 +544,7 @@ char *LP_connectedalice(cJSON *argjson) // alice swap->N.pair = pairsock; autxo->S.swap = swap; swap->utxo = autxo; + LP_aliceid(Q.tradeid,Q.aliceid,"started",Q.R.requestid,Q.R.quoteid); printf("alice pairstr.(%s) pairsock.%d\n",pairstr,pairsock); if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_aliceloop,(void *)swap) == 0 ) { @@ -531,8 +552,18 @@ char *LP_connectedalice(cJSON *argjson) // alice jaddstr(retjson,"result","success"); //jaddnum(retjson,"requestid",Q.R.requestid); //jaddnum(retjson,"quoteid",Q.R.quoteid); - } else jaddstr(retjson,"error","couldnt aliceloop"); - } else printf("connect error %s\n",nn_strerror(nn_errno())); + } + else + { + LP_aliceid(Q.tradeid,Q.aliceid,"error9",Q.R.requestid,Q.R.quoteid); + jaddstr(retjson,"error","couldnt aliceloop"); + } + } + else + { + LP_aliceid(Q.tradeid,Q.aliceid,"error10",Q.R.requestid,Q.R.quoteid); + printf("connect error %s\n",nn_strerror(nn_errno())); + } printf("connected result.(%s)\n",jprint(retjson,0)); if ( jobj(retjson,"error") != 0 ) LP_availableset(autxo); @@ -541,6 +572,7 @@ char *LP_connectedalice(cJSON *argjson) // alice else { LP_availableset(autxo); + LP_aliceid(Q.tradeid,Q.aliceid,"error11",0,0); printf("no privkey found coin.%s %s taddr.%u\n",Q.destcoin,Q.destaddr,coin->taddr); return(clonestr("{\"error\",\"no privkey\"}")); } @@ -658,6 +690,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { + LP_aliceid(Q.tradeid,Q.aliceid,"reserved",0,0); printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index e42fc369c..862d68883 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -27,7 +27,7 @@ struct LP_tradebot_trade uint64_t aliceid; int32_t dispdir; uint32_t started,finished,requestid,quoteid,tradeid; - char base[32],rel[32]; + char base[32],rel[32],event[32]; }; struct LP_tradebot @@ -100,11 +100,15 @@ cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) double price,basevol; cJSON *item = cJSON_CreateObject(); if ( tp == 0 ) return(cJSON_Parse("{}")); + if ( tp->event[0] != 0 ) + jaddstr(item,"status",tp->event); if ( tp->requestid != 0 && tp->quoteid != 0 ) { jaddnum(item,"requestid",tp->requestid); jaddnum(item,"quoteid",tp->quoteid); } else jaddnum(item,"tradeid",tp->tradeid); + if ( tp->aliceid != 0 ) + jadd64bits(item,"aliceid",tp->aliceid); if ( tp->basevol > SMALLVAL && tp->relvol > SMALLVAL ) { if ( dispflag > 0 ) @@ -338,6 +342,28 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) bot->pause = (uint32_t)time(NULL); } +void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid) +{ + struct LP_tradebot *bot,*tmp; int32_t i; struct LP_tradebot_trade *tp; + DL_FOREACH_SAFE(LP_tradebots,bot,tmp) + { + for (i=0; inumtrades; i++) + { + if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->tradeid == tradeid ) + { + tp->aliceid = aliceid; + if ( requestid != 0 && quoteid != 0 ) + { + tp->requestid = requestid; + tp->quoteid = quoteid; + } + strcpy(tp->event,event); + break; + } + } + } +} + void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) { struct LP_tradebot *bot,*tmp; int32_t i; struct LP_tradebot_trade *tp; From 76dcacdbe483d64dbbba7898745bc5f2b755b9b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 23:24:05 +0200 Subject: [PATCH 2223/2732] Test --- iguana/exchanges/LP_utxo.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 17814f4be..076e6729d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -118,22 +118,22 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) struct LP_utxoinfo *utxo; if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { - char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); + //char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); return(utxo); } if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { - char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); + //char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); return(utxo); } if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { - char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); + //char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); return(utxo); } if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { - char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); + //char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); return(utxo); } return(0); @@ -976,10 +976,14 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vout) { - struct LP_utxoinfo *utxo; struct LP_transaction *tx; struct iguana_info *coin; + struct LP_address_utxo *up; struct LP_utxoinfo *utxo; struct LP_transaction *tx; struct iguana_info *coin; + if ( (coin= LP_coinfind(symbol)) == 0 ) + return(1); + if ( LP_allocated(txid,vout) != 0 ) + return(1); if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 || (utxo= LP_utxo2find(iambob,txid,vout)) != 0 ) { - if ( (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 ) + if ( coin != 0 && (tx= LP_transactionfind(coin,txid)) != 0 ) { if ( tx->outpoints[vout].spendheight > 0 ) utxo->T.spentflag = tx->outpoints[vout].spendheight; @@ -991,6 +995,8 @@ int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vo return(1); } } + if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) != 0 && up->spendheight > 0 ) + return(1); return(0); } From 58548ead1062c3d924ed411c5ba5925b8ec88b90 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 23:41:59 +0200 Subject: [PATCH 2224/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f7bf6a38f..661c476e6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -635,7 +635,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } else return(LP_address_utxos(coin,coinaddr,0)); - } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,2)); + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); } int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) From cd5f624e73ae7490cf7c0865740a233d217233e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 00:30:27 +0200 Subject: [PATCH 2225/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 13b14f8ee..b51741787 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,9 +18,6 @@ // LP_nativeDEX.c // marketmaker // -// detecting new deposits in inventory -// bot progress -// swap started event for bot // bot status 1600% ? // BCH signing diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f6e1f325f..cf4560de3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1010,15 +1010,15 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - if ( destsatoshis - 0*desttxfee < autxo->S.satoshis ) + if ( destsatoshis - desttxfee < autxo->S.satoshis ) { - //destsatoshis -= 2*desttxfee; + destsatoshis -= desttxfee; autxo->S.satoshis = destsatoshis; //printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } - else if ( autxo->S.satoshis - 0*desttxfee < destsatoshis ) + else if ( autxo->S.satoshis - desttxfee < destsatoshis ) { - autxo->S.satoshis -= 0*desttxfee; + autxo->S.satoshis -= desttxfee; destsatoshis = autxo->S.satoshis; printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } From eb3d403d0c97f4d25e92d5ce2b42996d16e8ad37 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 00:44:26 +0200 Subject: [PATCH 2226/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cf4560de3..f6e1f325f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1010,15 +1010,15 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - if ( destsatoshis - desttxfee < autxo->S.satoshis ) + if ( destsatoshis - 0*desttxfee < autxo->S.satoshis ) { - destsatoshis -= desttxfee; + //destsatoshis -= 2*desttxfee; autxo->S.satoshis = destsatoshis; //printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } - else if ( autxo->S.satoshis - desttxfee < destsatoshis ) + else if ( autxo->S.satoshis - 0*desttxfee < destsatoshis ) { - autxo->S.satoshis -= desttxfee; + autxo->S.satoshis -= 0*desttxfee; destsatoshis = autxo->S.satoshis; printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } From 2308f7fb197da0cc1a74e95f0cbeb29ee78e617d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 05:21:11 +0200 Subject: [PATCH 2227/2732] Avoid bot pause --- iguana/exchanges/LP_tradebots.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 862d68883..55d1ddabe 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -291,7 +291,7 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice) void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { - double remaining,maxrel; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; + double remaining,maxrel; struct LP_tradebot_trade *tp; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { @@ -317,10 +317,10 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) { - bot->trades[bot->numtrades++] = LP_tradebot_pending(bot,pending,tradeid); + bot->trades[bot->numtrades++] = tp = LP_tradebot_pending(bot,pending,tradeid); if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); - else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) + else if ( tp->requestid != 0 && ((bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL) ) bot->pause = (uint32_t)time(NULL); printf("issued bot trade.%u %s\n",tradeid,retstr); free_json(retjson2); From 752d4fa637043fa43fe826f171e2eb06df963e52 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 05:23:44 +0200 Subject: [PATCH 2228/2732] Test --- iguana/exchanges/LP_tradebots.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 55d1ddabe..144786a77 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -318,6 +318,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) { bot->trades[bot->numtrades++] = tp = LP_tradebot_pending(bot,pending,tradeid); + sleep(3); if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); else if ( tp->requestid != 0 && ((bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL) ) From 0374147cc0d3c5e0fdba07dcda83fb82f92eeaa5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:07:59 +0200 Subject: [PATCH 2229/2732] Test --- iguana/exchanges/LP_tradebots.c | 57 +++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 144786a77..f9ae94852 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -26,7 +26,7 @@ struct LP_tradebot_trade double maxprice,totalrelvolume,basevol,relvol; uint64_t aliceid; int32_t dispdir; - uint32_t started,finished,requestid,quoteid,tradeid; + uint32_t started,finished,requestid,quoteid,tradeid,completed; char base[32],rel[32],event[32]; }; @@ -255,9 +255,9 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen tp->basevol = jdouble(pending,"basevalue"); tp->relvol = jdouble(pending,"relvalue"); printf("tradebot pending basevol %.8f relvol %.8f\n",tp->basevol,tp->relvol); - bot->pendrelsum += tp->relvol; - bot->pendbasesum += tp->basevol; - bot->numpending++; + //bot->pendrelsum += tp->relvol; + //bot->pendbasesum += tp->basevol; + //bot->numpending++; return(tp); } @@ -318,11 +318,6 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) if ( (pending= jobj(retjson2,"pending")) != 0 && juint(pending,"tradeid") == tradeid ) { bot->trades[bot->numtrades++] = tp = LP_tradebot_pending(bot,pending,tradeid); - sleep(3); - if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) - bot->dead = (uint32_t)time(NULL); - else if ( tp->requestid != 0 && ((bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL) ) - bot->pause = (uint32_t)time(NULL); printf("issued bot trade.%u %s\n",tradeid,retstr); free_json(retjson2); free(retstr); @@ -376,11 +371,11 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) { tp->requestid = requestid; tp->quoteid = quoteid; - bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; - bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; - bot->numpending--, bot->completed++; + //bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; + //bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; + //bot->numpending--, bot->completed++; printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u, numpending.%d completed.%d\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid,bot->numpending,bot->completed); - tp->finished = (uint32_t)time(NULL); + tp->completed = tp->finished = (uint32_t)time(NULL); break; } } @@ -398,22 +393,42 @@ void LP_tradebots_timeslice(void *ctx) if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) { // expire pending trades and see if any still need their requestid/quoteid + bot->basesum = bot->pendbasesum = 0.;//-= tp->basevol; + bot->relsum = bot->pendrelsum = 0.;//-= tp->relvol; + bot->completed = bot->numpending = 0;//--; for (i=0; inumtrades; i++) { - if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 ) + if ( (tp= bot->trades[i]) != 0 ) { - if ( time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) + if (tp->finished == 0 ) { - bot->pendbasesum -= tp->basevol; - bot->pendrelsum -= tp->relvol; - bot->numpending--; - tp->finished = (uint32_t)time(NULL); - printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); + if ( time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) + { + tp->finished = (uint32_t)time(NULL); + printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); + } + } + if ( tp->finished != 0 && tp->completed != 0 ) + { + bot->basesum += tp->basevol; + bot->relsum += tp->relvol; + bot->completed++; + } + else if ( tp->finished == 0 && tp->requestid != 0 && tp->quoteid != 0 ) + { + bot->pendbasesum += tp->basevol; + bot->pendrelsum += tp->relvol; + bot->numpending++; } } } } - else if ( bot->numpending == 0 ) + if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) + bot->dead = (uint32_t)time(NULL); + else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) + bot->pause = (uint32_t)time(NULL); + else bot->pause = 0; + if ( bot->numpending == 0 ) LP_tradebot_timeslice(ctx,bot); } lastnumfinished = LP_numfinished; From bdf651e6f8a727f1e02c7ea8ee631514840aab31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:15:03 +0200 Subject: [PATCH 2230/2732] Test --- iguana/exchanges/LP_tradebots.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index f9ae94852..e80eac6e1 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -36,7 +36,7 @@ struct LP_tradebot char name[128],base[32],rel[32]; int32_t numtrades,numpending,completed,dispdir; double maxprice,totalrelvolume,totalbasevolume,basesum,relsum,pendbasesum,pendrelsum; - uint32_t dead,pause,started,id; + uint32_t dead,pause,userpause,started,id; struct LP_tradebot_trade *trades[LP_TRADEBOTS_MAXTRADES]; } *LP_tradebots; @@ -134,8 +134,8 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) jaddstr(json,"name",bot->name); jaddnum(json,"botid",bot->id); jaddnum(json,"started",bot->started); - if ( bot->pause != 0 ) - jaddnum(json,"paused",bot->pause); + if ( bot->pause != 0 || bot->userpause != 0 ) + jaddnum(json,"paused",bot->userpause != 0 ? bot->userpause : bot->pause); if ( bot->dead != 0 ) jaddnum(json,"stopped",bot->dead); if ( bot->dispdir > 0 ) @@ -293,7 +293,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { double remaining,maxrel; struct LP_tradebot_trade *tp; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); - if ( bot->dead == 0 && bot->pause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) + if ( bot->dead == 0 && bot->pause == 0 && bot->userpause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { if ( (liststr= LP_recent_swaps(0)) != 0 ) { @@ -427,7 +427,8 @@ void LP_tradebots_timeslice(void *ctx) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->pause = (uint32_t)time(NULL); - else bot->pause = 0; + else if ( bot->userpause == 0 ) + bot->pause = 0; if ( bot->numpending == 0 ) LP_tradebot_timeslice(ctx,bot); } @@ -629,7 +630,7 @@ char *LP_tradebot_pause(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid) { if ( bot->dead != 0 ) return(clonestr("{\"error\":\"botid aleady stopped\"}")); - bot->pause = (uint32_t)time(NULL); + bot->userpause = (uint32_t)time(NULL); return(clonestr("{\"result\":\"success\"}")); } return(clonestr("{\"error\":\"couldnt find botid\"}")); @@ -642,9 +643,9 @@ char *LP_tradebot_resume(void *ctx,int32_t pubsock,cJSON *argjson,uint32_t botid { if ( bot->dead != 0 ) return(clonestr("{\"error\":\"botid aleady stopped\"}")); - if ( bot->pause == 0 ) + if ( bot->userpause == 0 ) return(clonestr("{\"result\":\"success\",\"status\":\"botid not paused\"}")); - bot->pause = 0; + bot->userpause = 0; return(clonestr("{\"result\":\"success\"}")); } return(clonestr("{\"error\":\"couldnt find botid\"}")); From b985f7988409490777755eca8b958c7cde0525d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:23:50 +0200 Subject: [PATCH 2231/2732] Test --- iguana/exchanges/LP_tradebots.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index e80eac6e1..5894009dc 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -348,6 +348,7 @@ void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->tradeid == tradeid ) { tp->aliceid = aliceid; + printf("bot event tradeid.%u aliceid.%llu %s r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); if ( requestid != 0 && quoteid != 0 ) { tp->requestid = requestid; From 33dc83ecbcd1a1ef9cf9157f0a8f2858b24283fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:32:53 +0200 Subject: [PATCH 2232/2732] Test --- iguana/exchanges/LP_network.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f553aca6c..101313348 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -409,7 +409,11 @@ void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON msglen = (int32_t)strlen((char *)msg) + 1; if ( crc32 == 0 ) crc32 = calc_crc32(0,&msg[2],msglen - 2); +#ifdef FROM_MARKETMAKER if ( G.LP_IAMLP == 0 ) +#else + if ( IAMLP == 0 ) +#endif { free(msg); //printf("broadcast %s\n",jstr(argjson,"method")); From cf9c06843be53d1ac1af8b8a62510bf4db8fb095 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:35:50 +0200 Subject: [PATCH 2233/2732] Test --- iguana/exchanges/stats.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 51c68d9c8..4fbe699d1 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -822,6 +822,7 @@ continue; #ifndef FROM_MARKETMAKER portable_mutex_t LP_commandmutex; +uint16_t LP_RPCPORT; void stats_kvjson(FILE *logfp,int32_t height,int32_t savedheight,uint32_t timestamp,char *key,cJSON *kvjson,bits256 pubkey,bits256 sigprev) { From 53358d03c037e8fbcc3d275abee087921f59f93f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:38:19 +0200 Subject: [PATCH 2234/2732] Test --- iguana/exchanges/stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 4fbe699d1..6453b85d5 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -1134,6 +1134,7 @@ char *stats_update(FILE *logfp,char *destdir,char *statefname,char *komodofname) return(jprint(retjson,1)); } +#ifndef FROM_PRIVATEBET int main(int argc, const char * argv[]) { struct tai T; uint32_t timestamp; struct DEXstats_disp prices[365]; int32_t i,n,seconds,leftdatenum; FILE *fp,*logfp; char *filestr,*retstr,*statefname,logfname[512],komodofile[512]; uint16_t port = LP_RPCPORT; @@ -1184,3 +1185,4 @@ int main(int argc, const char * argv[]) return 0; } #endif +#endif From 4dd934982b5d11cad28cdcbdf0a38ce9d35625ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 06:42:32 +0200 Subject: [PATCH 2235/2732] Test --- iguana/exchanges/DEXstats.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/DEXstats.h b/iguana/exchanges/DEXstats.h index e31ff68e3..edf2157cb 100644 --- a/iguana/exchanges/DEXstats.h +++ b/iguana/exchanges/DEXstats.h @@ -927,6 +927,7 @@ char *stats_prices(char *symbol,char *dest,struct DEXstats_disp *prices,int32_t } #ifndef FROM_MARKETMAKER +#ifndef FROM_PRIVATEBET char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port) { char *method,*agent,*retstr,*source,*dest; struct tai T; uint32_t endtimestamp; struct DEXstats_disp prices[365]; int32_t leftdatenum,seconds,numdates; @@ -953,5 +954,6 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char return(clonestr(jprint(argjson,0))); } #endif +#endif #endif /* DEXstats_h */ From 6e53f5adee3bc844d597d98388e7a9140ade8686 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 07:03:09 +0200 Subject: [PATCH 2236/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/bot_settings | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f6e1f325f..e220291eb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -146,12 +146,12 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str if ( strcmp(autxo->coinaddr,qp->destaddr) != 0 ) return(-10); } - if ( autxo != 0 && destvalue < 2*qp->desttxfee+qp->destsatoshis ) + if ( autxo != 0 && destvalue < qp->desttxfee+qp->destsatoshis ) { printf("destvalue %.8f destsatoshis %.8f is too small txfee %.8f?\n",dstr(destvalue),dstr(qp->destsatoshis),dstr(qp->desttxfee)); return(-11); } - if ( butxo != 0 && srcvalue < 2*qp->txfee+qp->satoshis ) + if ( butxo != 0 && srcvalue < qp->txfee+qp->satoshis ) { printf("srcvalue %.8f [%.8f] satoshis %.8f is too small txfee %.8f?\n",dstr(srcvalue),dstr(srcvalue) - dstr(qp->txfee+qp->satoshis),dstr(qp->satoshis),dstr(qp->txfee)); return(-33); diff --git a/iguana/exchanges/bot_settings b/iguana/exchanges/bot_settings index f619f92e3..f02ca3016 100755 --- a/iguana/exchanges/bot_settings +++ b/iguana/exchanges/bot_settings @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_settings\",\"botid\":$1,\"newprice\":$1,\"newvolume\":$2}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"bot_settings\",\"botid\":$1,\"newprice\":$2,\"newvolume\":$3}" From 3f397e22fbd88b77e883d3288d9695c9414d4420 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 07:09:47 +0200 Subject: [PATCH 2237/2732] Test --- iguana/exchanges/LP_tradebots.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 5894009dc..8a0ad850b 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -377,6 +377,7 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) //bot->numpending--, bot->completed++; printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u, numpending.%d completed.%d\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid,bot->numpending,bot->completed); tp->completed = tp->finished = (uint32_t)time(NULL); + strcpy(tp->event,"finished"); break; } } From b072b80191492b1c6460875a78749df8902c44b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 07:16:15 +0200 Subject: [PATCH 2238/2732] Test --- iguana/exchanges/LP_tradebots.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 8a0ad850b..710c9367a 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -340,7 +340,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid) { - struct LP_tradebot *bot,*tmp; int32_t i; struct LP_tradebot_trade *tp; + struct LP_tradebot *bot,*tmp; int32_t i,matched = 0; struct LP_tradebot_trade *tp; DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { for (i=0; inumtrades; i++) @@ -348,17 +348,22 @@ void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->tradeid == tradeid ) { tp->aliceid = aliceid; - printf("bot event tradeid.%u aliceid.%llu %s r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); + printf("bot event tradeid.%u aliceid.%llu (%s) r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); if ( requestid != 0 && quoteid != 0 ) { tp->requestid = requestid; tp->quoteid = quoteid; } strcpy(tp->event,event); + matched = 0; break; } } + if ( matched != 0 ) + break; } + if ( matched == 0 ) + printf("NO MATCH: bot event tradeid.%u aliceid.%llu (%s) r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); } void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) From cd02831a0e54734a88c1d6ddb837368eba16540f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 07:17:38 +0200 Subject: [PATCH 2239/2732] Test --- iguana/exchanges/LP_tradebots.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 710c9367a..02672eaca 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -341,6 +341,8 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid) { struct LP_tradebot *bot,*tmp; int32_t i,matched = 0; struct LP_tradebot_trade *tp; + if ( tradeid == 0 ) + return; DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { for (i=0; inumtrades; i++) From b53fde0c239e1ea77459ec3889d299a2d9135d29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 12:05:27 +0200 Subject: [PATCH 2240/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 +++++-- iguana/exchanges/LP_tradebots.c | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b51741787..c8950c7c7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,8 +18,11 @@ // LP_nativeDEX.c // marketmaker // -// bot status 1600% ? - +// swap started, pending, locked, finished, ... +// aliceid +//there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation +// bot safe to exit? +// // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 02672eaca..424909766 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -18,8 +18,8 @@ // marketmaker // -#define TRADEBOTS_GAPTIME 60 -#define LP_TRADEBOTS_MAXTRADES 100 +#define TRADEBOTS_GAPTIME 120 +#define LP_TRADEBOTS_MAXTRADES 10 struct LP_tradebot_trade { @@ -36,7 +36,7 @@ struct LP_tradebot char name[128],base[32],rel[32]; int32_t numtrades,numpending,completed,dispdir; double maxprice,totalrelvolume,totalbasevolume,basesum,relsum,pendbasesum,pendrelsum; - uint32_t dead,pause,userpause,started,id; + uint32_t lasttime,dead,pause,userpause,started,id; struct LP_tradebot_trade *trades[LP_TRADEBOTS_MAXTRADES]; } *LP_tradebots; @@ -438,8 +438,11 @@ void LP_tradebots_timeslice(void *ctx) bot->pause = (uint32_t)time(NULL); else if ( bot->userpause == 0 ) bot->pause = 0; - if ( bot->numpending == 0 ) + if ( bot->numpending == 0 && time(NULL) > bot->lasttime+TRADEBOTS_GAPTIME ) + { LP_tradebot_timeslice(ctx,bot); + bot->lasttime = (uint32_t)time(NULL); + } } lastnumfinished = LP_numfinished; } From 63d89d4d0a916b6adef08f9a3924c7e365993f61 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 12:21:11 +0200 Subject: [PATCH 2241/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 661c476e6..f7bf6a38f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -635,7 +635,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } else return(LP_address_utxos(coin,coinaddr,0)); - } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,2)); } int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) From 0bf0a7e981679dce41984990db55ebfd6994edc5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 12:26:04 +0200 Subject: [PATCH 2242/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8f9f899e9..8faaedaaf 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -605,7 +605,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 0 && electrumflag > 1 ) + if ( 1 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 4211a33565957792d7c8234651c69b266b97d6bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 12:37:33 +0200 Subject: [PATCH 2243/2732] Test --- iguana/exchanges/LP_socket.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8faaedaaf..bbf31294e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -408,6 +408,8 @@ int32_t electrum_kickstart(struct electrum_info *ep) return(0); } +int32_t zeroval() { return(0); } + cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -416,6 +418,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch ep = electrum_server(symbol,0); while ( ep != 0 ) { + if ( strcmp(ep->symbol,symbol) != 0 ) + { + printf("ep.%p %s %s:%u called for [%s]???\n",ep,ep->symbol,ep->ipaddr,ep->port,symbol); + int32_t i = 1 / zeroval(); + printf("it should be dead already.%d\n",i); + } if ( ep != 0 && ep->sock >= 0 && retjsonp != 0 ) { *retjsonp = 0; From 84febf8028e9362ba8162f2df21647153e1ece9a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:00:49 +0200 Subject: [PATCH 2244/2732] Test --- iguana/exchanges/LP_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index bbf31294e..b40c74ccb 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -391,8 +391,7 @@ void electrum_initial_requests(struct electrum_info *ep) int32_t electrum_kickstart(struct electrum_info *ep) { - closesocket(ep->sock), ep->sock = -1; - sleep(1); + closesocket(ep->sock);//, ep->sock = -1; if ( (ep->sock= LP_socket(0,ep->ipaddr,ep->port)) < 0 ) { printf("error RE-connecting to %s:%u\n",ep->ipaddr,ep->port); From 13cdad3437c30be673361dbb5493f7285669316f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:03:45 +0200 Subject: [PATCH 2245/2732] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f7bf6a38f..661c476e6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -635,7 +635,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr) sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } else return(LP_address_utxos(coin,coinaddr,0)); - } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,2)); + } else return(electrum_address_listunspent(symbol,coin->electrum,&retjson,coinaddr,1)); } int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) From dec6f9d515de46db83b8c25e57f0a03db9428a1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:05:47 +0200 Subject: [PATCH 2246/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b40c74ccb..584c7216a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -612,7 +612,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 1 && electrumflag > 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 6ac91582a0c75de53fb61a4ba661faea74a3884c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:23:40 +0200 Subject: [PATCH 2247/2732] Test --- iguana/exchanges/LP_socket.c | 6 +----- iguana/exchanges/LP_transaction.c | 7 ++++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 584c7216a..3d76b24b9 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -407,8 +407,6 @@ int32_t electrum_kickstart(struct electrum_info *ep) return(0); } -int32_t zeroval() { return(0); } - cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) { // queue id and string and callback @@ -419,9 +417,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { if ( strcmp(ep->symbol,symbol) != 0 ) { - printf("ep.%p %s %s:%u called for [%s]???\n",ep,ep->symbol,ep->ipaddr,ep->port,symbol); - int32_t i = 1 / zeroval(); - printf("it should be dead already.%d\n",i); + printf("electrum_submit ep.%p %s %s:%u called for [%s]???\n",ep,ep->symbol,ep->ipaddr,ep->port,symbol); } if ( ep != 0 && ep->sock >= 0 && retjsonp != 0 ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 5fe90e841..171981a0c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -854,7 +854,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value) int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine) { - char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; + char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,maxiters,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; *totalp = 0; interestsum = 0; init_hexbytes_noT(spendscriptstr,script,scriptlen); @@ -923,7 +923,8 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ preselected[numpre++] = min1; else min1 = 0; printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d amount %.8f\n",dustcombine,numpre,min0,min1,numunspents,dstr(amount)); - for (i=0; i sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); } } - printf("vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f\n",n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum)); + printf("numunspents.%d vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f\n",numunspents,n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum)); vp = &V[n++]; vp->N = vp->M = 1; vp->signers[0].privkey = privkey; From 366f0dfecb1b4ce72d1b99503b84a5a6385981f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:32:24 +0200 Subject: [PATCH 2248/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 3d76b24b9..527aefd61 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -430,12 +430,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ - portable_mutex_lock(&ep->mutex); + //portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(5000); - portable_mutex_unlock(&ep->mutex); + //portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) From fa67ddfde59a2d2ddfcc782dcd761669032e3145 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:42:12 +0200 Subject: [PATCH 2249/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxo.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 527aefd61..33b2467e4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -430,12 +430,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ - //portable_mutex_lock(&ep->mutex); +//portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(5000); - //portable_mutex_unlock(&ep->mutex); +//portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 076e6729d..293798c56 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1082,6 +1082,7 @@ void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedfla { char fname[1024]; FILE *fp=0; sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + printf("unspents cache.(%s)\n",fname); if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) updatedflag = 1; else if ( fp != 0 ) From 8b8b7808734e3e41086060401642d315e1d00085 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:43:17 +0200 Subject: [PATCH 2250/2732] Test --- iguana/exchanges/LP_utxo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 293798c56..0ad4c3251 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1078,11 +1078,18 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) return(num); } +char *LP_unspents_filestr(char *symbol,char *addr) +{ + char fname[1024]; long fsize; + sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + return(OS_filestr(&fsize,fname)); +} + void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag) { char fname[1024]; FILE *fp=0; sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - printf("unspents cache.(%s)\n",fname); + printf("unspents cache.(%s) for %s %s\n",fname,symbol,addr); if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) updatedflag = 1; else if ( fp != 0 ) @@ -1094,13 +1101,6 @@ void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedfla } } -char *LP_unspents_filestr(char *symbol,char *addr) -{ - char fname[1024]; long fsize; - sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - return(OS_filestr(&fsize,fname)); -} - uint64_t LP_unspents_load(char *symbol,char *addr) { char *arraystr; uint64_t balance = 0; int32_t i,n; cJSON *retjson,*item; struct iguana_info *coin; From 3281cc3cfeb7905532ffc6bb1a248c1660175d06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 13:44:03 +0200 Subject: [PATCH 2251/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0ad4c3251..2f1908771 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1089,7 +1089,7 @@ void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedfla { char fname[1024]; FILE *fp=0; sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - printf("unspents cache.(%s) for %s %s\n",fname,symbol,addr); + printf("unspents cache.(%s) for %s %s, updated.%d\n",fname,symbol,addr,updatedflag); if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) updatedflag = 1; else if ( fp != 0 ) From 9511fd7ad11663f4c6b099b9fd9b3cdf5d7107f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 14:23:47 +0200 Subject: [PATCH 2252/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c8950c7c7..8023a8727 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +// previously, it used to show amount, kmd equiv, perc // swap started, pending, locked, finished, ... // aliceid //there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e220291eb..d088e712a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -901,9 +901,9 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { item = jitem(asks,i); price = jdouble(item,"price"); - if ( price/maxprice < .9 ) - price *= 1.05; - else price *= 1.01; + if ( price < maxprice && price > maxprice*0.8) + price = price * 0.9 + 0.1 * maxprice; + else price *= 1.005; pubkey = jbits256(item,"pubkey"); if ( bits256_nonz(destpubkey) != 0 && bits256_cmp(destpubkey,pubkey) != 0 ) continue; From aaf3b87668d62b66cfb2fd951b9fa4a98f7db589 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 15:25:26 +0200 Subject: [PATCH 2253/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2f1908771..575aff00c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1089,7 +1089,7 @@ void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedfla { char fname[1024]; FILE *fp=0; sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - printf("unspents cache.(%s) for %s %s, updated.%d\n",fname,symbol,addr,updatedflag); + //printf("unspents cache.(%s) for %s %s, updated.%d\n",fname,symbol,addr,updatedflag); if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) updatedflag = 1; else if ( fp != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ea7d36b52..fdbef7e6f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -548,9 +548,9 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("array.%d\n",n); while ( used < n-1 ) { - //for (i=0; i= 0 ) { item = jitem(array,i); @@ -573,7 +573,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; From 7dd4a4492ee5fb38a5935e8c7c3c6288cf7bf8e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 15:30:02 +0200 Subject: [PATCH 2254/2732] Test --- iguana/exchanges/LP_transaction.c | 4 ++-- iguana/exchanges/LP_utxos.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 171981a0c..ea09a5bb3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -996,7 +996,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout,uint32_t locktime) { static void *ctx; - cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[256]; struct LP_address *ap; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[1024]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; @@ -1135,7 +1135,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); privkey = LP_privkey(vinaddr,coin->taddr); - maxV = 256; + maxV = 1024; V = malloc(maxV * sizeof(*V)); for (iter=0; iter<2; iter++) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fdbef7e6f..37498c0b4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -512,7 +512,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { coin->numutxos = n; - //printf("LP_privkey_init %s %s\n",coin->symbol,jprint(array,0)); + printf("LP_privkey_init %s %d\n",coin->symbol,n); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) @@ -537,7 +537,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri height = jint(item,"height"); } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); - if ( satoshis != 0 && satoshis != value ) + //if ( satoshis != 0 && satoshis != value ) printf("%s %s privkey_init value %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 )//&& height > 0 ) { From 02d3afbee2d8bd2a2c0324e93dd6a11c371b8ef5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 15:34:20 +0200 Subject: [PATCH 2255/2732] Test --- iguana/exchanges/LP_socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 33b2467e4..0844b4769 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -430,12 +430,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ -//portable_mutex_lock(&ep->mutex); +portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(5000); -//portable_mutex_unlock(&ep->mutex); +portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) @@ -608,7 +608,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 0 && electrumflag > 1 ) + //if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 3b4fca07aca62c0b02bfe279f8f5e1c23e5bc12d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 15:55:34 +0200 Subject: [PATCH 2256/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0d9508a18..35387d845 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -592,7 +592,7 @@ bot_resume(botid)\n\ LP_address(ptr,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); + //printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); if ( ptr->lastpushtime > 0 && ptr->addr_listunspent_requested > (uint32_t)time(NULL)-10 ) ptr->lastpushtime -= LP_ORDERBOOK_DURATION*0.1; ptr->addr_listunspent_requested = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 37498c0b4..5343e1051 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -502,7 +502,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("coin not active\n"); return(0); } - //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); + printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); LP_address(coin,coin->smartaddr); From af3f152c7186d5fb95171f4b93a3abbe1c9923d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 16:02:16 +0200 Subject: [PATCH 2257/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_utxos.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e5a045e33..c175de995 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -263,6 +263,7 @@ struct iguana_info void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; + bits256 lastprivkey; uint32_t lastprivkeytime; bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen; bits256 cachedmerkle; int32_t cachedmerkleheight; }; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5343e1051..380783b2e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -502,11 +502,17 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("coin not active\n"); return(0); } + if ( bits256_cmp(myprivkey,coin->lastprivkey) == 0 && time(NULL) < coin->lastprivkeytime+60 ) + return(0); + coin->lastprivkey = myprivkey; + coin->lastprivkeytime = (uint32_t)time(NULL); printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); + array = LP_listunspent(coin->symbol,coin->smartaddr); + printf("unspent array %ld\n",strlen(jprint(array,0))); LP_address(coin,coin->smartaddr); - if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) + if ( array != 0 ) { txfee = LP_txfeecalc(coin,0,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) From 01441181890ee57ca4d6d0af16e93437ae2dabe6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 16:10:04 +0200 Subject: [PATCH 2258/2732] Test --- iguana/exchanges/LP_socket.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0844b4769..6452f4087 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -598,10 +598,9 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON usecache = 0; else if ( ap->unspentheight < height ) usecache = 0; - else if ( G.LP_pendingswaps != 0 && time(NULL) > ap->unspenttime+20 ) + else if ( G.LP_pendingswaps != 0 && time(NULL) > ap->unspenttime+30 ) usecache = 0; } - //printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime)); if ( usecache == 0 || electrumflag > 1 ) { if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 ) @@ -636,7 +635,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( strcmp(addr,coin->smartaddr) == 0 && (retstr= LP_unspents_filestr(symbol,coin->smartaddr)) != 0 ) { - retjson = LP_address_utxos(coin,addr,1); + retjson = cJSON_Parse(retstr); free(retstr); } else retjson = LP_address_utxos(coin,addr,1); } From cbc557f2a48b15d6fd000dcd1529ef6de23fdfa8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 16:18:36 +0200 Subject: [PATCH 2259/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 17 +++++------------ iguana/exchanges/LP_utxos.c | 17 +++++++++++------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c175de995..aad96236c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -263,7 +263,7 @@ struct iguana_info void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; - bits256 lastprivkey; uint32_t lastprivkeytime; + bits256 lastprivkey; uint32_t lastprivkeytime; int32_t privkeydepth; bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen; bits256 cachedmerkle; int32_t cachedmerkleheight; }; diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6452f4087..547d67926 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -423,19 +423,19 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -//printf("%s %s",symbol,stratumreq); +printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ -portable_mutex_lock(&ep->mutex); +//portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) - usleep(5000); -portable_mutex_unlock(&ep->mutex); + usleep(15000); +//portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) @@ -897,15 +897,8 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; if ( str == 0 || len == 0 ) return(-1); + printf("RECV.(%s)\n",str); ep->lasttime = (uint32_t)time(NULL); - /*if ( (strjson= cJSON_Parse(str)) == 0 ) - { - strjson = cJSON_CreateObject(); - resitem = cJSON_CreateObject(); - jaddstr(resitem,"string",str); - jadd(strjson,"result",resitem); - printf("mapped.(%s) -> %s\n",str,jprint(strjson,0)); - }*/ if ( (strjson= cJSON_Parse(str)) != 0 ) { resultjson = jobj(strjson,"result"); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 380783b2e..40e4e2ae0 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -506,7 +506,10 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri return(0); coin->lastprivkey = myprivkey; coin->lastprivkeytime = (uint32_t)time(NULL); - printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); + if ( coin->privkeydepth > 0 ) + return(0); + coin->privkeydepth++; + printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); @@ -543,9 +546,9 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri height = jint(item,"height"); } satoshis = LP_txvalue(destaddr,coin->symbol,txid,vout); - //if ( satoshis != 0 && satoshis != value ) + if ( satoshis != 0 && satoshis != value ) printf("%s %s privkey_init value %.8f vs %.8f (%s) %.8f %.8f\n",coin->symbol,coin->smartaddr,dstr(satoshis),dstr(value),jprint(item,0),jdouble(item,"amount"),jdouble(item,"interest")); - if ( LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 )//&& height > 0 ) + if ( coin->electrum != 0 || LP_inventory_prevent(iambob,coin->symbol,txid,vout) == 0 )//&& height > 0 ) { values[i] = satoshis; //flag += LP_address_utxoadd(coin,destaddr,txid,vout,satoshis,height,-1); @@ -554,9 +557,9 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("array.%d\n",n); while ( used < n-1 ) { - for (i=0; i= 0 ) { item = jitem(array,i); @@ -642,6 +645,8 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } if ( values != 0 ) free(values); + if ( coin->privkeydepth > 0 ) + coin->privkeydepth--; //printf("privkey.%s %.8f\n",symbol,dstr(total)); return(flag); } From 542d459cda26222066239b1a02f23cd8fd06db8a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 16:23:38 +0200 Subject: [PATCH 2260/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d088e712a..c04beef58 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1010,15 +1010,15 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - if ( destsatoshis - 0*desttxfee < autxo->S.satoshis ) + if ( destsatoshis - desttxfee < autxo->S.satoshis ) { - //destsatoshis -= 2*desttxfee; + destsatoshis -= desttxfee; autxo->S.satoshis = destsatoshis; //printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } - else if ( autxo->S.satoshis - 0*desttxfee < destsatoshis ) + else if ( autxo->S.satoshis - desttxfee < destsatoshis ) { - autxo->S.satoshis -= 0*desttxfee; + autxo->S.satoshis -= desttxfee; destsatoshis = autxo->S.satoshis; printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 547d67926..8abbb6a3c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -897,10 +897,10 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; if ( str == 0 || len == 0 ) return(-1); - printf("RECV.(%s)\n",str); ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { + printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) From 984e266e16bd3397467adda854d13d6cb4ef3a24 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 16:28:05 +0200 Subject: [PATCH 2261/2732] Test --- iguana/exchanges/LP_socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8abbb6a3c..efcee767f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1073,10 +1073,13 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) } else { - kickval = electrum_kickstart(ep); jaddstr(retjson,"result","success"); jaddstr(retjson,"status","already there"); - jaddnum(retjson,"restart",kickval); + if ( ep->numerrors > 0 ) + { + kickval = electrum_kickstart(ep); + jaddnum(retjson,"restart",kickval); + } } //printf("(%s)\n",jprint(retjson,0)); return(retjson); From a8cc2a898bb8773d0c6df7d859211578f15e4fd0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 16:47:51 +0200 Subject: [PATCH 2262/2732] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 40e4e2ae0..8b7313630 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -509,11 +509,11 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( coin->privkeydepth > 0 ) return(0); coin->privkeydepth++; - printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); + //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); - printf("unspent array %ld\n",strlen(jprint(array,0))); + //printf("unspent array %ld\n",strlen(jprint(array,0))); LP_address(coin,coin->smartaddr); if ( array != 0 ) { @@ -521,7 +521,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { coin->numutxos = n; - printf("LP_privkey_init %s %d\n",coin->symbol,n); + //printf("LP_privkey_init %s %d\n",coin->symbol,n); for (iambob=0; iambob<=1; iambob++) { if ( iambob == 0 ) @@ -582,7 +582,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri else targetval = (depositval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; From 16eabe18d4490159b5d41e3d01384b3dc81f62be Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 17:09:42 +0200 Subject: [PATCH 2263/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 4 +- iguana/exchanges/LP_tradebots.c | 118 ++++++++++++++------------------ 3 files changed, 55 insertions(+), 69 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index aad96236c..84430761c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -39,7 +39,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 30 -#define ELECTRUM_TIMEOUT 15 +#define ELECTRUM_TIMEOUT 7 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 #define LP_MEMPOOL_TIMEINCR 10 diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index efcee767f..c7fa3a076 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -423,7 +423,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s",symbol,stratumreq); +//printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); @@ -900,7 +900,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { - printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); + //printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 424909766..efbf047e4 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -26,7 +26,7 @@ struct LP_tradebot_trade double maxprice,totalrelvolume,basevol,relvol; uint64_t aliceid; int32_t dispdir; - uint32_t started,finished,requestid,quoteid,tradeid,completed; + uint32_t started,finished,requestid,quoteid,tradeid,expired; char base[32],rel[32],event[32]; }; @@ -55,18 +55,10 @@ void LP_tradebot_updatestats(struct LP_tradebot *bot,struct LP_tradebot_trade *t { if ( strcmp(status,"finished") == 0 ) { - flag = 1; - bot->completed++; - bot->basesum += tp->basevol; - bot->relsum += tp->relvol; + if ( tp->finished == 0 ) + tp->finished = (uint32_t)time(NULL); } } - if ( flag == 0 ) - { - bot->numpending++; - bot->pendbasesum += tp->basevol; - bot->pendrelsum += tp->relvol; - } free_json(swapjson); } free(swapstr); @@ -75,11 +67,39 @@ void LP_tradebot_updatestats(struct LP_tradebot *bot,struct LP_tradebot_trade *t void LP_tradebot_calcstats(struct LP_tradebot *bot) { - int32_t i; + int32_t i; struct LP_tradebot_trade *tp; bot->basesum = bot->relsum = bot->pendbasesum = bot->pendrelsum = 0.; bot->numpending = bot->completed = 0; for (i=0; inumtrades; i++) - LP_tradebot_updatestats(bot,bot->trades[i]); + { + if ( (tp= bot->trades[i]) == 0 ) + continue; + if ( tp->finished == 0 && time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) + { + tp->expired = tp->finished = (uint32_t)time(NULL); + printf("tradeid.%u expired\n",tp->tradeid); + } + if ( tp->finished != 0 ) + { + if ( tp->expired == 0 ) + { + bot->basesum += tp->basevol; + bot->relsum += tp->relvol; + bot->completed++; + } + } + else + { + if ( tp->requestid != 0 && tp->quoteid != 0 ) + { + bot->pendbasesum += tp->basevol; + bot->pendrelsum += tp->relvol; + bot->numpending++; + } + } + //LP_tradebot_updatestats(bot,bot->trades[i]); + } + printf("completed.%d (%.8f / %.8f) pending.%d (%.8f / %.8f)\n",bot->completed,bot->basesum,bot->relsum,bot->numpending,bot->pendbasesum,bot->pendrelsum); } double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) @@ -129,6 +149,7 @@ cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) cJSON *LP_tradebot_json(struct LP_tradebot *bot) { int32_t i; double aveprice,basevolume,vol; cJSON *json,*array; + LP_tradebot_calcstats(bot); json = cJSON_CreateObject(); jaddstr(json,"result","success"); jaddstr(json,"name",bot->name); @@ -169,7 +190,6 @@ cJSON *LP_tradebot_json(struct LP_tradebot *bot) } } array = cJSON_CreateArray(); - LP_tradebot_calcstats(bot); for (i=0; inumtrades; i++) jaddi(array,LP_tradebot_tradejson(bot->trades[i],bot->dispdir)); jadd(json,"trades",array); @@ -255,9 +275,6 @@ struct LP_tradebot_trade *LP_tradebot_pending(struct LP_tradebot *bot,cJSON *pen tp->basevol = jdouble(pending,"basevalue"); tp->relvol = jdouble(pending,"relvalue"); printf("tradebot pending basevol %.8f relvol %.8f\n",tp->basevol,tp->relvol); - //bot->pendrelsum += tp->relvol; - //bot->pendbasesum += tp->basevol; - //bot->numpending++; return(tp); } @@ -293,6 +310,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { double remaining,maxrel; struct LP_tradebot_trade *tp; int32_t i,maxiters = 10; uint32_t tradeid; bits256 destpubkey; char *retstr,*liststr; cJSON *retjson,*retjson2,*pending; memset(destpubkey.bytes,0,sizeof(destpubkey)); + LP_tradebot_calcstats(bot); if ( bot->dead == 0 && bot->pause == 0 && bot->userpause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) ) { if ( (liststr= LP_recent_swaps(0)) != 0 ) @@ -328,6 +346,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) free(retstr); } } + LP_tradebot_calcstats(bot); } free_json(retjson); } @@ -347,18 +366,21 @@ void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid { for (i=0; inumtrades; i++) { - if ( (tp= bot->trades[i]) != 0 && tp->finished == 0 && tp->tradeid == tradeid ) + if ( (tp= bot->trades[i]) != 0 ) { - tp->aliceid = aliceid; - printf("bot event tradeid.%u aliceid.%llu (%s) r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); - if ( requestid != 0 && quoteid != 0 ) + if ( tp->finished == 0 && tp->tradeid == tradeid ) { - tp->requestid = requestid; - tp->quoteid = quoteid; - } - strcpy(tp->event,event); - matched = 0; - break; + tp->aliceid = aliceid; + printf("bot event tradeid.%u aliceid.%llu (%s) r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); + if ( requestid != 0 && quoteid != 0 ) + { + tp->requestid = requestid; + tp->quoteid = quoteid; + } + strcpy(tp->event,event); + matched = 1; + break; + } else printf("tradeid.%u finished.%u\n",tp->tradeid,tp->finished); } } if ( matched != 0 ) @@ -379,11 +401,8 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) { tp->requestid = requestid; tp->quoteid = quoteid; - //bot->pendbasesum -= tp->basevol, bot->basesum += tp->basevol; - //bot->pendrelsum -= tp->relvol, bot->relsum += tp->relvol; - //bot->numpending--, bot->completed++; - printf("bot.%u detected completion tradeid.%u aliceid.%llx r.%u q.%u, numpending.%d completed.%d\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid,bot->numpending,bot->completed); - tp->completed = tp->finished = (uint32_t)time(NULL); + printf("bot.%u detected completion tradeid.%u aliceid.%llu r.%u q.%u, numpending.%d completed.%d\n",bot->id,tp->tradeid,(long long)tp->aliceid,tp->requestid,tp->quoteid,bot->numpending,bot->completed); + tp->finished = (uint32_t)time(NULL); strcpy(tp->event,"finished"); break; } @@ -394,44 +413,11 @@ void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid) void LP_tradebots_timeslice(void *ctx) { static uint32_t lastnumfinished = 0; - struct LP_tradebot_trade *tp; struct iguana_info *relcoin; struct LP_tradebot *bot,*tmp; int32_t i; + struct iguana_info *relcoin; struct LP_tradebot *bot,*tmp; DL_FOREACH_SAFE(LP_tradebots,bot,tmp) { if ( (relcoin= LP_coinfind(bot->rel)) != 0 ) LP_listunspent_issue(bot->rel,relcoin->smartaddr,1); - if ( bot->numpending > 0 && LP_numfinished > lastnumfinished ) - { - // expire pending trades and see if any still need their requestid/quoteid - bot->basesum = bot->pendbasesum = 0.;//-= tp->basevol; - bot->relsum = bot->pendrelsum = 0.;//-= tp->relvol; - bot->completed = bot->numpending = 0;//--; - for (i=0; inumtrades; i++) - { - if ( (tp= bot->trades[i]) != 0 ) - { - if (tp->finished == 0 ) - { - if ( time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) - { - tp->finished = (uint32_t)time(NULL); - printf("%s trade.%d of %d expired\n",bot->name,i,bot->numtrades); - } - } - if ( tp->finished != 0 && tp->completed != 0 ) - { - bot->basesum += tp->basevol; - bot->relsum += tp->relvol; - bot->completed++; - } - else if ( tp->finished == 0 && tp->requestid != 0 && tp->quoteid != 0 ) - { - bot->pendbasesum += tp->basevol; - bot->pendrelsum += tp->relvol; - bot->numpending++; - } - } - } - } if ( bot->relsum >= 0.99*bot->totalrelvolume-SMALLVAL || bot->basesum >= 0.99*bot->totalbasevolume-SMALLVAL ) bot->dead = (uint32_t)time(NULL); else if ( (bot->pendrelsum+bot->relsum) >= 0.99*bot->totalrelvolume-SMALLVAL || (bot->basesum+bot->pendbasesum) >= 0.99*bot->totalbasevolume-SMALLVAL ) From 55b1a1e4d6336dc7063a13e01d57437a3d4eced5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 17:22:19 +0200 Subject: [PATCH 2264/2732] Test --- iguana/exchanges/LP_commands.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 35387d845..9d0f4ff47 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -393,10 +393,9 @@ bot_resume(botid)\n\ if ( coinaddr[0] != 0 ) { LP_address(ptr,coinaddr); - LP_listunspent_issue(coin,coinaddr,1); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - //printf("network invoked\n"); + LP_listunspent_issue(coin,coinaddr,2); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); if ( ptr->electrum != 0 ) @@ -487,6 +486,8 @@ bot_resume(botid)\n\ { //privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR); //LP_utxopurge(0); + LP_address(ptr,ptr->smartaddr); + LP_listunspent_issue(coin,ptr->smartaddr,2); if ( bits256_nonz(G.LP_privkey) != 0 ) LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); else printf("no LP_privkey\n"); From 2b3c25f9b0a0bf39519f41e95aea1562d4e272cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 17:24:59 +0200 Subject: [PATCH 2265/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c7fa3a076..efcee767f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -423,7 +423,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -//printf("%s %s",symbol,stratumreq); +printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); @@ -900,7 +900,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { - //printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); + printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) From 23a4df10fdda6ea8a2963b32bd2c4d411f7dc86d Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 10 Nov 2017 19:33:26 +0400 Subject: [PATCH 2266/2732] changes needed to build win32 marketmaker with MSVC 2015 --- OSlibs/win/mingw.h | 19 ++++++++++++------- marketmaker.vcxproj | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/OSlibs/win/mingw.h b/OSlibs/win/mingw.h index 76802c56e..2c35aa78c 100755 --- a/OSlibs/win/mingw.h +++ b/OSlibs/win/mingw.h @@ -61,13 +61,18 @@ * @remarks - #if (defined(_M_X64) || defined(__amd64__)) && defined(WIN32) * is equivalent to #if defined(_M_X64) as _M_X64 is defined for MSVC only */ -#if !defined(_M_X64) -struct pollfd { - SOCKET fd; /* file descriptor */ - short events; /* requested events */ - short revents; /* returned events */ -}; -#endif + + +// [Decker] pollfs is already defined in winsock2.h + +//#if !defined(_M_X64) +//struct pollfd { + //SOCKET fd; /* file descriptor */ + //short events; /* requested events */ + //short revents; /* returned events */ +//}; +//#endif + #if defined(_M_X64) /* diff --git a/marketmaker.vcxproj b/marketmaker.vcxproj index b441d6ab4..0dbe62279 100644 --- a/marketmaker.vcxproj +++ b/marketmaker.vcxproj @@ -130,6 +130,7 @@ Console true true + Ws2_32.lib;Advapi32.lib;$(SolutionDir)OSlibs\win\release\pthreadVC2.lib;libcurl.lib;nanomsg.lib;%(AdditionalDependencies) From c8d75a2ab590bdb82ead7de32866d22731c987d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 18:09:14 +0200 Subject: [PATCH 2267/2732] Test --- iguana/exchanges/LP_cache.c | 232 +++++++++++++++++++++++++++++++ iguana/exchanges/LP_include.h | 2 + iguana/exchanges/LP_nativeDEX.c | 5 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 38 +---- iguana/exchanges/LP_utxo.c | 154 -------------------- 6 files changed, 239 insertions(+), 194 deletions(-) create mode 100644 iguana/exchanges/LP_cache.c diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c new file mode 100644 index 000000000..ed0626a2b --- /dev/null +++ b/iguana/exchanges/LP_cache.c @@ -0,0 +1,232 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_cache.c +// marketmaker +// + +cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) +{ + uint8_t *extraspace; cJSON *txobj; char str[65],str2[65]; struct iguana_msgtx msgtx; bits256 checktxid; + extraspace = calloc(1,4000000); + memset(&msgtx,0,sizeof(msgtx)); + txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,4000000,serialized,len,0,0,coin->zcash); + //printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); + free(extraspace); + if ( bits256_cmp(txid,checktxid) != 0 ) + { + printf("%s LP_transaction_fromdata mismatched txid %s vs %s\n",coin->symbol,bits256_str(str,txid),bits256_str(str2,checktxid)); + free_json(txobj); + txobj = 0; + } + return(txobj); +} + +cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) +{ + cJSON *txobj; struct LP_transaction *tx; + if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) + { + txobj = LP_transactioninit(coin,txid,0,txobj); + LP_transactioninit(coin,txid,1,txobj); + tx = LP_transactionfind(coin,txid); + } + if ( tx != 0 ) + { + tx->serialized = serialized; + tx->len = len; + } + else + { + char str[65]; printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); + free(serialized); + } + } + return(txobj); +} + +int32_t LP_SPV_load(struct iguana_info *coin,bits256 txid,int32_t height) +{ + return(-1); +} + +void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) +{ + struct LP_transaction *tx = 0; + if ( strcmp(coin->smartaddr,coinaddr) == 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) + { + char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + } else printf("skip SPV store for (%s) tx.%p\n",coinaddr,tx); +} + +bits256 iguana_merkle(bits256 *tree,int32_t txn_count) +{ + int32_t i,n=0,prev; uint8_t serialized[sizeof(bits256) * 2]; + if ( txn_count == 1 ) + return(tree[0]); + prev = 0; + while ( txn_count > 1 ) + { + if ( (txn_count & 1) != 0 ) + tree[prev + txn_count] = tree[prev + txn_count-1], txn_count++; + n += txn_count; + for (i=0; i> 1)] = bits256_doublesha256(0,serialized,sizeof(serialized)); + } + prev = n; + txn_count >>= 1; + } + return(tree[n]); +} + +bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proofsize) +{ + int32_t i; uint8_t serialized[sizeof(bits256) * 2]; bits256 hash,proof; + hash = txid; + for (i=0; i>= 1; + } + return(hash); +} + +bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t height) +{ + cJSON *hdrobj; bits256 merkleroot; + memset(merkleroot.bytes,0,sizeof(merkleroot)); + if ( coin->cachedmerkleheight == height ) + return(coin->cachedmerkle); + if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 ) + { + if ( jobj(hdrobj,"merkle_root") != 0 ) + { + merkleroot = jbits256(hdrobj,"merkle_root"); + if ( bits256_nonz(merkleroot) != 0 ) + { + coin->cachedmerkle = merkleroot; + coin->cachedmerkleheight = height; + } + } + free_json(hdrobj); + } else printf("couldnt get header for ht.%d\n",height); + return(merkleroot); +} + +int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) +{ + cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t retval,m,SPV = 0; + if ( strcmp(coin->smartaddr,coinaddr) == 0 && (retval= LP_SPV_load(coin,txid,height)) > 0 ) + return(retval); + if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) + { + char str[65],str2[65],str3[65]; + SPV = -1; + memset(roothash.bytes,0,sizeof(roothash)); + if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) + { + roothash = validate_merkle(jint(merkobj,"pos"),txid,merkles,m); + merkleroot = LP_merkleroot(coin,ep,height); + if ( bits256_nonz(merkleroot) != 0 ) + { + if ( bits256_cmp(merkleroot,roothash) == 0 ) + { + SPV = height; + LP_SPV_store(coin,coinaddr,txid,height); + //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + } + else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + } else SPV = 0; + } + if ( SPV < 0 ) + { + printf("MERKLE DIDNT VERIFY.%s %s ht.%d (%s)\n",coin->symbol,bits256_str(str,txid),height,jprint(merkobj,0)); + if ( jobj(merkobj,"error") != 0 ) + SPV = 0; // try again later + } + free_json(merkobj); + } + return(SPV); +} + +char *LP_unspents_filestr(char *symbol,char *addr) +{ + char fname[1024]; long fsize; + sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + return(OS_filestr(&fsize,fname)); +} + +void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag) +{ + char fname[1024]; FILE *fp=0; + sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); + //printf("unspents cache.(%s) for %s %s, updated.%d\n",fname,symbol,addr,updatedflag); + if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) + updatedflag = 1; + else if ( fp != 0 ) + fclose(fp); + if ( updatedflag != 0 && (fp= fopen(fname,"wb")) != 0 ) + { + fwrite(arraystr,1,strlen(arraystr),fp); + fclose(fp); + } +} + +uint64_t LP_unspents_load(char *symbol,char *addr) +{ + char *arraystr; uint64_t balance = 0; int32_t i,n; cJSON *retjson,*item; struct iguana_info *coin; + if ( (coin= LP_coinfind(symbol)) != 0 ) + { + if ( (arraystr= LP_unspents_filestr(symbol,addr)) != 0 ) + { + if ( (retjson= cJSON_Parse(arraystr)) != 0 ) + { + //printf("PROCESS UNSPENTS %s\n",arraystr); + if ( (n= cJSON_GetArraySize(retjson)) > 0 ) + { + for (i=0; ielectrum,coin->smartaddr,retjson,1); + free_json(retjson); + } + free(arraystr); + } + } + return(balance); +} + + + diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 84430761c..f19aafc3c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -394,6 +394,8 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid); +cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len); +cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len); uint64_t LP_RTsmartbalance(struct iguana_info *coin); int32_t LP_getheight(struct iguana_info *coin); int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,char *msg); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8023a8727..fdd337b42 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -154,6 +154,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_bitcoin.c" #include "LP_coins.c" #include "LP_rpc.c" +#include "LP_cache.c" #include "LP_RTmetrics.c" #include "LP_utxo.c" #include "LP_prices.c" @@ -524,7 +525,7 @@ void LP_coinsloop(void *_coins) if ( up->SPV == 0 ) { nonz++; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,ap->coinaddr,backupep,up->U.txid,up->U.height); if ( 0 && up->SPV > 0 ) printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } @@ -535,7 +536,7 @@ void LP_coinsloop(void *_coins) oldht = up->U.height; LP_txheight_check(coin,ap->coinaddr,up); if ( oldht != up->U.height ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,ap->coinaddr,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) up->SPV = -2; else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c04beef58..fb5761d86 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -647,7 +647,7 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) return(-1); if ( (backupep= ep->prev) == 0 ) backupep = ep; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,coinaddr,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) return(-1); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index efcee767f..77f790c53 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -662,23 +662,6 @@ cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } -cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) -{ - uint8_t *extraspace; cJSON *txobj; char str[65],str2[65]; struct iguana_msgtx msgtx; bits256 checktxid; - extraspace = calloc(1,4000000); - memset(&msgtx,0,sizeof(msgtx)); - txobj = bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->height,&checktxid,&msgtx,extraspace,4000000,serialized,len,0,0,coin->zcash); - //printf("TX.(%s) match.%d\n",jprint(txobj,0),bits256_cmp(txid,checktxid)); - free(extraspace); - if ( bits256_cmp(txid,checktxid) != 0 ) - { - printf("%s LP_transaction_fromdata mismatched txid %s vs %s\n",coin->symbol,bits256_str(str,txid),bits256_str(str2,checktxid)); - free_json(txobj); - txobj = 0; - } - return(txobj); -} - cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; @@ -728,26 +711,7 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs memcpy(coin->cachedtxiddata,serialized,len); free(hexstr); //printf("DATA.(%s) from (%s)\n",hexstr+1,jprint(hexjson,0)); - if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) - { - if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) - { - txobj = LP_transactioninit(coin,txid,0,txobj); - LP_transactioninit(coin,txid,1,txobj); - tx = LP_transactionfind(coin,txid); - } - if ( tx != 0 ) - { - tx->serialized = serialized; - tx->len = len; - } - else - { - printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); - free(serialized); - } - } - *retjsonp = txobj; + *retjsonp = LP_cache_transaction(coin,txid,serialized,len); // eats serialized free_json(hexjson); //printf("return from electrum_transaction\n"); return(*retjsonp); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 575aff00c..ce98ac396 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -316,107 +316,6 @@ cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32 uint64_t _LP_unspents_metric(uint64_t total,int32_t n) { return((total<<16) | (n & 0xffff)); } -bits256 iguana_merkle(bits256 *tree,int32_t txn_count) -{ - int32_t i,n=0,prev; uint8_t serialized[sizeof(bits256) * 2]; - if ( txn_count == 1 ) - return(tree[0]); - prev = 0; - while ( txn_count > 1 ) - { - if ( (txn_count & 1) != 0 ) - tree[prev + txn_count] = tree[prev + txn_count-1], txn_count++; - n += txn_count; - for (i=0; i> 1)] = bits256_doublesha256(0,serialized,sizeof(serialized)); - } - prev = n; - txn_count >>= 1; - } - return(tree[n]); -} - -bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proofsize) -{ - int32_t i; uint8_t serialized[sizeof(bits256) * 2]; bits256 hash,proof; - hash = txid; - for (i=0; i>= 1; - } - return(hash); -} - -bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t height) -{ - cJSON *hdrobj; bits256 merkleroot; - memset(merkleroot.bytes,0,sizeof(merkleroot)); - if ( coin->cachedmerkleheight == height ) - return(coin->cachedmerkle); - if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 ) - { - if ( jobj(hdrobj,"merkle_root") != 0 ) - { - merkleroot = jbits256(hdrobj,"merkle_root"); - if ( bits256_nonz(merkleroot) != 0 ) - { - coin->cachedmerkle = merkleroot; - coin->cachedmerkleheight = height; - } - } - free_json(hdrobj); - } else printf("couldnt get header for ht.%d\n",height); - return(merkleroot); -} - -int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) -{ - cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; - if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) - { - char str[65],str2[65],str3[65]; - SPV = -1; - memset(roothash.bytes,0,sizeof(roothash)); - if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) - { - roothash = validate_merkle(jint(merkobj,"pos"),txid,merkles,m); - merkleroot = LP_merkleroot(coin,ep,height); - if ( bits256_nonz(merkleroot) != 0 ) - { - if ( bits256_cmp(merkleroot,roothash) == 0 ) - { - SPV = height; - //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); - } - else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); - } else SPV = 0; - } - if ( SPV < 0 ) - { - printf("MERKLE DIDNT VERIFY.%s %s ht.%d (%s)\n",coin->symbol,bits256_str(str,txid),height,jprint(merkobj,0)); - if ( jobj(merkobj,"error") != 0 ) - SPV = 0; // try again later - } - free_json(merkobj); - } - return(SPV); -} - cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; cJSON *txobj; @@ -1077,56 +976,3 @@ int32_t LP_undospends(struct iguana_info *coin,int32_t lastheight) } return(num); } - -char *LP_unspents_filestr(char *symbol,char *addr) -{ - char fname[1024]; long fsize; - sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - return(OS_filestr(&fsize,fname)); -} - -void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag) -{ - char fname[1024]; FILE *fp=0; - sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname); - //printf("unspents cache.(%s) for %s %s, updated.%d\n",fname,symbol,addr,updatedflag); - if ( updatedflag == 0 && (fp= fopen(fname,"rb")) == 0 ) - updatedflag = 1; - else if ( fp != 0 ) - fclose(fp); - if ( updatedflag != 0 && (fp= fopen(fname,"wb")) != 0 ) - { - fwrite(arraystr,1,strlen(arraystr),fp); - fclose(fp); - } -} - -uint64_t LP_unspents_load(char *symbol,char *addr) -{ - char *arraystr; uint64_t balance = 0; int32_t i,n; cJSON *retjson,*item; struct iguana_info *coin; - if ( (coin= LP_coinfind(symbol)) != 0 ) - { - if ( (arraystr= LP_unspents_filestr(symbol,addr)) != 0 ) - { - if ( (retjson= cJSON_Parse(arraystr)) != 0 ) - { - //printf("PROCESS UNSPENTS %s\n",arraystr); - if ( (n= cJSON_GetArraySize(retjson)) > 0 ) - { - for (i=0; ielectrum,coin->smartaddr,retjson,1); - free_json(retjson); - } - free(arraystr); - } - } - return(balance); -} - - - From 5268f5d71c391ecd7068a6d28f1bef5d9c63d58c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 18:15:52 +0200 Subject: [PATCH 2268/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fdd337b42..9ab94a382 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -467,7 +467,7 @@ void utxosQ_loop(void *myipaddr) void LP_coinsloop(void *_coins) { - struct LP_address *ap=0,*atmp; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + struct LP_address *ap=0; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); @@ -515,9 +515,8 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - HASH_ITER(hh,coin->addresses,ap,atmp) + if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { - break; // causes timeouts probably due to too much usage, SPV validation done on tx spending DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->U.height > 0 && up->spendheight < 0 ) From 13349dbaf68a94daf0e0925b741cdf840548ae19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 18:23:40 +0200 Subject: [PATCH 2269/2732] Test --- iguana/exchanges/LP_cache.c | 4 ++-- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index ed0626a2b..80b7d33c7 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -70,8 +70,8 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h struct LP_transaction *tx = 0; if ( strcmp(coin->smartaddr,coinaddr) == 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) { - char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); - } else printf("skip SPV store for (%s) tx.%p\n",coinaddr,tx); + //char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + } //else printf("skip SPV store for (%s) tx.%p\n",coinaddr,tx); } bits256 iguana_merkle(bits256 *tree,int32_t txn_count) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 77f790c53..c64c1330f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -423,7 +423,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s",symbol,stratumreq); +//printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); @@ -864,7 +864,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { - printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); + //printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) From 54a7c61f2fb8a9f6ec106fa13c04093313d3dfa9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 19:48:32 +0200 Subject: [PATCH 2270/2732] privkeys[] overflow --- iguana/exchanges/LP_cache.c | 68 +++++++++++++++++++++++++++---- iguana/exchanges/LP_include.h | 5 ++- iguana/exchanges/LP_tradebots.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 80b7d33c7..3c3f32b1b 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -60,18 +60,72 @@ cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seria return(txobj); } +struct LP_transaction +{ + UT_hash_handle hh; + bits256 txid; + int32_t height,numvouts,numvins,len,SPV; + uint8_t *serialized; + struct LP_outpoint outpoints[]; +}; + +int32_t LP_cacheitem(uint8_t *ptr,long remains) +{ + +} + +void *LP_cacheptr(FILE **wfp,long *fsizep,struct iguana_info *coin) +{ + char fname[1024]; long n,len = 0; uint8_t *ptr = 0; + sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); + if ( ((*wfp)= OS_appendfile(fname)) != 0 ) + { + ptr = OS_portable_mapfile(fname,fsizep,0); + while ( len < *fsizep ) + { + if ( (n= LP_cacheitem(coin,&ptr[len],*fsizep - len)) < 0 ) + { + printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,*fsizep); + fseek(*wfp,len,SEEK_SET); + break; + } + len += n; + } + } + return(ptr); +} + int32_t LP_SPV_load(struct iguana_info *coin,bits256 txid,int32_t height) { + struct LP_transaction *tp; + HASH_FIND(hh,coin->SPVcache,&txid,sizeof(txid),cp) return(-1); } +struct LP_transaction +{ + UT_hash_handle hh; + bits256 txid; + int32_t height,numvouts,numvins,len,SPV; + uint8_t *serialized; + struct LP_outpoint outpoints[]; +}; + void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) { - struct LP_transaction *tx = 0; - if ( strcmp(coin->smartaddr,coinaddr) == 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) + struct LP_transaction TX; struct LP_transaction *tx = 0; + if ( coin->cachefp != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) //strcmp(coin->smartaddr,coinaddr) == 0 && { - //char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); - } //else printf("skip SPV store for (%s) tx.%p\n",coinaddr,tx); + char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + TX = *tx; + memset(&TX.hh,0,sizeof(TX.hh)); + TX.serialized = 0; + fwrite(&TX,1,sizeof(TX),coin->cachefp); + if ( tx->numvouts > 0 ) + fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),coin->cachefp); + fwrite(tx->serialized,1,tx->len,coin->cachefp); + fflush(coin->cachefp); + } } bits256 iguana_merkle(bits256 *tree,int32_t txn_count) @@ -144,9 +198,9 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) { - cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t retval,m,SPV = 0; - if ( strcmp(coin->smartaddr,coinaddr) == 0 && (retval= LP_SPV_load(coin,txid,height)) > 0 ) - return(retval); + struct LP_transaction *tx; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t retval,m,SPV = 0; + if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height == height && tx->SPV > 0 ) + return(tx->SPV); if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) { char str[65],str2[65],str3[65]; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f19aafc3c..6101c6681 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -244,7 +244,8 @@ struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvi struct LP_transaction { UT_hash_handle hh; - bits256 txid; int32_t height,numvouts,numvins,len; //uint32_t timestamp; + bits256 txid; + int32_t height,numvouts,numvins,len,SPV; uint8_t *serialized; struct LP_outpoint outpoints[]; }; @@ -260,7 +261,7 @@ struct iguana_info char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; - void *electrum; void *ctx; + void *electrum; void *ctx; FILE *cachefp; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; bits256 lastprivkey; uint32_t lastprivkeytime; int32_t privkeydepth; diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index efbf047e4..9f7a94b4e 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -99,7 +99,7 @@ void LP_tradebot_calcstats(struct LP_tradebot *bot) } //LP_tradebot_updatestats(bot,bot->trades[i]); } - printf("completed.%d (%.8f / %.8f) pending.%d (%.8f / %.8f)\n",bot->completed,bot->basesum,bot->relsum,bot->numpending,bot->pendbasesum,bot->pendrelsum); + //printf("completed.%d (%.8f / %.8f) pending.%d (%.8f / %.8f)\n",bot->completed,bot->basesum,bot->relsum,bot->numpending,bot->pendbasesum,bot->pendrelsum); } double LP_pricevol_invert(double *basevolumep,double maxprice,double relvolume) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ea09a5bb3..81a7e7b3b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -475,7 +475,7 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson,int32_t zcash) { - uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; + uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[1024],privkey,txid; cJSON *item; cJSON *txobj = 0; maxsize = 1000000; memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) From d262d03ee6687d061838bbb5381cd8eec9f34d0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 19:50:55 +0200 Subject: [PATCH 2271/2732] Test --- iguana/exchanges/LP_cache.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 3c3f32b1b..dcdbf777b 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -60,18 +60,18 @@ cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seria return(txobj); } -struct LP_transaction +/*struct LP_transaction { UT_hash_handle hh; bits256 txid; int32_t height,numvouts,numvins,len,SPV; uint8_t *serialized; struct LP_outpoint outpoints[]; -}; +};*/ -int32_t LP_cacheitem(uint8_t *ptr,long remains) +int32_t LP_cacheitem(struct iguana_info *coin,uint8_t *ptr,long remains) { - + return(-1); } void *LP_cacheptr(FILE **wfp,long *fsizep,struct iguana_info *coin) @@ -97,19 +97,10 @@ void *LP_cacheptr(FILE **wfp,long *fsizep,struct iguana_info *coin) int32_t LP_SPV_load(struct iguana_info *coin,bits256 txid,int32_t height) { - struct LP_transaction *tp; - HASH_FIND(hh,coin->SPVcache,&txid,sizeof(txid),cp) + // struct LP_transaction *tp; return(-1); } -struct LP_transaction -{ - UT_hash_handle hh; - bits256 txid; - int32_t height,numvouts,numvins,len,SPV; - uint8_t *serialized; - struct LP_outpoint outpoints[]; -}; void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) { @@ -198,7 +189,7 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) { - struct LP_transaction *tx; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t retval,m,SPV = 0; + struct LP_transaction *tx; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height == height && tx->SPV > 0 ) return(tx->SPV); if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) From 456ede8d700cee6cb02ed3bb2136061f5273bbe5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 20:01:40 +0200 Subject: [PATCH 2272/2732] Test --- iguana/exchanges/LP_cache.c | 62 +++++++++++++++---------------- iguana/exchanges/LP_transaction.c | 4 +- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index dcdbf777b..4423aa7e5 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -60,21 +60,39 @@ cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seria return(txobj); } -/*struct LP_transaction +void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) { - UT_hash_handle hh; - bits256 txid; - int32_t height,numvouts,numvins,len,SPV; - uint8_t *serialized; - struct LP_outpoint outpoints[]; -};*/ + struct LP_transaction TX; struct LP_transaction *tx = 0; + if ( coin->cachefp != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) //strcmp(coin->smartaddr,coinaddr) == 0 && + { + char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + TX = *tx; + memset(&TX.hh,0,sizeof(TX.hh)); + TX.serialized = 0; + TX.SPV = height; + fwrite(&TX,1,sizeof(TX),coin->cachefp); + if ( tx->numvouts > 0 ) + fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),coin->cachefp); + fwrite(tx->serialized,1,tx->len,coin->cachefp); + fflush(coin->cachefp); + } +} + +/*struct LP_transaction + { + UT_hash_handle hh; + bits256 txid; + int32_t height,numvouts,numvins,len,SPV; + uint8_t *serialized; + struct LP_outpoint outpoints[]; + };*/ int32_t LP_cacheitem(struct iguana_info *coin,uint8_t *ptr,long remains) { return(-1); } -void *LP_cacheptr(FILE **wfp,long *fsizep,struct iguana_info *coin) +void *LP_cacheptrs_init(FILE **wfp,long *fsizep,struct iguana_info *coin) { char fname[1024]; long n,len = 0; uint8_t *ptr = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); @@ -95,30 +113,6 @@ void *LP_cacheptr(FILE **wfp,long *fsizep,struct iguana_info *coin) return(ptr); } -int32_t LP_SPV_load(struct iguana_info *coin,bits256 txid,int32_t height) -{ - // struct LP_transaction *tp; - return(-1); -} - - -void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) -{ - struct LP_transaction TX; struct LP_transaction *tx = 0; - if ( coin->cachefp != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) //strcmp(coin->smartaddr,coinaddr) == 0 && - { - char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); - TX = *tx; - memset(&TX.hh,0,sizeof(TX.hh)); - TX.serialized = 0; - fwrite(&TX,1,sizeof(TX),coin->cachefp); - if ( tx->numvouts > 0 ) - fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),coin->cachefp); - fwrite(tx->serialized,1,tx->len,coin->cachefp); - fflush(coin->cachefp); - } -} - bits256 iguana_merkle(bits256 *tree,int32_t txn_count) { int32_t i,n=0,prev; uint8_t serialized[sizeof(bits256) * 2]; @@ -189,7 +183,7 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) { - struct LP_transaction *tx; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; + struct LP_transaction *tx=0; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height == height && tx->SPV > 0 ) return(tx->SPV); if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) @@ -206,6 +200,8 @@ int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_i if ( bits256_cmp(merkleroot,roothash) == 0 ) { SPV = height; + if ( tx != 0 ) + tx->SPV = height; LP_SPV_store(coin,coinaddr,txid,height); //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 81a7e7b3b..50e8b2c69 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -475,11 +475,12 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson,int32_t zcash) { - uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[1024],privkey,txid; cJSON *item; cJSON *txobj = 0; + uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 *privkeys,privkey,txid; cJSON *item; cJSON *txobj = 0; maxsize = 1000000; memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) { + privkeys = calloc(numinputs,sizeof(*privkeys)); serialized = malloc(maxsize); serialized2 = malloc(maxsize); serialized3 = malloc(maxsize); @@ -595,6 +596,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ } else printf("rwmsgtx error\n"); } else printf("no inputs in vins.(%s)\n",vins!=0?jprint(vins,0):"null"); free(extraspace); + free(privkeys); free(serialized), free(serialized2), free(serialized3), free(serialized4); } else return(-1); if ( txobj != 0 ) From df16a10457b2ac2d88cd4dfe15e73ae256044a59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 20:23:50 +0200 Subject: [PATCH 2273/2732] Test --- iguana/exchanges/LP_cache.c | 8 ++++++-- iguana/exchanges/LP_include.h | 11 +++++++++-- iguana/exchanges/LP_transaction.c | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 4423aa7e5..f741bd24f 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -87,8 +87,10 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h struct LP_outpoint outpoints[]; };*/ -int32_t LP_cacheitem(struct iguana_info *coin,uint8_t *ptr,long remains) +int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) { + int32_t offset; + return(-1); } @@ -101,13 +103,15 @@ void *LP_cacheptrs_init(FILE **wfp,long *fsizep,struct iguana_info *coin) ptr = OS_portable_mapfile(fname,fsizep,0); while ( len < *fsizep ) { - if ( (n= LP_cacheitem(coin,&ptr[len],*fsizep - len)) < 0 ) + if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],*fsizep - len)) < 0 ) { printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,*fsizep); fseek(*wfp,len,SEEK_SET); break; } len += n; + if ( (len & 1) != 0 ) + printf("odd offset at %ld\n",len); } } return(ptr); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6101c6681..a1b7e98ca 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -239,13 +239,20 @@ struct LP_swap_remember char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; }; -struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; char coinaddr[64]; }; +struct LP_outpoint +{ + bits256 spendtxid; + uint64_t value,interest; + int32_t spendvini,spendheight; + char coinaddr[56]; +}; struct LP_transaction { UT_hash_handle hh; bits256 txid; - int32_t height,numvouts,numvins,len,SPV; + int32_t height,len,SPV; + uint16_t numvouts,numvins; uint8_t *serialized; struct LP_outpoint outpoints[]; }; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 50e8b2c69..33946846e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -500,7 +500,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys,zcash) > 0 && numinputs == msgtx->tx_in ) { memset(pubkeys,0,sizeof(pubkeys)); - memset(privkeys,0,sizeof(privkeys)); + memset(privkeys,0,sizeof(*privkeys)*numinputs); if ( (n= cJSON_GetArraySize(privkeysjson)) > 0 ) { for (i=0; i Date: Fri, 10 Nov 2017 20:25:38 +0200 Subject: [PATCH 2274/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 33946846e..e6ec2e565 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -480,7 +480,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) { - privkeys = calloc(numinputs,sizeof(*privkeys)); + privkeys = calloc(numinputs+1024,sizeof(*privkeys)); serialized = malloc(maxsize); serialized2 = malloc(maxsize); serialized3 = malloc(maxsize); From 6badbe8d33dab00725132f37b2798ff168384969 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 20:32:05 +0200 Subject: [PATCH 2275/2732] Test --- iguana/exchanges/LP_include.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a1b7e98ca..c87c181ba 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -244,15 +244,14 @@ struct LP_outpoint bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; - char coinaddr[56]; + char coinaddr[64]; }; struct LP_transaction { UT_hash_handle hh; bits256 txid; - int32_t height,len,SPV; - uint16_t numvouts,numvins; + int32_t height,numvouts,numvins,len,SPV; uint8_t *serialized; struct LP_outpoint outpoints[]; }; From b1450a1670d4f6e294cd62bde5d2dc3e6d06974f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 20:41:15 +0200 Subject: [PATCH 2276/2732] Test --- iguana/exchanges/LP_cache.c | 6 +++++- iguana/exchanges/LP_transaction.c | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index f741bd24f..f79f23175 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -90,7 +90,11 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) { int32_t offset; - + offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); + if ( offset+tx->len <= remains ) + { + return(0); + } return(-1); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index e6ec2e565..6fe266200 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -247,7 +247,10 @@ int32_t iguana_msgtx_Vset(uint8_t *serialized,int32_t maxlen,struct iguana_msgtx int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLockTime,struct vin_info *V,int32_t numvins) { - uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript,savescript[IGUANA_MAXSCRIPTSIZE]; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,scriptlen,activescriptlen,savelen,errs = 0; cJSON *spendscript,*item=0; + uint8_t *script,*activescript,*savescript; char *str; int32_t vini,scriptlen,activescriptlen,savelen,errs = 0; cJSON *spendscript,*item=0; + script = calloc(1,IGUANA_MAXSCRIPTSIZE); + savescript = calloc(1,IGUANA_MAXSCRIPTSIZE); + str = calloc(1,IGUANA_MAXSCRIPTSIZE*2+1); for (vini=0; vini Date: Fri, 10 Nov 2017 20:54:19 +0200 Subject: [PATCH 2277/2732] Test --- iguana/exchanges/LP_cache.c | 15 ++++++++++++--- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_transaction.c | 10 ++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index f79f23175..faa0ba9a6 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -62,7 +62,7 @@ cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seria void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) { - struct LP_transaction TX; struct LP_transaction *tx = 0; + struct LP_transaction TX; int32_t n; struct LP_transaction *tx = 0; if ( coin->cachefp != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) //strcmp(coin->smartaddr,coinaddr) == 0 && { char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); @@ -74,6 +74,9 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h if ( tx->numvouts > 0 ) fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),coin->cachefp); fwrite(tx->serialized,1,tx->len,coin->cachefp); + n = tx->len; + while ( (n & 7) != 0 ) + fputc(0,coin->cachefp), n++; fflush(coin->cachefp); } } @@ -89,11 +92,17 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) { - int32_t offset; + int32_t offset; bits256 hash; char str[65],str2[65]; offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); if ( offset+tx->len <= remains ) { - return(0); + hash = bits256_doublesha256(0,&((uint8_t *)tx)[offset],tx->len); + if ( bits256_cmp(hash,tx->txid) == 0 ) + { + printf("%s validated in cache\n",bits256_str(str,hash)); + return(0); + } + printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,tx->txid)); } return(-1); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c87c181ba..ec308800d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -37,6 +37,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_BARTERDEX_VERSION 1 #define LP_MAGICBITS 8 +#define LP_MAXVINS 64 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) #define LP_AUTOTRADE_TIMEOUT 30 #define ELECTRUM_TIMEOUT 7 diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6fe266200..91bdb2f2d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -481,12 +481,11 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson,int32_t zcash) { - uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 *privkeys,privkey,txid; cJSON *item; cJSON *txobj = 0; + uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 100000; char *privkeystr,*signedtx = 0; bits256 privkeys[LP_MAXVINS],privkey,txid; cJSON *item; cJSON *txobj = 0; maxsize = 1000000; memset(privkey.bytes,0,sizeof(privkey)); if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize ) { - privkeys = calloc(numinputs+1024,sizeof(*privkeys)); serialized = malloc(maxsize); serialized2 = malloc(maxsize); serialized3 = malloc(maxsize); @@ -506,7 +505,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys,zcash) > 0 && numinputs == msgtx->tx_in ) { memset(pubkeys,0,sizeof(pubkeys)); - memset(privkeys,0,sizeof(*privkeys)*numinputs); + memset(privkeys,0,sizeof(privkeys)); if ( (n= cJSON_GetArraySize(privkeysjson)) > 0 ) { for (i=0; ismartaddr,sizeof(changeaddr)); safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); privkey = LP_privkey(vinaddr,coin->taddr); - maxV = 1024; + maxV = LP_MAXVINS; V = malloc(maxV * sizeof(*V)); for (iter=0; iter<2; iter++) { From 98e9e24087435dc669567ce1f7fca3d6d70ab729 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:08:55 +0200 Subject: [PATCH 2278/2732] Test --- iguana/exchanges/LP_cache.c | 35 ++++++++++++++++------------------- iguana/exchanges/LP_coins.c | 1 + iguana/exchanges/LP_include.h | 3 ++- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index faa0ba9a6..ab02bfbcb 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -81,44 +81,41 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h } } -/*struct LP_transaction - { - UT_hash_handle hh; - bits256 txid; - int32_t height,numvouts,numvins,len,SPV; - uint8_t *serialized; - struct LP_outpoint outpoints[]; - };*/ - int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) { - int32_t offset; bits256 hash; char str[65],str2[65]; + int32_t offset,n; bits256 hash; cJSON *txobj; char str[65],str2[65]; offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); if ( offset+tx->len <= remains ) { - hash = bits256_doublesha256(0,&((uint8_t *)tx)[offset],tx->len); + tx->serialized = &((uint8_t *)tx)[offset]; + hash = bits256_doublesha256(0,tx->serialized,tx->len); if ( bits256_cmp(hash,tx->txid) == 0 ) { printf("%s validated in cache\n",bits256_str(str,hash)); - return(0); + n = tx->len; + while ( (n & 7) != 0 ) + n++; + if ( (txobj= LP_cache_transaction(coin,tx->txid,tx->serialized,tx->len)) != 0 ) + free_json(txobj); + return(offset + n); } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,tx->txid)); } return(-1); } -void *LP_cacheptrs_init(FILE **wfp,long *fsizep,struct iguana_info *coin) +long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin) { - char fname[1024]; long n,len = 0; uint8_t *ptr = 0; + char fname[1024]; long n,fsize=0,len = 0; uint8_t *ptr = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); if ( ((*wfp)= OS_appendfile(fname)) != 0 ) { - ptr = OS_portable_mapfile(fname,fsizep,0); - while ( len < *fsizep ) + ptr = OS_portable_mapfile(fname,&fsize,0); + while ( len < fsize ) { - if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],*fsizep - len)) < 0 ) + if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) { - printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,*fsizep); + printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); fseek(*wfp,len,SEEK_SET); break; } @@ -127,7 +124,7 @@ void *LP_cacheptrs_init(FILE **wfp,long *fsizep,struct iguana_info *coin) printf("odd offset at %ld\n",len); } } - return(ptr); + return(fsize); } bits256 iguana_merkle(bits256 *tree,int32_t txn_count) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 38c62ac64..afd5a8129 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -353,6 +353,7 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->zcash = LP_IS_BITCOINCASH; //printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); } + coin->cachesize = LP_cacheptrs_init(&coin->cachefp,coin); return(port); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ec308800d..c5608a125 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -268,7 +268,7 @@ struct iguana_info char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; - void *electrum; void *ctx; FILE *cachefp; + void *electrum; void *ctx; FILE *cachefp; long cachesize; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; bits256 lastprivkey; uint32_t lastprivkeytime; int32_t privkeydepth; @@ -432,6 +432,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid); uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance); int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); void LP_smartutxos_push(struct iguana_info *coin); +long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); From d47fbfc716b54b7a3e62a58b467f373c418af27a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:10:41 +0200 Subject: [PATCH 2279/2732] Test --- iguana/exchanges/LP_cache.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index ab02bfbcb..a6134e813 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -106,22 +106,27 @@ int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long rem long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin) { - char fname[1024]; long n,fsize=0,len = 0; uint8_t *ptr = 0; + char fname[1024]; FILE *fp; long n,fsize=0,len = 0; uint8_t *ptr = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); + fp = fopen(fname,"rb"); if ( ((*wfp)= OS_appendfile(fname)) != 0 ) { - ptr = OS_portable_mapfile(fname,&fsize,0); - while ( len < fsize ) + if ( fp != 0 ) { - if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) + fclose(fp); + ptr = OS_portable_mapfile(fname,&fsize,0); + while ( len < fsize ) { - printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); - fseek(*wfp,len,SEEK_SET); - break; + if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) + { + printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); + fseek(*wfp,len,SEEK_SET); + break; + } + len += n; + if ( (len & 1) != 0 ) + printf("odd offset at %ld\n",len); } - len += n; - if ( (len & 1) != 0 ) - printf("odd offset at %ld\n",len); } } return(fsize); From 2cd41e6a4372581a2564149b9f6a459651e19b92 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:13:55 +0200 Subject: [PATCH 2280/2732] Test --- iguana/exchanges/LP_cache.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index a6134e813..4967a8692 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -106,26 +106,32 @@ int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long rem long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin) { - char fname[1024]; FILE *fp; long n,fsize=0,len = 0; uint8_t *ptr = 0; + char fname[1024]; FILE *fp; int32_t flag = 0; long n,fsize=0,len = 0; uint8_t *ptr = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); fp = fopen(fname,"rb"); if ( ((*wfp)= OS_appendfile(fname)) != 0 ) { if ( fp != 0 ) { + fseek(fp,0,SEEK_END); + if ( ftell(fp) > sizeof(struct LP_transaction) ) + flag = 1; fclose(fp); - ptr = OS_portable_mapfile(fname,&fsize,0); - while ( len < fsize ) + if ( flag != 0 ) { - if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) + ptr = OS_portable_mapfile(fname,&fsize,0); + while ( len < fsize ) { - printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); - fseek(*wfp,len,SEEK_SET); - break; + if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) + { + printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); + fseek(*wfp,len,SEEK_SET); + break; + } + len += n; + if ( (len & 1) != 0 ) + printf("odd offset at %ld\n",len); } - len += n; - if ( (len & 1) != 0 ) - printf("odd offset at %ld\n",len); } } } From 96c50ce02f5c0fda48ba7506ba0c771f71bc810e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:15:27 +0200 Subject: [PATCH 2281/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c64c1330f..77f790c53 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -423,7 +423,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -//printf("%s %s",symbol,stratumreq); +printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); @@ -864,7 +864,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { - //printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); + printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) From 0dda4d18a0281d1dd8ef155cf9a64e89dcee5b81 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:22:16 +0200 Subject: [PATCH 2282/2732] Test --- iguana/exchanges/LP_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 4967a8692..ae9626eb6 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -87,6 +87,7 @@ int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long rem offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); if ( offset+tx->len <= remains ) { + printf("offset.%d txlen.%d remains.%ld\n",offset,tx->len,remains); tx->serialized = &((uint8_t *)tx)[offset]; hash = bits256_doublesha256(0,tx->serialized,tx->len); if ( bits256_cmp(hash,tx->txid) == 0 ) @@ -129,7 +130,7 @@ long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin) break; } len += n; - if ( (len & 1) != 0 ) + if ( (len & 7) != 0 ) printf("odd offset at %ld\n",len); } } From 6b11505dad4b1bd577936f29d7233818fe29bfb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:26:08 +0200 Subject: [PATCH 2283/2732] Test --- iguana/exchanges/LP_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index ae9626eb6..ddc519209 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -83,12 +83,12 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) { - int32_t offset,n; bits256 hash; cJSON *txobj; char str[65],str2[65]; + int32_t offset,n; uint8_t *serialized; bits256 hash; cJSON *txobj; char str[65],str2[65]; offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); if ( offset+tx->len <= remains ) { printf("offset.%d txlen.%d remains.%ld\n",offset,tx->len,remains); - tx->serialized = &((uint8_t *)tx)[offset]; + serialized = &((uint8_t *)tx)[offset]; hash = bits256_doublesha256(0,tx->serialized,tx->len); if ( bits256_cmp(hash,tx->txid) == 0 ) { From 8a537d788caa7290fb9ebc157373f3e5acba49c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:27:30 +0200 Subject: [PATCH 2284/2732] Test --- iguana/exchanges/LP_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index ddc519209..6179b3fe1 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -89,14 +89,14 @@ int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long rem { printf("offset.%d txlen.%d remains.%ld\n",offset,tx->len,remains); serialized = &((uint8_t *)tx)[offset]; - hash = bits256_doublesha256(0,tx->serialized,tx->len); + hash = bits256_doublesha256(0,serialized,tx->len); if ( bits256_cmp(hash,tx->txid) == 0 ) { printf("%s validated in cache\n",bits256_str(str,hash)); n = tx->len; while ( (n & 7) != 0 ) n++; - if ( (txobj= LP_cache_transaction(coin,tx->txid,tx->serialized,tx->len)) != 0 ) + if ( (txobj= LP_cache_transaction(coin,tx->txid,serialized,tx->len)) != 0 ) free_json(txobj); return(offset + n); } From d72f025e730b814bbf686a05168725b5834d5569 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:42:20 +0200 Subject: [PATCH 2285/2732] test --- iguana/exchanges/LP_cache.c | 52 +++++++++++++++++++++++++---------- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_socket.c | 25 +++++++++++++++++ 3 files changed, 63 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 6179b3fe1..924f839d5 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -35,26 +35,48 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se return(txobj); } -cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) +cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len,int32_t height) { - cJSON *txobj; struct LP_transaction *tx; + cJSON *txobj; bits256 spenttxid; int32_t i,spentvout,numvins,numvouts; cJSON *vout,*vin,*vins,*vouts; struct LP_transaction *tx; char str[65]; if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) { - if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) + vins = jarray(&numvins,txobj,"vin"); + vouts = jarray(&numvouts,txobj,"vout"); + tx = LP_transactionadd(coin,txid,height,numvouts,numvins); + printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); + for (i=0; ioutpoints[i].value = LP_value_extract(vout,0); + tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); + LP_destaddr(tx->outpoints[i].coinaddr,vout); + printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); + LP_address_utxoadd("LP_transactioninit iter0",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } - if ( tx != 0 ) + for (i=0; iserialized = serialized; - tx->len = len; - } - else - { - char str[65]; printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); - free(serialized); + vin = jitem(vins,i); + spenttxid = jbits256(vin,"txid"); + spentvout = jint(vin,"vout"); + if ( i == 0 && bits256_nonz(spenttxid) == 0 ) + continue; + if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) + { + if ( spentvout < tx->numvouts ) + { + if ( tx->outpoints[spentvout].spendheight <= 0 ) + { + tx->outpoints[spentvout].spendtxid = txid; + tx->outpoints[spentvout].spendvini = i; + tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; + LP_address_utxoadd("LP_transactioninit iter1",coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + if ( 0 && strcmp(coin->symbol,"REVS") == 0 ) + printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); + } + } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d spendheight.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts,tx->outpoints[spentvout].spendheight); + } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + if ( bits256_cmp(spenttxid,txid) == 0 ) + printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } } return(txobj); @@ -96,7 +118,7 @@ int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long rem n = tx->len; while ( (n & 7) != 0 ) n++; - if ( (txobj= LP_cache_transaction(coin,tx->txid,serialized,tx->len)) != 0 ) + if ( (txobj= LP_create_transaction(coin,tx->txid,serialized,tx->len,tx->height)) != 0 ) free_json(txobj); return(offset + n); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c5608a125..b5f98b3d1 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -410,6 +410,7 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); +struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins); void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 77f790c53..c34c04ee7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -662,6 +662,31 @@ cJSON *electrum_getheader(char *symbol,struct electrum_info *ep,cJSON **retjsonp return(electrum_intarg(symbol,ep,retjsonp,"blockchain.block.get_header",n,ELECTRUM_TIMEOUT)); } +cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len) +{ + cJSON *txobj; struct LP_transaction *tx; + if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) == 0 || tx->serialized == 0 ) + { + txobj = LP_transactioninit(coin,txid,0,txobj); + LP_transactioninit(coin,txid,1,txobj); + tx = LP_transactionfind(coin,txid); + } + if ( tx != 0 ) + { + tx->serialized = serialized; + tx->len = len; + } + else + { + char str[65]; printf("unexpected couldnt find tx %s %s\n",coin->symbol,bits256_str(str,txid)); + free(serialized); + } + } + return(txobj); +} + cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; From 8a31dd2721acdc1a1c605a8fb3503757bad2875d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 21:44:36 +0200 Subject: [PATCH 2286/2732] Test --- iguana/exchanges/LP_cache.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 924f839d5..24500e53f 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -43,15 +43,18 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); tx = LP_transactionadd(coin,txid,height,numvouts,numvins); - printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); + tx->serialized = serialized; + tx->len = len; + tx->height = height; + //printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); for (i=0; ioutpoints[i].value = LP_value_extract(vout,0); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); - printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); - LP_address_utxoadd("LP_transactioninit iter0",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); + //printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); + LP_address_utxoadd("LP_create_transaction",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } for (i=0; i Date: Fri, 10 Nov 2017 21:55:30 +0200 Subject: [PATCH 2287/2732] Test --- iguana/exchanges/LP_cache.c | 75 ++++++++++++++++++----------------- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_include.h | 4 +- 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 24500e53f..9af599b21 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -87,22 +87,26 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) { - struct LP_transaction TX; int32_t n; struct LP_transaction *tx = 0; - if ( coin->cachefp != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) //strcmp(coin->smartaddr,coinaddr) == 0 && + FILE *fp; char fname[512]; struct LP_transaction TX; int32_t n; struct LP_transaction *tx = 0; + if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) { - char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); - TX = *tx; - memset(&TX.hh,0,sizeof(TX.hh)); - TX.serialized = 0; - TX.SPV = height; - fwrite(&TX,1,sizeof(TX),coin->cachefp); - if ( tx->numvouts > 0 ) - fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),coin->cachefp); - fwrite(tx->serialized,1,tx->len,coin->cachefp); - n = tx->len; - while ( (n & 7) != 0 ) - fputc(0,coin->cachefp), n++; - fflush(coin->cachefp); + sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); + if ( (fp= OS_appendfile(fname)) != 0 ) + { + char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + TX = *tx; + memset(&TX.hh,0,sizeof(TX.hh)); + TX.serialized = 0; + TX.SPV = height; + fwrite(&TX,1,sizeof(TX),fp); + if ( tx->numvouts > 0 ) + fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),fp); + fwrite(tx->serialized,1,tx->len,fp); + n = tx->len; + while ( (n & 7) != 0 ) + fputc(0,fp), n++; + fclose(fp); + } } } @@ -130,38 +134,37 @@ int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long rem return(-1); } -long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin) +void LP_cacheptrs_init(struct iguana_info *coin) { - char fname[1024]; FILE *fp; int32_t flag = 0; long n,fsize=0,len = 0; uint8_t *ptr = 0; + char fname[1024]; FILE *fp; int32_t tflag=0,flag = 0; long n,fsize=0,len = 0; uint8_t *ptr = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); fp = fopen(fname,"rb"); - if ( ((*wfp)= OS_appendfile(fname)) != 0 ) + if ( fp != 0 ) { - if ( fp != 0 ) + fseek(fp,0,SEEK_END); + if ( ftell(fp) > sizeof(struct LP_transaction) ) + flag = 1; + fclose(fp); + if ( flag != 0 ) { - fseek(fp,0,SEEK_END); - if ( ftell(fp) > sizeof(struct LP_transaction) ) - flag = 1; - fclose(fp); - if ( flag != 0 ) + ptr = OS_portable_mapfile(fname,&fsize,0); + while ( len < fsize ) { - ptr = OS_portable_mapfile(fname,&fsize,0); - while ( len < fsize ) + if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) { - if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) - { - printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); - fseek(*wfp,len,SEEK_SET); - break; - } - len += n; - if ( (len & 7) != 0 ) - printf("odd offset at %ld\n",len); + printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); + tflag = 1; + break; } + len += n; + if ( (len & 7) != 0 ) + printf("odd offset at %ld\n",len); } + OS_releasemap(ptr,fsize); } } - return(fsize); + if ( tflag != 0 ) + OS_truncate(fname,len); } bits256 iguana_merkle(bits256 *tree,int32_t txn_count) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index afd5a8129..69bf86302 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -353,7 +353,7 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->zcash = LP_IS_BITCOINCASH; //printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); } - coin->cachesize = LP_cacheptrs_init(&coin->cachefp,coin); + LP_cacheptrs_init(coin); return(port); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b5f98b3d1..61749e7ff 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -268,7 +268,7 @@ struct iguana_info char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; - void *electrum; void *ctx; FILE *cachefp; long cachesize; + void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; bits256 lastprivkey; uint32_t lastprivkeytime; int32_t privkeydepth; @@ -433,7 +433,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid); uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance); int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); void LP_smartutxos_push(struct iguana_info *coin); -long LP_cacheptrs_init(FILE **wfp,struct iguana_info *coin); +void LP_cacheptrs_init(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout); void LP_postutxos(char *symbol,char *coinaddr); From 252351a8aeabb8acad49d4069a05488d49e600fa Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:02:49 +0200 Subject: [PATCH 2288/2732] Test --- iguana/exchanges/LP_cache.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 9af599b21..c7a507250 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -110,14 +110,15 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h } } -int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) +long LP_cacheitem(struct iguana_info *coin,void *ptr,long fpos,long remains) { - int32_t offset,n; uint8_t *serialized; bits256 hash; cJSON *txobj; char str[65],str2[65]; - offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); + struct LP_transaction *tx; long offset; int32_t n; uint8_t *serialized; bits256 hash; cJSON *txobj; char str[65],str2[65]; + tx = ptr; + offset = fpos + sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); if ( offset+tx->len <= remains ) { - printf("offset.%d txlen.%d remains.%ld\n",offset,tx->len,remains); - serialized = &((uint8_t *)tx)[offset]; + printf("offset.%ld txlen.%d remains.%ld\n",offset,tx->len,remains); + serialized = &((uint8_t *)ptr)[offset]; hash = bits256_doublesha256(0,serialized,tx->len); if ( bits256_cmp(hash,tx->txid) == 0 ) { @@ -150,13 +151,13 @@ void LP_cacheptrs_init(struct iguana_info *coin) ptr = OS_portable_mapfile(fname,&fsize,0); while ( len < fsize ) { - if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],fsize - len)) < 0 ) + if ( (n= LP_cacheitem(coin,ptr,len,fsize - len)) < 0 ) { printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); tflag = 1; break; } - len += n; + len = n; if ( (len & 7) != 0 ) printf("odd offset at %ld\n",len); } From 75c162e52b7ce693220824383568afc0cb01e6ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:11:19 +0200 Subject: [PATCH 2289/2732] Test --- iguana/exchanges/LP_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index c7a507250..fb7b822b9 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -128,6 +128,7 @@ long LP_cacheitem(struct iguana_info *coin,void *ptr,long fpos,long remains) n++; if ( (txobj= LP_create_transaction(coin,tx->txid,serialized,tx->len,tx->height)) != 0 ) free_json(txobj); + printf("return offset.%ld + tx->len %d -> %d\n",offset,tx->len,n); return(offset + n); } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,tx->txid)); From 4964952dc9d85f2ec2f9c40f5da8e46819142e2a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:32:26 +0200 Subject: [PATCH 2290/2732] Test --- iguana/exchanges/LP_cache.c | 75 +++++++++++++------------------------ 1 file changed, 27 insertions(+), 48 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index fb7b822b9..8b4d705b1 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -87,82 +87,61 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) { - FILE *fp; char fname[512]; struct LP_transaction TX; int32_t n; struct LP_transaction *tx = 0; + FILE *fp; char fname[512]; struct LP_transaction *tx = 0; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) { sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); if ( (fp= OS_appendfile(fname)) != 0 ) { char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); - TX = *tx; - memset(&TX.hh,0,sizeof(TX.hh)); - TX.serialized = 0; - TX.SPV = height; - fwrite(&TX,1,sizeof(TX),fp); - if ( tx->numvouts > 0 ) - fwrite(TX.outpoints,tx->numvouts,sizeof(*TX.outpoints),fp); - fwrite(tx->serialized,1,tx->len,fp); - n = tx->len; - while ( (n & 7) != 0 ) - fputc(0,fp), n++; + fwrite(&tx->txid,1,sizeof(tx->txid),fp); + fwrite(&tx->len,1,sizeof(tx->len),fp); + fwrite(&tx->height,1,sizeof(tx->height),fp); + fwrite(&tx->serialized,1,tx->len,fp); fclose(fp); } } } -long LP_cacheitem(struct iguana_info *coin,void *ptr,long fpos,long remains) +long LP_cacheitem(struct iguana_info *coin,FILE *fp) { - struct LP_transaction *tx; long offset; int32_t n; uint8_t *serialized; bits256 hash; cJSON *txobj; char str[65],str2[65]; - tx = ptr; - offset = fpos + sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints); - if ( offset+tx->len <= remains ) + bits256 txid,hash; int32_t height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { - printf("offset.%ld txlen.%d remains.%ld\n",offset,tx->len,remains); - serialized = &((uint8_t *)ptr)[offset]; - hash = bits256_doublesha256(0,serialized,tx->len); - if ( bits256_cmp(hash,tx->txid) == 0 ) + serialized = malloc(len); + if ( fread(serialized,1,len,fp) == len ) { - printf("%s validated in cache\n",bits256_str(str,hash)); - n = tx->len; - while ( (n & 7) != 0 ) - n++; - if ( (txobj= LP_create_transaction(coin,tx->txid,serialized,tx->len,tx->height)) != 0 ) - free_json(txobj); - printf("return offset.%ld + tx->len %d -> %d\n",offset,tx->len,n); - return(offset + n); + hash = bits256_doublesha256(0,serialized,len); + if ( bits256_cmp(hash,txid) == 0 ) + { + printf("%s validated in cache\n",bits256_str(str,hash)); + if ( (txobj= LP_create_transaction(coin,txid,serialized,len,height)) != 0 ) + free_json(txobj); + return(ftell(fp)); + } + printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,txid)); } - printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,tx->txid)); } return(-1); } void LP_cacheptrs_init(struct iguana_info *coin) { - char fname[1024]; FILE *fp; int32_t tflag=0,flag = 0; long n,fsize=0,len = 0; uint8_t *ptr = 0; + char fname[1024]; FILE *fp; int32_t tflag=0; long n,fsize=0,len = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); fp = fopen(fname,"rb"); if ( fp != 0 ) { - fseek(fp,0,SEEK_END); - if ( ftell(fp) > sizeof(struct LP_transaction) ) - flag = 1; - fclose(fp); - if ( flag != 0 ) + while ( len < fsize ) { - ptr = OS_portable_mapfile(fname,&fsize,0); - while ( len < fsize ) + if ( (n= LP_cacheitem(coin,fp)) < 0 ) { - if ( (n= LP_cacheitem(coin,ptr,len,fsize - len)) < 0 ) - { - printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); - tflag = 1; - break; - } - len = n; - if ( (len & 7) != 0 ) - printf("odd offset at %ld\n",len); + printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,fsize); + tflag = 1; + break; } - OS_releasemap(ptr,fsize); + len = n; + printf("len.%ld\n",len); } } if ( tflag != 0 ) From 10badb29e7a639bc635e62f4c527a4e7da844394 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:43:03 +0200 Subject: [PATCH 2291/2732] Test --- iguana/exchanges/LP_cache.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 8b4d705b1..3a28cd241 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -105,11 +105,12 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h long LP_cacheitem(struct iguana_info *coin,FILE *fp) { - bits256 txid,hash; int32_t height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + bits256 txid,hash; int32_t retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { serialized = malloc(len); - if ( fread(serialized,1,len,fp) == len ) + printf("read len.%d\n",len); + if ( (retval= (int32_t)fread(serialized,1,len,fp)) == len ) { hash = bits256_doublesha256(0,serialized,len); if ( bits256_cmp(hash,txid) == 0 ) @@ -120,8 +121,8 @@ long LP_cacheitem(struct iguana_info *coin,FILE *fp) return(ftell(fp)); } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,txid)); - } - } + } else printf("retval.%d vs len.%d\n",retval,len); + } else printf("fread error\n"); return(-1); } @@ -143,7 +144,7 @@ void LP_cacheptrs_init(struct iguana_info *coin) len = n; printf("len.%ld\n",len); } - } + } else printf("couldnt find.(%s)\n",fname); if ( tflag != 0 ) OS_truncate(fname,len); } From 6421c45df086b19cba5595ecebdfe3bf47aaec95 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:46:39 +0200 Subject: [PATCH 2292/2732] Test --- iguana/exchanges/LP_cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 3a28cd241..bf4a909c3 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -133,6 +133,9 @@ void LP_cacheptrs_init(struct iguana_info *coin) fp = fopen(fname,"rb"); if ( fp != 0 ) { + fseek(fp,0,SEEK_END); + fsize = ftell(fp); + rewind(fp); while ( len < fsize ) { if ( (n= LP_cacheitem(coin,fp)) < 0 ) From 14fdcee45e7b8db49dcd0e12fb4e50e0fd8bab7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:51:14 +0200 Subject: [PATCH 2293/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index bf4a909c3..5044702ea 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -97,7 +97,7 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h fwrite(&tx->txid,1,sizeof(tx->txid),fp); fwrite(&tx->len,1,sizeof(tx->len),fp); fwrite(&tx->height,1,sizeof(tx->height),fp); - fwrite(&tx->serialized,1,tx->len,fp); + fwrite(tx->serialized,1,tx->len,fp); fclose(fp); } } From 7d5ca7ab122752b08c566827426d38b73b6167fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 22:56:13 +0200 Subject: [PATCH 2294/2732] Test --- iguana/exchanges/LP_cache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 5044702ea..2fa3f6d69 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -103,13 +103,13 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h } } -long LP_cacheitem(struct iguana_info *coin,FILE *fp) +int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) { - bits256 txid,hash; int32_t retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + bits256 txid,hash; long fpos; int32_t retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + fpos = ftell(fp); if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { serialized = malloc(len); - printf("read len.%d\n",len); if ( (retval= (int32_t)fread(serialized,1,len,fp)) == len ) { hash = bits256_doublesha256(0,serialized,len); @@ -118,7 +118,7 @@ long LP_cacheitem(struct iguana_info *coin,FILE *fp) printf("%s validated in cache\n",bits256_str(str,hash)); if ( (txobj= LP_create_transaction(coin,txid,serialized,len,height)) != 0 ) free_json(txobj); - return(ftell(fp)); + return((int32_t)(ftell(fp) - fpos)); } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,txid)); } else printf("retval.%d vs len.%d\n",retval,len); @@ -144,8 +144,8 @@ void LP_cacheptrs_init(struct iguana_info *coin) tflag = 1; break; } - len = n; - printf("len.%ld\n",len); + len += n; + printf("len.%ld n.%ld\n",len,n); } } else printf("couldnt find.(%s)\n",fname); if ( tflag != 0 ) From 9fc67c9b2493f775f98a27fe12ca727331a4c354 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:03:22 +0200 Subject: [PATCH 2295/2732] Test --- iguana/exchanges/LP_cache.c | 4 +++- iguana/exchanges/LP_coins.c | 1 - iguana/exchanges/LP_socket.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 2fa3f6d69..bcca92a86 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -131,6 +131,7 @@ void LP_cacheptrs_init(struct iguana_info *coin) char fname[1024]; FILE *fp; int32_t tflag=0; long n,fsize=0,len = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); fp = fopen(fname,"rb"); + printf("load %s\n",fname); if ( fp != 0 ) { fseek(fp,0,SEEK_END); @@ -145,8 +146,9 @@ void LP_cacheptrs_init(struct iguana_info *coin) break; } len += n; - printf("len.%ld n.%ld\n",len,n); + printf("%s len.%ld n.%ld\n",fname,len,n); } + fclose(fp); } else printf("couldnt find.(%s)\n",fname); if ( tflag != 0 ) OS_truncate(fname,len); diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 69bf86302..38c62ac64 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -353,7 +353,6 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->zcash = LP_IS_BITCOINCASH; //printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); } - LP_cacheptrs_init(coin); return(port); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c34c04ee7..8435aa6df 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1056,7 +1056,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); - ep->prev = coin->electrum; + if ( (ep->prev= coin->electrum) == 0 ) + LP_cacheptrs_init(coin); coin->electrum = ep; } } From 9777a4e933d6a83c664e408527a642295247c78f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:08:14 +0200 Subject: [PATCH 2296/2732] Test --- iguana/exchanges/LP_cache.c | 9 +++++---- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_socket.c | 8 ++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index bcca92a86..660ff107c 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -115,7 +115,7 @@ int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) hash = bits256_doublesha256(0,serialized,len); if ( bits256_cmp(hash,txid) == 0 ) { - printf("%s validated in cache\n",bits256_str(str,hash)); + //printf("%s validated in cache\n",bits256_str(str,hash)); if ( (txobj= LP_create_transaction(coin,txid,serialized,len,height)) != 0 ) free_json(txobj); return((int32_t)(ftell(fp) - fpos)); @@ -128,10 +128,10 @@ int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) void LP_cacheptrs_init(struct iguana_info *coin) { - char fname[1024]; FILE *fp; int32_t tflag=0; long n,fsize=0,len = 0; + char fname[1024]; FILE *fp; int32_t count,tflag=0; long n,fsize=0,len = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); fp = fopen(fname,"rb"); - printf("load %s\n",fname); + count = 0; if ( fp != 0 ) { fseek(fp,0,SEEK_END); @@ -145,9 +145,10 @@ void LP_cacheptrs_init(struct iguana_info *coin) tflag = 1; break; } + count++; len += n; - printf("%s len.%ld n.%ld\n",fname,len,n); } + printf("loaded %s %d entries total len.%ld\n",fname,count,len); fclose(fp); } else printf("couldnt find.(%s)\n",fname); if ( tflag != 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 61749e7ff..08f82f182 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -263,7 +263,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t numutxos,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; - uint32_t electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; + uint32_t loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8435aa6df..9c816046a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1056,9 +1056,13 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); - if ( (ep->prev= coin->electrum) == 0 ) - LP_cacheptrs_init(coin); + ep->prev = coin->electrum; coin->electrum = ep; + if ( coin->loadedcache == 0 ) + { + LP_cacheptrs_init(coin); + coin->loadedcache = (uint32_t)time(NULL); + } } } else From c2ea6b6b16fa69558945262fd969930b7fd27a24 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:11:28 +0200 Subject: [PATCH 2297/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 660ff107c..18ed73f16 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -45,7 +45,7 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri tx = LP_transactionadd(coin,txid,height,numvouts,numvins); tx->serialized = serialized; tx->len = len; - tx->height = height; + tx->SPV = tx->height = height; //printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); for (i=0; i Date: Fri, 10 Nov 2017 23:19:31 +0200 Subject: [PATCH 2298/2732] Test --- iguana/exchanges/LP_cache.c | 6 +++--- iguana/exchanges/LP_include.h | 14 ++++++++++++++ iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 20 +++++++------------- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 18ed73f16..c66957bd1 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -85,7 +85,7 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri return(txobj); } -void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t height) +void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) { FILE *fp; char fname[512]; struct LP_transaction *tx = 0; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) @@ -223,7 +223,7 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t return(merkleroot); } -int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) +int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) { struct LP_transaction *tx=0; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height == height && tx->SPV > 0 ) @@ -244,7 +244,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_i SPV = height; if ( tx != 0 ) tx->SPV = height; - LP_SPV_store(coin,coinaddr,txid,height); + LP_SPV_store(coin,txid,height); //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 08f82f182..2003f3a06 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -371,6 +371,19 @@ struct LP_pubkeyinfo uint8_t rmd160[20],sig[65],pubsecp[33],siglen; }; +struct electrum_info +{ + queue_t sendQ,pendingQ; + portable_mutex_t mutex,txmutex; + struct electrum_info *prev; + int32_t bufsize,sock,*heightp,numerrors; + struct iguana_info *coin; + uint32_t stratumid,lasttime,keepalive,pending,*heighttimep; + char ipaddr[64],symbol[16]; + uint16_t port; + uint8_t buf[]; +}; + int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item); int32_t LP_pubkey_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,bits256 pub,uint8_t *rmd160,uint8_t *pubsecp); int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson); @@ -410,6 +423,7 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); +int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height); struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins); void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9ab94a382..49eca0745 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -524,7 +524,7 @@ void LP_coinsloop(void *_coins) if ( up->SPV == 0 ) { nonz++; - up->SPV = LP_merkleproof(coin,ap->coinaddr,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); if ( 0 && up->SPV > 0 ) printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } @@ -535,7 +535,7 @@ void LP_coinsloop(void *_coins) oldht = up->U.height; LP_txheight_check(coin,ap->coinaddr,up); if ( oldht != up->U.height ) - up->SPV = LP_merkleproof(coin,ap->coinaddr,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) up->SPV = -2; else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fb5761d86..c04beef58 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -647,7 +647,7 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) return(-1); if ( (backupep= ep->prev) == 0 ) backupep = ep; - up->SPV = LP_merkleproof(coin,coinaddr,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) return(-1); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9c816046a..c06101f1a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -238,18 +238,7 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) return(recvlen); } -struct electrum_info -{ - queue_t sendQ,pendingQ; - portable_mutex_t mutex,txmutex; - struct electrum_info *prev; - int32_t bufsize,sock,*heightp,numerrors; - struct iguana_info *coin; - uint32_t stratumid,lasttime,keepalive,pending,*heighttimep; - char ipaddr[64],symbol[16]; - uint16_t port; - uint8_t buf[]; -} *Electrums[8192]; +struct electrum_info *Electrums[8192]; int32_t Num_electrums; struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) @@ -750,12 +739,17 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { - cJSON *retjson; + cJSON *retjson; struct iguana_info *coin; struct LP_transaction *tx; if ( ep != 0 ) portable_mutex_lock(&ep->txmutex); retjson = _electrum_transaction(symbol,ep,retjsonp,txid); if ( ep != 0 ) portable_mutex_unlock(&ep->txmutex); + if ( ep != 0 && (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 && tx->SPV <= 0 ) + { + LP_merkleproof(coin,ep,txid,tx->height); + printf("extra merkle\n"); + } return(retjson); } From 72cb226ac19b2e797840b9627dcbbd33214dcbe2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:29:22 +0200 Subject: [PATCH 2299/2732] Test --- iguana/exchanges/LP_socket.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c06101f1a..e6bc5ad02 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -739,17 +739,19 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { - cJSON *retjson; struct iguana_info *coin; struct LP_transaction *tx; + cJSON *retjson; //struct iguana_info *coin; struct LP_transaction *tx; if ( ep != 0 ) portable_mutex_lock(&ep->txmutex); retjson = _electrum_transaction(symbol,ep,retjsonp,txid); if ( ep != 0 ) portable_mutex_unlock(&ep->txmutex); - if ( ep != 0 && (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 && tx->SPV <= 0 ) + /*if ( ep != 0 && (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV <= 0 ) // we just dont have height! { + if ( tx->height == 0 ) + tx->height = LP_gettxheight(coin,txid); LP_merkleproof(coin,ep,txid,tx->height); printf("extra merkle\n"); - } + }*/ return(retjson); } From 408f2e4d5d5fa1982e69004d0df6b026ee4c27c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:32:16 +0200 Subject: [PATCH 2300/2732] Test --- iguana/exchanges/LP_socket.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e6bc5ad02..74a9bb364 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -327,7 +327,11 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep if (tx->height <= 0 ) { tx->height = ht; - //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); + if ( ep != 0 && coin != 0 && tx->SPV == 0 ) + { + tx->SPV = LP_merkleproof(coin,ep,txid,tx->height); + printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); + } } if ( v >= 0 && v < tx->numvouts ) { From 3a6f78c6a9f49235b33f20717eb1ccb054bab3ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:40:25 +0200 Subject: [PATCH 2301/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index c66957bd1..b0c59611f 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -93,7 +93,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); if ( (fp= OS_appendfile(fname)) != 0 ) { - char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + //char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); fwrite(&tx->txid,1,sizeof(tx->txid),fp); fwrite(&tx->len,1,sizeof(tx->len),fp); fwrite(&tx->height,1,sizeof(tx->height),fp); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 74a9bb364..00eea5c12 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -416,7 +416,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s",symbol,stratumreq); +//printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); @@ -889,7 +889,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { - printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); + //printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 ) From c0970054ecba149e8b863909902eb1a1313396a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:44:31 +0200 Subject: [PATCH 2302/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 00eea5c12..7b4bac8f4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -600,7 +600,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - //if ( 0 && electrumflag > 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From de8c4145d80a0f7fcce3e1348a68dc748dc2dc96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:48:45 +0200 Subject: [PATCH 2303/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_socket.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index b0c59611f..c66957bd1 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -93,7 +93,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); if ( (fp= OS_appendfile(fname)) != 0 ) { - //char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); + char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); fwrite(&tx->txid,1,sizeof(tx->txid),fp); fwrite(&tx->len,1,sizeof(tx->len),fp); fwrite(&tx->height,1,sizeof(tx->height),fp); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 49eca0745..f6f1725d4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -467,7 +467,7 @@ void utxosQ_loop(void *myipaddr) void LP_coinsloop(void *_coins) { - struct LP_address *ap=0; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + struct LP_address *ap=0,*atmp; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); @@ -515,7 +515,8 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) + HASH_ITER(hh,coin->addresses,ap,atmp) + //if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7b4bac8f4..52dc27212 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -416,7 +416,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -//printf("%s %s",symbol,stratumreq); +printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); From 017ac281a2086ef688cfa632ed7f09984e482e82 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:53:43 +0200 Subject: [PATCH 2304/2732] Test --- iguana/exchanges/LP_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index c66957bd1..4be0a5fc5 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -100,7 +100,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) fwrite(tx->serialized,1,tx->len,fp); fclose(fp); } - } + } else printf("cant store tx.%p len.%d\n",tx,tx!=0?tx->len:0); } int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) @@ -245,7 +245,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 if ( tx != 0 ) tx->SPV = height; LP_SPV_store(coin,txid,height); - //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); + printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); } else SPV = 0; From 96b6a1fc505db4233325a47e7bc22824e2713010 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:58:18 +0200 Subject: [PATCH 2305/2732] Test --- iguana/exchanges/LP_cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 4be0a5fc5..f95b1bb28 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -225,8 +225,13 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) { - struct LP_transaction *tx=0; cJSON *merkobj,*merkles; bits256 roothash,merkleroot; int32_t m,SPV = 0; - if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height == height && tx->SPV > 0 ) + struct LP_transaction *tx=0; cJSON *merkobj,*merkles,*retjson; bits256 roothash,merkleroot; int32_t m,SPV = 0; + if ( (tx= LP_transactionfind(coin,txid)) == 0) + { + if ( (retjson= electrum_transaction(coin->symbol,ep,&retjson,txid)) != 0 ) + free_json(retjson); + } + if ( tx != 0 && tx->height == height && tx->SPV > 0 ) return(tx->SPV); if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) { From 6a8ec0cda2071c1cbd6bbdcca0c0a0357bf40c5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:01:43 +0200 Subject: [PATCH 2306/2732] Test --- iguana/exchanges/LP_cache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index f95b1bb28..14c7b178d 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -87,20 +87,19 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) { - FILE *fp; char fname[512]; struct LP_transaction *tx = 0; + FILE *fp; char fname[512],str[65]; struct LP_transaction *tx = 0; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) { sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); if ( (fp= OS_appendfile(fname)) != 0 ) { - char str[65]; printf("store %s %s.[%d]\n",coin->symbol,bits256_str(str,txid),tx->len); fwrite(&tx->txid,1,sizeof(tx->txid),fp); fwrite(&tx->len,1,sizeof(tx->len),fp); fwrite(&tx->height,1,sizeof(tx->height),fp); fwrite(tx->serialized,1,tx->len,fp); fclose(fp); } - } else printf("cant store tx.%p len.%d\n",tx,tx!=0?tx->len:0); + } else printf("cant store %s %s tx.%p [%d]\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1); } int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) From f0115d14148f285012679902534e34e6b0f0ade9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:02:12 +0200 Subject: [PATCH 2307/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 14c7b178d..81f2592ec 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -249,7 +249,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 if ( tx != 0 ) tx->SPV = height; LP_SPV_store(coin,txid,height); - printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); + //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); } else SPV = 0; From 890b5fe5a05223ae06dfe0ffac2cc14113efb00e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:06:13 +0200 Subject: [PATCH 2308/2732] Test --- iguana/exchanges/LP_socket.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 52dc27212..92e0e5589 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -416,7 +416,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s",symbol,stratumreq); +//printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); @@ -743,19 +743,12 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { - cJSON *retjson; //struct iguana_info *coin; struct LP_transaction *tx; + cJSON *retjson; if ( ep != 0 ) portable_mutex_lock(&ep->txmutex); retjson = _electrum_transaction(symbol,ep,retjsonp,txid); if ( ep != 0 ) portable_mutex_unlock(&ep->txmutex); - /*if ( ep != 0 && (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV <= 0 ) // we just dont have height! - { - if ( tx->height == 0 ) - tx->height = LP_gettxheight(coin,txid); - LP_merkleproof(coin,ep,txid,tx->height); - printf("extra merkle\n"); - }*/ return(retjson); } From 8867693aa0e908dc6db2cae330c77e67e0d81eb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:12:06 +0200 Subject: [PATCH 2309/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 +++++++++--- iguana/exchanges/LP_utxo.c | 7 +++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f6f1725d4..8af912800 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -467,7 +467,7 @@ void utxosQ_loop(void *myipaddr) void LP_coinsloop(void *_coins) { - struct LP_address *ap=0,*atmp; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + struct LP_address *ap=0,*atmp; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); @@ -526,8 +526,14 @@ void LP_coinsloop(void *_coins) { nonz++; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( 0 && up->SPV > 0 ) - printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + if ( up->SPV > 0 ) + { + if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && tx->SPV == 0 ) + { + tx->SPV = up->SPV; + printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } + } } else if ( up->SPV == -1 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ce98ac396..9674cece5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -237,7 +237,7 @@ void LP_mark_spent(char *symbol,bits256 txid,int32_t vout) int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { - struct LP_address *ap; cJSON *txobj; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; + struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about @@ -282,8 +282,11 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); retval = 1; - if ( value == 0 ) + if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) + { + up->SPV = tx->SPV; printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + } } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); From f20efd48adae1aa1a28b660cd9f6b0b247707471 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:16:27 +0200 Subject: [PATCH 2310/2732] Test --- iguana/exchanges/LP_cache.c | 2 ++ iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 81f2592ec..5230bc9cd 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -225,6 +225,8 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) { struct LP_transaction *tx=0; cJSON *merkobj,*merkles,*retjson; bits256 roothash,merkleroot; int32_t m,SPV = 0; + if ( height < 0 ) + return(0); if ( (tx= LP_transactionfind(coin,txid)) == 0) { if ( (retjson= electrum_transaction(coin->symbol,ep,&retjson,txid)) != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8af912800..36e98a96a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -531,7 +531,7 @@ void LP_coinsloop(void *_coins) if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && tx->SPV == 0 ) { tx->SPV = up->SPV; - printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + //printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } } } From bf0c22ea0e22e246c7372a67784ac43678c30d14 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:16:54 +0200 Subject: [PATCH 2311/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9674cece5..b76413ee5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -285,7 +285,7 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) { up->SPV = tx->SPV; - printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + //printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); From 907de285bf3f5f14a1ccaa66784bd1f2964be0d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:22:46 +0200 Subject: [PATCH 2312/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 5230bc9cd..999f2c0cd 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -149,7 +149,7 @@ void LP_cacheptrs_init(struct iguana_info *coin) } printf("loaded %s %d entries total len.%ld\n",fname,count,len); fclose(fp); - } else printf("couldnt find.(%s)\n",fname); + } //else printf("couldnt find.(%s)\n",fname); if ( tflag != 0 ) OS_truncate(fname,len); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c04beef58..9cd07e134 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -649,7 +649,7 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) backupep = ep; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) - return(-1); + return(up->SPV); } } return(0); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 92e0e5589..7e3a9e22c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1047,7 +1047,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) } else { - printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); + //printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); ep->prev = coin->electrum; coin->electrum = ep; From 61d48edc8b5bd711a9935ad22eb95ad8e761e18d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 00:24:03 +0200 Subject: [PATCH 2313/2732] Test --- iguana/exchanges/LP_ordermatch.c | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9cd07e134..17dc752ef 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -649,7 +649,7 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) backupep = ep; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) - return(up->SPV); + return(-1); } } return(0); @@ -666,30 +666,20 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_tradecommand_log(argjson); //printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); retval = 1; - if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) - { - printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); - return(retval); - } - else if (LP_validSPV(Q.destcoin,Q.destaddr,Q.feetxid,Q.feevout) < 0 ) - { - printf("%s dexfee %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.feetxid)); - return(retval); - } if ( strcmp(method,"reserved") == 0 ) { - if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) - { - printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); - return(retval); - } - else if (LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid2,Q.vout2) < 0 ) - { - printf("%s src2 %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid2)); - return(retval); - } if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { + if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) + { + printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); + return(retval); + } + else if (LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid2,Q.vout2) < 0 ) + { + printf("%s src2 %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid2)); + return(retval); + } LP_aliceid(Q.tradeid,Q.aliceid,"reserved",0,0); printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) @@ -725,6 +715,16 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } + if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) + { + printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); + return(retval); + } + else if (LP_validSPV(Q.destcoin,Q.destaddr,Q.feetxid,Q.feevout) < 0 ) + { + printf("%s dexfee %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.feetxid)); + return(retval); + } price = ask; /*if ( coin->electrum != 0 ) { From 41d03240ce12864c70753f52d7143b6776c9624a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:07:06 +0200 Subject: [PATCH 2314/2732] Test --- iguana/exchanges/LP_cache.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 999f2c0cd..3da97708d 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -43,8 +43,9 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); tx = LP_transactionadd(coin,txid,height,numvouts,numvins); - tx->serialized = serialized; - tx->len = len; + tx->serialized = 0; + free(serialized); + tx->len = 0; tx->SPV = tx->height = height; //printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); for (i=0; i Date: Sat, 11 Nov 2017 11:12:43 +0200 Subject: [PATCH 2315/2732] Test --- iguana/exchanges/LP_cache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 3da97708d..caad5d3aa 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -45,7 +45,7 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri tx = LP_transactionadd(coin,txid,height,numvouts,numvins); tx->serialized = 0; free(serialized); - tx->len = 0; + tx->len = -tx->len; tx->SPV = tx->height = height; //printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); for (i=0; iSPV = height; + printf("tx len.%d ht.%d %d\n",tx->len,tx->height,height); + } LP_SPV_store(coin,txid,height); //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); } From eae2f9da52a546106de70cceb7c34ad642d6cfd3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:16:44 +0200 Subject: [PATCH 2316/2732] Test --- iguana/exchanges/LP_cache.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index caad5d3aa..c27129bbc 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -109,8 +109,6 @@ int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) fpos = ftell(fp); if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { - if ( len < 4096 ) - { serialized = malloc(len); if ( (retval= (int32_t)fread(serialized,1,len,fp)) == len ) { @@ -124,14 +122,14 @@ int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,txid)); } else printf("retval.%d vs len.%d\n",retval,len); - } + /*} else { printf("warning: big cachelen.%d\n",len); for (i=0; isymbol,ep,&retjson,txid)) != 0 ) free_json(retjson); } + tx->height = height; if ( tx != 0 && tx->height == height && tx->SPV > 0 ) return(tx->SPV); if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) From ed728730f507ed03d5c924c1dc32da2952ecefbf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:22:58 +0200 Subject: [PATCH 2317/2732] Test --- iguana/exchanges/LP_cache.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index c27129bbc..f460d7b2f 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -105,7 +105,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) { - bits256 txid,hash; long fpos; int32_t i,retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + bits256 txid,hash; long fpos; int32_t retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; fpos = ftell(fp); if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { @@ -241,9 +241,12 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 if ( (retjson= electrum_transaction(coin->symbol,ep,&retjson,txid)) != 0 ) free_json(retjson); } - tx->height = height; - if ( tx != 0 && tx->height == height && tx->SPV > 0 ) - return(tx->SPV); + if ( tx != 0 ) + { + tx->height = height; + if ( tx->SPV > 0 ) + return(tx->SPV); + } if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) { char str[65],str2[65],str3[65]; From 7027afa6bc06162ae19785fe779a64526ec08fdf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:33:01 +0200 Subject: [PATCH 2318/2732] Test --- iguana/exchanges/LP_cache.c | 22 +++++++++------------- iguana/exchanges/LP_include.h | 1 + 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index f460d7b2f..f9cc747a2 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -35,7 +35,7 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se return(txobj); } -cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len,int32_t height) +cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len,int32_t height,long fpos) { cJSON *txobj; bits256 spenttxid; int32_t i,spentvout,numvins,numvouts; cJSON *vout,*vin,*vins,*vouts; struct LP_transaction *tx; char str[65]; if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) @@ -44,8 +44,9 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri vouts = jarray(&numvouts,txobj,"vout"); tx = LP_transactionadd(coin,txid,height,numvouts,numvins); tx->serialized = 0; + tx->fpos = fpos; free(serialized); - tx->len = -tx->len; + tx->len = tx->len; tx->SPV = tx->height = height; //printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); for (i=0; itxid,1,sizeof(tx->txid),fp); fwrite(&tx->len,1,sizeof(tx->len),fp); fwrite(&tx->height,1,sizeof(tx->height),fp); + tx->fpos = ftell(fp); fwrite(tx->serialized,1,tx->len,fp); fclose(fp); } - } else printf("cant store %s %s tx.%p [%d]\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1); + } + else printf("cant store %s %s tx.%p [%d] fpos.%ld\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1); } int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) { - bits256 txid,hash; long fpos; int32_t retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + bits256 txid,hash; long fpos; int32_t offset,retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; fpos = ftell(fp); if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { + offset = (int32_t)(sizeof(txid) + sizeof(len) + sizeof(height)); serialized = malloc(len); if ( (retval= (int32_t)fread(serialized,1,len,fp)) == len ) { @@ -116,20 +120,12 @@ int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) if ( bits256_cmp(hash,txid) == 0 ) { //printf("%s validated in cache\n",bits256_str(str,hash)); - if ( (txobj= LP_create_transaction(coin,txid,serialized,len,height)) != 0 ) + if ( (txobj= LP_create_transaction(coin,txid,serialized,len,height,fpos+offset)) != 0 ) free_json(txobj); return((int32_t)(ftell(fp) - fpos)); } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,txid)); } else printf("retval.%d vs len.%d\n",retval,len); - /*} - else - { - printf("warning: big cachelen.%d\n",len); - for (i=0; i Date: Sat, 11 Nov 2017 11:35:00 +0200 Subject: [PATCH 2319/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index f9cc747a2..b7231c95d 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -103,7 +103,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) fclose(fp); } } - else printf("cant store %s %s tx.%p [%d] fpos.%ld\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1); + else printf("cant store %s %s tx.%p [%d] fpos.%ld SPV.%d\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1,tx!=0?tx->SPV:-1); } int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) From 721dd9c23dca50202eaf987ef8980ecb537ad87f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:37:01 +0200 Subject: [PATCH 2320/2732] Test --- iguana/exchanges/LP_cache.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index b7231c95d..1c38e1edc 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -257,12 +257,9 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 if ( bits256_cmp(merkleroot,roothash) == 0 ) { SPV = height; + LP_SPV_store(coin,txid,height); if ( tx != 0 ) - { tx->SPV = height; - printf("tx len.%d ht.%d %d\n",tx->len,tx->height,height); - } - LP_SPV_store(coin,txid,height); //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); From e34415eed0e28015d195f6307485e07df1eea0d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:40:48 +0200 Subject: [PATCH 2321/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 36e98a96a..989d3d384 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -515,8 +515,8 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - HASH_ITER(hh,coin->addresses,ap,atmp) - //if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) + //HASH_ITER(hh,coin->addresses,ap,atmp) + if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { From e66a42da1b4f10a6dd2af329e13b5e6b208778e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:44:41 +0200 Subject: [PATCH 2322/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_utxo.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 989d3d384..36e98a96a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -515,8 +515,8 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - //HASH_ITER(hh,coin->addresses,ap,atmp) - if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) + HASH_ITER(hh,coin->addresses,ap,atmp) + //if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b76413ee5..b2263c87e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -237,7 +237,7 @@ void LP_mark_spent(char *symbol,bits256 txid,int32_t vout) int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { - struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; char str[65]; + struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //char str[65]; if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about @@ -532,13 +532,15 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins) { + static long totalsize; struct LP_transaction *tx; int32_t i; if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { - //char str[65]; printf("%s ht.%d u.%u NEW TXID.(%s) vouts.[%d]\n",coin->symbol,height,timestamp,bits256_str(str,txid),numvouts); //if ( bits256_nonz(txid) == 0 && tx->height == 0 ) // getchar(); tx = calloc(1,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts)); + totalsize += sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts); + char str[65]; printf("%s ht.%d NEW TXID.(%s) vouts.[%d] size.%ld total %ld\n",coin->symbol,height,bits256_str(str,txid),numvouts,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts),totalsize); for (i=0; ioutpoints[i].spendvini = -1; tx->height = height; From 94723ece6b26d3babe9d8c3480234e60466397af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:49:01 +0200 Subject: [PATCH 2323/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 1c38e1edc..ee093db2c 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -48,7 +48,7 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri free(serialized); tx->len = tx->len; tx->SPV = tx->height = height; - //printf("tx.%p vins.(%s) vouts.(%s)\n",tx,jprint(vins,0),jprint(vouts,0)); + printf("tx.%s numvins.%d numvouts.%d\n",bits256_str(str,txid),numvins,numvouts); for (i=0; iheight == 0 ) @@ -551,7 +551,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i portable_mutex_lock(&coin->txmutex); HASH_ADD_KEYPTR(hh,coin->transactions,tx->txid.bytes,sizeof(tx->txid),tx); portable_mutex_unlock(&coin->txmutex); - } // else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid)); + } else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid)); return(tx); } From 2b19e9ec44584c472e570bc45b7ce0d77d2a461f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:52:11 +0200 Subject: [PATCH 2324/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index ee093db2c..596bc725b 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -90,7 +90,7 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) { FILE *fp; char fname[512],str[65]; struct LP_transaction *tx = 0; - if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 ) + if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 && tx->len > 0 && tx->fpos == 0 ) { sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); if ( (fp= OS_appendfile(fname)) != 0 ) From bab171978d01d6eebde79f25ac5f268ece03fac8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:56:46 +0200 Subject: [PATCH 2325/2732] Test --- iguana/exchanges/LP_cache.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 596bc725b..d2f65c153 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -35,9 +35,11 @@ cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *se return(txobj); } -cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len,int32_t height,long fpos) +struct LP_transaction *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len,int32_t height,long fpos) { cJSON *txobj; bits256 spenttxid; int32_t i,spentvout,numvins,numvouts; cJSON *vout,*vin,*vins,*vouts; struct LP_transaction *tx; char str[65]; + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + return(tx); if ( (txobj= LP_transaction_fromdata(coin,txid,serialized,len)) != 0 ) { vins = jarray(&numvins,txobj,"vin"); @@ -83,8 +85,9 @@ cJSON *LP_create_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seri if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } + free_json(txobj); } - return(txobj); + return(tx); } void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) @@ -108,7 +111,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) { - bits256 txid,hash; long fpos; int32_t offset,retval,height,len; uint8_t *serialized; cJSON *txobj; char str[65],str2[65]; + bits256 txid,hash; long fpos; int32_t offset,retval,height,len; uint8_t *serialized; char str[65],str2[65]; fpos = ftell(fp); if ( fread(&txid,1,sizeof(txid),fp) == sizeof(txid) && fread(&len,1,sizeof(len),fp) == sizeof(len) && fread(&height,1,sizeof(height),fp) == sizeof(height) && len < 100000 ) { @@ -120,8 +123,7 @@ int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) if ( bits256_cmp(hash,txid) == 0 ) { //printf("%s validated in cache\n",bits256_str(str,hash)); - if ( (txobj= LP_create_transaction(coin,txid,serialized,len,height,fpos+offset)) != 0 ) - free_json(txobj); + LP_create_transaction(coin,txid,serialized,len,height,fpos+offset); return((int32_t)(ftell(fp) - fpos)); } printf("%s vs %s did not validated in cache\n",bits256_str(str,hash),bits256_str(str2,txid)); From 6b01280d178b2b110e53276d37228578d346b836 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 11:59:32 +0200 Subject: [PATCH 2326/2732] Test --- iguana/exchanges/LP_cache.c | 3 +-- iguana/exchanges/LP_utxo.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index d2f65c153..da4c9a802 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -105,8 +105,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height) fwrite(tx->serialized,1,tx->len,fp); fclose(fp); } - } - else printf("cant store %s %s tx.%p [%d] fpos.%ld SPV.%d\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1,tx!=0?tx->SPV:-1); + } //else printf("cant store %s %s tx.%p [%d] fpos.%ld SPV.%d\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1,tx!=0?tx->SPV:-1); } int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ef51f0693..097478910 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -533,14 +533,14 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins) { static long totalsize; - struct LP_transaction *tx; int32_t i; char str[65]; + struct LP_transaction *tx; int32_t i; //char str[65]; if ( (tx= LP_transactionfind(coin,txid)) == 0 ) { //if ( bits256_nonz(txid) == 0 && tx->height == 0 ) // getchar(); tx = calloc(1,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts)); totalsize += sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts); - char str[65]; printf("%s ht.%d NEW TXID.(%s) vouts.[%d] size.%ld total %ld\n",coin->symbol,height,bits256_str(str,txid),numvouts,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts),totalsize); + //char str[65]; printf("%s ht.%d NEW TXID.(%s) vouts.[%d] size.%ld total %ld\n",coin->symbol,height,bits256_str(str,txid),numvouts,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts),totalsize); for (i=0; ioutpoints[i].spendvini = -1; tx->height = height; @@ -551,7 +551,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i portable_mutex_lock(&coin->txmutex); HASH_ADD_KEYPTR(hh,coin->transactions,tx->txid.bytes,sizeof(tx->txid),tx); portable_mutex_unlock(&coin->txmutex); - } else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid)); + } //else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid)); return(tx); } From 95b7dac42a2e9328ea5a04562dc0bf6797add73a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 12:01:47 +0200 Subject: [PATCH 2327/2732] Test --- iguana/exchanges/LP_cache.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index da4c9a802..e4727a333 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -50,7 +50,7 @@ struct LP_transaction *LP_create_transaction(struct iguana_info *coin,bits256 tx free(serialized); tx->len = tx->len; tx->SPV = tx->height = height; - printf("tx.%s numvins.%d numvouts.%d\n",bits256_str(str,txid),numvins,numvouts); + //printf("tx.%s numvins.%d numvouts.%d\n",bits256_str(str,txid),numvins,numvouts); for (i=0; iserialized != 0 && tx->len > 0 && tx->fpos == 0 ) { sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); @@ -260,7 +260,15 @@ int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 SPV = height; LP_SPV_store(coin,txid,height); if ( tx != 0 ) + { tx->SPV = height; + if ( tx->serialized != 0 ) + { + free(tx->serialized); + tx->serialized = 0; + tx->len = 0; + } + } //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); } else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); From e94a8fe75e9ce4d6dfa9d14ebd596e4574f002e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 12:06:31 +0200 Subject: [PATCH 2328/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 36e98a96a..989d3d384 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -515,8 +515,8 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - HASH_ITER(hh,coin->addresses,ap,atmp) - //if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) + //HASH_ITER(hh,coin->addresses,ap,atmp) + if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { From 383e62381af5b7176debfad12f0a5c0967137ca0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 12:08:37 +0200 Subject: [PATCH 2329/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7e3a9e22c..7d32978d4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -330,7 +330,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep if ( ep != 0 && coin != 0 && tx->SPV == 0 ) { tx->SPV = LP_merkleproof(coin,ep,txid,tx->height); - printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); + //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } } if ( v >= 0 && v < tx->numvouts ) From 87619c3cd3ac7bf14d5cbcbee676a0cad5a5a2b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 12:09:36 +0200 Subject: [PATCH 2330/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 989d3d384..8ab521c12 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -520,6 +520,7 @@ void LP_coinsloop(void *_coins) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { + break; if ( up->U.height > 0 && up->spendheight < 0 ) { if ( up->SPV == 0 ) From be98b5d3f37ee0fb136b3c77104006dbfbb91ccb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 13:33:27 +0200 Subject: [PATCH 2331/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8ab521c12..9b15ce7be 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,6 +18,7 @@ // LP_nativeDEX.c // marketmaker // +// version info // previously, it used to show amount, kmd equiv, perc // swap started, pending, locked, finished, ... // aliceid diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 17dc752ef..c9cf68261 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -885,7 +885,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i return(0); if ( basecoin->electrum == 0 ) max = 1000; - else max = 40; + else max = LP_MAXDESIRED_UTXOS; utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); //printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 7d32978d4..b1a72bc5d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1027,6 +1027,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) if ( ipaddr == 0 || ipaddr[0] == 0 || port == 0 ) { coin->electrum = 0; + coin->inactive = (uint32_t)time(NULL); //printf("would have disabled %s electrum here\n",coin->symbol); return(cJSON_Parse("{\"result\":\"success\",\"status\":\"electrum mode disabled, now in native coin mode\"}")); } @@ -1060,6 +1061,11 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) } else { + if ( coin->electrum == 0 ) + { + coin->electrum = ep; + ep->prev = 0; + } jaddstr(retjson,"result","success"); jaddstr(retjson,"status","already there"); if ( ep->numerrors > 0 ) From d1d16b2f0162dd26d2ef8a167be631a5689c81f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 13:40:40 +0200 Subject: [PATCH 2332/2732] Test --- iguana/exchanges/LP_include.h | 4 ++++ iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 45c9117da..980c8aeb2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,6 +21,10 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H +#define LP_MAJOR_VERSION "0" +#define LP_MINOR_VERSION "1" +#define LP_BUILD_NUMBER "11843" + #ifdef FROM_JS #include #define sleep(x) emscripten_usleep((x) * 1000000) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9b15ce7be..76c75db1c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -854,6 +854,7 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha 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; 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(); + printf("Marketmaker %s.%s %s\n",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { From 90d78eaf728b313327a6efa76d1515c53ceb414d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 14:59:58 +0200 Subject: [PATCH 2333/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 254 +++++++++++++++---------------- 2 files changed, 127 insertions(+), 129 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 76c75db1c..f50e30a62 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -468,7 +468,7 @@ void utxosQ_loop(void *myipaddr) void LP_coinsloop(void *_coins) { - struct LP_address *ap=0,*atmp; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + struct LP_address *ap=0; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c9cf68261..43d2819c2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -708,149 +708,147 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } return(retval); } - if ( bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) + if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { - if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) - { - printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); - return(retval); - } - if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) - { - printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); - return(retval); - } - else if (LP_validSPV(Q.destcoin,Q.destaddr,Q.feetxid,Q.feevout) < 0 ) - { - printf("%s dexfee %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.feetxid)); - return(retval); - } - price = ask; - /*if ( coin->electrum != 0 ) - { - printf("electrum can only be for alice\n"); - return(retval); - }*/ - if ( LP_aliceonly(Q.srccoin) > 0 ) - { - printf("{\"error\":\"GAME can only be alice coin\"}\n"); - return(retval); - } - if ( strcmp(Q.coinaddr,coin->smartaddr) != 0 ) + printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); + return(retval); + } + if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) + { + printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); + return(retval); + } + else if (LP_validSPV(Q.destcoin,Q.destaddr,Q.feetxid,Q.feevout) < 0 ) + { + printf("%s dexfee %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.feetxid)); + return(retval); + } + price = ask; + if ( LP_aliceonly(Q.srccoin) > 0 ) + { + printf("{\"error\":\"GAME can only be alice coin\"}\n"); + return(retval); + } + autxo = &A; + butxo = &B; + memset(autxo,0,sizeof(*autxo)); + memset(butxo,0,sizeof(*butxo)); + LP_abutxo_set(autxo,butxo,&Q); + if ( strcmp(method,"request") == 0 ) + { + char str[65],str2[65]; + printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); + recalc = 0; + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) + recalc = 1; + else { - printf("bob is patching Q.coinaddr %s mismatch != %s\n",Q.coinaddr,coin->smartaddr); - strcpy(Q.coinaddr,coin->smartaddr); + char tmp[64]; + value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); + printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) + recalc = 1; } - autxo = &A; - butxo = &B; - memset(autxo,0,sizeof(*autxo)); - memset(butxo,0,sizeof(*butxo)); - LP_abutxo_set(autxo,butxo,&Q); - if ( strcmp(method,"request") == 0 ) + if ( recalc != 0 ) { - char str[65],str2[65]; - printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); - recalc = 0; - if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) - recalc = 1; - else + LP_RTmetrics_update(Q.srccoin,Q.destcoin); + if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) { - char tmp[64]; - value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); - printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) - recalc = 1; + printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); + return(retval); } - if ( recalc != 0 ) + printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); + LP_listunspent_both(Q.srccoin,Q.coinaddr,0); + if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { - LP_RTmetrics_update(Q.srccoin,Q.destcoin); - if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) - { - printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); - return(retval); - } - printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); - LP_listunspent_both(Q.srccoin,Q.coinaddr,0); - if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) - { - Q.txid = butxo->payment.txid; - Q.vout = butxo->payment.vout; - Q.txid2 = butxo->deposit.txid; - Q.vout2 = butxo->deposit.vout; - printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); - } - else - { - printf("cant find utxopair\n"); - return(retval); - } + strcpy(Q.gui,G.gui); + strcpy(Q.coinaddr,coin->smartaddr); + Q.srchash = G.LP_mypub25519; + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; + printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); + } + else + { + printf("cant find utxopair\n"); + return(retval); } } - else // "connect" + } + else // "connect" + { + if ( bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) { - butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); - } - char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); - if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) + butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); // better work! + } else return(retval); + } + if ( strcmp(Q.coinaddr,coin->smartaddr) != 0 ) + { + printf("bob is patching Q.coinaddr %s mismatch != %s\n",Q.coinaddr,coin->smartaddr); + strcpy(Q.coinaddr,coin->smartaddr); + } + char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); + if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) + { + char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f -> %.8f\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,dstr(Q.satoshis),dstr(Q.destsatoshis)); + return(retval); + } + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(-3); + } + if ( qprice < (price - 0.00000001) * 0.9999 ) + { + printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); + return(-4); + } + if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) + butxo->T.swappending = 0; + if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's + { + if ( LP_isavailable(butxo) > 0 ) { - char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f -> %.8f\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,dstr(Q.satoshis),dstr(Q.destsatoshis)); + autxo->T.swappending = butxo->T.swappending = Q.timestamp + LP_RESERVETIME; + retjson = LP_quotejson(&Q); + butxo->S.otherpubkey = jbits256(argjson,"desthash"); + LP_unavailableset(butxo,butxo->S.otherpubkey); + jaddnum(retjson,"quotetime",juint(argjson,"quotetime")); + jaddnum(retjson,"pending",butxo->T.swappending); + jaddbits256(retjson,"desthash",butxo->S.otherpubkey); + jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); + jaddstr(retjson,"method","reserved"); + msg = jprint(retjson,0); + butxo->T.lasttime = (uint32_t)time(NULL); + printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); + // LP_addsig + //msg2 = clonestr(msg); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); + sleep(1); + bits256 zero; + memset(zero.bytes,0,sizeof(zero)); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); + //LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); + free_json(retjson); return(retval); - } - if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL ) - { - printf("quote validate error %.0f\n",qprice); - return(-3); - } - if ( qprice < (price - 0.00000001) * 0.9999 ) - { - printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); - return(-4); - } - if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) - butxo->T.swappending = 0; - if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's - { - if ( LP_isavailable(butxo) > 0 ) - { - autxo->T.swappending = butxo->T.swappending = Q.timestamp + LP_RESERVETIME; - retjson = LP_quotejson(&Q); - butxo->S.otherpubkey = jbits256(argjson,"desthash"); - LP_unavailableset(butxo,butxo->S.otherpubkey); - jaddnum(retjson,"quotetime",juint(argjson,"quotetime")); - jaddnum(retjson,"pending",butxo->T.swappending); - jaddbits256(retjson,"desthash",butxo->S.otherpubkey); - jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); - jaddstr(retjson,"method","reserved"); - msg = jprint(retjson,0); - butxo->T.lasttime = (uint32_t)time(NULL); - printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); - // LP_addsig - //msg2 = clonestr(msg); - LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); - sleep(1); - bits256 zero; - memset(zero.bytes,0,sizeof(zero)); - LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); - //LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); - free_json(retjson); - return(retval); - } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); - } - else if ( strcmp(method,"connect") == 0 ) // bob + } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); + } + else if ( strcmp(method,"connect") == 0 ) // bob + { + retval = 4; + if ( butxo->S.swap == 0 && butxo->T.swappending != 0 ) { - retval = 4; - if ( butxo->S.swap == 0 && butxo->T.swappending != 0 ) - { - // validate SPV alice - LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); - //LP_butxo_swapfields_set(butxo); - return(retval); - } - else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); + // validate SPV alice + LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); + //LP_butxo_swapfields_set(butxo); + return(retval); } - //LP_butxo_swapfields_set(butxo); + else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } + //LP_butxo_swapfields_set(butxo); } return(retval); } From e5d0a8c0aab5e6b34c33dda5bd3f61a0dff1019c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 15:14:11 +0200 Subject: [PATCH 2334/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f50e30a62..4d25a76aa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -457,7 +457,7 @@ void command_rpcloop(void *myipaddr) void utxosQ_loop(void *myipaddr) { strcpy(utxosQ_loop_stats.name,"utxosQ_loop"); - utxosQ_loop_stats.threshold = 500.; + utxosQ_loop_stats.threshold = 5000.; while ( 1 ) { LP_millistats_update(&utxosQ_loop_stats); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 43d2819c2..92ab8cc51 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -739,6 +739,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char str[65],str2[65]; printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); recalc = 0; + strcpy(Q.gui,G.gui); + strcpy(Q.coinaddr,coin->smartaddr); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) recalc = 1; else From 11098d23cf08f5cf44d200d082118ed42fe57f30 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 15:25:17 +0200 Subject: [PATCH 2335/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 92ab8cc51..3c8f735c9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -751,6 +751,10 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) recalc = 1; + else + { + printf("butxo deposit %s, Q %s\n",bits256_str(str,butxo->deposit.txid),bits256_str(str2,Q.txid2)); + } } if ( recalc != 0 ) { From 7e8f1529eedcfcb805b8a02018b71c5055f64fd4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 15:35:21 +0200 Subject: [PATCH 2336/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3c8f735c9..e91468d59 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -741,6 +741,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 0; strcpy(Q.gui,G.gui); strcpy(Q.coinaddr,coin->smartaddr); + strcpy(butxo->coinaddr,coin->smartaddr); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) recalc = 1; else From 308ed8e421167056c4691752aab653c0e715e239 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 15:56:13 +0200 Subject: [PATCH 2337/2732] Test --- iguana/exchanges/LP_ordermatch.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e91468d59..0d1080857 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -426,7 +426,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) { - if ( bits256_cmp(qp->srchash,qp2->srchash) == 0 && bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) + if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) //bits256_cmp(qp->srchash,qp2->srchash) == 0 && return(0); else return(-1); } @@ -666,10 +666,20 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_tradecommand_log(argjson); //printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); retval = 1; + autxo = &A; + butxo = &B; + memset(autxo,0,sizeof(*autxo)); + memset(butxo,0,sizeof(*butxo)); + LP_abutxo_set(autxo,butxo,&Q); if ( strcmp(method,"reserved") == 0 ) { if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(-33); + } if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) { printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); @@ -692,6 +702,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { + if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(-33); + } if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) { printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); @@ -729,11 +744,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("{\"error\":\"GAME can only be alice coin\"}\n"); return(retval); } - autxo = &A; - butxo = &B; - memset(autxo,0,sizeof(*autxo)); - memset(butxo,0,sizeof(*butxo)); - LP_abutxo_set(autxo,butxo,&Q); if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; @@ -808,7 +818,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("quote validate error %.0f\n",qprice); return(-3); } - if ( qprice < (price - 0.00000001) * 0.9999 ) + if ( qprice < (price - 0.00000001) * 0.998 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); return(-4); From f36ad2774d23954a1c4820410a29479027239fb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 15:58:16 +0200 Subject: [PATCH 2338/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0d1080857..25a412dc3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -678,7 +678,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); - return(-33); + return(retval); } if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) { @@ -705,7 +705,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { printf("quote validate error %.0f\n",qprice); - return(-33); + return(retval); } if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) { From 32cf86b014428b633b93c81939ec538d7898096f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 16:47:14 +0200 Subject: [PATCH 2339/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 25a412dc3..0c6a0146a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -807,7 +807,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("bob is patching Q.coinaddr %s mismatch != %s\n",Q.coinaddr,coin->smartaddr); strcpy(Q.coinaddr,coin->smartaddr); } - char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); if ( butxo == 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 || butxo->payment.vout < 0 || butxo->deposit.vout < 0 ) { char str[65],str2[65]; printf("couldnt find bob utxos for autxo %s/v%d %s/v%d %.8f -> %.8f\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,dstr(Q.satoshis),dstr(Q.destsatoshis)); @@ -823,6 +822,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); return(-4); } + char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) butxo->T.swappending = 0; if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's From f7fdea738a05f7d8a0223841f652c7c20476e881 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 16:50:56 +0200 Subject: [PATCH 2340/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0c6a0146a..98583a9ed 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -820,7 +820,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( qprice < (price - 0.00000001) * 0.998 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); - return(-4); + return(retval); } char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) From c64b11f4cc9d0825d0c8150d0299d7619531cc57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 16:56:31 +0200 Subject: [PATCH 2341/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 98583a9ed..671628311 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -916,9 +916,9 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { item = jitem(asks,i); price = jdouble(item,"price"); - if ( price < maxprice && price > maxprice*0.8) - price = price * 0.9 + 0.1 * maxprice; - else price *= 1.005; + //if ( price < maxprice && price > maxprice*0.8) + // price = price * 0.9 + 0.1 * maxprice; + //else price *= 1.005; pubkey = jbits256(item,"pubkey"); if ( bits256_nonz(destpubkey) != 0 && bits256_cmp(destpubkey,pubkey) != 0 ) continue; @@ -942,7 +942,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i LP_listunspent_query(base,coinaddr); for (j=0; jpubkey,gui)) != 0 ) + if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,maxprice*.999,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) { //printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); break; From 245106dc6329b6c89a573da150792944fc3218db Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 17:11:04 +0200 Subject: [PATCH 2342/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 671628311..ff4bd844d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -506,7 +506,7 @@ char *LP_connectedalice(cJSON *argjson) // alice } if ( LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin) <= SMALLVAL || bid <= SMALLVAL ) { - printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); + //printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); LP_aliceid(Q.tradeid,Q.aliceid,"error5",0,0); return(clonestr("{\"error\":\"no price set\"}")); @@ -725,7 +725,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { - printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); + //printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) From 31516af39e14cc4f9f709069071357f20df1d503 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 17:39:03 +0200 Subject: [PATCH 2343/2732] Test --- iguana/exchanges/LP_ordermatch.c | 13 +++++++++---- iguana/exchanges/LP_utxos.c | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ff4bd844d..e1162a908 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -749,10 +749,15 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char str[65],str2[65]; printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); recalc = 0; - strcpy(Q.gui,G.gui); - strcpy(Q.coinaddr,coin->smartaddr); - strcpy(butxo->coinaddr,coin->smartaddr); - if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) + if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 ) + { + strcpy(Q.gui,G.gui); + strcpy(Q.coinaddr,coin->smartaddr); + strcpy(butxo->coinaddr,coin->smartaddr); + Q.srchash = G.LP_mypub25519; + recalc = 1; + } + else if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) recalc = 1; else { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8b7313630..cefafa37a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -376,7 +376,9 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t // utxo->S.profitmargin = profitmargin; utxo->T.lasttime = (uint32_t)time(NULL); //printf("return existing utxo[%d] %s %s\n",iambob,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid)); - return(utxo); + if ( bits256_cmp(txid,utxo->payment.txid) != 0 || vout != utxo->payment.vout || bits256_cmp(txid2,u.txid) != 0 || vout2 != u.vout ) + printf("unexpected mismatch? %s vs %s\n",bits256_str(str,txid2),bits256_str(str2,u.txid)); + else return(utxo); } } utxo = calloc(1,sizeof(*utxo)); From 60776b9707d1424d797c1f7560fc6aa72a14409a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 18:17:41 +0200 Subject: [PATCH 2344/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_ordermatch.c | 5 ++++- iguana/exchanges/LP_utxo.c | 12 ++++++++++- iguana/exchanges/LP_utxos.c | 37 +++++++++++++++++++++++++++++--- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 980c8aeb2..95017580e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -429,6 +429,7 @@ struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height); +int32_t LP_utxos_remove(bits256 txid,int32_t vout); struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins); void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid); uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e1162a908..c7ba1fe7d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -762,6 +762,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else { char tmp[64]; + LP_utxos_remove(Q.txid,Q.vout); + LP_utxos_remove(Q.txid2,Q.vout2); value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); @@ -769,7 +771,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; else { - printf("butxo deposit %s, Q %s\n",bits256_str(str,butxo->deposit.txid),bits256_str(str2,Q.txid2)); + if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) + recalc = 1; } } if ( recalc != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 097478910..aab3e1c27 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -185,7 +185,7 @@ printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str continue; } } - if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 && LP_utxos_remove(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max ) @@ -480,6 +480,16 @@ struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) return(utxo); } +void _LP_utxo_delete(int32_t iambob,struct LP_utxoinfo *utxo) +{ + HASH_DELETE(hh,G.LP_utxoinfos[iambob],utxo); +} + +void _LP_utxo2_delete(int32_t iambob,struct LP_utxoinfo *utxo) +{ + HASH_DELETE(hh,G.LP_utxoinfos2[iambob],utxo); +} + struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; uint8_t key2[sizeof(txid2) + sizeof(vout2)]; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index cefafa37a..8d88547b4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -376,9 +376,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t // utxo->S.profitmargin = profitmargin; utxo->T.lasttime = (uint32_t)time(NULL); //printf("return existing utxo[%d] %s %s\n",iambob,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid)); - if ( bits256_cmp(txid,utxo->payment.txid) != 0 || vout != utxo->payment.vout || bits256_cmp(txid2,u.txid) != 0 || vout2 != u.vout ) - printf("unexpected mismatch? %s vs %s\n",bits256_str(str,txid2),bits256_str(str2,u.txid)); - else return(utxo); + return(utxo); } } utxo = calloc(1,sizeof(*utxo)); @@ -432,6 +430,39 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t return(utxo); } +int32_t LP_utxos_remove(bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo,*utxo2; int32_t retval = 0,iambob = 1; + utxo = utxo2 = 0; + portable_mutex_lock(&LP_utxomutex); + if ( (utxo= _LP_utxofind(iambob,txid,vout)) != 0 ) + { + if ( LP_isavailable(utxo) == 0 ) + retval = -1; + else + { + if ( (utxo2= _LP_utxo2find(iambob,txid,vout)) != 0 ) + { + if ( LP_isavailable(utxo) == 0 ) + retval = -1; + else + { + _LP_utxo_delete(iambob,utxo); + _LP_utxo2_delete(iambob,utxo2); + } + } + } + } + else if ( (utxo2= _LP_utxo2find(iambob,txid,vout)) != 0 ) + { + if ( LP_isavailable(utxo2) == 0 ) + retval = -1; + else _LP_utxo2_delete(iambob,utxo2); + } + portable_mutex_unlock(&LP_utxomutex); + return(retval); +} + cJSON *LP_inventory(char *symbol) { struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; int32_t iambob = 0; struct iguana_info *coin; From 16f1e1b1e816250009a2bab39788a16ffa9e7bd8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 18:35:40 +0200 Subject: [PATCH 2345/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c7ba1fe7d..fba1784ce 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -911,7 +911,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i else max = LP_MAXDESIRED_UTXOS; utxos = calloc(max,sizeof(*utxos)); LP_txfees(&txfee,&desttxfee,base,autxo->coin); - //printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); + printf("LP_buyutxo maxprice %.8f relvol %.8f %s/%s %.8f %.8f\n",maxprice,dstr(autxo->S.satoshis),base,autxo->coin,dstr(txfee),dstr(desttxfee)); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) @@ -932,7 +932,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i continue; if ( LP_RTmetrics_blacklisted(pubkey) >= 0 ) continue; -//printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); +printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { if ( bits256_nonz(destpubkey) == 0 ) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b1a72bc5d..20357071d 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -416,7 +416,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -//printf("%s %s",symbol,stratumreq); +printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); From cc1b53a39a05cf191fe6e6aeacfeedc9256617b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 18:44:06 +0200 Subject: [PATCH 2346/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fba1784ce..e034a5de4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -275,7 +275,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { @@ -882,7 +882,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); - //printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); + printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) { bestutxo->pubkey = pubkey; From 0325613ba7d95dd299a7a5eee3724b5bc393ad1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 18:55:32 +0200 Subject: [PATCH 2347/2732] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_utxo.c | 6 +++--- iguana/exchanges/LP_utxos.c | 11 +++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 95017580e..5d2283a1e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -429,6 +429,7 @@ struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height); +int32_t _LP_utxos_remove(bits256 txid,int32_t vout); int32_t LP_utxos_remove(bits256 txid,int32_t vout); struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins); void LP_tradebot_finished(uint32_t tradeid,uint32_t requestid,uint32_t quoteid); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index aab3e1c27..00b080739 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -141,14 +141,14 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) { - struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; char str[65]; + struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; //printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); + char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 && LP_RTmetrics_avoidtxid(up->U.txid) < 0 ) { if ( coin->electrum == 0 ) @@ -185,7 +185,7 @@ printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str continue; } } - if ( LP_allocated(up->U.txid,up->U.vout) == 0 && LP_utxos_remove(up->U.txid,up->U.vout) == 0 ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 && _LP_utxos_remove(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d88547b4..8d5d16c52 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -430,11 +430,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t return(utxo); } -int32_t LP_utxos_remove(bits256 txid,int32_t vout) +int32_t _LP_utxos_remove(bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo,*utxo2; int32_t retval = 0,iambob = 1; utxo = utxo2 = 0; - portable_mutex_lock(&LP_utxomutex); if ( (utxo= _LP_utxofind(iambob,txid,vout)) != 0 ) { if ( LP_isavailable(utxo) == 0 ) @@ -459,6 +458,14 @@ int32_t LP_utxos_remove(bits256 txid,int32_t vout) retval = -1; else _LP_utxo2_delete(iambob,utxo2); } + return(retval); +} + +int32_t LP_utxos_remove(bits256 txid,int32_t vout) +{ + int32_t retval; + portable_mutex_lock(&LP_utxomutex); + retval = _LP_utxos_remove(txid,vout); portable_mutex_unlock(&LP_utxomutex); return(retval); } From e8f09d0cdd4e87f60dbe5805689824e39f2bc9df Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:00:27 +0200 Subject: [PATCH 2348/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ed2a52b8f..d86f1bd7f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -817,7 +817,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); - if ( relcoin->electrum == 0 ) + //if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr,0); LP_listunspent_query(rel,bids[i]->coinaddr); n++; @@ -837,7 +837,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); - if ( basecoin->electrum == 0 ) + //if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr,0); LP_listunspent_query(base,asks[i]->coinaddr); n++; From 10884a398eed21503f9b1fd971b8952d317237c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:10:54 +0200 Subject: [PATCH 2349/2732] Test --- iguana/exchanges/LP_prices.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d86f1bd7f..868975735 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -765,7 +765,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; uint64_t depth; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; + uint32_t now,i; uint64_t depth; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*tmpjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 ) @@ -817,8 +817,10 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); - //if ( relcoin->electrum == 0 ) + if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr,0); + else if ( (tmpjson= LP_listunspent(rel,bids[i]->coinaddr)) != 0 ) + free_json(tmpjson); LP_listunspent_query(rel,bids[i]->coinaddr); n++; } @@ -837,8 +839,10 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); - //if ( basecoin->electrum == 0 ) + if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr,0); + else if ( (tmpjson= LP_listunspent(base,asks[i]->coinaddr)) != 0 ) + free_json(tmpjson); LP_listunspent_query(base,asks[i]->coinaddr); n++; } From ea8aab324b7afa0538a2b5c405e5a82cfb5655e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:27:58 +0200 Subject: [PATCH 2350/2732] Test --- iguana/exchanges/LP_cache.c | 4 ++-- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_socket.c | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index e4727a333..d061b0b2a 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -228,12 +228,12 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t return(merkleroot); } -int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height) +int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) { struct LP_transaction *tx=0; cJSON *merkobj,*merkles,*retjson; bits256 roothash,merkleroot; int32_t m,SPV = 0; if ( height < 0 ) return(0); - if ( (tx= LP_transactionfind(coin,txid)) == 0) + if ( (tx= LP_transactionfind(coin,txid)) == 0 && strcmp(coinaddr,coin->smartaddr) == 0 ) { if ( (retjson= electrum_transaction(coin->symbol,ep,&retjson,txid)) != 0 ) free_json(retjson); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5d2283a1e..273625a41 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -428,7 +428,7 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); -int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height); +int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height); int32_t _LP_utxos_remove(bits256 txid,int32_t vout); int32_t LP_utxos_remove(bits256 txid,int32_t vout); struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4d25a76aa..e536875e8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -527,7 +527,7 @@ void LP_coinsloop(void *_coins) if ( up->SPV == 0 ) { nonz++; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,coin->smartaddr,backupep,up->U.txid,up->U.height); if ( up->SPV > 0 ) { if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && tx->SPV == 0 ) @@ -544,7 +544,7 @@ void LP_coinsloop(void *_coins) oldht = up->U.height; LP_txheight_check(coin,ap->coinaddr,up); if ( oldht != up->U.height ) - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,coin->smartaddr,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) up->SPV = -2; else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e034a5de4..617a7af3f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -647,7 +647,7 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) return(-1); if ( (backupep= ep->prev) == 0 ) backupep = ep; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + up->SPV = LP_merkleproof(coin,coinaddr,backupep,up->U.txid,up->U.height); if ( up->SPV <= 0 ) return(-1); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 20357071d..e9ba0388b 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -329,7 +329,8 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep tx->height = ht; if ( ep != 0 && coin != 0 && tx->SPV == 0 ) { - tx->SPV = LP_merkleproof(coin,ep,txid,tx->height); + if ( strcmp(coinaddr,coin->smartaddr) == 0 ) + tx->SPV = LP_merkleproof(coin,coin->smartaddr,ep,txid,tx->height); //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } } From c097611934053087126ff5ab4c27451b10d97040 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:32:07 +0200 Subject: [PATCH 2351/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e9ba0388b..60a7a3835 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -417,7 +417,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch { *retjsonp = 0; sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params); -printf("%s %s",symbol,stratumreq); +//printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); /*sitem = (struct stritem *)queueitem(stratumreq); From 95b25f9072245b226eb03af7f228b6b9f275db73 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:35:19 +0200 Subject: [PATCH 2352/2732] Test --- iguana/exchanges/LP_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index d061b0b2a..2e06711f4 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -45,9 +45,9 @@ struct LP_transaction *LP_create_transaction(struct iguana_info *coin,bits256 tx vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); tx = LP_transactionadd(coin,txid,height,numvouts,numvins); - tx->serialized = 0; + tx->serialized = serialized; + //free(serialized); tx->fpos = fpos; - free(serialized); tx->len = tx->len; tx->SPV = tx->height = height; //printf("tx.%s numvins.%d numvouts.%d\n",bits256_str(str,txid),numvins,numvouts); From 8265ba228657a399d2363b8b02f0131e9424cc40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:42:28 +0200 Subject: [PATCH 2353/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 617a7af3f..bab638c5c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -762,6 +762,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else { char tmp[64]; + price = (qprice * 0.5) + (0.5 * price); LP_utxos_remove(Q.txid,Q.vout); LP_utxos_remove(Q.txid2,Q.vout2); value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); From 16721bf44bfd89af67ef523fa1370d611ed6d2a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 19:55:26 +0200 Subject: [PATCH 2354/2732] Test --- iguana/exchanges/LP_ordermatch.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bab638c5c..abcc1528c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -755,6 +755,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, strcpy(Q.coinaddr,coin->smartaddr); strcpy(butxo->coinaddr,coin->smartaddr); Q.srchash = G.LP_mypub25519; + memset(&Q.txid,0,sizeof(Q.txid)); + memset(&Q.txid2,0,sizeof(Q.txid2)); + Q.vout = Q.vout2 = -1; recalc = 1; } else if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) @@ -763,13 +766,20 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { char tmp[64]; price = (qprice * 0.5) + (0.5 * price); - LP_utxos_remove(Q.txid,Q.vout); - LP_utxos_remove(Q.txid2,Q.vout2); - value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); - printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) - recalc = 1; + if ( bits256_nonz(Q.txid) != 0 ) + LP_utxos_remove(Q.txid,Q.vout); + else recalc = 1; + if ( bits256_nonz(Q.txid2) != 0 ) + LP_utxos_remove(Q.txid2,Q.vout2); + else recalc = 1; + if ( recalc == 0 ) + { + value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); + printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) + recalc = 1; + } else { if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) From e0b10b8144a7194f36555665b657890231b43280 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 20:07:38 +0200 Subject: [PATCH 2355/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 00b080739..07ffa159b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -148,7 +148,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); + //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 && LP_RTmetrics_avoidtxid(up->U.txid) < 0 ) { if ( coin->electrum == 0 ) @@ -157,7 +157,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( LP_value_extract(txout,0) == 0 ) { - printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); + //printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); free_json(txout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) From 331c0c95f1e299e65bb4d0aacd36ef83b18de980 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 20:10:41 +0200 Subject: [PATCH 2356/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 07ffa159b..2b762ab97 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -179,7 +179,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( up->SPV < 0 || up->U.height == 0 ) { -printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); +//printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; continue; From ad9c343cf388b53f522fadbb57e4b3d4b6e55191 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 20:53:45 +0200 Subject: [PATCH 2357/2732] Test --- iguana/exchanges/LP_ordermatch.c | 22 +++++++++++++++------- iguana/exchanges/LP_utxo.c | 16 ++-------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index abcc1528c..179a763a5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -269,12 +269,13 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price,uint64_t desttxfee) { - struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0; + struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0,*utmp; + targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); + targetval2 = (targetval / 8) * 9 + 2*txfee; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { - targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); if ( 1 ) { int32_t i; @@ -287,7 +288,6 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { up = utxos[mini]; utxos[mini] = 0; - targetval2 = (targetval / 8) * 9 + 2*txfee; printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) @@ -309,6 +309,14 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } //else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); + HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,utmp) + { + if ( LP_isavailable(utxo) != 0 && utxo->payment.value >= targetval && targetval >= utxo->payment.value/2 && utxo->deposit.value >= targetval2 ) + { + printf("backup method found utxo!\n"); + return(utxo); + } + } return(0); } @@ -359,7 +367,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ privkey = LP_privkey(utxo->coinaddr,coin->taddr); if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && { - LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-2*qp->txfee,rel,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); if ( (swap= LP_swapinit(1,0,privkey,&qp->R,qp)) == 0 ) { printf("cant initialize swap\n"); @@ -522,7 +530,7 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_nonz(Q.privkey) != 0 )//&& Q.quotetime >= Q.timestamp-3 ) { retjson = cJSON_CreateObject(); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); if ( (swap= LP_swapinit(0,0,Q.privkey,&Q.R,&Q)) == 0 ) { jaddstr(retjson,"error","couldnt swapinit"); @@ -662,7 +670,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { // LP_checksig LP_quoteparse(&Q,argjson); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); //printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); retval = 1; @@ -794,7 +802,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); return(retval); } - printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); + //printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); LP_listunspent_both(Q.srccoin,Q.coinaddr,0); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2b762ab97..473e66b7d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -185,7 +185,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a continue; } } - if ( LP_allocated(up->U.txid,up->U.vout) == 0 && _LP_utxos_remove(up->U.txid,up->U.vout) == 0 ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 && _LP_utxofind(iambob,up->U.txid,up->U.vout) == 0 && _LP_utxo2find(iambob,up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max ) @@ -468,15 +468,8 @@ void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) struct LP_utxoinfo *_LP_utxofind(int32_t iambob,bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo=0; uint8_t key[sizeof(txid) + sizeof(vout)]; - /*if ( iambob != 0 ) - { - static uint32_t counter; - if ( counter++ < 3 ) - printf("_LP_utxofind deprecated iambob\n"); - return(0); - }*/ LP_utxosetkey(key,txid,vout); - HASH_FIND(hh,G.LP_utxoinfos[iambob],key,sizeof(key),utxo); + HASH_FIND(hh,G.LP_utxoinfos[iambob!=0],key,sizeof(key),utxo); return(utxo); } @@ -493,11 +486,6 @@ void _LP_utxo2_delete(int32_t iambob,struct LP_utxoinfo *utxo) struct LP_utxoinfo *_LP_utxo2find(int32_t iambob,bits256 txid2,int32_t vout2) { struct LP_utxoinfo *utxo=0; uint8_t key2[sizeof(txid2) + sizeof(vout2)]; - /*if ( iambob != 0 ) - { - printf("_LP_utxo2find deprecated iambob\n"); - return(0); - }*/ LP_utxosetkey(key2,txid2,vout2); HASH_FIND(hh2,G.LP_utxoinfos2[iambob],key2,sizeof(key2),utxo); return(utxo); From 448c0a5a0f29a4deb3323d3b225797eb347b17b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 21:09:22 +0200 Subject: [PATCH 2358/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_utxo.c | 39 +++++++++++++++++++------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 179a763a5..229ffba74 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -813,6 +813,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; + butxo->S.satoshis = Q.satoshis; printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 473e66b7d..4a46e48e3 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -812,25 +812,32 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol strcpy(destaddr,destaddr2); if ( coin != 0 ) { - if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) + if ( coin->electrum != 0 ) { - //printf("txid spent\n"); - return(0); - } - if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 ) - { - //printf("txid2 spent\n"); - return(0); - } - if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) - { - //printf("txid %s spentB\n",destaddr); - return(0); + if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) + { + //printf("txid spent\n"); + return(0); + } + if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 ) + { + //printf("txid2 spent\n"); + return(0); + } + if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) + { + //printf("txid %s spentB\n",destaddr); + return(0); + } + if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) + { + //printf("txid2 %s spentB\n",destaddr); + return(0); + } } - if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) + else { - //printf("txid2 %s spentB\n",destaddr); - return(0); + } } return(1); From 2a33b0903a2db88913fac8018c5d3b0f06061f00 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 21:32:32 +0200 Subject: [PATCH 2359/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 229ffba74..4561f816d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -276,7 +276,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); + //printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { From 00ebd4731f233af33417cf95a84859eaf6f0bdfe Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 21:34:34 +0200 Subject: [PATCH 2360/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4561f816d..09e779bee 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -755,7 +755,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; - printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); + //printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); recalc = 0; if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 ) { @@ -784,7 +784,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); - printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); + //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) recalc = 1; } @@ -818,7 +818,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - printf("cant find utxopair\n"); + //printf("cant find utxopair\n"); return(retval); } } From 3e00def8443cdf6353a829f8fc056ad66bcb204d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 21:55:11 +0200 Subject: [PATCH 2361/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 09e779bee..c85731001 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -424,6 +424,8 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(clonestr("{\"error\":\"cant find alice utxopair\"}")); } price = 0.; + memset(qp->txid.bytes,0,sizeof(qp->txid)); + qp->txid2 = qp->txid; qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); qp->tradeid = tradeid; LP_query(ctx,myipaddr,mypubsock,"request",qp); @@ -1071,6 +1073,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } LP_RTmetrics_update(base,rel); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); while ( 1 ) { if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs,destpubkey)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) From a4e4bef43ac2e01b6282bd4f4ca3af9bf89f844b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 22:04:58 +0200 Subject: [PATCH 2362/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 60a7a3835..6890371db 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -424,12 +424,12 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch sitem->expiration = timeout; sitem->DL.type = ep->stratumid++; sitem->retptrp = (void **)retjsonp;*/ -//portable_mutex_lock(&ep->mutex); +portable_mutex_lock(&ep->mutex); //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(15000); -//portable_mutex_unlock(&ep->mutex); +portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) From af148d931ab197dc7ba6d27dc9767af6e3283e3e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 22:09:35 +0200 Subject: [PATCH 2363/2732] Test --- iguana/exchanges/LP_prices.c | 22 +++++++++++++--------- iguana/exchanges/LP_socket.c | 9 ++------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 868975735..66bb2fdc3 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -765,7 +765,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; uint64_t depth; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*tmpjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; + uint32_t now,i; uint64_t depth; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 ) @@ -813,15 +813,17 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos < 3 ) + if ( suppress_prefetch == 0 && n < 3 && bids[i]->numutxos == 0 ) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); if ( relcoin->electrum == 0 ) + { LP_listunspent_issue(rel,bids[i]->coinaddr,0); - else if ( (tmpjson= LP_listunspent(rel,bids[i]->coinaddr)) != 0 ) - free_json(tmpjson); - LP_listunspent_query(rel,bids[i]->coinaddr); + //else if ( (tmpjson= LP_listunspent(rel,bids[i]->coinaddr)) != 0 ) + // free_json(tmpjson); + LP_listunspent_query(rel,bids[i]->coinaddr); + } n++; } free(bids[i]); @@ -835,15 +837,17 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) for (i=n=0; inumutxos < 3 ) + if ( suppress_prefetch == 0 && n < 3 && asks[i]->numutxos == 0 ) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) + { LP_listunspent_issue(base,asks[i]->coinaddr,0); - else if ( (tmpjson= LP_listunspent(base,asks[i]->coinaddr)) != 0 ) - free_json(tmpjson); - LP_listunspent_query(base,asks[i]->coinaddr); + //else if ( (tmpjson= LP_listunspent(base,asks[i]->coinaddr)) != 0 ) + // free_json(tmpjson); + LP_listunspent_query(base,asks[i]->coinaddr); + } n++; } free(asks[i]); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 6890371db..5be93ba33 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -420,16 +420,11 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch //printf("%s %s",symbol,stratumreq); memset(ep->buf,0,ep->bufsize); sitem = electrum_sitem(ep,stratumreq,timeout,retjsonp); - /*sitem = (struct stritem *)queueitem(stratumreq); - sitem->expiration = timeout; - sitem->DL.type = ep->stratumid++; - sitem->retptrp = (void **)retjsonp;*/ -portable_mutex_lock(&ep->mutex); - //queue_enqueue("sendQ",&ep->sendQ,&sitem->DL); + portable_mutex_lock(&ep->mutex); // this helps performance! expiration = (uint32_t)time(NULL) + timeout + 1; while ( *retjsonp == 0 && time(NULL) <= expiration ) usleep(15000); -portable_mutex_unlock(&ep->mutex); + portable_mutex_unlock(&ep->mutex); if ( *retjsonp == 0 || jobj(*retjsonp,"error") != 0 ) { if ( ++ep->numerrors >= LP_ELECTRUM_MAXERRORS ) From 789df311533c65c77aeafc1af26a05c6f02d9af8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 22:13:54 +0200 Subject: [PATCH 2364/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c85731001..cf65a2b8e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1073,7 +1073,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } LP_RTmetrics_update(base,rel); - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); + //return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); while ( 1 ) { if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs,destpubkey)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) From 4700d321feb9688cbe7ffba5912fef13bc88175b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 22:20:05 +0200 Subject: [PATCH 2365/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 273625a41..787d6c57f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -43,7 +43,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAXVINS 64 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 30 +#define LP_AUTOTRADE_TIMEOUT 40 #define ELECTRUM_TIMEOUT 7 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cf65a2b8e..ed736ed3a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -459,7 +459,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); - if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) + if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice*1.005 ) { qp->tradeid = LP_Alicequery.tradeid; memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); @@ -904,7 +904,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); - printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); + //printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) { bestutxo->pubkey = pubkey; From dcb5fdec1827983e368d6db9cccbb304f0e77ffc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 22:27:22 +0200 Subject: [PATCH 2366/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e536875e8..9bed33bbc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -519,6 +519,8 @@ void LP_coinsloop(void *_coins) //HASH_ITER(hh,coin->addresses,ap,atmp) if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { + if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) + free_json(retjson); DL_FOREACH_SAFE(ap->utxos,up,tmp) { break; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 91bdb2f2d..abeaf8ff0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1820,7 +1820,7 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data diff = swap->otherfee.I.locktime - (swap->I.started+1); if ( diff < 0 ) diff = -diff; - if ( diff == 0 ) + if ( diff < 10 ) printf("dexfee verified\n"); else printf("locktime mismatch in otherfee, reject %u vs %u\n",swap->otherfee.I.locktime,swap->I.started+1); return(0); From 9e43fe980907627e60f2fe7621a5446c2aabfc89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 22:55:36 +0200 Subject: [PATCH 2367/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- iguana/exchanges/LP_swap.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ed736ed3a..8a4962afe 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -313,6 +313,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { if ( LP_isavailable(utxo) != 0 && utxo->payment.value >= targetval && targetval >= utxo->payment.value/2 && utxo->deposit.value >= targetval2 ) { + utxo->S.satoshis = targetval; printf("backup method found utxo!\n"); return(utxo); } @@ -954,7 +955,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i continue; if ( LP_RTmetrics_blacklisted(pubkey) >= 0 ) continue; -printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); +//printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis)); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { if ( bits256_nonz(destpubkey) == 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 8671759fc..c7d3c4033 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -626,7 +626,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } - if ( j64bits(vout,"satoshis") >= rawtx->I.amount-txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( j64bits(vout,"satoshis") >= rawtx->I.amount-2*txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { From 961f70103083c5dc874e2fcc658efaca78736221 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 23:10:18 +0200 Subject: [PATCH 2368/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8a4962afe..c28343b32 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -309,7 +309,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } //else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); - HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,utmp) + /*HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,utmp) { if ( LP_isavailable(utxo) != 0 && utxo->payment.value >= targetval && targetval >= utxo->payment.value/2 && utxo->deposit.value >= targetval2 ) { @@ -317,7 +317,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("backup method found utxo!\n"); return(utxo); } - } + }*/ return(0); } From 712e8a4c265aac9318128c391283d72df17eccf5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 23:52:11 +0200 Subject: [PATCH 2369/2732] Test --- iguana/exchanges/LP_utxo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4a46e48e3..e76b74a54 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -779,7 +779,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct LP_transaction *tx; struct LP_address_utxo *up; struct iguana_info *coin = LP_coinfind(symbol); + uint64_t val,val2=0,txfee,threshold=0; cJSON *txobj; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct LP_transaction *tx; struct LP_address_utxo *up; struct iguana_info *coin = LP_coinfind(symbol); if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) { printf("null txid not eligible\n"); @@ -837,7 +837,12 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } else { - + if ( (txobj= LP_gettxout(coin->symbol,destaddr,txid,vout)) == 0 ) + return(0); + else free_json(txobj); + if ( (txobj= LP_gettxout(coin->symbol,destaddr,txid2,vout2)) == 0 ) + return(0); + else free_json(txobj); } } return(1); From 9c9d4dbabfa6e963908ff6b2f0685266a99b4113 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Nov 2017 23:54:54 +0200 Subject: [PATCH 2370/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c28343b32..1b080de14 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -115,7 +115,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str { if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { - char str[65]; printf("alice not eligible (%.8f %.8f) %s/v%d\n",dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); + char str[65]; printf("alice not eligible destsatoshis %.8f (%.8f %.8f) %s/v%d\n",dstr(qp->destsatoshis),dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); return(-3); } if ( (txout= LP_gettxout(qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout)) != 0 ) @@ -269,7 +269,7 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price,uint64_t desttxfee) { - struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0,*utmp; + struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0;//,*utmp; targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); targetval2 = (targetval / 8) * 9 + 2*txfee; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) From 13af7a3da3cec40fc80dc6dd3240947db73626c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 00:17:36 +0200 Subject: [PATCH 2371/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_utxos.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1b080de14..4cb3e0bfc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -296,7 +296,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { if ( up != 0 && (up2= utxos[mini]) != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 ) { utxo->S.satoshis = targetval; char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); @@ -788,7 +788,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) recalc = 1; } else @@ -816,7 +816,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - butxo->S.satoshis = Q.satoshis; + //butxo->S.satoshis = Q.satoshis; printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d5d16c52..e82541a63 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -286,9 +286,9 @@ void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) utxo->T.spentflag = (uint32_t)time(NULL); } -struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) +struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid,uint64_t satoshis) { - uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { char str[65],str2[65]; printf("REJECT (%s) iambob.%d %s utxoadd.(%.8f %.8f) %s/v%d %s/v%d\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); @@ -301,7 +301,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t return(0); } txfee = LP_txfeecalc(coin,0,0); - if ( iambob != 0 && value2 < 9 * (value >> 3) + 2*txfee ) // big txfee padding + /*if ( iambob != 0 && value2 < 9 * (satoshis >> 3) + 2*txfee ) // big txfee padding { if ( value2 > 2*txfee ) tmpsatoshis = (((value2 - 2*txfee) / 9) << 3); @@ -310,7 +310,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("value2 %.8f <= 2 * %.8f\n",dstr(value2),dstr(txfee)); return(0); } - } else tmpsatoshis = (value - txfee); + } else tmpsatoshis = (satoshis - txfee);*/ char str[65],str2[65],dispflag = 0;//(iambob == 0); if ( iambob == 0 && bits256_cmp(pubkey,G.LP_mypub25519) != 0 ) { @@ -319,11 +319,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t } if ( coin->inactive == 0 ) { - if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) + if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,satoshis,txid2,vout2) <= 0 ) { static uint32_t counter; if ( counter++ < 3 ) - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(satoshis)); return(0); } if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) @@ -351,10 +351,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t if ( 0 && LP_ismine(utxo) == 0 ) { char str2[65],str3[65]; printf("iambob.%d %s %s utxoadd.(%.8f %.8f) %s %s\n",iambob,bits256_str(str3,pubkey),symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); - printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(tmpsatoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); + printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(satoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); } u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || tmpsatoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) + if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || satoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) { utxo->T.errors++; char str[65],str2[65],str3[65],str4[65],str5[65],str6[65]; @@ -364,7 +364,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t // utxo->T.spentflag = (uint32_t)time(NULL); printf("original utxo pair not valid\n"); if ( dispflag != 0 ) - printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); + printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,satoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); utxo = 0; } } @@ -389,7 +389,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t utxo->payment.txid = txid; utxo->payment.vout = vout; utxo->payment.value = value; - utxo->S.satoshis = tmpsatoshis; + utxo->S.satoshis = satoshis; if ( (utxo->iambob= iambob) != 0 ) { utxo->deposit.txid = txid2; @@ -658,14 +658,14 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) { } } else { //printf("call utxoadd\n"); - if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) { } } From fcb3859b6d8bc27699296d780c900e1c86585204 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 00:51:38 +0200 Subject: [PATCH 2372/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9bed33bbc..314cbe30a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,7 +18,7 @@ // LP_nativeDEX.c // marketmaker // -// version info +// immediate "request" // previously, it used to show amount, kmd equiv, perc // swap started, pending, locked, finished, ... // aliceid diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4cb3e0bfc..562cff7ba 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -466,8 +466,9 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); LP_Alicemaxprice = 0.; Alice_expiration = 0; + printf("send CONNECT\n"); LP_query(ctx,myipaddr,mypubsock,"connect",qp); - } + } else printf("LP_reserved price %.8f vs maxprice %.8f\n",price,maxprice*1.005); } else printf("probably a timeout, reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(),price,maxprice); } From 36110b787e17e02d62493b58a513086a1801a010 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 01:20:06 +0200 Subject: [PATCH 2373/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_utxos.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 562cff7ba..c4c902f13 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -296,7 +296,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { if ( up != 0 && (up2= utxos[mini]) != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) { utxo->S.satoshis = targetval; char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); @@ -789,7 +789,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) recalc = 1; } else @@ -817,7 +817,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - //butxo->S.satoshis = Q.satoshis; + butxo->S.satoshis = Q.satoshis; printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e82541a63..8d5d16c52 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -286,9 +286,9 @@ void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) utxo->T.spentflag = (uint32_t)time(NULL); } -struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid,uint64_t satoshis) +struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { - uint64_t val,val2=0,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { char str[65],str2[65]; printf("REJECT (%s) iambob.%d %s utxoadd.(%.8f %.8f) %s/v%d %s/v%d\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); @@ -301,7 +301,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t return(0); } txfee = LP_txfeecalc(coin,0,0); - /*if ( iambob != 0 && value2 < 9 * (satoshis >> 3) + 2*txfee ) // big txfee padding + if ( iambob != 0 && value2 < 9 * (value >> 3) + 2*txfee ) // big txfee padding { if ( value2 > 2*txfee ) tmpsatoshis = (((value2 - 2*txfee) / 9) << 3); @@ -310,7 +310,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("value2 %.8f <= 2 * %.8f\n",dstr(value2),dstr(txfee)); return(0); } - } else tmpsatoshis = (satoshis - txfee);*/ + } else tmpsatoshis = (value - txfee); char str[65],str2[65],dispflag = 0;//(iambob == 0); if ( iambob == 0 && bits256_cmp(pubkey,G.LP_mypub25519) != 0 ) { @@ -319,11 +319,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t } if ( coin->inactive == 0 ) { - if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,satoshis,txid2,vout2) <= 0 ) + if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { static uint32_t counter; if ( counter++ < 3 ) - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(satoshis)); + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); return(0); } if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) @@ -351,10 +351,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t if ( 0 && LP_ismine(utxo) == 0 ) { char str2[65],str3[65]; printf("iambob.%d %s %s utxoadd.(%.8f %.8f) %s %s\n",iambob,bits256_str(str3,pubkey),symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); - printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(satoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); + printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(tmpsatoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); } u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || satoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) + if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || tmpsatoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) { utxo->T.errors++; char str[65],str2[65],str3[65],str4[65],str5[65],str6[65]; @@ -364,7 +364,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t // utxo->T.spentflag = (uint32_t)time(NULL); printf("original utxo pair not valid\n"); if ( dispflag != 0 ) - printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,satoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); + printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); utxo = 0; } } @@ -389,7 +389,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t utxo->payment.txid = txid; utxo->payment.vout = vout; utxo->payment.value = value; - utxo->S.satoshis = satoshis; + utxo->S.satoshis = tmpsatoshis; if ( (utxo->iambob= iambob) != 0 ) { utxo->deposit.txid = txid2; @@ -658,14 +658,14 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) { } } else { //printf("call utxoadd\n"); - if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) + if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) { } } From d0fbae5c3f85e1efeb57df325d5a5520f0e2aac4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 01:38:24 +0200 Subject: [PATCH 2374/2732] Test --- iguana/exchanges/LP_swap.c | 7 +++++-- iguana/exchanges/LP_transaction.c | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index c7d3c4033..f923ad161 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -556,7 +556,7 @@ struct basilisk_rawtx *LP_swapdata_rawtx(struct basilisk_swap *swap,uint8_t *dat int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct basilisk_rawtx *rawtx,int32_t v,uint8_t *recvbuf,int32_t recvlen,int32_t suppress_pubkeys) { - bits256 otherhash,myhash,txid; int64_t txfee; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; + bits256 otherhash,myhash,txid; int64_t txfee,val; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; for (i=0; i<32; i++) otherhash.bytes[i] = recvbuf[offset++]; for (i=0; i<32; i++) @@ -626,7 +626,10 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } - if ( j64bits(vout,"satoshis") >= rawtx->I.amount-2*txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( rawtx->I.amount > 2*txfee) + val = rawtx->I.amount-2*txfee; + else val = 1; + if ( j64bits(vout,"satoshis") >= val && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index abeaf8ff0..d9939432d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1805,7 +1805,10 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d } } if ( swap->alicepayment.I.datalen != 0 && swap->alicepayment.I.spendlen > 0 && swap->myfee.I.datalen != 0 && swap->myfee.I.spendlen > 0 ) + { + printf("fee sent\n"); return(0); + } return(-1); } From d7cd0235862fd73e77c3d987ca00e660caac1109 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 01:43:46 +0200 Subject: [PATCH 2375/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_utxos.c | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c4c902f13..3f876861f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -296,7 +296,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { if ( up != 0 && (up2= utxos[mini]) != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 ) { utxo->S.satoshis = targetval; char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); @@ -789,7 +789,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0)) == 0 ) + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) recalc = 1; } else diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d5d16c52..e82541a63 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -286,9 +286,9 @@ void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) utxo->T.spentflag = (uint32_t)time(NULL); } -struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) +struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid,uint64_t satoshis) { - uint64_t val,val2=0,tmpsatoshis,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,txfee; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 )//|| sessionid == 0 ) { char str[65],str2[65]; printf("REJECT (%s) iambob.%d %s utxoadd.(%.8f %.8f) %s/v%d %s/v%d\n",coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); @@ -301,7 +301,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t return(0); } txfee = LP_txfeecalc(coin,0,0); - if ( iambob != 0 && value2 < 9 * (value >> 3) + 2*txfee ) // big txfee padding + /*if ( iambob != 0 && value2 < 9 * (satoshis >> 3) + 2*txfee ) // big txfee padding { if ( value2 > 2*txfee ) tmpsatoshis = (((value2 - 2*txfee) / 9) << 3); @@ -310,7 +310,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("value2 %.8f <= 2 * %.8f\n",dstr(value2),dstr(txfee)); return(0); } - } else tmpsatoshis = (value - txfee); + } else tmpsatoshis = (satoshis - txfee);*/ char str[65],str2[65],dispflag = 0;//(iambob == 0); if ( iambob == 0 && bits256_cmp(pubkey,G.LP_mypub25519) != 0 ) { @@ -319,11 +319,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t } if ( coin->inactive == 0 ) { - if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) + if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,satoshis,txid2,vout2) <= 0 ) { static uint32_t counter; if ( counter++ < 3 ) - printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(tmpsatoshis)); + printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f:%.8f, value2 %.8f:%.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(val),dstr(value2),dstr(val2),dstr(satoshis)); return(0); } if ( (numconfirms= LP_numconfirms(symbol,coinaddr,txid,vout,0)) <= 0 ) @@ -351,10 +351,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t if ( 0 && LP_ismine(utxo) == 0 ) { char str2[65],str3[65]; printf("iambob.%d %s %s utxoadd.(%.8f %.8f) %s %s\n",iambob,bits256_str(str3,pubkey),symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); - printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(tmpsatoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); + printf("duplicate %.8f %.8f %.8f vs utxo.(%.8f %.8f %.8f)\n",dstr(value),dstr(value2),dstr(satoshis),dstr(utxo->payment.value),dstr(utxo->deposit.value),dstr(utxo->S.satoshis)); } u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || tmpsatoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) + if ( bits256_cmp(txid,utxo->payment.txid) != 0 || bits256_cmp(txid2,u.txid) != 0 || vout != utxo->payment.vout || value != utxo->payment.value || satoshis != utxo->S.satoshis || vout2 != u.vout || value2 != u.value || strcmp(symbol,utxo->coin) != 0 || strcmp(coinaddr,utxo->coinaddr) != 0 || bits256_cmp(pubkey,utxo->pubkey) != 0 ) { utxo->T.errors++; char str[65],str2[65],str3[65],str4[65],str5[65],str6[65]; @@ -364,7 +364,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t // utxo->T.spentflag = (uint32_t)time(NULL); printf("original utxo pair not valid\n"); if ( dispflag != 0 ) - printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); + printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,satoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); utxo = 0; } } @@ -389,7 +389,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t utxo->payment.txid = txid; utxo->payment.vout = vout; utxo->payment.value = value; - utxo->S.satoshis = tmpsatoshis; + utxo->S.satoshis = satoshis; if ( (utxo->iambob= iambob) != 0 ) { utxo->deposit.txid = txid2; @@ -658,14 +658,14 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) { } } else { //printf("call utxoadd\n"); - if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid)) != 0 ) + if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) { } } From bdcb4576fd38b030d4b5ad0bf708761157e7b6e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 01:55:03 +0200 Subject: [PATCH 2376/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3f876861f..c2eba14fb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -685,11 +685,13 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_abutxo_set(autxo,butxo,&Q); if ( strcmp(method,"reserved") == 0 ) { + if ( LP_Alicemaxprice == 0. ) + return(retval); if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { - printf("quote validate error %.0f\n",qprice); + printf("reserved quote validate error %.0f\n",qprice); return(retval); } if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid,Q.vout) < 0 ) From dcb4ea56b1fdff3b24288dc3718b4a53e98b8fc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 02:00:22 +0200 Subject: [PATCH 2377/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- iguana/exchanges/LP_include.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 2e06711f4..95fbe6f99 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -231,7 +231,7 @@ bits256 LP_merkleroot(struct iguana_info *coin,struct electrum_info *ep,int32_t int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_info *ep,bits256 txid,int32_t height) { struct LP_transaction *tx=0; cJSON *merkobj,*merkles,*retjson; bits256 roothash,merkleroot; int32_t m,SPV = 0; - if ( height < 0 ) + if ( height <= 0 ) return(0); if ( (tx= LP_transactionfind(coin,txid)) == 0 && strcmp(coinaddr,coin->smartaddr) == 0 ) { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 787d6c57f..3922708ed 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "11843" +#define LP_BUILD_NUMBER "14288" #ifdef FROM_JS #include From 1651ff762f0b8b74f56d04d78e6a95dd37b58bda Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 10:41:46 +0200 Subject: [PATCH 2378/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 314cbe30a..279276789 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,10 +18,8 @@ // LP_nativeDEX.c // marketmaker // -// immediate "request" +// immediate "request", actual auction // previously, it used to show amount, kmd equiv, perc -// swap started, pending, locked, finished, ... -// aliceid //there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation // bot safe to exit? // From 2db0f96ae53040688b8d4b001d5d2a49b0e9d447 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 10:51:32 +0200 Subject: [PATCH 2379/2732] Timestamp in swapstatus --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_remember.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c2eba14fb..08721bcaf 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -699,7 +699,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("%s src %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid)); return(retval); } - else if (LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid2,Q.vout2) < 0 ) + else if ( LP_validSPV(Q.srccoin,Q.coinaddr,Q.txid2,Q.vout2) < 0 ) { printf("%s src2 %s failed SPV check\n",Q.srccoin,bits256_str(str,Q.txid2)); return(retval); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index f8bc1a227..5b145da5c 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -450,6 +450,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) { cJSON *item,*array; int32_t i; item = cJSON_CreateObject(); + jaddnum(item,"timestamp",rswap->expiration - INSTANTDEX_LOCKTIME*2); jaddnum(item,"tradeid",rswap->tradeid); jaddnum(item,"requestid",rswap->requestid); jaddnum(item,"quoteid",rswap->quoteid); From 1c5de221b88783ff4b520bc0b44b332722d1b38f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 11:19:00 +0200 Subject: [PATCH 2380/2732] Finishtime in swapstatus --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_remember.c | 5 ++++ iguana/exchanges/LP_rpc.c | 46 ++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3922708ed..5d07367d3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -443,6 +443,7 @@ struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coina int32_t LP_destaddr(char *destaddr,cJSON *item); int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration); char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey); +uint32_t LP_heighttime(char *symbol,int32_t height); uint64_t LP_unspents_load(char *symbol,char *addr); int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout); struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 5b145da5c..4d189f6d0 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -477,7 +477,12 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) jadd(item,"values",array); jaddstr(item,"result","success"); if ( rswap->finishedflag != 0 ) + { jaddstr(item,"status","finished"); + if ( rswap->iambob == 0 ) + jaddnum(item,"finishtime",LP_txtime(rswap->dest,rswap->paymentspent)); + else jaddnum(item,"finishtime",LP_txtime(rswap->dest,rswap->depositspent)); + } else jaddstr(item,"status","pending"); jaddbits256(item,"bobdeposit",rswap->txids[BASILISK_BOBDEPOSIT]); jaddbits256(item,"alicepayment",rswap->txids[BASILISK_ALICEPAYMENT]); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 661c476e6..3b77916af 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -447,6 +447,22 @@ uint32_t LP_locktime(char *symbol,bits256 txid) return(locktime); } +uint32_t LP_txtime(char *symbol,bits256 txid) +{ + struct LP_transaction *tx; struct iguana_info *coin; int32_t timestamp=0,height = 0; + if ( (timestamp= LP_locktime(symbol,txid)) != 0 ) + return(timestamp); + if ( (coin= LP_coinfind(symbol)) != 0 ) + { + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + { + height = tx->height; + timestamp = LP_heighttime(symbol,height); + } + } + return(height); +} + cJSON *LP_gettxout_json(bits256 txid,int32_t vout,int32_t height,char *coinaddr,uint64_t value) { cJSON *retjson,*addresses,*sobj; @@ -1013,6 +1029,36 @@ cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) return(bitcoin_json(coin,"getblock",buf)); } +uint32_t LP_heighttime(char *symbol,int32_t height) +{ + struct electrum_info *ep; uint32_t timestamp = 0; cJSON *retjson; char *blockhashstr; struct iguana_info *coin = LP_coinfind(symbol); + if ( coin != 0 ) + { + if ( (ep= coin->electrum) == 0 ) + { + if ( (blockhashstr= LP_blockhashstr(symbol,height)) != 0 ) + { + if ( (retjson= cJSON_Parse(blockhashstr)) != 0 ) + { + timestamp = juint(retjson,"time"); + free_json(retjson); + } + free(blockhashstr); + } + } + else + { + if ( (retjson= electrum_getheader(coin->symbol,ep,&retjson,height)) != 0 ) + { + printf("%s\n",jprint(retjson,0)); + timestamp = juint(retjson,"timestamp"); + free_json(retjson); + } + } + } + return(timestamp); +} + cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t height) { cJSON *json = 0; int32_t flag = 0; struct iguana_info *coin; From d7ef7be5e21630bc7e4555d2a0bc0892b4cbb7d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 11:35:43 +0200 Subject: [PATCH 2381/2732] Test --- iguana/exchanges/LP_commands.c | 3 +++ iguana/exchanges/LP_remember.c | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9d0f4ff47..25bb1ee70 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -260,7 +260,10 @@ bot_resume(botid)\n\ { uint32_t requestid,quoteid; if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) + { + printf("swapentry %u %u\n",requestid,quoteid); return(basilisk_swapentry(requestid,quoteid)); + } else if ( coin[0] != 0 ) return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); else if ( base[0] != 0 && rel[0] != 0 ) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 4d189f6d0..a25325258 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -481,7 +481,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) jaddstr(item,"status","finished"); if ( rswap->iambob == 0 ) jaddnum(item,"finishtime",LP_txtime(rswap->dest,rswap->paymentspent)); - else jaddnum(item,"finishtime",LP_txtime(rswap->dest,rswap->depositspent)); + else jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->depositspent)); } else jaddstr(item,"status","pending"); jaddbits256(item,"bobdeposit",rswap->txids[BASILISK_BOBDEPOSIT]); @@ -1137,7 +1137,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) { - uint64_t ridqids[4096],ridqid; char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i,j,count=0; + uint64_t ridqids[4096],ridqid; char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[LP_MAXPRICEINFOS],BTCtotals[LP_MAXPRICEINFOS],Btotal,Ktotal; int32_t i,j,count=0; portable_mutex_lock(&LP_swaplistmutex); memset(ridqids,0,sizeof(ridqids)); memset(KMDtotals,0,sizeof(KMDtotals)); @@ -1229,8 +1229,13 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid) char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) { - char *liststr,*retstr = 0; cJSON *retjson,*array,*item; int32_t i,n; - if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) + cJSON *item; int64_t KMDtotals[LP_MAXPRICEINFOS],BTCtotals[LP_MAXPRICEINFOS]; + memset(KMDtotals,0,sizeof(KMDtotals)); + memset(BTCtotals,0,sizeof(BTCtotals)); + if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) + return(jprint(item,1)); + else return(clonestr("{\"error\":\"cant find requestid-quoteid\"}")); + /*if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) { //printf("swapentry.(%s)\n",liststr); if ( (retjson= cJSON_Parse(liststr)) != 0 ) @@ -1252,7 +1257,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) } free(liststr); } - return(retstr); + return(retstr);*/ } extern struct LP_quoteinfo LP_Alicequery; From 011064ed3a7a89cd8461cf47a44700c179dca0e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 11:42:19 +0200 Subject: [PATCH 2382/2732] Test --- iguana/exchanges/LP_rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3b77916af..5b2a654ee 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -450,6 +450,7 @@ uint32_t LP_locktime(char *symbol,bits256 txid) uint32_t LP_txtime(char *symbol,bits256 txid) { struct LP_transaction *tx; struct iguana_info *coin; int32_t timestamp=0,height = 0; + char str[65]; printf("LP_txtime (%s %s)\n",symbol,bits256_str(str,txid)); if ( (timestamp= LP_locktime(symbol,txid)) != 0 ) return(timestamp); if ( (coin= LP_coinfind(symbol)) != 0 ) @@ -1040,6 +1041,7 @@ uint32_t LP_heighttime(char *symbol,int32_t height) { if ( (retjson= cJSON_Parse(blockhashstr)) != 0 ) { + printf("height.(%s)\n",jprint(retjson,0)); timestamp = juint(retjson,"time"); free_json(retjson); } From b1e4171eb7bc4ae17003baa4955c0f2a3bd90d58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 11:45:43 +0200 Subject: [PATCH 2383/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index a25325258..75e582bd0 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -480,7 +480,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) { jaddstr(item,"status","finished"); if ( rswap->iambob == 0 ) - jaddnum(item,"finishtime",LP_txtime(rswap->dest,rswap->paymentspent)); + jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->paymentspent)); else jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->depositspent)); } else jaddstr(item,"status","pending"); From 88243c22f79d2bf7c6d31caaaa79e6573920934a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 11:53:40 +0200 Subject: [PATCH 2384/2732] Test --- iguana/exchanges/LP_commands.c | 3 --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_remember.c | 6 +++--- iguana/exchanges/LP_rpc.c | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 25bb1ee70..9d0f4ff47 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -260,10 +260,7 @@ bot_resume(botid)\n\ { uint32_t requestid,quoteid; if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) - { - printf("swapentry %u %u\n",requestid,quoteid); return(basilisk_swapentry(requestid,quoteid)); - } else if ( coin[0] != 0 ) return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); else if ( base[0] != 0 && rel[0] != 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5d07367d3..4e3a1e5f2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -238,7 +238,7 @@ struct LP_swap_remember bits256 pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)]; uint64_t Atxfee,Btxfee,srcamount,destamount,aliceid; int64_t values[sizeof(txnames)/sizeof(*txnames)]; - uint32_t tradeid,requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; + uint32_t finishtime,tradeid,requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 75e582bd0..b50caa432 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -479,9 +479,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) if ( rswap->finishedflag != 0 ) { jaddstr(item,"status","finished"); - if ( rswap->iambob == 0 ) - jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->paymentspent)); - else jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->depositspent)); + jaddnum(item,"finishtime",rswap->finishtime); } else jaddstr(item,"status","pending"); jaddbits256(item,"bobdeposit",rswap->txids[BASILISK_BOBDEPOSIT]); @@ -663,6 +661,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) { if ( (fileobj= cJSON_Parse(fstr)) != 0 ) { + rswap->finishtime = juint(fileobj,"finishtime"); rswap->origfinishedflag = rswap->finishedflag = 1; free_json(fileobj); } @@ -1121,6 +1120,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (fp= fopen(fname,"wb")) != 0 ) { jaddstr(item,"method","tradestatus"); + jaddnum(item,"finishtime",rswap.finishtime); jaddstr(item,"gui",G.gui); itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5b2a654ee..1d952ff6d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -447,7 +447,7 @@ uint32_t LP_locktime(char *symbol,bits256 txid) return(locktime); } -uint32_t LP_txtime(char *symbol,bits256 txid) +/*uint32_t LP_txtime(char *symbol,bits256 txid) { struct LP_transaction *tx; struct iguana_info *coin; int32_t timestamp=0,height = 0; char str[65]; printf("LP_txtime (%s %s)\n",symbol,bits256_str(str,txid)); @@ -462,7 +462,7 @@ uint32_t LP_txtime(char *symbol,bits256 txid) } } return(height); -} +}*/ cJSON *LP_gettxout_json(bits256 txid,int32_t vout,int32_t height,char *coinaddr,uint64_t value) { From 4720157afd869030f8ec5d4b260bb40824406a6f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 12:00:14 +0200 Subject: [PATCH 2385/2732] Test --- iguana/exchanges/LP_remember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b50caa432..44d93a71a 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -450,7 +450,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) { cJSON *item,*array; int32_t i; item = cJSON_CreateObject(); - jaddnum(item,"timestamp",rswap->expiration - INSTANTDEX_LOCKTIME*2); + jaddnum(item,"expiration",rswap->expiration);// - INSTANTDEX_LOCKTIME*2); jaddnum(item,"tradeid",rswap->tradeid); jaddnum(item,"requestid",rswap->requestid); jaddnum(item,"quoteid",rswap->quoteid); From acc7a27089f5ad01e937d982351a9a48f0dce09f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 12:36:45 +0200 Subject: [PATCH 2386/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 08721bcaf..ac4034a29 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1011,7 +1011,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid) { - uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( gui == 0 ) @@ -1076,8 +1076,16 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } + bestsatoshis = LP_basesatoshis(relvolume,maxprice,txfee,desttxfee); + memset(&B,0,sizeof(B)); + strcpy(B.coin,base); + if ( LP_quoteinfoinit(&Q,&B,rel,maxprice,bestsatoshis,destsatoshis) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); + LP_RTmetrics_update(base,rel); - //return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); while ( 1 ) { if ( (bestutxo= LP_buyutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,gui,pubkeys,numpubs,destpubkey)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) From e428bc183f8afb7c7f9c856f4b9335d3767f9725 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:07:42 +0200 Subject: [PATCH 2387/2732] Test --- iguana/exchanges/LP_commands.c | 1 - iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxo.c | 1 + iguana/exchanges/LP_utxos.c | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9d0f4ff47..1b25666c9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -395,7 +395,6 @@ bot_resume(botid)\n\ LP_address(ptr,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - LP_listunspent_issue(coin,coinaddr,2); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); if ( ptr->electrum != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 279276789..a3f9a648f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -813,12 +813,14 @@ void LP_reserved_msgs(void *ignore) if ( num_Reserved_msgs[1] > 0 ) { num_Reserved_msgs[1]--; + printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); Reserved_msgs[1][num_Reserved_msgs[1]] = 0; } else if ( num_Reserved_msgs[0] > 0 ) { num_Reserved_msgs[0]--; + printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); Reserved_msgs[0][num_Reserved_msgs[0]] = 0; } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5be93ba33..0dc2d6596 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -288,7 +288,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep int32_t i,v,n,ht,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*retjson,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - //printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); + printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); for (i=0; i 1 ) + if ( 1 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e76b74a54..855794a45 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -145,6 +145,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a //printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); + LP_listunspent_issue(coin->symbol,coin->smartaddr,2); portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e82541a63..c453368f2 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -550,6 +550,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri return(0); coin->privkeydepth++; //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); + LP_listunspent_issue(coin->symbol,coin->smartaddr,2); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); From 197fffb8466d125939a41920b82eefaff46a93a2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:16:54 +0200 Subject: [PATCH 2388/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 855794a45..16ecba91d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -186,7 +186,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a continue; } } - if ( LP_allocated(up->U.txid,up->U.vout) == 0 && _LP_utxofind(iambob,up->U.txid,up->U.vout) == 0 && _LP_utxo2find(iambob,up->U.txid,up->U.vout) == 0 ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 && (iambob == 0 || (_LP_utxofind(iambob,up->U.txid,up->U.vout) == 0 && _LP_utxo2find(iambob,up->U.txid,up->U.vout) == 0)) ) { utxos[n++] = up; if ( n >= max ) From 8fe188021c5610b5776ae06efbe8d8b198954084 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:28:28 +0200 Subject: [PATCH 2389/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0dc2d6596..5be93ba33 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -288,7 +288,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep int32_t i,v,n,ht,flag = 0; char str[65]; uint64_t value; bits256 txid; cJSON *item,*retjson,*txobj; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { - printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); + //printf("PROCESS %s/%s %s num.%d\n",coin->symbol,ep!=0?ep->symbol:"nanolistunspent",coinaddr,n); for (i=0; i 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 8571a0e1cb6f00af15b48a0daafa6c2d89dbebf4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:38:53 +0200 Subject: [PATCH 2390/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ac4034a29..305322e22 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -676,7 +676,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - //printf("LP_tradecommand: check received method %s aliceid.%llx\n",method,(long long)Q.aliceid); + printf("LP_tradecommand: check received method %s aliceid.%llx %s/%s %.8f -> %.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis)); retval = 1; autxo = &A; butxo = &B; @@ -761,7 +761,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; - //printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); + printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); recalc = 0; if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 ) { @@ -808,7 +808,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); return(retval); } - //printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); + printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); LP_listunspent_both(Q.srccoin,Q.coinaddr,0); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { From 9bc00587a7920a8af8e01cf5080c45d72cd23036 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:41:32 +0200 Subject: [PATCH 2391/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a3f9a648f..7fc952235 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -813,14 +813,14 @@ void LP_reserved_msgs(void *ignore) if ( num_Reserved_msgs[1] > 0 ) { num_Reserved_msgs[1]--; - printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); + //printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); Reserved_msgs[1][num_Reserved_msgs[1]] = 0; } else if ( num_Reserved_msgs[0] > 0 ) { num_Reserved_msgs[0]--; - printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); + //printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); Reserved_msgs[0][num_Reserved_msgs[0]] = 0; } From 05ba34f9b14beb2dd8dbe35b8a90b72fe98a79e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:53:55 +0200 Subject: [PATCH 2392/2732] Test --- iguana/exchanges/LP_ordermatch.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 305322e22..9e7305d72 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -486,14 +486,6 @@ char *LP_connectedalice(cJSON *argjson) // alice return(clonestr("{\"result\",\"update stats\"}")); } printf("CONNECTED.(%s) numpending.%d tradeid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid); - /*if ( LP_alice_eligible() == 0 || LP_quotecmp(&Q,&LP_Alicequery) != 0 ) - { - printf("reject mismatched alice query\n"); - return(clonestr("{\"error\",\"mismatched alice query\"}")); - } - memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - LP_Alicemaxprice = 0.; - Alice_expiration = 0;*/ if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { printf("cant find autxo\n"); @@ -761,9 +753,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"request") == 0 ) { char str[65],str2[65]; - printf("address.(%s/%s) request.(%s)\n",Q.coinaddr,coin->smartaddr,jprint(argjson,0)); recalc = 0; - if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 ) + if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) { strcpy(Q.gui,G.gui); strcpy(Q.coinaddr,coin->smartaddr); @@ -800,6 +791,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; } } + printf("recalc.%d address.(%s/%s) request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,jprint(argjson,0)); if ( recalc != 0 ) { LP_RTmetrics_update(Q.srccoin,Q.destcoin); @@ -1083,6 +1075,8 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,G.LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + int32_t changed; + LP_mypriceset(&changed,autxo->coin,base,1. / maxprice); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); LP_RTmetrics_update(base,rel); From 91eb8aadb1efbab4a342bd037a4913cad9439479 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 13:59:27 +0200 Subject: [PATCH 2393/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9e7305d72..6a10898a9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -494,6 +494,7 @@ char *LP_connectedalice(cJSON *argjson) // alice } if ( autxo->S.swap != 0 ) { + printf("ignore duplicate swap\n"); LP_aliceid(Q.tradeid,Q.aliceid,"error3",0,0); return(clonestr("{\"error\":\"ignore duplicate swap\"}")); } @@ -510,7 +511,7 @@ char *LP_connectedalice(cJSON *argjson) // alice } if ( LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin) <= SMALLVAL || bid <= SMALLVAL ) { - //printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); + printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); LP_aliceid(Q.tradeid,Q.aliceid,"error5",0,0); return(clonestr("{\"error\":\"no price set\"}")); From 94013d9cd04c54f2ba138b3100a5eebbcef4d1ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 14:11:31 +0200 Subject: [PATCH 2394/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6a10898a9..a0a6ca5f2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -801,7 +801,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); return(retval); } - printf("butxo.%p recalc path %p %s, %p %s, %.8f\n",butxo,LP_allocated(butxo->payment.txid,butxo->payment.vout),bits256_str(str,butxo->payment.txid),LP_allocated(butxo->deposit.txid,butxo->deposit.vout),bits256_str(str2,butxo->deposit.txid),LP_quote_validate(autxo,butxo,&Q,1)); LP_listunspent_both(Q.srccoin,Q.coinaddr,0); if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { @@ -817,7 +816,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - //printf("cant find utxopair\n"); + printf("cant find utxopair\n"); return(retval); } } From eb3984aecea9d628f5d68743c168cd62779474a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 14:17:08 +0200 Subject: [PATCH 2395/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a0a6ca5f2..a43b776da 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -261,7 +261,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { - //printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); + printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); if ( relvolume > dstr(desttxfee) && price > SMALLVAL ) return(SATOSHIDEN * (relvolume / price) + 2*txfee); else return(0); @@ -669,7 +669,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %s aliceid.%llx %s/%s %.8f -> %.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis)); + printf("LP_tradecommand: check received method %s aliceid.%llx %s/%s %.8f -> %.8f price %.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; @@ -771,6 +771,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else { char tmp[64]; + printf("price %.8f qprice %.8f -> %.8f\n",dstr(price),dstr(qprice),dstr((qprice * 0.5) + (0.5 * price))); price = (qprice * 0.5) + (0.5 * price); if ( bits256_nonz(Q.txid) != 0 ) LP_utxos_remove(Q.txid,Q.vout); From a45ced08e94badf081f7c4c2500c53b0e790ac52 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 14:44:29 +0200 Subject: [PATCH 2396/2732] Test --- iguana/exchanges/LP_ordermatch.c | 53 +++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a43b776da..a46ba3902 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -18,6 +18,31 @@ // LP_ordermatch.c // marketmaker // +struct LP_quoteinfo LP_Alicequery; +double LP_Alicemaxprice; +uint32_t Alice_expiration; +struct { uint64_t aliceid; double bestprice; } Bob_competition[512]; + +double LP_bob_competition(uint64_t aliceid,double price) +{ + int32_t i,firsti = -1; + for (i=0; i dstr(desttxfee) && price > SMALLVAL ) return(SATOSHIDEN * (relvolume / price) + 2*txfee); else return(0); @@ -413,9 +438,6 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(retval); } -struct LP_quoteinfo LP_Alicequery; -double LP_Alicemaxprice; -uint32_t Alice_expiration; char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t tradeid) { struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; @@ -662,14 +684,14 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t value,value2; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,recalc,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t aliceid,value,value2; cJSON *retjson; double qprice,bestprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,recalc,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { // LP_checksig LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %s aliceid.%llx %s/%s %.8f -> %.8f price %.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); + printf("LP_tradecommand: check received method %12s aliceid.%16llx %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; @@ -678,6 +700,10 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_abutxo_set(autxo,butxo,&Q); if ( strcmp(method,"reserved") == 0 ) { + aliceid = j64bits(argjson,"aliceid"); + price = jdouble(argjson,"price"); + bestprice = LP_bob_competition(aliceid,price); + printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,price,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) @@ -768,11 +794,16 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) recalc = 1; - else + else if ( price < qprice ) { - char tmp[64]; - printf("price %.8f qprice %.8f -> %.8f\n",dstr(price),dstr(qprice),dstr((qprice * 0.5) + (0.5 * price))); - price = (qprice * 0.5) + (0.5 * price); + char tmp[64]; double range; int32_t r; + r = (rand() % 100); + range = (qprice - price); + bestprice = LP_bob_competition(j64bits(argjson,"aliceid"),price); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",dstr(price),dstr(qprice),r,range,price + r*range,bestprice); + price += (r * range); + if ( price < bestprice+SMALLVAL ) + return(retval); if ( bits256_nonz(Q.txid) != 0 ) LP_utxos_remove(Q.txid,Q.vout); else recalc = 1; @@ -792,7 +823,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) recalc = 1; } - } + } else return(retval); printf("recalc.%d address.(%s/%s) request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,jprint(argjson,0)); if ( recalc != 0 ) { From 2c9e15808345dc40464b55b562a31301a9e6a4ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 14:53:43 +0200 Subject: [PATCH 2397/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a46ba3902..bedd8223b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1100,7 +1100,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } - bestsatoshis = LP_basesatoshis(relvolume,maxprice,txfee,desttxfee); + bestsatoshis = LP_basesatoshis(dstr(destsatoshis),maxprice,txfee,desttxfee); memset(&B,0,sizeof(B)); strcpy(B.coin,base); if ( LP_quoteinfoinit(&Q,&B,rel,maxprice,bestsatoshis,destsatoshis) < 0 ) From c01ef0fe05f0f00ea9df78e805ed7a05f0d77bd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 14:59:14 +0200 Subject: [PATCH 2398/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bedd8223b..fb7e8103c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -30,8 +30,11 @@ double LP_bob_competition(uint64_t aliceid,double price) { if ( Bob_competition[i].aliceid == aliceid ) { - if ( price < Bob_competition[i].bestprice ) + if ( price != 0. && (Bob_competition[i].bestprice == 0. || price < Bob_competition[i].bestprice) ) + { Bob_competition[i].bestprice = price; + printf("Bob competition aliceid.%llx <- bestprice %.8f\n",(long long)aliceid,price); + } return(Bob_competition[i].bestprice); } else if ( Bob_competition[i].aliceid == 0 ) @@ -41,7 +44,8 @@ double LP_bob_competition(uint64_t aliceid,double price) firsti = (rand() % (sizeof(Bob_competition)/sizeof(*Bob_competition))); Bob_competition[firsti].aliceid = aliceid; Bob_competition[firsti].bestprice = price; - return(Bob_competition[i].bestprice); + printf("Bob competition aliceid.%llx %.8f\n",(long long)aliceid,price); + return(price); } uint64_t LP_txfeecalc(struct iguana_info *coin,uint64_t txfee,int32_t txlen) From 1c6eaf859d6a7a3811f2afd1db0443e97ec2adcd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 15:22:46 +0200 Subject: [PATCH 2399/2732] Test --- iguana/exchanges/LP_ordermatch.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fb7e8103c..5f8c7b81f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -800,14 +800,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; else if ( price < qprice ) { - char tmp[64]; double range; int32_t r; - r = (rand() % 100); - range = (qprice - price); - bestprice = LP_bob_competition(j64bits(argjson,"aliceid"),price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",dstr(price),dstr(qprice),r,range,price + r*range,bestprice); - price += (r * range); - if ( price < bestprice+SMALLVAL ) - return(retval); + char tmp[64]; if ( bits256_nonz(Q.txid) != 0 ) LP_utxos_remove(Q.txid,Q.vout); else recalc = 1; @@ -828,6 +821,14 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; } } else return(retval); + double range; int32_t r; + r = (rand() % 100); + range = (qprice - price); + bestprice = LP_bob_competition(j64bits(argjson,"aliceid"),price); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",dstr(price),dstr(qprice),r,range,price + r*range,bestprice); + price += (r * range); + if ( price < bestprice+SMALLVAL ) + return(retval); printf("recalc.%d address.(%s/%s) request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,jprint(argjson,0)); if ( recalc != 0 ) { From 006cf524691402583f2ffbd510a836274107f073 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 15:26:47 +0200 Subject: [PATCH 2400/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5f8c7b81f..defd94f6b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -787,6 +787,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 0; if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) { + qprice = (double)Q.destsatoshis / Q.satoshis; strcpy(Q.gui,G.gui); strcpy(Q.coinaddr,coin->smartaddr); strcpy(butxo->coinaddr,coin->smartaddr); From be8e18ac41caf85f2ee8ecf443068f7597c89409 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 15:27:52 +0200 Subject: [PATCH 2401/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index defd94f6b..59ea546c0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -760,7 +760,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } return(retval); } - if ( (coin= LP_coinfind(Q.srccoin)) == 0 || (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) + price = LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin); + if ( (coin= LP_coinfind(Q.srccoin)) == 0 || ask <= SMALLVAL ) { //printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); From 913504797fcf93a972cdc327b19e6b40670eb5ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 15:38:15 +0200 Subject: [PATCH 2402/2732] Test --- iguana/exchanges/LP_ordermatch.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 59ea546c0..354c5c762 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -761,7 +761,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } price = LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin); - if ( (coin= LP_coinfind(Q.srccoin)) == 0 || ask <= SMALLVAL ) + if ( (coin= LP_coinfind(Q.srccoin)) == 0 || price <= SMALLVAL || ask <= SMALLVAL ) { //printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); @@ -816,10 +816,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) recalc = 1; - } - else - { - if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) + else if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) recalc = 1; } } else return(retval); @@ -831,7 +828,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price += (r * range); if ( price < bestprice+SMALLVAL ) return(retval); - printf("recalc.%d address.(%s/%s) request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,jprint(argjson,0)); + printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); if ( recalc != 0 ) { LP_RTmetrics_update(Q.srccoin,Q.destcoin); From b95f610e890a67a4d3e23aae1995cb5a262b48e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 15:47:42 +0200 Subject: [PATCH 2403/2732] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 354c5c762..3630e89aa 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -702,12 +702,12 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(autxo,butxo,&Q); + aliceid = j64bits(argjson,"aliceid"); + qprice = jdouble(argjson,"price"); if ( strcmp(method,"reserved") == 0 ) { - aliceid = j64bits(argjson,"aliceid"); - price = jdouble(argjson,"price"); - bestprice = LP_bob_competition(aliceid,price); - printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,price,bestprice); + bestprice = LP_bob_competition(aliceid,qprice); + printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) @@ -823,9 +823,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, double range; int32_t r; r = (rand() % 100); range = (qprice - price); - bestprice = LP_bob_competition(j64bits(argjson,"aliceid"),price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",dstr(price),dstr(qprice),r,range,price + r*range,bestprice); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",dstr(price),dstr(qprice),r,range,price + r*range,LP_bob_competition(aliceid,price)); price += (r * range); + bestprice = LP_bob_competition(aliceid,price); if ( price < bestprice+SMALLVAL ) return(retval); printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); From 6ff2d4fdfd513d571fc7b9094e4ba1995924c905 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 15:58:20 +0200 Subject: [PATCH 2404/2732] Test --- iguana/exchanges/LP_ordermatch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3630e89aa..53342ae2d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -688,7 +688,7 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { - char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t aliceid,value,value2; cJSON *retjson; double qprice,bestprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t retval = -1,recalc,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + char *method,*msg,*retstr,str[65]; int32_t DEXselector = 0; uint64_t aliceid,value,value2; cJSON *retjson; double qprice,range,bestprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct iguana_info *coin; struct LP_address_utxo *utxos[1000]; struct LP_quoteinfo Q; int32_t r,retval = -1,recalc,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"reserved") == 0 ||strcmp(method,"connected") == 0 || strcmp(method,"request") == 0 || strcmp(method,"connect") == 0) ) { // LP_checksig @@ -766,6 +766,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } + price = ask; + printf("MYPRICE %s/%s %.8f\n",Q.srccoin,Q.destcoin,price); if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) { printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); @@ -776,7 +778,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("%s dexfee %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.feetxid)); return(retval); } - price = ask; if ( LP_aliceonly(Q.srccoin) > 0 ) { printf("{\"error\":\"GAME can only be alice coin\"}\n"); @@ -809,6 +810,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( bits256_nonz(Q.txid2) != 0 ) LP_utxos_remove(Q.txid2,Q.vout2); else recalc = 1; + printf("price %.8f qprice %.8f\n",price,qprice); if ( recalc == 0 ) { value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); @@ -820,10 +822,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; } } else return(retval); - double range; int32_t r; r = (rand() % 100); range = (qprice - price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",dstr(price),dstr(qprice),r,range,price + r*range,LP_bob_competition(aliceid,price)); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + r*range,LP_bob_competition(aliceid,price)); price += (r * range); bestprice = LP_bob_competition(aliceid,price); if ( price < bestprice+SMALLVAL ) @@ -847,7 +848,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.vout = butxo->payment.vout; Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; - butxo->S.satoshis = Q.satoshis; + Q.satoshis = butxo->S.satoshis; printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else From 0eba6792441aeb61943594d241ade40866a9efed Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:01:08 +0200 Subject: [PATCH 2405/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 53342ae2d..6f21fc40d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -825,7 +825,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, r = (rand() % 100); range = (qprice - price); printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + r*range,LP_bob_competition(aliceid,price)); - price += (r * range); + price += (r * range) / 100.; bestprice = LP_bob_competition(aliceid,price); if ( price < bestprice+SMALLVAL ) return(retval); From 6e799be950afe0be666b7b16ecac86de5329b7ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:05:27 +0200 Subject: [PATCH 2406/2732] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6f21fc40d..f6a947e69 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -707,7 +707,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"reserved") == 0 ) { bestprice = LP_bob_competition(aliceid,qprice); - printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); + //printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) @@ -767,7 +767,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } price = ask; - printf("MYPRICE %s/%s %.8f\n",Q.srccoin,Q.destcoin,price); + //printf("MYPRICE %s/%s %.8f\n",Q.srccoin,Q.destcoin,price); if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) { printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); @@ -785,7 +785,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } if ( strcmp(method,"request") == 0 ) { - char str[65],str2[65]; + char str[65];//,str2[65]; recalc = 0; if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) { @@ -829,7 +829,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, bestprice = LP_bob_competition(aliceid,price); if ( price < bestprice+SMALLVAL ) return(retval); - printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); + //printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); if ( recalc != 0 ) { LP_RTmetrics_update(Q.srccoin,Q.destcoin); @@ -849,7 +849,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; Q.satoshis = butxo->S.satoshis; - printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); + //printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else { From 525411bc891f77e6312b8948b6eb0f18453fde94 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:20:54 +0200 Subject: [PATCH 2407/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_utxos.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 1b25666c9..9d0f4ff47 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -395,6 +395,7 @@ bot_resume(botid)\n\ LP_address(ptr,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { + LP_listunspent_issue(coin,coinaddr,2); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); if ( ptr->electrum != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c453368f2..e82541a63 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -550,7 +550,6 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri return(0); coin->privkeydepth++; //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); - LP_listunspent_issue(coin->symbol,coin->smartaddr,2); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); From 633473fc9c38b3259dd1439027e4874f779d196c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:30:54 +0200 Subject: [PATCH 2408/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e82541a63..36612ddaa 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -549,12 +549,12 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( coin->privkeydepth > 0 ) return(0); coin->privkeydepth++; + LP_address(coin,coin->smartaddr); //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); - //printf("unspent array %ld\n",strlen(jprint(array,0))); - LP_address(coin,coin->smartaddr); + printf("unspent array %ld\n",strlen(jprint(array,0))); if ( array != 0 ) { txfee = LP_txfeecalc(coin,0,0); From 5e2655b301b6932595addc3221d54c499862ac71 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:47:29 +0200 Subject: [PATCH 2409/2732] Test --- iguana/exchanges/LP_ordermatch.c | 25 ++++++++++++++----------- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f6a947e69..af7f7c5e2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -33,7 +33,7 @@ double LP_bob_competition(uint64_t aliceid,double price) if ( price != 0. && (Bob_competition[i].bestprice == 0. || price < Bob_competition[i].bestprice) ) { Bob_competition[i].bestprice = price; - printf("Bob competition aliceid.%llx <- bestprice %.8f\n",(long long)aliceid,price); + //printf("Bob competition aliceid.%llx <- bestprice %.8f\n",(long long)aliceid,price); } return(Bob_competition[i].bestprice); } @@ -44,7 +44,7 @@ double LP_bob_competition(uint64_t aliceid,double price) firsti = (rand() % (sizeof(Bob_competition)/sizeof(*Bob_competition))); Bob_competition[firsti].aliceid = aliceid; Bob_competition[firsti].bestprice = price; - printf("Bob competition aliceid.%llx %.8f\n",(long long)aliceid,price); + //printf("Bob competition aliceid.%llx %.8f\n",(long long)aliceid,price); return(price); } @@ -695,7 +695,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %12s aliceid.%16llx %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); + //printf("LP_tradecommand: check received method %12s aliceid.%16llx %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; @@ -822,13 +822,16 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, recalc = 1; } } else return(retval); - r = (rand() % 100); - range = (qprice - price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + r*range,LP_bob_competition(aliceid,price)); - price += (r * range) / 100.; - bestprice = LP_bob_competition(aliceid,price); - if ( price < bestprice+SMALLVAL ) - return(retval); + if ( qprice > price ) + { + r = (rand() % 100); + range = (qprice - price); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + r*range,LP_bob_competition(aliceid,price)); + price += (r * range) / 100.; + bestprice = LP_bob_competition(aliceid,price); + if ( price < bestprice+SMALLVAL ) + return(retval); + } else return(retval); //printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); if ( recalc != 0 ) { @@ -853,7 +856,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - printf("cant find utxopair\n"); + //printf("cant find utxopair\n"); return(retval); } } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 5be93ba33..e679ef67f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -329,7 +329,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep tx->height = ht; if ( ep != 0 && coin != 0 && tx->SPV == 0 ) { - if ( strcmp(coinaddr,coin->smartaddr) == 0 ) + if ( 0 && strcmp(coinaddr,coin->smartaddr) == 0 ) tx->SPV = LP_merkleproof(coin,coin->smartaddr,ep,txid,tx->height); //printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height); } From b420153811bd6bc1c1d71d5fd6fc1d99bd6109c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:52:02 +0200 Subject: [PATCH 2410/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7fc952235..6383119ff 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -521,7 +521,6 @@ void LP_coinsloop(void *_coins) free_json(retjson); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - break; if ( up->U.height > 0 && up->spendheight < 0 ) { if ( up->SPV == 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 36612ddaa..2d5a04915 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -554,7 +554,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); - printf("unspent array %ld\n",strlen(jprint(array,0))); + //printf("unspent array %ld\n",strlen(jprint(array,0))); if ( array != 0 ) { txfee = LP_txfeecalc(coin,0,0); From 1d11d9a78f458a20a6e331338c0a0270873cf468 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 16:59:46 +0200 Subject: [PATCH 2411/2732] Test --- iguana/exchanges/LP_tradebots.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 9f7a94b4e..a2e82ac10 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -476,13 +476,14 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl free(retstr); txfee = LP_txfeecalc(relcoin,0,0); txfees = 10 * txfee; - printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees)); - if ( dstr(abalance) < relvolume + dstr(txfees) ) + if ( relcoin->electrum != 0 ) + balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr); + else balance = LP_RTsmartbalance(relcoin); + sum = (relvolume+2*dstr(txfees)) + 3 * ((relvolume+2*dstr(txfees))/777); + printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); + if ( dstr(abalance) < relvolume + dstr(txfees) && balance > sum+txfee ) { retjson = cJSON_CreateObject(); - if ( relcoin->electrum != 0 ) - balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr); - else balance = LP_RTsmartbalance(relcoin); jaddstr(retjson,"error","not enough funds"); jaddstr(retjson,"coin",rel); jaddnum(retjson,"abalance",dstr(abalance)); @@ -491,7 +492,6 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - sum = (relvolume+2*dstr(txfees)) + 3 * ((relvolume+2*dstr(txfees))/777); if ( balance >= sum+txfee ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; From 7909aed3f146fcd8c3598cf3d6e08062e89a038e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 17:57:24 +0200 Subject: [PATCH 2412/2732] Fix native missed numconfirms --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_utxo.c | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6383119ff..0bb66c9bf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,9 +18,9 @@ // LP_nativeDEX.c // marketmaker // -// immediate "request", actual auction +// alice waiting for bestprice // previously, it used to show amount, kmd equiv, perc -//there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation +// there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation // bot safe to exit? // // BCH signing diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index af7f7c5e2..8222443ed 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -826,7 +826,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { r = (rand() % 100); range = (qprice - price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + r*range,LP_bob_competition(aliceid,price)); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + (r*range)/100.,LP_bob_competition(aliceid,price)); price += (r * range) / 100.; bestprice = LP_bob_competition(aliceid,price); if ( price < bestprice+SMALLVAL ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 16ecba91d..54cb5a27d 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -661,6 +661,11 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int } else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 ) numconfirms = 0; + else if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + { + numconfirms = jint(txobj,"confirmations"); + free_json(txobj); + } } else { From 4f171163db4444e249e9ca179afef3b4df31b181 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 18:12:43 +0200 Subject: [PATCH 2413/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0bb66c9bf..4cad2061d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -466,7 +466,7 @@ void utxosQ_loop(void *myipaddr) void LP_coinsloop(void *_coins) { - struct LP_address *ap=0; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; + struct LP_address *ap=0,*atmp; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t oldht,j,nonz; char *coins = _coins; if ( strcmp("BTC",coins) == 0 ) { strcpy(LP_coinsloopBTC_stats.name,"BTC coin loop"); @@ -514,11 +514,18 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - //HASH_ITER(hh,coin->addresses,ap,atmp) if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) free_json(retjson); + } + HASH_ITER(hh,coin->addresses,ap,atmp) + { + if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) + free_json(retjson); + } + HASH_ITER(hh,coin->addresses,ap,atmp) + { DL_FOREACH_SAFE(ap->utxos,up,tmp) { if ( up->U.height > 0 && up->spendheight < 0 ) From 65e276c004560e88fe126928bfcb981fa27fb125 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 18:31:57 +0200 Subject: [PATCH 2414/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4cad2061d..158d51b48 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -521,6 +521,7 @@ void LP_coinsloop(void *_coins) } HASH_ITER(hh,coin->addresses,ap,atmp) { + printf("call unspent %s\n",ap->coinaddr); if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) free_json(retjson); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e679ef67f..b60f91c34 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -596,7 +596,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 0 && electrumflag > 1 ) + //if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 19aec0f9ce34f23d21297504a478b61e5ca95a1b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 18:40:03 +0200 Subject: [PATCH 2415/2732] Test --- iguana/exchanges/LP_utxo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 54cb5a27d..29446521f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -64,7 +64,10 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) { struct LP_address *ap = 0; if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) + { ap = _LP_addressadd(coin,coinaddr); + printf("LP_address %s %s\n",coin->symbol,coinaddr); + } return(ap); } From 026c707045cde6035db7ed4f15cc0b09ebf71d62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 18:45:41 +0200 Subject: [PATCH 2416/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 158d51b48..972c04374 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -514,6 +514,7 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; + printf("electrum %s\n",coin->symbol); if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) From d085e808602041c28c79afb0718fa275e77568ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 18:47:31 +0200 Subject: [PATCH 2417/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 29446521f..33554c05e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -66,7 +66,7 @@ struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) { ap = _LP_addressadd(coin,coinaddr); - printf("LP_address %s %s\n",coin->symbol,coinaddr); + //printf("LP_address %s %s\n",coin->symbol,coinaddr); } return(ap); } From 4da0f241b00a141fb48ae0e43f49539eea01080f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 20:35:54 +0200 Subject: [PATCH 2418/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_socket.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 972c04374..27ab16469 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -514,7 +514,8 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - printf("electrum %s\n",coin->symbol); + // skip cLP_address MNZ bXcSsYBiVKtTzYErqxvma4UsojZTEf5L6H + //printf("electrum %s\n",coin->symbol); if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) @@ -522,7 +523,7 @@ void LP_coinsloop(void *_coins) } HASH_ITER(hh,coin->addresses,ap,atmp) { - printf("call unspent %s\n",ap->coinaddr); + //printf("call unspent %s\n",ap->coinaddr); if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) free_json(retjson); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index b60f91c34..e679ef67f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -596,7 +596,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - //if ( 0 && electrumflag > 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From fda20a4b9edafed1e0e5d091851437020e59c12a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 20:37:38 +0200 Subject: [PATCH 2419/2732] Test --- iguana/exchanges/sell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/sell b/iguana/exchanges/sell index fccc4d61e..a48ffaac1 100755 --- a/iguana/exchanges/sell +++ b/iguana/exchanges/sell @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"BTC\",\"basevolume\":10.0\",price\":0.0005}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"BTC\",\"basevolume\":10.0\",\"price\":0.0005}" From 645351ae44e6c4b5ba80542c6bcf0611e70805d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 22:03:01 +0200 Subject: [PATCH 2420/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8222443ed..1aa138e33 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -883,7 +883,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("quote validate error %.0f\n",qprice); return(-3); } - if ( qprice < (price - 0.00000001) * 0.998 ) + if ( qprice < (ask - 0.00000001) * 0.998 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); return(retval); From 59e688208289c6299b43272cadebc698687f7850 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 22:22:19 +0200 Subject: [PATCH 2421/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1aa138e33..7bb60dd40 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -144,7 +144,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str { if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { - char str[65]; printf("alice not eligible destsatoshis %.8f (%.8f %.8f) %s/v%d\n",dstr(qp->destsatoshis),dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); + char str[65],str2[65]; printf("alice not eligible %.8f -> dest %.8f %.8f (%.8f %.8f) %s/v%d %s/v%d\n",dstr(qp->satoshis),dstr(qp->destsatoshis),(double)qp->destsatoshis/qp->satoshis,dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(-3); } if ( (txout= LP_gettxout(qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout)) != 0 ) @@ -885,7 +885,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } if ( qprice < (ask - 0.00000001) * 0.998 ) { - printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); + printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s %.8f < %.8f\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin,qprice,(ask - 0.00000001) * 0.998); return(retval); } char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); @@ -906,7 +906,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddstr(retjson,"method","reserved"); msg = jprint(retjson,0); butxo->T.lasttime = (uint32_t)time(NULL); - printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); + printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,ask,msg); // LP_addsig //msg2 = clonestr(msg); LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); From d8fad6895fb658b9854e3df122ee4ade6102e70b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 22:23:35 +0200 Subject: [PATCH 2422/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d9939432d..bc582236c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -652,7 +652,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch satoshis = value - 3*txfee/4; printf("reduce satoshis %.8f by txfee %.8f to value %.8f\n",dstr(satoshis),dstr(txfee),dstr(value)); } - else if ( value == satoshis && (double)txfee/value < 0.1 ) + else if ( value == satoshis && (double)txfee/value < 0.25 ) { satoshis = value - txfee; printf("txfee allocation from value %.8f identical to satoshis: %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); From 4dfa34bf9069399e703ec154a47b2476fb5039d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 22:53:01 +0200 Subject: [PATCH 2423/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 27ab16469..c24f24cd4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -856,7 +856,8 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha if ( num_Reserved_msgs[priority] > max_Reserved_msgs[priority] ) { max_Reserved_msgs[priority] = num_Reserved_msgs[priority]; - printf("New priority.%d max_Reserved_msgs.%d\n",priority,max_Reserved_msgs[priority]); + if ( (max_Reserved_msgs[priority] % 100) == 0 )) + printf("New priority.%d max_Reserved_msgs.%d\n",priority,max_Reserved_msgs[priority]); } portable_mutex_unlock(&LP_reservedmutex); return(n); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 33554c05e..bfd1103f3 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -856,7 +856,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } return(1); } - } // else printf("no val2\n"); + } else printf("no val2 %.8f < threshold %.8f\n",dstr(val),dstr(threshold)); } /*char str2[65]; if ( val != 0 && val2 != 0 ) From 8140631cdc21af687e87ffe7b1825e4d9703bc5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 22:55:32 +0200 Subject: [PATCH 2424/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c24f24cd4..0e427191c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -856,7 +856,7 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha if ( num_Reserved_msgs[priority] > max_Reserved_msgs[priority] ) { max_Reserved_msgs[priority] = num_Reserved_msgs[priority]; - if ( (max_Reserved_msgs[priority] % 100) == 0 )) + if ( (max_Reserved_msgs[priority] % 100) == 0 ) printf("New priority.%d max_Reserved_msgs.%d\n",priority,max_Reserved_msgs[priority]); } portable_mutex_unlock(&LP_reservedmutex); From f7e2cfb985e70cb36118873af9bdb6ab09073a91 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 23:49:04 +0200 Subject: [PATCH 2425/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0e427191c..ce4574d09 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // alice waiting for bestprice +// regen inventory // previously, it used to show amount, kmd equiv, perc // there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation // bot safe to exit? From 047df333a036d79c9adb911e4963a045b6cfb2ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Nov 2017 23:49:39 +0200 Subject: [PATCH 2426/2732] No MUSTFIX --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 4e3a1e5f2..a46edacae 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "14288" +#define LP_BUILD_NUMBER "14336" #ifdef FROM_JS #include From b1d772b8aa619bd997b8356edaeb30c7b41fb75a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 14:16:09 +0200 Subject: [PATCH 2427/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_swap.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ce4574d09..6486bfa83 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,7 +21,6 @@ // alice waiting for bestprice // regen inventory // previously, it used to show amount, kmd equiv, perc -// there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation // bot safe to exit? // // BCH signing diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index f923ad161..11dba75e7 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1121,20 +1121,20 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 } swap->myfee.I.locktime = swap->I.started + 1; swap->otherfee.I.locktime = swap->I.started + 1; - basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + 0*swap->bobcoin.txfee,4,0,jumblrflag); + basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin.txfee,4,0,jumblrflag); basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); swap->bobrefund.I.suppress_pubkeys = 1; basilisk_rawtx_setparms("aliceclaim",swap->I.req.quoteid,&swap->aliceclaim,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,alicepub33,jumblrflag); swap->aliceclaim.I.suppress_pubkeys = 1; swap->aliceclaim.I.locktime = swap->I.started + swap->I.putduration+swap->I.callduration + 1; - basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,&swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + 0*swap->bobcoin.txfee,3,0,jumblrflag); + basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,&swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + swap->bobcoin.txfee,3,0,jumblrflag); basilisk_rawtx_setparms("alicespend",swap->I.req.quoteid,&swap->alicespend,&swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,alicepub33,jumblrflag); swap->alicespend.I.suppress_pubkeys = 1; basilisk_rawtx_setparms("bobreclaim",swap->I.req.quoteid,&swap->bobreclaim,&swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,bobpub33,jumblrflag); swap->bobreclaim.I.suppress_pubkeys = 1; swap->bobreclaim.I.locktime = swap->I.started + swap->I.putduration + 1; - basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,&swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + 0*swap->alicecoin.txfee,2,0,jumblrflag); + basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,&swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + swap->alicecoin.txfee,2,0,jumblrflag); basilisk_rawtx_setparms("bobspend",swap->I.req.quoteid,&swap->bobspend,&swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,bobpub33,jumblrflag); swap->bobspend.I.suppress_pubkeys = 1; basilisk_rawtx_setparms("alicereclaim",swap->I.req.quoteid,&swap->alicereclaim,&swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,alicepub33,jumblrflag); From 4cd023ccfc1bea17364a8fe3fe80279019de954e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 14:26:08 +0200 Subject: [PATCH 2428/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7bb60dd40..b04094aa1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -852,6 +852,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; Q.satoshis = butxo->S.satoshis; + printf("found %.8f -> %.8f newprice %.8f vs ask %.8f += %.8f qprice %.8f\n",dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis,ask,price,qprice); //printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); } else From c0672f2658ea17ccad8c0c78336e70143699cca6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 14:34:15 +0200 Subject: [PATCH 2429/2732] test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b04094aa1..bd480c224 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -842,7 +842,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } LP_listunspent_both(Q.srccoin,Q.coinaddr,0); - if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) + if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,2*Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { strcpy(Q.gui,G.gui); strcpy(Q.coinaddr,coin->smartaddr); From 37349c8e4db7af3b3ce90fad1d3b671b5b9f9665 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 14:38:12 +0200 Subject: [PATCH 2430/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index bd480c224..b04094aa1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -842,7 +842,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } LP_listunspent_both(Q.srccoin,Q.coinaddr,0); - if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,2*Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) + if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { strcpy(Q.gui,G.gui); strcpy(Q.coinaddr,coin->smartaddr); From 2bc60b60ddcb372a5e10890fec91eb575b865ad4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 14:52:32 +0200 Subject: [PATCH 2431/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a46edacae..b23ba015f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -43,7 +43,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAXVINS 64 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 40 +#define LP_AUTOTRADE_TIMEOUT 30 #define ELECTRUM_TIMEOUT 7 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b04094aa1..c210ba075 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -21,15 +21,20 @@ struct LP_quoteinfo LP_Alicequery; double LP_Alicemaxprice; uint32_t Alice_expiration; -struct { uint64_t aliceid; double bestprice; } Bob_competition[512]; +struct { uint64_t aliceid; double bestprice; uint32_t starttime; } Bob_competition[512]; double LP_bob_competition(uint64_t aliceid,double price) { - int32_t i,firsti = -1; + int32_t i,firsti = -1; uint32_t now = (uint32_t)time(NULL); for (i=0; i Bob_competition[i].starttime+LP_AUTOTRADE_TIMEOUT ) + { + printf("aliceid.%llx expired\n",(long long)aliceid); + Bob_competition[i].bestprice = 0.; + } if ( price != 0. && (Bob_competition[i].bestprice == 0. || price < Bob_competition[i].bestprice) ) { Bob_competition[i].bestprice = price; @@ -42,6 +47,7 @@ double LP_bob_competition(uint64_t aliceid,double price) } if ( firsti < 0 ) firsti = (rand() % (sizeof(Bob_competition)/sizeof(*Bob_competition))); + Bob_competition[firsti].starttime = (uint32_t)time(NULL); Bob_competition[firsti].aliceid = aliceid; Bob_competition[firsti].bestprice = price; //printf("Bob competition aliceid.%llx %.8f\n",(long long)aliceid,price); From d2e53f072467989e37bb25dcaa3b72d683de0a55 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 14:59:12 +0200 Subject: [PATCH 2432/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c210ba075..22f503cd1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -832,7 +832,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { r = (rand() % 100); range = (qprice - price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + (r*range)/100.,LP_bob_competition(aliceid,price)); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f\n",price,qprice,r,range,price + (r*range)/100.); price += (r * range) / 100.; bestprice = LP_bob_competition(aliceid,price); if ( price < bestprice+SMALLVAL ) From 5e6710410fc116aa2198d68d20a1b5bc6140e1a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 15:02:35 +0200 Subject: [PATCH 2433/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 22f503cd1..d6b929b84 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -32,8 +32,9 @@ double LP_bob_competition(uint64_t aliceid,double price) { if ( now > Bob_competition[i].starttime+LP_AUTOTRADE_TIMEOUT ) { - printf("aliceid.%llx expired\n",(long long)aliceid); + //printf("aliceid.%llx expired\n",(long long)aliceid); Bob_competition[i].bestprice = 0.; + Bob_competition[i].starttime = now; } if ( price != 0. && (Bob_competition[i].bestprice == 0. || price < Bob_competition[i].bestprice) ) { From ea468bab7f89b7df42c4e00a6df576495d8abf89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 15:19:35 +0200 Subject: [PATCH 2434/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 21 ++++++++++++++------- iguana/exchanges/LP_socket.c | 2 ++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b23ba015f..c7eeca62e 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -96,7 +96,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define JUMBLR_RMD160 "5177f8b427e5f47342a4b8ab5dac770815d4389e" #define TIERNOLAN_RMD160 "daedddd8dbe7a2439841ced40ba9c3d375f98146" #define INSTANTDEX_BTC "1KRhTPvoxyJmVALwHFXZdeeWFbcJSbkFPu" -#define INSTANTDEX_BTCD "RThtXup6Zo7LZAi8kRWgjAyi1s4u6U9Cpf" +#define INSTANTDEX_KMD "RThtXup6Zo7LZAi8kRWgjAyi1s4u6U9Cpf" //#define BASILISK_DISABLEWAITTX //#define BASILISK_DISABLESENDTX diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d6b929b84..57e8d451b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -21,11 +21,12 @@ struct LP_quoteinfo LP_Alicequery; double LP_Alicemaxprice; uint32_t Alice_expiration; -struct { uint64_t aliceid; double bestprice; uint32_t starttime; } Bob_competition[512]; +struct { uint64_t aliceid; double bestprice; uint32_t starttime,counter; } Bob_competition[512]; -double LP_bob_competition(uint64_t aliceid,double price) +double LP_bob_competition(int32_t *counterp,uint64_t aliceid,double price,int32_t counter) { int32_t i,firsti = -1; uint32_t now = (uint32_t)time(NULL); + *counterp = 0; for (i=0; i bestprice %.8f\n",(long long)aliceid,qprice,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); @@ -744,6 +750,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else if ( strcmp(method,"connected") == 0 ) { + bestprice = LP_bob_competition(&counter,aliceid,qprice,1000); if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) @@ -833,10 +840,10 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { r = (rand() % 100); range = (qprice - price); - printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f\n",price,qprice,r,range,price + (r*range)/100.); price += (r * range) / 100.; - bestprice = LP_bob_competition(aliceid,price); - if ( price < bestprice+SMALLVAL ) + bestprice = LP_bob_competition(&counter,aliceid,price,0); + printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",ask,qprice,r,range,price,bestprice,counter); + if ( counter > 2 || price > bestprice*1.1 ) return(retval); } else return(retval); //printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e679ef67f..8d8cbb908 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -578,6 +578,8 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; char *retstr; struct LP_address *ap; struct iguana_info *coin; int32_t updatedflag,height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); + if ( strcmp(addr,INSTANTDEX_KMD) == 0 ) + return(cJSON_Parse("[]")); if ( ep == 0 || ep->heightp == 0 ) height = coin->longestchain; else height = *(ep->heightp); From 99e6f263dcdf1e130047b1a23e77508f178c7231 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 15:28:01 +0200 Subject: [PATCH 2435/2732] test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 8d8cbb908..951e14923 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -703,7 +703,7 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs } hexjson = electrum_hasharg(symbol,ep,&hexjson,"blockchain.transaction.get",txid,ELECTRUM_TIMEOUT); hexstr = jprint(hexjson,0); - if ( strlen(hexstr) > 60000 ) + if ( strlen(hexstr) > 100000 ) { static uint32_t counter; if ( counter++ < 3 ) From 5284db6b197faba46e3c3a815492350c94f1ed12 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 17:25:44 +0200 Subject: [PATCH 2436/2732] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 ++++ iguana/exchanges/LP_stats.c | 11 +++++++++-- iguana/exchanges/LP_swap.c | 6 +++--- iguana/exchanges/LP_tradebots.c | 6 +++--- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 38c62ac64..7f43a005a 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -229,7 +229,7 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) jaddnum(item,"pubtype",coin->pubtype); jaddnum(item,"p2shtype",coin->p2shtype); jaddnum(item,"wiftype",coin->wiftype); - jaddnum(item,"txfee",coin->txfee); + jaddnum(item,"txfee",strcmp(coin->symbol,"BTC") != 0 ? coin->txfee : LP_txfeecalc(coin,0,0)); return(item); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6486bfa83..c41f82f88 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -666,6 +666,8 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) if ( LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); else LP_unspents_load(coin->symbol,coin->smartaddr); + if ( coin->txfee == 0 && strcmp(coin->symbol,"BTC") != 0 ) + coin->txfee = LP_MIN_TXFEE; } } if ( (n= cJSON_GetArraySize(coins)) > 0 ) @@ -683,6 +685,8 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) if ( LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); else LP_unspents_load(coin->symbol,coin->smartaddr); + if ( coin->txfee == 0 && strcmp(coin->symbol,"BTC") != 0 ) + coin->txfee = LP_MIN_TXFEE; } } } diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 1fcea0355..853ce8bd0 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -34,6 +34,13 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj); char *LP_stats_methods[] = { "unknown", "request", "reserved", "connect", "connected", "tradestatus" }; +uint32_t LP_atomic_locktime(char *base,char *rel) +{ + if ( strcmp(base,"BTC") != 0 && strcmp(rel,"BTC") != 0 ) + return(INSTANTDEX_LOCKTIME); + else return(INSTANTDEX_LOCKTIME * 10); +} + static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatuses,LP_parse_errors,LP_unknowns,LP_duplicates,LP_aliceids; void LP_tradecommand_log(cJSON *argjson) @@ -195,7 +202,7 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO if ( (sp->finished= juint(lineobj,"timestamp")) == 0 ) sp->finished = (uint32_t)time(NULL); } - if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) + if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+LP_atomic_locktime(base,rel)*2 ) sp->expired = (uint32_t)time(NULL); return(0); } @@ -337,7 +344,7 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime,char *refgu array = cJSON_CreateArray(); HASH_ITER(hh,LP_swapstats,sp,tmp) { - if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+INSTANTDEX_LOCKTIME*2 ) + if ( sp->finished == 0 && time(NULL) > sp->Q.timestamp+LP_atomic_locktime(sp->Q.srccoin,sp->Q.destcoin)*2 ) sp->expired = (uint32_t)time(NULL); dispflag = 0; if ( starttime == 0 && endtime == 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 11dba75e7..fb6adf940 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -801,7 +801,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,INSTANTDEX_LOCKTIME*2,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin.symbol,swap->alicecoin.symbol)*2,30); } } } @@ -867,7 +867,7 @@ void LP_aliceloop(void *_swap) }*/ if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,INSTANTDEX_LOCKTIME*2,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin.symbol,swap->alicecoin.symbol)*2,30); } } } @@ -1009,7 +1009,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 printf("bitcoin_swapinit %s Btxfee %.8f rejected\n",swap->I.req.src,dstr(swap->I.Btxfee)); return(0); } - swap->I.putduration = swap->I.callduration = INSTANTDEX_LOCKTIME; + swap->I.putduration = swap->I.callduration = LP_atomic_locktime(swap->bobcoin.symbol,swap->alicecoin.symbol); if ( optionduration < 0 ) swap->I.putduration -= optionduration; else if ( optionduration > 0 ) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index a2e82ac10..a0b4406cb 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -27,13 +27,13 @@ struct LP_tradebot_trade uint64_t aliceid; int32_t dispdir; uint32_t started,finished,requestid,quoteid,tradeid,expired; - char base[32],rel[32],event[32]; + char base[65],rel[65],event[32]; }; struct LP_tradebot { struct LP_tradebot *next,*prev; - char name[128],base[32],rel[32]; + char name[128],base[65],rel[65]; int32_t numtrades,numpending,completed,dispdir; double maxprice,totalrelvolume,totalbasevolume,basesum,relsum,pendbasesum,pendrelsum; uint32_t lasttime,dead,pause,userpause,started,id; @@ -74,7 +74,7 @@ void LP_tradebot_calcstats(struct LP_tradebot *bot) { if ( (tp= bot->trades[i]) == 0 ) continue; - if ( tp->finished == 0 && time(NULL) > tp->started+INSTANTDEX_LOCKTIME*2 ) + if ( tp->finished == 0 && time(NULL) > tp->started+LP_atomic_locktime(bot->base,bot->rel)*2 ) { tp->expired = tp->finished = (uint32_t)time(NULL); printf("tradeid.%u expired\n",tp->tradeid); From d59aca98d1791190854436185140d23649e2cf22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 18:51:52 +0200 Subject: [PATCH 2437/2732] Test --- iguana/exchanges/DEXstats.h | 4 ++-- iguana/exchanges/LP_RTmetrics.c | 2 +- iguana/exchanges/LP_include.h | 12 ++++++------ iguana/exchanges/LP_nativeDEX.c | 3 +++ iguana/exchanges/LP_portfolio.c | 8 ++++---- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_remember.c | 10 ++++++++++ iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_socket.c | 6 +++--- iguana/exchanges/mm.c | 4 ++-- iguana/exchanges/stats.c | 4 ++-- 12 files changed, 36 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/DEXstats.h b/iguana/exchanges/DEXstats.h index edf2157cb..dc1f89864 100644 --- a/iguana/exchanges/DEXstats.h +++ b/iguana/exchanges/DEXstats.h @@ -51,7 +51,7 @@ struct DEXstats_pricepoint struct DEXstats_pairinfo { - char dest[16]; + char dest[128]; int32_t numprices; struct DEXstats_pricepoint *prices; }; @@ -64,7 +64,7 @@ struct DEXstats_datenuminfo struct DEXstats_priceinfo { - char symbol[16]; + char symbol[128]; int32_t firstdatenum,numdates; struct DEXstats_datenuminfo *dates; } Prices[1024]; diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index 54d9300bd..ac01d3025 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -29,7 +29,7 @@ struct LP_metricinfo struct LP_RTmetrics_pendings { - char refbase[16],refrel[16]; + char refbase[65],refrel[65]; int32_t numswaps,numavoidtxids,numwhitelist,numblacklist,numpendings,pending_swaps[1024]; bits256 avoidtxids[8192],whitelist[1024],blacklist[1024],pending_pubkeys[1024]; } LP_RTmetrics; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c7eeca62e..a8d31fc40 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -166,7 +166,7 @@ struct basilisk_swap; struct basilisk_rawtxinfo { - char destaddr[64],coinstr[16]; + char destaddr[64],coinstr[128]; bits256 txid,signedtxid,actualtxid; int64_t amount,change,inputsum; int32_t redeemlen,datalen,completed,vintype,vouttype,numconfirms,spendlen,secretstart,suppress_pubkeys; @@ -200,7 +200,7 @@ struct basilisk_rawtx struct basilisk_swapinfo { struct basilisk_request req; - char bobstr[64],alicestr[64]; + char bobstr[128],alicestr[128]; bits256 myhash,otherhash,orderhash; uint32_t statebits,otherstatebits,started,expiration,finished,dead,reftime,putduration,callduration; int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad,aliceistrusted,bobistrusted,otheristrusted,otherstrust,alicemaxconfirms,bobmaxconfirms; @@ -270,7 +270,7 @@ struct iguana_info int32_t numutxos,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; uint32_t loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; - char symbol[16],smartaddr[64],userpass[1024],serverport[128]; + char symbol[128],smartaddr[64],userpass[1024],serverport[128]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; void *electrum; void *ctx; @@ -301,7 +301,7 @@ struct LP_utxoinfo int32_t iambob,iamlp; uint8_t key[sizeof(bits256) + sizeof(int32_t)]; uint8_t key2[sizeof(bits256) + sizeof(int32_t)]; - char coin[16],coinaddr[64],gui[16];//spendscript[256]; + char coin[65],coinaddr[64],gui[16];//spendscript[256]; }; struct LP_address_utxo @@ -340,7 +340,7 @@ struct LP_quoteinfo uint64_t satoshis,txfee,destsatoshis,desttxfee,aliceid; uint32_t timestamp,quotetime,tradeid; int32_t vout,vout2,destvout,feevout,pair; - char srccoin[16],coinaddr[64],destcoin[16],destaddr[64],gui[64]; + char srccoin[65],coinaddr[64],destcoin[65],destaddr[64],gui[64]; }; struct LP_endpoint { int32_t pair; char ipaddr[64]; uint16_t port; }; @@ -384,7 +384,7 @@ struct electrum_info int32_t bufsize,sock,*heightp,numerrors; struct iguana_info *coin; uint32_t stratumid,lasttime,keepalive,pending,*heighttimep; - char ipaddr[64],symbol[16]; + char ipaddr[64],symbol[66]; uint16_t port; uint8_t buf[]; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c41f82f88..782fa35ce 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -26,6 +26,9 @@ // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs +//BTC LP_transaction_fromdata mismatched txid f78c80e831c02c89c0888e7d4438287030238e09e33f88da6df4dc84b949959b vs 1390f386f5997607e646be9c93f30018aa68ea971790b92b7b06e892656f0769 +//failed blockchain.transaction.get BTC f78c80e831c02c89c0888e7d4438287030238e09e33f88da6df4dc84b949959b +//02000000000101242344292f9117c8318adb84f7991239361da2ff0a15ad2106d402945072cc110a0000001716001470eb5212b558cfc10b31f0849ef88ecf17097ac1ffffffff0c4a8321000000000017a914baed1c79cc6325333d5013b44dc17e8256bf5b718704bf3c000000000017a914255cf2809a1f42569c5c47c71e6234aac35a800f873099f400000000001976a914049877b81a8d6d8592919b75b9bcb4182f7c52cd88acb907e200000000001976a9140614fc114940e867210b09cc900db14d8bc58d2b88ac40771b00000000001976a9148cadbb1d7002d22d60e38ca238678d00f04ed22988ac002d3101000000001976a9140d05714431cf478846cea1435f9eabae9ad5c65388acc0f280010000000017a914c17a70c74154fc53263652aaca26c8d71683f1ba87aa2a4e00000000001976a914feea6b867954b1072962083233796d47e4c1665e88ace0e1de02000000001976a91445b71fbb02df53be5563257b77780b9afcc55bdc88acf6fe6700000000001976a91492332f8ff3b26e3ce2666afa5fee2e45308225af88ace74c1500000000001976a914fc7580f1ce24b2c85c80b2c8e641592b9bbf974588ac081ad000000000001976a9145e61c81c9b3ac55bf90ab00240023e8ddaf43e1788ac02483045022100a74be4e00585637c6792eeff9279508f09163db525f8b16c03e57283d12b0a6a022042cc061d70e78e9260ff30635db4f4e0b317831a8cb1f30473a25b93b4d1b4fb01210238288b60e8c50785809a69517ae3ca2fe3e407cac8b5868c5fb3803c233dfbcc00000000 data2json n.219 vs len.586 #include struct LP_millistats diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 43fd77c89..4004a8c41 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -18,7 +18,7 @@ // marketmaker // -char LP_portfolio_base[16],LP_portfolio_rel[16]; +char LP_portfolio_base[128],LP_portfolio_rel[128]; double LP_portfolio_relvolume; cJSON *LP_portfolio_entry(struct iguana_info *coin) @@ -203,7 +203,7 @@ int32_t LP_autoprices,num_LP_autorefs; struct LP_autoprice_ref { - char refbase[16],refrel[16],base[16],rel[16]; + char refbase[65],refrel[65],base[65],rel[65]; } LP_autorefs[100]; /*int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) @@ -325,7 +325,7 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, - int32_t i,j,n,iter; double price,kmdbtc,bid,ask,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + int32_t i,j,n,iter; double price,kmdbtc,bid,ask,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[65],*name,*refcoin; cJSON *retjson,*array,*item; if ( (retjson= cJSON_Parse(retstr)) != 0 ) { //printf("got.(%s)\n",retstr); @@ -553,7 +553,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str else return(-1); } -struct LP_portfoliotrade { double metric; char buycoin[16],sellcoin[16]; }; +struct LP_portfoliotrade { double metric; char buycoin[65],sellcoin[65]; }; int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *array) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 66bb2fdc3..7313c733b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -22,7 +22,7 @@ struct LP_orderbookentry { bits256 pubkey; double price; uint64_t minsatoshis,ma struct LP_priceinfo { - char symbol[16]; + char symbol[68]; uint64_t coinbits; int32_t ind,pad; double diagval,high[2],low[2],last[2],bid[2],ask[2]; //volume,btcvolume,prevday; // mostly bittrex info diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 44d93a71a..2180a498c 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -94,6 +94,10 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx if ( (fp= fopen(fname,"wb")) != 0 ) { fprintf(fp,"{\"tradeid\":%u,\"aliceid\":\"%llu\",\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u,\"Atxfee\":%llu,\"Btxfee\":%llu",swap->tradeid,(long long)swap->aliceid,swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime,(long long)swap->I.Atxfee,(long long)swap->I.Btxfee); + if ( swap->I.iambob == 0 ) + fprintf(fp,",\"Agui\":\"%s\"",G.gui); + else fprintf(fp,",\"Bgui\":\"%s\"",G.gui); + fprintf(fp,",\"gui\":\"%s\"",G.gui); if ( memcmp(zeroes,swap->I.secretAm,20) != 0 ) { init_hexbytes_noT(secretAmstr,swap->I.secretAm,20); @@ -455,6 +459,9 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) jaddnum(item,"requestid",rswap->requestid); jaddnum(item,"quoteid",rswap->quoteid); jaddnum(item,"iambob",rswap->iambob); + jaddstr(item,"Bgui",rswap->Bgui); + jaddstr(item,"Agui",rswap->Agui); + jaddstr(item,"gui",rswap->gui); jaddstr(item,"bob",rswap->src); jaddnum(item,"srcamount",dstr(rswap->srcamount)); jaddnum(item,"bobtxfee",dstr(rswap->Btxfee)); @@ -503,6 +510,9 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t if ( (item= cJSON_Parse(fstr)) != 0 ) { rswap->iambob = jint(item,"iambob"); + safecopy(rswap->Bgui,jstr(item,"Bgui"),sizeof(rswap->Bgui)); + safecopy(rswap->Agui,jstr(item,"Agui"),sizeof(rswap->Agui)); + safecopy(rswap->gui,jstr(item,"gui"),sizeof(rswap->gui)); rswap->tradeid = juint(item,"tradeid"); rswap->aliceid = j64bits(item,"aliceid"); if ( (secretstr= jstr(item,"secretAm")) != 0 && strlen(secretstr) == 40 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1d952ff6d..30789efe7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -208,7 +208,7 @@ cJSON *LP_NXT_decrypt(uint64_t txnum,char *account,char *data,char *nonce,char * cJSON *LP_NXT_redeems() { - char url[1024],*retstr,*recv,*method,*msgstr,assetname[16]; uint64_t totals[20],mult,txnum,assetid,qty; int32_t i,ind,numtx,past_marker=0; cJSON *item,*attach,*decjson,*array,*msgjson,*encjson,*retjson=0; + char url[1024],*retstr,*recv,*method,*msgstr,assetname[128]; uint64_t totals[20],mult,txnum,assetid,qty; int32_t i,ind,numtx,past_marker=0; cJSON *item,*attach,*decjson,*array,*msgjson,*encjson,*retjson=0; uint64_t txnum_marker = calc_nxt64bits("0"); uint64_t txnum_marker2 = calc_nxt64bits("7256847492742571143"); char *passphrase = ""; diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index a8c33fc28..5a5a12051 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -127,7 +127,7 @@ int sort_balance(void *a,void *b) cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { - static bits256 bannedarray[64]; static int32_t numbanned,indallvouts,maxsnapht; static char lastcoin[16]; + static bits256 bannedarray[64]; static int32_t numbanned,indallvouts,maxsnapht; static char lastcoin[65]; struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t isKMD,i,j,n,skipflag=0,startht,endht,ht; uint64_t banned_balance=0,balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; if ( bannedarray[0].txid == 0 ) numbanned = komodo_bannedset(&indallvouts,bannedarray,(int32_t)(sizeof(bannedarray)/sizeof(*bannedarray))); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 951e14923..96855e6d7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -98,7 +98,7 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port) #endif expand_ipbits(checkipaddr,saddr.sin_addr.s_addr); if ( strcmp(ipaddr,checkipaddr) != 0 ) - printf("bindflag.%d iguana_socket mismatch (%s) -> (%s)?\n",bindflag,checkipaddr,ipaddr); + printf("bindflag.%d iguana_socket mismatch (%s) -> (%s)\n",bindflag,checkipaddr,ipaddr); //#endif if ( (sock= socket(AF_INET,SOCK_STREAM,0)) < 0 ) { @@ -578,8 +578,8 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; char *retstr; struct LP_address *ap; struct iguana_info *coin; int32_t updatedflag,height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); - if ( strcmp(addr,INSTANTDEX_KMD) == 0 ) - return(cJSON_Parse("[]")); + //if ( strcmp(addr,INSTANTDEX_KMD) == 0 ) + // return(cJSON_Parse("[]")); if ( ep == 0 || ep->heightp == 0 ) height = coin->longestchain; else height = *(ep->heightp); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 12c8f1496..1d2a1bd5e 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -74,7 +74,7 @@ struct mmpending_order int32_t dir; uint32_t pending,completed,canceled,cancelstarted,reported; cJSON *errorjson; - char exchange[16],base[16],rel[16],orderid[64]; + char exchange[16],base[65],rel[65],orderid[64]; } *Pending_orders; int32_t Num_Pending; @@ -415,7 +415,7 @@ void marketmaker_pendingupdate(char *exchange,char *base,char *rel) void marketmaker_pendinginit(char *exchange,char *base,char *rel) { - char *retstr,*orderid,*pairstr,relbase[64]; cJSON *retjson,*array,*item; int32_t i,j,n,dir; struct mmpending_order *ptr; + char *retstr,*orderid,*pairstr,relbase[65]; cJSON *retjson,*array,*item; int32_t i,j,n,dir; struct mmpending_order *ptr; sprintf(relbase,"%s-%s",rel,base); if ( (retstr= DEX_openorders(exchange)) != 0 ) { diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 6453b85d5..d283b1301 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -62,7 +62,7 @@ char CURRENCIES[][8] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", // end of currencies }; -char ASSETCHAINS_SYMBOL[16] = { "KV" }; +char ASSETCHAINS_SYMBOL[65] = { "KV" }; struct komodo_state { @@ -1090,7 +1090,7 @@ int32_t komodo_parsestatefile(FILE *logfp,struct komodo_state *sp,FILE *fp,char int32_t stats_stateupdate(FILE *logfp,char *destdir,char *statefname,int32_t maxseconds,char *komodofile) { static long lastpos[2]; - char symbol[64],base[64]; int32_t iter,n; FILE *fp; uint32_t starttime; struct komodo_state *sp; + char symbol[65],base[65]; int32_t iter,n; FILE *fp; uint32_t starttime; struct komodo_state *sp; starttime = (uint32_t)time(NULL); strcpy(base,"KV"); strcpy(symbol,"KV"); From 987e52e408abefeebe6d8834e7380f60e82b80f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 19:07:25 +0200 Subject: [PATCH 2438/2732] Test --- iguana/exchanges/LP_cache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 95fbe6f99..65140dc2c 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -247,7 +247,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_i if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 ) { char str[65],str2[65],str3[65]; - SPV = -1; + SPV = 0; memset(roothash.bytes,0,sizeof(roothash)); if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 ) { @@ -271,7 +271,11 @@ int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_i } //printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash)); } - else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + else + { + SPV = -1; + printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); + } } else SPV = 0; } if ( SPV < 0 ) From 7b451b5cb16284bb5672dc6f03bf354cabf01e7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 19:11:01 +0200 Subject: [PATCH 2439/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a8d31fc40..cda3f0348 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -180,7 +180,7 @@ struct basilisk_request int64_t srcamount,unused; // 16 to 31 bits256 srchash; // 32 to 63 bits256 desthash; - char src[8],dest[8]; + char src[65],dest[65]; uint64_t destamount; int32_t optionhours,DEXselector; }; @@ -241,7 +241,7 @@ struct LP_swap_remember uint32_t finishtime,tradeid,requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; - char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; + char Agui[65],Bgui[65],gui[65],src[65],dest[65],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[65],bobcoin[65],*txbytes[sizeof(txnames)/sizeof(*txnames)]; }; struct LP_outpoint From 34bd4fab06ebe8747e0f929fdc42b41042099180 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 19:47:27 +0200 Subject: [PATCH 2440/2732] Test --- iguana/exchanges/LP_bitcoin.c | 9 +++++++++ iguana/exchanges/LP_nativeDEX.c | 10 ++++++++++ iguana/exchanges/LP_tradebots.c | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 0eef539d1..cd70c13d4 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3328,6 +3328,15 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj return(len); } +/* + normal: nVersion|txins|txouts|nLockTime. + segwit + nVersion|marker|flag|txins|txouts|witness|nLockTime +Format of nVersion, txins, txouts, and nLockTime are same as the original format +The marker MUST be 0x00 +The flag MUST be 0x01 +*/ + int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { int32_t i,n,len = 0,extraused=0; uint8_t spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 782fa35ce..05ce41c36 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -30,6 +30,16 @@ //failed blockchain.transaction.get BTC f78c80e831c02c89c0888e7d4438287030238e09e33f88da6df4dc84b949959b //02000000000101242344292f9117c8318adb84f7991239361da2ff0a15ad2106d402945072cc110a0000001716001470eb5212b558cfc10b31f0849ef88ecf17097ac1ffffffff0c4a8321000000000017a914baed1c79cc6325333d5013b44dc17e8256bf5b718704bf3c000000000017a914255cf2809a1f42569c5c47c71e6234aac35a800f873099f400000000001976a914049877b81a8d6d8592919b75b9bcb4182f7c52cd88acb907e200000000001976a9140614fc114940e867210b09cc900db14d8bc58d2b88ac40771b00000000001976a9148cadbb1d7002d22d60e38ca238678d00f04ed22988ac002d3101000000001976a9140d05714431cf478846cea1435f9eabae9ad5c65388acc0f280010000000017a914c17a70c74154fc53263652aaca26c8d71683f1ba87aa2a4e00000000001976a914feea6b867954b1072962083233796d47e4c1665e88ace0e1de02000000001976a91445b71fbb02df53be5563257b77780b9afcc55bdc88acf6fe6700000000001976a91492332f8ff3b26e3ce2666afa5fee2e45308225af88ace74c1500000000001976a914fc7580f1ce24b2c85c80b2c8e641592b9bbf974588ac081ad000000000001976a9145e61c81c9b3ac55bf90ab00240023e8ddaf43e1788ac02483045022100a74be4e00585637c6792eeff9279508f09163db525f8b16c03e57283d12b0a6a022042cc061d70e78e9260ff30635db4f4e0b317831a8cb1f30473a25b93b4d1b4fb01210238288b60e8c50785809a69517ae3ca2fe3e407cac8b5868c5fb3803c233dfbcc00000000 data2json n.219 vs len.586 + +//BTC LP_transaction_fromdata mismatched txid ae7af65215554964b7af01babb58fce10fc51d9812ced07ee4a62a1ffe10c0bb vs 051ef4f75898b511dd3aebd687d5a5bdb004226d811aaf13e64be741dbe81ff2 +//failed blockchain.transaction.get BTC ae7af65215554964b7af01babb58fce10fc51d9812ced07ee4a62a1ffe10c0bb +//errortxobj.({"version":1}) +//010000000001010c590740b0c558f75b64cc0d00b0533ff951e403d993b866a87c7c52981388a60300000017160014cd2b7646f9931c85bb9d4d353b652c76b40aff84ffffffff0240420f000000000017a914239ae54cd403a91b084d3244e7e423f05c25ec268728fe28010000000017a914b96e21dd6e11bb67479f9072df55881e7fb17f788702473044022076e4c1cfba0dab889598efdfdcbc7a1046cc0eecfb8fec379994d559143d271c02206b16d9a0e3c425434d1b793d61e1e491f269abc7e7d3af52d95f6a26c1c2aa0d0121037f88a6ccdd608645024b05f408324550cf6fa1c74e3d7c1f94a1e9b57369d10600000000 data2json n.-1 vs len.247 + + +//ScriptSig: PUSHDATA(34)[002072d8f7debd607b94c95ced6cff38265ed99c7c1ee58b67d0a3f3ed43b6d9a977] +//Witness: 040047304402206f23bb2dd06bc70d78312e27d53954420d0defbda7ad638718b9dc2c1efb93100220270f79bfb3230194d2e625875073799f6f07d96d5bce43b19cfe6be9957d95540148304502210081842f5987009e65f1d7de6140433da541b9da52ed211e87e1ae6fc25260d7680220798de97c682541d7b26b0795b19994f045f3ef4f433c55da0b5f1506ddeec413014752210305345798069ac85285628732485a3ce7e96b85696ed7da72287f6eae3b275363210268aace9c841b8d61fe3532981c8b25e235690003916c5a90c23a708e5d8f929752ae + #include struct LP_millistats { diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index a0b4406cb..1f6fa7c48 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -481,7 +481,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl else balance = LP_RTsmartbalance(relcoin); sum = (relvolume+2*dstr(txfees)) + 3 * ((relvolume+2*dstr(txfees))/777); printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); - if ( dstr(abalance) < relvolume + dstr(txfees) && balance > sum+txfee ) + if ( dstr(abalance) < relvolume && balance > sum+txfee ) { retjson = cJSON_CreateObject(); jaddstr(retjson,"error","not enough funds"); From 989bffe20a0b7d7e10520db1cedfce86edb42d4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 20:38:14 +0200 Subject: [PATCH 2441/2732] Test --- iguana/exchanges/LP_bitcoin.c | 28 ++++++++++++++++++---------- iguana/exchanges/LP_ordermatch.c | 24 +++++++++++++++++------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index cd70c13d4..4106f0399 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3328,18 +3328,9 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj return(len); } -/* - normal: nVersion|txins|txouts|nLockTime. - segwit - nVersion|marker|flag|txins|txouts|witness|nLockTime -Format of nVersion, txins, txouts, and nLockTime are same as the original format -The marker MUST be 0x00 -The flag MUST be 0x01 -*/ - int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { - int32_t i,n,len = 0,extraused=0; uint8_t spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + int32_t i,n,len = 0,extraused=0; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) @@ -3359,6 +3350,19 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is if ( json != 0 ) jaddnum(json,"timestamp",msg->timestamp); } + if ( rwflag == 0 ) + { + /* + normal: nVersion|txins|txouts|nLockTime. + segwit + nVersion|marker|flag|txins|txouts|witness|nLockTime + Format of nVersion, txins, txouts, and nLockTime are same as the original format + The marker MUST be 0x00 + The flag MUST be 0x01 + */ + if ( serialized[len] == 0x00 && (segwitflag= serialized[len+1]) == 0x01 ) + len += 2; + } len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_in); if ( rwflag == 0 ) { @@ -3425,6 +3429,10 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } if ( voutarray != 0 ) jaddi(voutarray,iguana_voutjson(taddr,pubtype,p2shtype,&msg->vouts[i],i,*txidp)); + } + if ( segwitflag != 0 ) + { + } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); //printf("lock_time.%08x len.%d\n",msg->lock_time,len); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 57e8d451b..5a9b2031b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -20,6 +20,7 @@ // struct LP_quoteinfo LP_Alicequery; double LP_Alicemaxprice; +bits256 LP_Alicedestpubkey; uint32_t Alice_expiration; struct { uint64_t aliceid; double bestprice; uint32_t starttime,counter; } Bob_competition[512]; @@ -455,7 +456,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(retval); } -char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t tradeid) +char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t tradeid,bits256 destpubkey) { struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) @@ -469,14 +470,16 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); qp->tradeid = tradeid; LP_query(ctx,myipaddr,mypubsock,"request",qp); - LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; - printf("LP_trade %s/%s %.8f vol %.8f\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis)); + LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout, LP_Alicedestpubkey = destpubkey; + char str[65]; printf("LP_trade %s/%s %.8f vol %.8f dest.(%s)\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis),bits256_str(str,LP_Alicedestpubkey)); return(LP_recent_swaps(0)); } int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) { - if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) //bits256_cmp(qp->srchash,qp2->srchash) == 0 && + if ( bits256_nonz(LP_Alicedestpubkey) != 0 && bits256_cmp(LP_Alicedestpubkey,qp->srchash) != 0 ) + return(-1); + else if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) //bits256_cmp(qp->srchash,qp2->srchash) == 0 && return(0); else return(-1); } @@ -487,6 +490,7 @@ int32_t LP_alice_eligible() { printf("time expired for Alice_request\n"); memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + memset(&LP_Alicedestpubkey,0,sizeof(LP_Alicedestpubkey)); LP_Alicemaxprice = 0.; Alice_expiration = 0; } @@ -503,6 +507,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo { qp->tradeid = LP_Alicequery.tradeid; memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + memset(&LP_Alicedestpubkey,0,sizeof(LP_Alicedestpubkey)); LP_Alicemaxprice = 0.; Alice_expiration = 0; printf("send CONNECT\n"); @@ -723,6 +728,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); + if ( bits256_nonz(LP_Alicedestpubkey) != 0 && bits256_cmp(LP_Alicedestpubkey,Q.srchash) != 0 ) + { + printf("got reserved response from different node\n"); + return(retval); + } if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) @@ -801,7 +811,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { char str[65];//,str2[65]; recalc = 0; - if ( bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) + if ( bits256_nonz(Q.srchash) == 0 || bits256_cmp(Q.srchash,G.LP_mypub25519) != 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) { qprice = (double)Q.destsatoshis / Q.satoshis; strcpy(Q.gui,G.gui); @@ -1132,7 +1142,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); int32_t changed; LP_mypriceset(&changed,autxo->coin,base,1. / maxprice); - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid,destpubkey)); LP_RTmetrics_update(base,rel); while ( 1 ) @@ -1172,7 +1182,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel else return(clonestr("{\"error\":\"cant ordermatch to destpubkey\"}")); } printf("i.%d maxiters.%d qprice %.8f vs maxprice %.8f\n",i,maxiters,dstr(qprice),dstr(maxprice)); - return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid,destpubkey)); } return(clonestr("{\"error\":\"cant get here\"}")); } From 147d0b124998af842aa49d554abd8c020f2005c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 20:47:50 +0200 Subject: [PATCH 2442/2732] Test --- iguana/exchanges/LP_bitcoin.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 4106f0399..f2ebd671d 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3330,7 +3330,7 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { - int32_t i,n,len = 0,extraused=0; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + int32_t i,n,len = 0,extraused=0; uint32_t seglen; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) @@ -3432,7 +3432,14 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } if ( segwitflag != 0 ) { - + if ( rwflag != 0 ) + printf("unsupported rwflag.%d when segwitflag\n",rwflag); + else + { + len += iguana_rwvarint32(rwflag,&serialized[len],&seglen); + if ( seglen+len < maxsize ) + len += maxsize; + } } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); //printf("lock_time.%08x len.%d\n",msg->lock_time,len); From a3c72ca74d911627e13d94d19aa0f56d64c7fc6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 20:55:00 +0200 Subject: [PATCH 2443/2732] Test --- iguana/exchanges/LP_bitcoin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index f2ebd671d..d408de24d 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3361,7 +3361,10 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is The flag MUST be 0x01 */ if ( serialized[len] == 0x00 && (segwitflag= serialized[len+1]) == 0x01 ) + { len += 2; + printf("SEGWIT transaction\n"); + } } len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_in); if ( rwflag == 0 ) @@ -3437,6 +3440,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is else { len += iguana_rwvarint32(rwflag,&serialized[len],&seglen); + printf("witness len.%d sum %d vs max.%d\n",seglen,seglen+len,maxsize); if ( seglen+len < maxsize ) len += maxsize; } From 61368ea65751d22aa465fafa525682c025f84d85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:00:04 +0200 Subject: [PATCH 2444/2732] Test --- iguana/exchanges/LP_bitcoin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index d408de24d..5e4e78a33 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3366,6 +3366,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is printf("SEGWIT transaction\n"); } } + printf("segwit.%d \n",segwitflag); len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_in); if ( rwflag == 0 ) { From feb53d0648a797fa49d99b2c7b9286b3108ed076 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:02:50 +0200 Subject: [PATCH 2445/2732] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 5e4e78a33..ab3bd968a 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3628,7 +3628,7 @@ cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t txobj = cJSON_CreateObject(); jaddstr(txobj,"error","couldnt decode transaction"); } - //printf("msgtx.(%s)\n",jprint(txobj,0)); + printf("msgtx.(%s)\n",jprint(txobj,0)); if ( n != len ) { int32_t i; From 5bc027c57b8d50206b5d86090d8987e3591168c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:05:18 +0200 Subject: [PATCH 2446/2732] Test --- iguana/exchanges/LP_bitcoin.c | 4 ++-- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index ab3bd968a..c934ea48e 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3628,11 +3628,11 @@ cJSON *bitcoin_data2json(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t txobj = cJSON_CreateObject(); jaddstr(txobj,"error","couldnt decode transaction"); } - printf("msgtx.(%s)\n",jprint(txobj,0)); + //printf("msgtx.(%s)\n",jprint(txobj,0)); if ( n != len ) { int32_t i; - for (i=0; iserialized != 0 ) { - //char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); + char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); if ( (txobj= LP_transaction_fromdata(coin,txid,tx->serialized,tx->len)) != 0 ) { *retjsonp = txobj; From 3df69fab0a75c942661faec84ca87b98a623777b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:08:36 +0200 Subject: [PATCH 2447/2732] Test --- iguana/exchanges/LP_ordermatch.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 5a9b2031b..cb9a88bf9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -477,9 +477,15 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) { - if ( bits256_nonz(LP_Alicedestpubkey) != 0 && bits256_cmp(LP_Alicedestpubkey,qp->srchash) != 0 ) - return(-1); - else if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) //bits256_cmp(qp->srchash,qp2->srchash) == 0 && + if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) + { + if (bits256_cmp(LP_Alicedestpubkey,qp->srchash) != 0 ) + { + printf("reject quote from non-matching pubkey\n"); + return(-1); + } else printf("dont reject quote from destpubkey\n"); + } + if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) //bits256_cmp(qp->srchash,qp2->srchash) == 0 && return(0); else return(-1); } @@ -728,10 +734,13 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, //printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); - if ( bits256_nonz(LP_Alicedestpubkey) != 0 && bits256_cmp(LP_Alicedestpubkey,Q.srchash) != 0 ) + if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) { - printf("got reserved response from different node\n"); - return(retval); + if (bits256_cmp(LP_Alicedestpubkey,Q.srchash) != 0 ) + { + printf("got reserved response from different node %s\n",bits256_str(str,Q.srchash)); + return(retval); + } else printf("got reserved response from destpubkey %s\n",bits256_str(str,Q.srchash)); } if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { From 6f5bb98d6b3d2a978447bb70e812efe43f351622 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:13:26 +0200 Subject: [PATCH 2448/2732] Test --- iguana/exchanges/LP_bitcoin.c | 3 +-- iguana/exchanges/LP_socket.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index c934ea48e..19c34cf6b 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3350,7 +3350,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is if ( json != 0 ) jaddnum(json,"timestamp",msg->timestamp); } - if ( rwflag == 0 ) + if ( rwflag == 0 && zcash == 0 ) { /* normal: nVersion|txins|txouts|nLockTime. @@ -3366,7 +3366,6 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is printf("SEGWIT transaction\n"); } } - printf("segwit.%d \n",segwitflag); len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_in); if ( rwflag == 0 ) { diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 673412be8..96855e6d7 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -681,12 +681,12 @@ cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *seria cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) { char *hexstr,str[65]; int32_t len; cJSON *hexjson,*txobj=0; struct iguana_info *coin; uint8_t *serialized; struct LP_transaction *tx; - printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); + //printf("electrum_transaction %s %s\n",symbol,bits256_str(str,txid)); if ( bits256_nonz(txid) != 0 && (coin= LP_coinfind(symbol)) != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->serialized != 0 ) { - char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); + //char str[65]; printf("%s cache hit -> TRANSACTION.(%s)\n",symbol,bits256_str(str,txid)); if ( (txobj= LP_transaction_fromdata(coin,txid,tx->serialized,tx->len)) != 0 ) { *retjsonp = txobj; From e84cf291f30d757137bf896c16e65a93b83842a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:19:00 +0200 Subject: [PATCH 2449/2732] Test --- iguana/exchanges/LP_bitcoin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 19c34cf6b..373af373b 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3435,6 +3435,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } if ( segwitflag != 0 ) { + printf("tx_out %d, tx_in %d %02x %02x %02x\n",msg->tx_out,msg->tx_in,serialized[len],serialized[len+1],serialized[len+2]); if ( rwflag != 0 ) printf("unsupported rwflag.%d when segwitflag\n",rwflag); else From d9cca82171819ef9885908f6f5c71af6f6278dec Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:41:39 +0200 Subject: [PATCH 2450/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 96855e6d7..24aa88653 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -598,7 +598,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 0 && electrumflag > 1 ) + if ( electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) From 1c1c1467b273c6a4df4cfeccb77da72e30440653 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 21:49:48 +0200 Subject: [PATCH 2451/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 05ce41c36..0901d9c0b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -540,7 +540,7 @@ void LP_coinsloop(void *_coins) if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) free_json(retjson); } - HASH_ITER(hh,coin->addresses,ap,atmp) + if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { From 6ce04c99c883f44c9be0cb2b77d85defd662487e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:02:01 +0200 Subject: [PATCH 2452/2732] Test --- iguana/exchanges/LP_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 24aa88653..e200c5891 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -598,7 +598,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( electrumflag > 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) @@ -707,7 +707,7 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs { static uint32_t counter; if ( counter++ < 3 ) - printf("rawtransaction too big %d\n",(int32_t)strlen(hexstr)); + printf("rawtransaction %s %s too big %d\n",coin->symbol,bits256_str(str,txid),(int32_t)strlen(hexstr)); free(hexstr); free_json(hexjson); *retjsonp = cJSON_Parse("{\"error\":\"transaction too big\"}"); From f2a39dcc835bb3bf1d3b38cb1d74958585ec2815 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:13:25 +0200 Subject: [PATCH 2453/2732] Test --- iguana/exchanges/LP_transaction.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index bc582236c..6990da6e6 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -978,7 +978,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); } } - printf("numunspents.%d vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f\n",numunspents,n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum)); + printf("numunspents.%d vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f %s/v%d\n",numunspents,n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum),bits256_str(str,up->U.txid),up->U.vout); vp = &V[n++]; vp->N = vp->M = 1; vp->signers[0].privkey = privkey; @@ -1059,6 +1059,10 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); //return(0); } + char str[65]; + for (i=0; iU.txid),utxos[i]->U.vout,dstr(utxos[i]->U.value)); + ignore_cltverr = 0; suppress_pubkeys = 1; scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); From 0a84293c5d2c2f3acef0f22299d6314c29ffea3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:29:15 +0200 Subject: [PATCH 2454/2732] Test --- iguana/exchanges/LP_transaction.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6990da6e6..8ee70ca89 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1002,7 +1002,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout,uint32_t locktime) { static void *ctx; - cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[LP_MAXVINS]; struct LP_address *ap; + cJSON *txobj,*item,*array; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,n,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[LP_MAXVINS]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; @@ -1047,13 +1047,31 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } } - LP_listunspent_issue(coin->symbol,coin->smartaddr,1); + LP_listunspent_issue(coin->symbol,coin->smartaddr,2); if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) { printf("LP_createrawtransaction: cant find address data\n"); return(0); } memset(utxos,0,sizeof(utxos)); + if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) + { + int32_t vout,height; + ap->utxos = 0; + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; ismartaddr,txid,vout,value,height,-1); + } + } + } if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) { printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); From 7923b76d4311dd722f79c092fa4296f8bccae0ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:39:19 +0200 Subject: [PATCH 2455/2732] Test --- iguana/exchanges/LP_commands.c | 10 +++--- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_transaction.c | 56 ++++++++++++++++++------------- iguana/exchanges/LP_utxos.c | 1 + 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9d0f4ff47..a084c0e0d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -103,7 +103,7 @@ notarizations(coin)\n\ parselog()\n\ statsdisp(starttime=0, endtime=0, gui="", pubkey="")\n\ getrawtransaction(coin, txid)\n\ -inventory(coin)\n\ +inventory(coin, reset=0)\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce, destpubkey="")\n\ @@ -484,10 +484,12 @@ bot_resume(botid)\n\ struct iguana_info *ptr; if ( (ptr= LP_coinfind(coin)) != 0 ) { - //privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR); - //LP_utxopurge(0); LP_address(ptr,ptr->smartaddr); - LP_listunspent_issue(coin,ptr->smartaddr,2); + if ( jint(argjson,"reset") != 0 ) + { + LP_address_utxo_reset(ptr); + LP_passphrase_init(G.PASSPHRASE,G.gui); + } if ( bits256_nonz(G.LP_privkey) != 0 ) LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); else printf("no LP_privkey\n"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0901d9c0b..047c485c9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -122,7 +122,7 @@ struct LP_globals uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; int32_t LP_IAMLP,LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting,LP_numskips; - char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41],gui[16]; + char USERPASS[65],USERPASS_WIFSTR[64],PASSPHRASE[1024],LP_myrmd160str[41],gui[16]; struct LP_privkey LP_privkeys[100]; } G; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 8ee70ca89..574fcbbb2 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -999,10 +999,40 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(n); } +struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) +{ + struct LP_address *ap; int32_t i,n; cJSON *array,*item; int64_t value; bits256 txid; int32_t vout,height; + LP_listunspent_issue(coin->symbol,coin->smartaddr,2); + if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) + { + printf("LP_createrawtransaction: cant find address data\n"); + return(0); + } + if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) + { + ap->utxos = 0; + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; ismartaddr,txid,vout,value,height,-1); + } + } + free_json(array); + } + return(ap); +} + char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout,uint32_t locktime) { static void *ctx; - cJSON *txobj,*item,*array; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,n,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[LP_MAXVINS]; struct LP_address *ap; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],script[64],spendscript[256]; char *coinaddr,*rawtxbytes; bits256 txid; uint32_t timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,dustcombine,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0,numvins=0,numutxos=0; struct LP_address_utxo *utxos[LP_MAXVINS]; struct LP_address *ap; if ( ctx == 0 ) ctx = bitcoin_ctx(); *numvinsp = 0; @@ -1047,31 +1077,9 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } } - LP_listunspent_issue(coin->symbol,coin->smartaddr,2); - if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) - { - printf("LP_createrawtransaction: cant find address data\n"); + if ( (ap= LP_address_utxo_reset(coin)) == 0 ) return(0); - } memset(utxos,0,sizeof(utxos)); - if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) - { - int32_t vout,height; - ap->utxos = 0; - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; ismartaddr,txid,vout,value,height,-1); - } - } - } if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) { printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2d5a04915..3fbf10371 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -870,6 +870,7 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) } } memset(&G,0,sizeof(G)); + strcpy(G.PASSPHRASE,passphrase); LP_privkey_updates(ctx,LP_mypubsock,passphrase); init_hexbytes_noT(G.LP_myrmd160str,G.LP_myrmd160,20); G.LP_sessionid = (uint32_t)time(NULL); From f955f2a28f3587bd89ae4fab1738a1aa7cd1790d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:42:30 +0200 Subject: [PATCH 2456/2732] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3fbf10371..0c7fa39a5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -870,12 +870,13 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) } } memset(&G,0,sizeof(G)); - strcpy(G.PASSPHRASE,passphrase); LP_privkey_updates(ctx,LP_mypubsock,passphrase); init_hexbytes_noT(G.LP_myrmd160str,G.LP_myrmd160,20); G.LP_sessionid = (uint32_t)time(NULL); safecopy(G.gui,gui,sizeof(G.gui)); G.USERPASS_COUNTER = counter; + strcpy(G.PASSPHRASE,passphrase); + printf("set PASSPHRASE.(%s)\n",G.PASSPHRASE); G.initializing = 0; return(0); } From b9cc5ba6bb6d002628e6be7b09a7afe1b11ce8ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:46:20 +0200 Subject: [PATCH 2457/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxos.c | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a084c0e0d..9e68ead18 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -103,7 +103,7 @@ notarizations(coin)\n\ parselog()\n\ statsdisp(starttime=0, endtime=0, gui="", pubkey="")\n\ getrawtransaction(coin, txid)\n\ -inventory(coin, reset=0)\n\ +inventory(coin, reset=0, [passphrase=])\n\ bestfit(rel, relvolume)\n\ lastnonce()\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce, destpubkey="")\n\ @@ -488,7 +488,7 @@ bot_resume(botid)\n\ if ( jint(argjson,"reset") != 0 ) { LP_address_utxo_reset(ptr); - LP_passphrase_init(G.PASSPHRASE,G.gui); + LP_passphrase_init(jstr(argjson,"passphrase"),G.gui); } if ( bits256_nonz(G.LP_privkey) != 0 ) LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 047c485c9..0901d9c0b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -122,7 +122,7 @@ struct LP_globals uint8_t LP_myrmd160[20],LP_pubsecp[33]; uint32_t LP_sessionid,counter; int32_t LP_IAMLP,LP_pendingswaps,USERPASS_COUNTER,LP_numprivkeys,initializing,waiting,LP_numskips; - char USERPASS[65],USERPASS_WIFSTR[64],PASSPHRASE[1024],LP_myrmd160str[41],gui[16]; + char USERPASS[65],USERPASS_WIFSTR[64],LP_myrmd160str[41],gui[16]; struct LP_privkey LP_privkeys[100]; } G; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0c7fa39a5..2d5a04915 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -875,8 +875,6 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) G.LP_sessionid = (uint32_t)time(NULL); safecopy(G.gui,gui,sizeof(G.gui)); G.USERPASS_COUNTER = counter; - strcpy(G.PASSPHRASE,passphrase); - printf("set PASSPHRASE.(%s)\n",G.PASSPHRASE); G.initializing = 0; return(0); } From 1d7ac2dc9da2ef963acc7dce01e03e696ff1bfb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:55:29 +0200 Subject: [PATCH 2458/2732] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9e68ead18..eda89f9f7 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -488,6 +488,7 @@ bot_resume(botid)\n\ if ( jint(argjson,"reset") != 0 ) { LP_address_utxo_reset(ptr); + ptr->privkeydepth = 0; LP_passphrase_init(jstr(argjson,"passphrase"),G.gui); } if ( bits256_nonz(G.LP_privkey) != 0 ) From 06c4d96c866f6689c26c79985497af3fe43a3842 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 22:56:01 +0200 Subject: [PATCH 2459/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index eda89f9f7..3aca6ee1c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -484,11 +484,11 @@ bot_resume(botid)\n\ struct iguana_info *ptr; if ( (ptr= LP_coinfind(coin)) != 0 ) { + ptr->privkeydepth = 0; LP_address(ptr,ptr->smartaddr); if ( jint(argjson,"reset") != 0 ) { LP_address_utxo_reset(ptr); - ptr->privkeydepth = 0; LP_passphrase_init(jstr(argjson,"passphrase"),G.gui); } if ( bits256_nonz(G.LP_privkey) != 0 ) From d716a534da7412222b4a2542e2d1da1c4d4b9f2d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:01:06 +0200 Subject: [PATCH 2460/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/install | 2 +- iguana/exchanges/invreset | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100755 iguana/exchanges/invreset diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e200c5891..282124a6f 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -598,7 +598,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 0 && electrumflag > 1 ) + if ( 1 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 86709f0ab..efb2c7a2e 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/exchanges/invreset b/iguana/exchanges/invreset new file mode 100755 index 000000000..f0b1c79e3 --- /dev/null +++ b/iguana/exchanges/invreset @@ -0,0 +1,3 @@ +source userpass +source passphrase +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"KMD\",\"reset\":1,\"passphrase\":\"$passphrase\"}" From c874bfbe676682440489d61fec213dad6074f229 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:07:33 +0200 Subject: [PATCH 2461/2732] Test --- iguana/exchanges/LP_commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3aca6ee1c..5773bf88a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -388,13 +388,16 @@ bot_resume(botid)\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { char *coinaddr; + printf("listunspent\n"); if ( (coinaddr= jstr(argjson,"address")) != 0 ) { if ( coinaddr[0] != 0 ) { LP_address(ptr,coinaddr); + printf("check addr\n"); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { + printf("my addr\n"); LP_listunspent_issue(coin,coinaddr,2); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); From 0c30756bd149e613b76405a14f58142931191381 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:15:35 +0200 Subject: [PATCH 2462/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 574fcbbb2..661319305 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -989,7 +989,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); if ( remains <= 0 && i >= numpre-1 ) break; - if ( numunspents == 0 ) + if ( numunspents < 0 ) { printf("total %.8f not enough for amount %.8f\n",dstr(total),dstr(amount)); return(0); From 3db4ea83ef1de3c2247ffbc9701a43aba62dbcbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:23:13 +0200 Subject: [PATCH 2463/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2d5a04915..93d6ff688 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -550,7 +550,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri return(0); coin->privkeydepth++; LP_address(coin,coin->smartaddr); - //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); + printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); From 8dd3b6520637eb5e2867ffefedfd3d4f890337b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:26:02 +0200 Subject: [PATCH 2464/2732] Test --- iguana/exchanges/LP_commands.c | 3 --- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxos.c | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5773bf88a..3aca6ee1c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -388,16 +388,13 @@ bot_resume(botid)\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { char *coinaddr; - printf("listunspent\n"); if ( (coinaddr= jstr(argjson,"address")) != 0 ) { if ( coinaddr[0] != 0 ) { LP_address(ptr,coinaddr); - printf("check addr\n"); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - printf("my addr\n"); LP_listunspent_issue(coin,coinaddr,2); LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); //LP_smartutxos_push(ptr); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 282124a6f..e200c5891 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -598,7 +598,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { if ( jobj(retjson,"error") == 0 && is_cJSON_Array(retjson) != 0 ) { - if ( 1 && electrumflag > 1 ) + if ( 0 && electrumflag > 1 ) printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 93d6ff688..770b84b89 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -542,15 +542,15 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("coin not active\n"); return(0); } - if ( bits256_cmp(myprivkey,coin->lastprivkey) == 0 && time(NULL) < coin->lastprivkeytime+60 ) - return(0); + /*if ( bits256_cmp(myprivkey,coin->lastprivkey) == 0 && time(NULL) < coin->lastprivkeytime+60 ) + return(0);*/ coin->lastprivkey = myprivkey; coin->lastprivkeytime = (uint32_t)time(NULL); if ( coin->privkeydepth > 0 ) return(0); coin->privkeydepth++; LP_address(coin,coin->smartaddr); - printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); + //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); array = LP_listunspent(coin->symbol,coin->smartaddr); From 0660c741744b47f62c0b78a3511d33bb068455d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:47:27 +0200 Subject: [PATCH 2465/2732] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 770b84b89..8991e141c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -238,11 +238,11 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) // jl777 remove mempool HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { - //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( strcmp(symbol,utxo->coin) != 0 ) continue; if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { + char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); bestsize = 0; if ( bestutxo == 0 ) { @@ -273,7 +273,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; } bestutxo = utxo; - } // else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); + } else printf("skip alice utxo %.8f vs dest %.8f, bestsize.%d\n",dstr(utxo->S.satoshis),dstr(destsatoshis),bestsize); } } return(bestutxo); From ca4c233201dade6d1931de95ba23cae4fa7e7607 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:55:49 +0200 Subject: [PATCH 2466/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_utxos.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index cb9a88bf9..47fc78296 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1125,6 +1125,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); + printf("bestfit selected alice (%.8f %.8f) for %.8f sats %.8f\n",dstr(autxo->payment.value),dstr(autxo->fee.value),dstr(destsatoshis),dstr(autxo->S.satoshis)); if ( destsatoshis - desttxfee < autxo->S.satoshis ) { destsatoshis -= desttxfee; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8991e141c..0a5546d5e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -266,6 +266,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) } if ( bestsize > 0 ) { + printf("bestsize.%d %.8f %.8f\n",dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { //if ( utxo->T.spentflag == 0 ) @@ -273,7 +274,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; } bestutxo = utxo; - } else printf("skip alice utxo %.8f vs dest %.8f, bestsize.%d\n",dstr(utxo->S.satoshis),dstr(destsatoshis),bestsize); + } else printf("skip alice utxo %.8f vs dest %.8f, bestsize.%d %p\n",dstr(utxo->S.satoshis),dstr(destsatoshis),bestsize,bestutxo); } } return(bestutxo); From f4d9d95f7a6dd9a7eb02836125d2fa3c8a5b7d89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Nov 2017 23:59:18 +0200 Subject: [PATCH 2467/2732] Test --- iguana/exchanges/LP_utxos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0a5546d5e..96a20984e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -242,7 +242,8 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { - char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); + printf("(%.8f %.8f %.8f)\n",dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); + //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); bestsize = 0; if ( bestutxo == 0 ) { @@ -266,7 +267,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) } if ( bestsize > 0 ) { - printf("bestsize.%d %.8f %.8f\n",dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); + printf("bestsize.%d %.8f %.8f -> %.8f\n",bestsize,dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { //if ( utxo->T.spentflag == 0 ) From 194a356815d786b2b7787bfc446a047347919433 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:04:38 +0200 Subject: [PATCH 2468/2732] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 96a20984e..20aadc7a9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -414,7 +414,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - //printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); + printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,G.LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From e7f594d9968a26cc64054e1a6997a68c5ee6f190 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:11:46 +0200 Subject: [PATCH 2469/2732] Test --- iguana/exchanges/LP_utxos.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 20aadc7a9..5aa0d7554 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -414,7 +414,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<<\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob); + printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<< %.8f\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob,dstr(satoshis)); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,G.LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) @@ -538,7 +538,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { int32_t enable_utxos = 0; - char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,flag=0,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,value,total = 0; int64_t targetval; + char *script,destaddr[64]; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,flag=0,height,n,cmpflag,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,biggerval,value,total = 0; int64_t targetval; if ( coin == 0 || (IAMLP == 0 && coin->inactive != 0) ) { //printf("coin not active\n"); @@ -617,15 +617,15 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri depositvout = juint(item,"tx_pos"); script = coin->smartaddr; } - depositval = values[i]; + biggerval = values[i]; values[i] = 0, used++; if ( iambob == 0 ) - targetval = (depositval / 776) + txfee; - else targetval = (depositval / 9) * 8 + 2*txfee; + targetval = (biggerval / 776) + txfee; + else targetval = (biggerval / 9) * 8 + 2*txfee; if ( targetval < txfee*2 ) targetval = txfee*2; - //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(depositval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); - if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) + //printf("iambob.%d i.%d deposit %.8f min %.8f target %.8f\n",iambob,i,dstr(biggerval),dstr((1+LP_MINSIZE_TXFEEMULT)*txfee),dstr(targetval)); + if ( biggerval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; i = -1; if ( iambob != 0 ) @@ -637,7 +637,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } if ( i >= 0 || (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { - //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(biggerval),dstr(targetval)); item = jitem(array,i); cmpflag = 0; if ( coin->electrum == 0 ) @@ -660,14 +660,14 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) + if ( (utxo= LP_utxoadd(1,coin->symbol,txid,vout,value,deposittxid,depositvout,biggerval,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) { } } else { //printf("call utxoadd\n"); - if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,value)) != 0 ) + if ( (utxo= LP_utxoadd(0,coin->symbol,deposittxid,depositvout,biggerval,txid,vout,value,coin->smartaddr,mypub,LP_gui,G.LP_sessionid,biggerval)) != 0 ) { } } From 287310ae293e46098148bf1ad6fd8c0e09be564c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:17:30 +0200 Subject: [PATCH 2470/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_tradebots.c | 4 ++-- iguana/exchanges/LP_utxos.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 47fc78296..12e8dccb0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1125,7 +1125,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - printf("bestfit selected alice (%.8f %.8f) for %.8f sats %.8f\n",dstr(autxo->payment.value),dstr(autxo->fee.value),dstr(destsatoshis),dstr(autxo->S.satoshis)); + //printf("bestfit selected alice (%.8f %.8f) for %.8f sats %.8f\n",dstr(autxo->payment.value),dstr(autxo->fee.value),dstr(destsatoshis),dstr(autxo->S.satoshis)); if ( destsatoshis - desttxfee < autxo->S.satoshis ) { destsatoshis -= desttxfee; diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 1f6fa7c48..022b7d3d9 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -481,7 +481,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl else balance = LP_RTsmartbalance(relcoin); sum = (relvolume+2*dstr(txfees)) + 3 * ((relvolume+2*dstr(txfees))/777); printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); - if ( dstr(abalance) < relvolume && balance > sum+txfee ) + if ( dstr(abalance) < relvolume && balance > sum+2*txfee ) { retjson = cJSON_CreateObject(); jaddstr(retjson,"error","not enough funds"); @@ -492,7 +492,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl jaddnum(retjson,"txfees",dstr(txfees)); shortfall = (relvolume + dstr(txfees)) - dstr(balance); jaddnum(retjson,"shortfall",shortfall); - if ( balance >= sum+txfee ) + if ( balance > sum+2*txfee ) { char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item; outputjson = cJSON_CreateObject(); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5aa0d7554..b24c47ff3 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -242,7 +242,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { - printf("(%.8f %.8f %.8f)\n",dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); + //printf("(%.8f %.8f %.8f)\n",dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); bestsize = 0; if ( bestutxo == 0 ) @@ -267,7 +267,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) } if ( bestsize > 0 ) { - printf("bestsize.%d %.8f %.8f -> %.8f\n",bestsize,dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); + //printf("bestsize.%d %.8f %.8f -> %.8f\n",bestsize,dstr(utxo->payment.value),dstr(utxo->fee.value),dstr(utxo->S.satoshis)); if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { //if ( utxo->T.spentflag == 0 ) @@ -275,7 +275,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; } bestutxo = utxo; - } else printf("skip alice utxo %.8f vs dest %.8f, bestsize.%d %p\n",dstr(utxo->S.satoshis),dstr(destsatoshis),bestsize,bestutxo); + } //else printf("skip alice utxo %.8f vs dest %.8f, bestsize.%d %p\n",dstr(utxo->S.satoshis),dstr(destsatoshis),bestsize,bestutxo); } } return(bestutxo); @@ -414,7 +414,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,char *symbol,bits256 txid,int32_t printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); utxo->T.spentflag = (uint32_t)time(NULL); } - printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<< %.8f\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob,dstr(satoshis)); + //printf(" %s %.8f %.8f %p addutxo.%d (%s %s) session.%u iambob.%d <<<<<<<<<<<<<<< %.8f\n",symbol,dstr(value),dstr(value2),utxo,LP_ismine(utxo) > 0,bits256_str(str,utxo->payment.txid),bits256_str(str2,iambob != 0 ? utxo->deposit.txid : utxo->fee.txid),utxo->T.sessionid,iambob,dstr(satoshis)); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,G.LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From f892e94d3bd43470ec2d012a611b280d6b1a2ae6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:21:43 +0200 Subject: [PATCH 2471/2732] Test --- crypto777/iguana_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 153cd4529..8d461fa13 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -446,6 +446,7 @@ char *clonestr(char *str) return(clone); } +int32_t zeroval() { return(0); } int32_t safecopy(char *dest,char *src,long len) { @@ -459,6 +460,7 @@ int32_t safecopy(char *dest,char *src,long len) if ( i == len ) { printf("safecopy: %s too long %ld\n",src,len); + printf("divide by zero! %d\n",1/zeroval()); #ifdef __APPLE__ //getchar(); #endif From b457e62a9b158266128ea37c2c95bd5957898985 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:30:28 +0200 Subject: [PATCH 2472/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_tradebots.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index cda3f0348..ce65acb43 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -43,7 +43,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAXVINS 64 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 30 +#define LP_AUTOTRADE_TIMEOUT 60 #define ELECTRUM_TIMEOUT 7 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 022b7d3d9..ce3a6a65a 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -479,7 +479,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl if ( relcoin->electrum != 0 ) balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr); else balance = LP_RTsmartbalance(relcoin); - sum = (relvolume+2*dstr(txfees)) + 3 * ((relvolume+2*dstr(txfees))/777); + sum = (SATOSHIDEN*relvolume+2*dstr(txfees)) + 3 * ((SATOSHIDEN*relvolume+2*dstr(txfees))/777); printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); if ( dstr(abalance) < relvolume && balance > sum+2*txfee ) { From a93ea0a7f7a8bb094532b37cd02580b53e59e5cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:31:33 +0200 Subject: [PATCH 2473/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0901d9c0b..430b104dd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -856,8 +856,8 @@ void LP_reserved_msgs(void *ignore) if ( ignore == 0 ) break; if ( nonz != 0 ) - usleep(3000); - else usleep(25000); + usleep(1000); + else usleep(5000); } } From d7795cc3723cbead3c799c8fe43d742fa58f539a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:39:48 +0200 Subject: [PATCH 2474/2732] Test --- iguana/exchanges/LP_signatures.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 1ac171c03..6b5643bb6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -104,6 +104,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) { uint32_t rid,qid; + memset(qp,0,sizeof(*qp)); safecopy(qp->gui,LP_gui,sizeof(qp->gui)); safecopy(qp->srccoin,jstr(argjson,"base"),sizeof(qp->srccoin)); safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr)); From d738c7b99abdb37aeeaa03c888a56bd9536e0aa2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:40:07 +0200 Subject: [PATCH 2475/2732] Test --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 8d461fa13..e75257149 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -460,7 +460,7 @@ int32_t safecopy(char *dest,char *src,long len) if ( i == len ) { printf("safecopy: %s too long %ld\n",src,len); - printf("divide by zero! %d\n",1/zeroval()); + //printf("divide by zero! %d\n",1/zeroval()); #ifdef __APPLE__ //getchar(); #endif From b9a5c02bdfa6c90e4f18bebc88cb63e59ede1463 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 00:53:29 +0200 Subject: [PATCH 2476/2732] Test --- iguana/exchanges/LP_socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e200c5891..f345e9ab6 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -922,9 +922,11 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) if ( item->type == idnum ) { DL_DELETE(ep->pendingQ.list,item); - *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson)); + if ( resultjson != 0 ) + *((cJSON **)stritem->retptrp) = jduplicate(resultjson); + else *((cJSON **)stritem->retptrp) = strjson, strjson = 0; //printf("matched idnum.%d result.(%s)\n",idnum,jprint(*((cJSON **)stritem->retptrp),0)); - resultjson = strjson = 0; + //resultjson = strjson = 0; free(item); break; } From bcf793e545f9304ad315cc74930d277a53992490 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 01:10:50 +0200 Subject: [PATCH 2477/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_remember.c | 12 ++-- iguana/exchanges/LP_swap.c | 94 +++++++++++++++---------------- iguana/exchanges/LP_transaction.c | 78 ++++++++++++------------- 4 files changed, 93 insertions(+), 93 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ce65acb43..ec9a2eca5 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -347,7 +347,7 @@ struct LP_endpoint { int32_t pair; char ipaddr[64]; uint16_t port; }; struct basilisk_swap { - void *ctx; struct iguana_info bobcoin,alicecoin; struct LP_utxoinfo *utxo; + void *ctx; struct iguana_info *bobcoin,*alicecoin; struct LP_utxoinfo *utxo; struct LP_endpoint N; void (*balancingtrade)(struct basilisk_swap *swap,int32_t iambob); int32_t subsock,pushsock,connected,aliceunconf,depositunconf,paymentunconf; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 2180a498c..0820bf82b 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -47,10 +47,10 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,"\",\"txid\":\"%s\"",bits256_str(str,bits256_doublesha256(0,rawtx->txbytes,rawtx->I.datalen))); if ( rawtx == &swap->bobdeposit || rawtx == &swap->bobpayment ) { - LP_swap_coinaddr(&swap->bobcoin,coinaddr,0,rawtx->txbytes,rawtx->I.datalen,0); + LP_swap_coinaddr(swap->bobcoin,coinaddr,0,rawtx->txbytes,rawtx->I.datalen,0); if ( coinaddr[0] != 0 ) { - LP_importaddress(swap->bobcoin.symbol,coinaddr); + LP_importaddress(swap->bobcoin->symbol,coinaddr); if ( rawtx == &swap->bobdeposit ) safecopy(swap->Bdeposit,coinaddr,sizeof(swap->Bdeposit)); else safecopy(swap->Bpayment,coinaddr,sizeof(swap->Bpayment)); @@ -63,16 +63,16 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,",\"%s\":\"%s\"","Bpayment",swap->Bpayment); fprintf(fp,",\"expiration\":%u",swap->I.expiration); fprintf(fp,",\"iambob\":%d",swap->I.iambob); - fprintf(fp,",\"bobcoin\":\"%s\"",swap->bobcoin.symbol); - fprintf(fp,",\"alicecoin\":\"%s\"",swap->alicecoin.symbol); + fprintf(fp,",\"bobcoin\":\"%s\"",swap->bobcoin->symbol); + fprintf(fp,",\"alicecoin\":\"%s\"",swap->alicecoin->symbol); fprintf(fp,",\"lock\":%u",locktime); fprintf(fp,",\"amount\":%.8f",dstr(rawtx->I.amount)); if ( bits256_nonz(triggertxid) != 0 ) fprintf(fp,",\"trigger\":\"%s\"",bits256_str(str,triggertxid)); if ( bits256_nonz(swap->I.pubAm) != 0 && bits256_nonz(swap->I.pubBn) != 0 ) { - basilisk_alicescript(redeemscript,&len,script,0,coinaddr,swap->alicecoin.taddr,swap->alicecoin.p2shtype,swap->I.pubAm,swap->I.pubBn); - LP_importaddress(swap->alicecoin.symbol,coinaddr); + basilisk_alicescript(redeemscript,&len,script,0,coinaddr,swap->alicecoin->taddr,swap->alicecoin->p2shtype,swap->I.pubAm,swap->I.pubBn); + LP_importaddress(swap->alicecoin->symbol,coinaddr); fprintf(fp,",\"Apayment\":\"%s\"",coinaddr); } if ( rawtx->I.redeemlen > 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index fb6adf940..e803f48fd 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -620,9 +620,9 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = LP_MIN_TXFEE; else { - if ( strcmp(rawtx->coin->symbol,swap->bobcoin.symbol) == 0 ) + if ( strcmp(rawtx->coin->symbol,swap->bobcoin->symbol) == 0 ) txfee = swap->I.Btxfee; - else if ( strcmp(rawtx->coin->symbol,swap->alicecoin.symbol) == 0 ) + else if ( strcmp(rawtx->coin->symbol,swap->alicecoin->symbol) == 0 ) txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } @@ -783,12 +783,12 @@ void LP_bobloop(void *_swap) printf("error bobscripts payment\n"); else { - if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) + if ( strcmp(swap->alicecoin->symbol,"BTC") == 0 ) m = 0; else m = swap->I.aliceconfirms; - while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice + while ( (n= LP_numconfirms(swap->alicecoin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { - char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin->symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) @@ -801,7 +801,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin.symbol,swap->alicecoin.symbol)*2,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin->symbol,swap->alicecoin->symbol)*2,30); } } } @@ -840,12 +840,12 @@ void LP_aliceloop(void *_swap) printf("error sending alicepayment\n"); else { - if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) + if ( strcmp(swap->alicecoin->symbol,"BTC") == 0 ) m = 0; else m = swap->I.aliceconfirms; - while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) + while ( (n= LP_numconfirms(swap->alicecoin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { - char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin->symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } swap->sentflag = 1; @@ -853,21 +853,21 @@ void LP_aliceloop(void *_swap) printf("error waiting for bobpayment\n"); else { - while ( (n= LP_numconfirms(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) + while ( (n= LP_numconfirms(swap->bobcoin->symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { - char str[65];printf("%d wait for bobpayment %s numconfs.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); + char str[65];printf("%d wait for bobpayment %s numconfs.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin->symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(10); } /*if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); - while ( (n= LP_numconfirms(swap->alicecoin.symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) + while ( (n= LP_numconfirms(swap->alicecoin->symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) { - char str[65];printf("%d wait for alicespend %s numconfs.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); + char str[65];printf("%d wait for alicespend %s numconfs.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin->symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); }*/ if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin.symbol,swap->alicecoin.symbol)*2,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin->symbol,swap->alicecoin->symbol)*2,30); } } } @@ -1009,7 +1009,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 printf("bitcoin_swapinit %s Btxfee %.8f rejected\n",swap->I.req.src,dstr(swap->I.Btxfee)); return(0); } - swap->I.putduration = swap->I.callduration = LP_atomic_locktime(swap->bobcoin.symbol,swap->alicecoin.symbol); + swap->I.putduration = swap->I.callduration = LP_atomic_locktime(swap->bobcoin->symbol,swap->alicecoin->symbol); if ( optionduration < 0 ) swap->I.putduration -= optionduration; else if ( optionduration > 0 ) @@ -1058,27 +1058,27 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 return(0); } if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) - swap->alicecoin = *coin; + swap->alicecoin = coin; else { - printf("missing bobcoin.%p or missing alicecoin.%p src.%p dest.%p\n",&swap->bobcoin,&swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); + printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); free(swap); return(0); } if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) - swap->bobcoin = *coin; + swap->bobcoin = coin; else { - printf("missing bobcoin.%p or missing alicecoin.%p src.%p dest.%p\n",&swap->bobcoin,&swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); + printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); free(swap); return(0); } - if ( strcmp("BTC",swap->bobcoin.symbol) == 0 ) + if ( strcmp("BTC",swap->bobcoin->symbol) == 0 ) { swap->I.bobconfirms = (1 + sqrt(dstr(swap->I.bobsatoshis) * .1)); swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } - else if ( strcmp("BTC",swap->alicecoin.symbol) == 0 ) + else if ( strcmp("BTC",swap->alicecoin->symbol) == 0 ) { swap->I.aliceconfirms = (1 + sqrt(dstr(swap->I.alicesatoshis) * .1)); swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; @@ -1088,17 +1088,17 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } - if ( swap->bobcoin.isassetchain != 0 ) + if ( swap->bobcoin->isassetchain != 0 ) swap->I.bobconfirms = 1; - if ( swap->alicecoin.isassetchain != 0 ) + if ( swap->alicecoin->isassetchain != 0 ) swap->I.aliceconfirms = 1; - if ( swap->bobcoin.userconfirms > 0 ) - swap->I.bobconfirms = swap->bobcoin.userconfirms; - if ( swap->alicecoin.userconfirms > 0 ) - swap->I.aliceconfirms = swap->alicecoin.userconfirms; - if ( (swap->I.bobmaxconfirms= swap->bobcoin.maxconfirms) == 0 ) + if ( swap->bobcoin->userconfirms > 0 ) + swap->I.bobconfirms = swap->bobcoin->userconfirms; + if ( swap->alicecoin->userconfirms > 0 ) + swap->I.aliceconfirms = swap->alicecoin->userconfirms; + if ( (swap->I.bobmaxconfirms= swap->bobcoin->maxconfirms) == 0 ) swap->I.bobmaxconfirms = BASILISK_DEFAULT_MAXCONFIRMS; - if ( (swap->I.alicemaxconfirms= swap->alicecoin.maxconfirms) == 0 ) + if ( (swap->I.alicemaxconfirms= swap->alicecoin->maxconfirms) == 0 ) swap->I.alicemaxconfirms = BASILISK_DEFAULT_MAXCONFIRMS; if ( swap->I.bobconfirms > swap->I.bobmaxconfirms ) swap->I.bobconfirms = swap->I.bobmaxconfirms; @@ -1106,51 +1106,51 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.aliceconfirms = swap->I.alicemaxconfirms; swap->I.bobconfirms *= !swap->I.bobistrusted; swap->I.aliceconfirms *= !swap->I.aliceistrusted; - printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin.taddr,swap->alicecoin.taddr); + printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin->taddr,swap->alicecoin->taddr); if ( swap->I.iambob != 0 ) { - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin.txfee,0,0,jumblrflag); - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin->txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin->txfee,0,0,jumblrflag); bobpub33 = pubkey33; } else { - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,&swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin.txfee,0,0,jumblrflag); - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,&swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin.txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin->txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin->txfee,0,0,jumblrflag); alicepub33 = pubkey33; } swap->myfee.I.locktime = swap->I.started + 1; swap->otherfee.I.locktime = swap->I.started + 1; - basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,&swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin.txfee,4,0,jumblrflag); - basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); + basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin->txfee,4,0,jumblrflag); + basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); swap->bobrefund.I.suppress_pubkeys = 1; - basilisk_rawtx_setparms("aliceclaim",swap->I.req.quoteid,&swap->aliceclaim,&swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,alicepub33,jumblrflag); + basilisk_rawtx_setparms("aliceclaim",swap->I.req.quoteid,&swap->aliceclaim,swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,alicepub33,jumblrflag); swap->aliceclaim.I.suppress_pubkeys = 1; swap->aliceclaim.I.locktime = swap->I.started + swap->I.putduration+swap->I.callduration + 1; - basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,&swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + swap->bobcoin.txfee,3,0,jumblrflag); - basilisk_rawtx_setparms("alicespend",swap->I.req.quoteid,&swap->alicespend,&swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,alicepub33,jumblrflag); + basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + swap->bobcoin->txfee,3,0,jumblrflag); + basilisk_rawtx_setparms("alicespend",swap->I.req.quoteid,&swap->alicespend,swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,alicepub33,jumblrflag); swap->alicespend.I.suppress_pubkeys = 1; - basilisk_rawtx_setparms("bobreclaim",swap->I.req.quoteid,&swap->bobreclaim,&swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,bobpub33,jumblrflag); + basilisk_rawtx_setparms("bobreclaim",swap->I.req.quoteid,&swap->bobreclaim,swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,bobpub33,jumblrflag); swap->bobreclaim.I.suppress_pubkeys = 1; swap->bobreclaim.I.locktime = swap->I.started + swap->I.putduration + 1; - basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,&swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + swap->alicecoin.txfee,2,0,jumblrflag); - basilisk_rawtx_setparms("bobspend",swap->I.req.quoteid,&swap->bobspend,&swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,bobpub33,jumblrflag); + basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + swap->alicecoin->txfee,2,0,jumblrflag); + basilisk_rawtx_setparms("bobspend",swap->I.req.quoteid,&swap->bobspend,swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,bobpub33,jumblrflag); swap->bobspend.I.suppress_pubkeys = 1; - basilisk_rawtx_setparms("alicereclaim",swap->I.req.quoteid,&swap->alicereclaim,&swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,alicepub33,jumblrflag); + basilisk_rawtx_setparms("alicereclaim",swap->I.req.quoteid,&swap->alicereclaim,swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,alicepub33,jumblrflag); swap->alicereclaim.I.suppress_pubkeys = 1; swap->bobpayment.utxotxid = qp->txid, swap->bobpayment.utxovout = qp->vout; swap->bobdeposit.utxotxid = qp->txid2, swap->bobdeposit.utxovout = qp->vout2; swap->alicepayment.utxotxid = qp->desttxid, swap->alicepayment.utxovout = qp->destvout; - LP_mark_spent(swap->bobcoin.symbol,qp->txid,qp->vout); - LP_mark_spent(swap->bobcoin.symbol,qp->txid2,qp->vout2); - LP_mark_spent(swap->alicecoin.symbol,qp->desttxid,qp->destvout); + LP_mark_spent(swap->bobcoin->symbol,qp->txid,qp->vout); + LP_mark_spent(swap->bobcoin->symbol,qp->txid2,qp->vout2); + LP_mark_spent(swap->alicecoin->symbol,qp->desttxid,qp->destvout); if ( swap->I.iambob != 0 ) swap->otherfee.utxotxid = qp->feetxid, swap->otherfee.utxovout = qp->feevout; else { swap->myfee.utxotxid = qp->feetxid, swap->myfee.utxovout = qp->feevout; - LP_mark_spent(swap->alicecoin.symbol,qp->feetxid,qp->feevout); + LP_mark_spent(swap->alicecoin->symbol,qp->feetxid,qp->feevout); } char str[65],str2[65],str3[65]; printf("IAMBOB.%d %s %s %s\n",swap->I.iambob,bits256_str(str,qp->txid),bits256_str(str2,qp->txid2),bits256_str(str3,qp->feetxid)); return(swap); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 661319305..54c3045c0 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1230,7 +1230,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub return(-1); if ( strcmp(coin->smartaddr,vinaddr) != 0 ) { - printf("basilisk_rawtx_gen mismatched vinaddr.%s != %s\n",vinaddr,coin->smartaddr); + printf("basilisk_rawtx_gen mismatched %s vinaddr.%s != (%s)\n",coin->symbol,vinaddr,coin->smartaddr); return(-1); } argjson = cJSON_CreateObject(); @@ -1613,7 +1613,7 @@ int32_t basilisk_bobpayment_reclaim(struct basilisk_swap *swap,int32_t delay) len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); memcpy(swap->I.userdata_bobreclaim,userdata,len); swap->I.userdata_bobreclaimlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr,swap->bobcoin.zcash)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr,swap->bobcoin->zcash)) == 0 ) { for (i=0; ibobreclaim.I.datalen; i++) printf("%02x",swap->bobreclaim.txbytes[i]); @@ -1630,7 +1630,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) len = basilisk_swapuserdata(userdata,swap->I.privBn,0,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); memcpy(swap->I.userdata_bobrefund,userdata,len); swap->I.userdata_bobrefundlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin.zcash)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin->zcash)) == 0 ) { for (i=0; ibobrefund.I.datalen; i++) printf("%02x",swap->bobrefund.txbytes[i]); @@ -1674,15 +1674,15 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,int32_t genflag) { int32_t j; char coinaddr[64],checkaddr[64]; - bitcoin_address(coinaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->changermd160,20); + bitcoin_address(coinaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->changermd160,20); if ( genflag != 0 && swap->I.iambob == 0 ) printf("basilisk_bobscripts_set WARNING: alice generating BOB tx\n"); if ( depositflag == 0 ) { swap->bobpayment.I.spendlen = basilisk_bobscript(swap->bobpayment.I.rmd160,swap->bobpayment.redeemscript,&swap->bobpayment.I.redeemlen,swap->bobpayment.spendscript,0,&swap->bobpayment.I.locktime,&swap->bobpayment.I.secretstart,&swap->I,0); - bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); + bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); - //LP_importaddress(swap->bobcoin.symbol,swap->bobpayment.I.destaddr); + //LP_importaddress(swap->bobcoin->symbol,swap->bobpayment.I.destaddr); //int32_t i; for (i=0; ibobpayment.I.redeemlen; i++) // printf("%02x",swap->bobpayment.redeemscript[i]); //printf(" <- bobpayment redeem %d %s\n",i,swap->bobpayment.I.destaddr); @@ -1703,13 +1703,13 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i printf("%02x",swap->bobpayment.redeemscript[j]); printf(" <- redeem.%d\n",swap->bobpayment.I.redeemlen); printf(" <- GENERATED BOB PAYMENT.%d destaddr.(%s)\n",swap->bobpayment.I.datalen,swap->bobpayment.I.destaddr); - LP_swap_coinaddr(&swap->bobcoin,checkaddr,0,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); + LP_swap_coinaddr(swap->bobcoin,checkaddr,0,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); if ( strcmp(swap->bobpayment.I.destaddr,checkaddr) != 0 ) { printf("BOBPAYMENT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobpayment.I.destaddr,checkaddr); return(-1); } - LP_unspents_mark(swap->bobcoin.symbol,swap->bobpayment.vins); + LP_unspents_mark(swap->bobcoin->symbol,swap->bobpayment.vins); //printf("bobscripts set completed\n"); return(0); } @@ -1718,7 +1718,7 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i else { swap->bobdeposit.I.spendlen = basilisk_bobscript(swap->bobdeposit.I.rmd160,swap->bobdeposit.redeemscript,&swap->bobdeposit.I.redeemlen,swap->bobdeposit.spendscript,0,&swap->bobdeposit.I.locktime,&swap->bobdeposit.I.secretstart,&swap->I,1); - bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); //int32_t i; for (i=0; ibobdeposit.I.redeemlen; i++) // printf("%02x",swap->bobdeposit.redeemscript[i]); @@ -1736,13 +1736,13 @@ int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,i for (j=0; jbobdeposit.I.datalen; j++) printf("%02x",swap->bobdeposit.txbytes[j]); printf(" <- GENERATED BOB DEPOSIT.%d (%s)\n",swap->bobdeposit.I.datalen,swap->bobdeposit.I.destaddr); - LP_swap_coinaddr(&swap->bobcoin,checkaddr,0,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); + LP_swap_coinaddr(swap->bobcoin,checkaddr,0,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); if ( strcmp(swap->bobdeposit.I.destaddr,checkaddr) != 0 ) { printf("BOBDEPOSIT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobdeposit.I.destaddr,checkaddr); return(-1); } - LP_unspents_mark(swap->bobcoin.symbol,swap->bobdeposit.vins); + LP_unspents_mark(swap->bobcoin->symbol,swap->bobdeposit.vins); printf("bobscripts set completed\n"); return(0); } @@ -1758,7 +1758,7 @@ int32_t basilisk_alicepayment_spend(struct basilisk_swap *swap,struct basilisk_r { int32_t i,retval; printf("alicepayment_spend\n"); - swap->alicepayment.I.spendlen = basilisk_alicescript(swap->alicepayment.redeemscript,&swap->alicepayment.I.redeemlen,swap->alicepayment.spendscript,0,swap->alicepayment.I.destaddr,swap->alicecoin.p2shtype,swap->I.pubAm,swap->I.pubBn); + swap->alicepayment.I.spendlen = basilisk_alicescript(swap->alicepayment.redeemscript,&swap->alicepayment.I.redeemlen,swap->alicepayment.spendscript,0,swap->alicepayment.I.destaddr,swap->alicecoin->p2shtype,swap->I.pubAm,swap->I.pubBn); printf("alicepayment_spend len.%d\n",swap->alicepayment.I.spendlen); if ( swap->I.iambob == 0 ) { @@ -1770,7 +1770,7 @@ int32_t basilisk_alicepayment_spend(struct basilisk_swap *swap,struct basilisk_r memcpy(swap->I.userdata_bobspend,swap->alicepayment.redeemscript,swap->alicepayment.I.spendlen); swap->I.userdata_bobspendlen = swap->alicepayment.I.spendlen; } - if ( (retval= basilisk_rawtx_sign(swap->alicecoin.symbol,swap->alicecoin.pubtype,swap->alicecoin.p2shtype,swap->alicecoin.isPoS,swap->alicecoin.wiftype,swap,dest,&swap->alicepayment,swap->I.privAm,&swap->I.privBn,0,0,1,swap->changermd160)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->alicecoin->symbol,swap->alicecoin->pubtype,swap->alicecoin->p2shtype,swap->alicecoin->isPoS,swap->alicecoin->wiftype,swap,dest,&swap->alicepayment,swap->I.privAm,&swap->I.privBn,0,0,1,swap->changermd160)) == 0 ) { for (i=0; iI.datalen; i++) printf("%02x",dest->txbytes[i]); @@ -1802,26 +1802,26 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d printf("error alice generating payment.%d\n",swap->alicepayment.I.spendlen); else { - bitcoin_address(swap->alicepayment.I.destaddr,swap->alicecoin.taddr,swap->alicecoin.p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); - //LP_importaddress(swap->alicecoin.symbol,swap->alicepayment.I.destaddr); + bitcoin_address(swap->alicepayment.I.destaddr,swap->alicecoin->taddr,swap->alicecoin->p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); + //LP_importaddress(swap->alicecoin->symbol,swap->alicepayment.I.destaddr); strcpy(swap->alicepayment.p2shaddr,swap->alicepayment.I.destaddr); retval = 0; for (i=0; ialicepayment.I.datalen; i++) printf("%02x",swap->alicepayment.txbytes[i]); printf(" ALICE PAYMENT created.(%s)\n",swap->alicepayment.I.destaddr); - LP_unspents_mark(swap->alicecoin.symbol,swap->alicepayment.vins); - //LP_importaddress(swap->alicecoin.symbol,swap->alicepayment.I.destaddr); + LP_unspents_mark(swap->alicecoin->symbol,swap->alicepayment.vins); + //LP_importaddress(swap->alicecoin->symbol,swap->alicepayment.I.destaddr); //basilisk_txlog(swap,&swap->alicepayment,-1); } if ( swap->myfee.I.datalen == 0 ) { - printf("generate fee %.8f\n",dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); - bitcoin_address(coinaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->changermd160,20); + printf("%s generate fee %.8f from.%s\n",swap->alicecoin->symbol,dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee),swap->alicecoin->smartaddr); + bitcoin_address(coinaddr,swap->alicecoin->taddr,swap->alicecoin->pubtype,swap->changermd160,20); if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,swap->myfee.I.locktime,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) { printf("rawtxsend %s %.8f\n",swap->myfee.coin->symbol,dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); swap->I.statebits |= LP_swapdata_rawtxsend(pairsock,swap,0x80,data,maxlen,&swap->myfee,0x40,0); - LP_unspents_mark(swap->I.iambob!=0?swap->bobcoin.symbol:swap->alicecoin.symbol,swap->myfee.vins); + LP_unspents_mark(swap->I.iambob!=0?swap->bobcoin->symbol:swap->alicecoin->symbol,swap->myfee.vins); //basilisk_txlog(swap,&swap->myfee,-1); for (i=0; imyfee.I.datalen; i++) printf("%02x",swap->myfee.txbytes[i]); @@ -1845,7 +1845,7 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { int32_t diff; - if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) + if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) { printf("otherfee amount %.8f -> %s vs %s locktime %u vs %u\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr,swap->otherfee.I.locktime,swap->I.started+1); if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) @@ -1864,7 +1864,7 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data int32_t LP_verify_alicespend(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->alicespend,0,data,datalen,0) == 0 ) + if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->alicespend,0,data,datalen,0) == 0 ) { printf("alicespend amount %.8f -> %s vs %s\n",dstr(swap->alicespend.I.amount),swap->alicespend.p2shaddr,swap->alicespend.I.destaddr); if ( strcmp(swap->alicespend.I.destaddr,swap->alicespend.p2shaddr) == 0 ) @@ -1886,10 +1886,10 @@ int32_t LP_verify_alicespend(struct basilisk_swap *swap,uint8_t *data,int32_t da int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { uint8_t userdata[512]; int32_t retval=-1,len = 0; static bits256 zero; - if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->bobdeposit,0,data,datalen,0) == 0 ) + if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->bobdeposit,0,data,datalen,0) == 0 ) { swap->aliceclaim.utxovout = 0; - swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,swap->bobcoin.symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); + swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,swap->bobcoin->symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); if ( bits256_nonz(swap->bobdeposit.I.signedtxid) != 0 ) swap->depositunconf = 1; else swap->bobdeposit.I.signedtxid = swap->bobdeposit.I.actualtxid; @@ -1897,7 +1897,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da swap->aliceclaim.utxotxid = swap->bobdeposit.I.signedtxid; memcpy(swap->I.userdata_aliceclaim,userdata,len); swap->I.userdata_aliceclaimlen = len; - bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); basilisk_dontforget_update(swap,&swap->bobdeposit); //int32_t i; char str[65]; for (i=0; ibobdeposit.I.datalen; i++) @@ -1909,9 +1909,9 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da memcpy(swap->aliceclaim.redeemscript,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); swap->aliceclaim.I.redeemlen = swap->bobdeposit.I.redeemlen; memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); - bitcoin_address(swap->aliceclaim.I.destaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->persistent_pubkey33,33); + bitcoin_address(swap->aliceclaim.I.destaddr,swap->alicecoin->taddr,swap->alicecoin->pubtype,swap->persistent_pubkey33,33); retval = 0; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin.zcash)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin->zcash)) == 0 ) { int32_t i; for (i=0; ibobdeposit.I.datalen; i++) printf("%02x",swap->bobdeposit.txbytes[i]); @@ -1920,7 +1920,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->aliceclaim.txbytes[i]); printf(" <- aliceclaim\n"); //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,0,60)); + return(LP_waitmempool(swap->bobcoin->symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,0,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); } printf("error with bobdeposit\n"); @@ -1929,18 +1929,18 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da int32_t LP_verify_alicepayment(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - if ( LP_rawtx_spendscript(swap,swap->alicecoin.longestchain,&swap->alicepayment,0,data,datalen,0) == 0 ) + if ( LP_rawtx_spendscript(swap,swap->alicecoin->longestchain,&swap->alicepayment,0,data,datalen,0) == 0 ) { swap->bobspend.utxovout = 0; - swap->bobspend.utxotxid = swap->alicepayment.I.signedtxid = LP_broadcast_tx(swap->alicepayment.name,swap->alicecoin.symbol,swap->alicepayment.txbytes,swap->alicepayment.I.datalen); - bitcoin_address(swap->alicepayment.p2shaddr,swap->alicecoin.taddr,swap->alicecoin.p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); + swap->bobspend.utxotxid = swap->alicepayment.I.signedtxid = LP_broadcast_tx(swap->alicepayment.name,swap->alicecoin->symbol,swap->alicepayment.txbytes,swap->alicepayment.I.datalen); + bitcoin_address(swap->alicepayment.p2shaddr,swap->alicecoin->taddr,swap->alicecoin->p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); strcpy(swap->alicepayment.I.destaddr,swap->alicepayment.p2shaddr); if ( bits256_nonz(swap->alicepayment.I.signedtxid) != 0 ) swap->aliceunconf = 1; basilisk_dontforget_update(swap,&swap->alicepayment); - return(LP_waitmempool(swap->alicecoin.symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,60)); + return(LP_waitmempool(swap->alicecoin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,60)); //printf("import alicepayment address.(%s)\n",swap->alicepayment.p2shaddr); - //LP_importaddress(swap->alicecoin.symbol,swap->alicepayment.p2shaddr); + //LP_importaddress(swap->alicecoin->symbol,swap->alicepayment.p2shaddr); return(0); } printf("error validating alicepayment\n"); @@ -1951,7 +1951,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da { uint8_t userdata[512]; int32_t i,retval=-1,len = 0; bits256 revAm; memset(revAm.bytes,0,sizeof(revAm)); - if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->bobpayment,0,data,datalen,0) == 0 ) + if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->bobpayment,0,data,datalen,0) == 0 ) { swap->alicespend.utxovout = 0; swap->alicespend.utxotxid = swap->bobpayment.I.signedtxid = LP_broadcast_tx(swap->bobpayment.name,swap->bobpayment.coin->symbol,swap->bobpayment.txbytes,swap->bobpayment.I.datalen); @@ -1960,10 +1960,10 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da for (i=0; i<32; i++) revAm.bytes[i] = swap->I.privAm.bytes[31-i]; len = basilisk_swapuserdata(userdata,revAm,0,swap->I.myprivs[0],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); - bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); + bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); basilisk_dontforget_update(swap,&swap->bobpayment); - //LP_importaddress(swap->bobcoin.symbol,swap->bobpayment.I.destaddr); + //LP_importaddress(swap->bobcoin->symbol,swap->bobpayment.I.destaddr); /*for (i=0; ibobpayment.I.datalen; i++) printf("%02x",swap->bobpayment.txbytes[i]); printf(" <- bobpayment.%d\n",swap->bobpayment.I.datalen); @@ -1974,9 +1974,9 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da swap->I.userdata_alicespendlen = len; retval = 0; memcpy(swap->alicespend.I.pubkey33,swap->persistent_pubkey33,33); - bitcoin_address(swap->alicespend.I.destaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->persistent_pubkey33,33); + bitcoin_address(swap->alicespend.I.destaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->persistent_pubkey33,33); //char str[65],str2[65]; printf("bobpaid privAm.(%s) myprivs[0].(%s)\n",bits256_str(str,swap->I.privAm),bits256_str(str2,swap->I.myprivs[0])); - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr,swap->bobcoin.zcash)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr,swap->bobcoin->zcash)) == 0 ) { /*for (i=0; ibobpayment.I.datalen; i++) printf("%02x",swap->bobpayment.txbytes[i]); @@ -1985,7 +1985,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da printf("%02x",swap->alicespend.txbytes[i]); printf(" <- alicespend\n\n");*/ swap->I.alicespent = 1; - return(LP_waitmempool(swap->bobcoin.symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,60)); + return(LP_waitmempool(swap->bobcoin->symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,60)); } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->alicespend.I.suppress_pubkeys,swap->bobpayment.I.destaddr); } printf("error validating bobpayment\n"); From 90d9f06d4448ac5a7e94323c3a5f719693fecb51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 01:16:40 +0200 Subject: [PATCH 2478/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 12e8dccb0..f65f88370 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -719,7 +719,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - //printf("LP_tradecommand: check received method %12s aliceid.%16llx %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); + printf("LP_tradecommand: check received method %12s aliceid.%16llx %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; From 262a9b132c23792aead7da4e1cc3ea42965f0fdd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 01:22:17 +0200 Subject: [PATCH 2479/2732] Test --- iguana/exchanges/LP_swap.c | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e803f48fd..008bdf45f 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -801,7 +801,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin->symbol,swap->alicecoin->symbol)*2,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->I.bobstr,swap->I.alicestr)*2,30); } } } @@ -867,7 +867,7 @@ void LP_aliceloop(void *_swap) }*/ if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->bobcoin->symbol,swap->alicecoin->symbol)*2,30); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->I.bobstr,swap->I.alicestr)*2,30); } } } @@ -999,6 +999,24 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 { //FILE *fp; char fname[512]; uint8_t *alicepub33=0,*bobpub33=0; int32_t jumblrflag=-2,x = -1; struct iguana_info *coin; + strcpy(swap->I.bobstr,swap->I.req.src); + strcpy(swap->I.alicestr,swap->I.req.dest); + if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) + swap->alicecoin = coin; + else + { + printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); + free(swap); + return(0); + } + if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) + swap->bobcoin = coin; + else + { + printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); + free(swap); + return(0); + } if ( (swap->I.Atxfee= qp->desttxfee) < 0 ) { printf("bitcoin_swapinit %s Atxfee %.8f rejected\n",swap->I.req.dest,dstr(swap->I.Atxfee)); @@ -1009,7 +1027,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 printf("bitcoin_swapinit %s Btxfee %.8f rejected\n",swap->I.req.src,dstr(swap->I.Btxfee)); return(0); } - swap->I.putduration = swap->I.callduration = LP_atomic_locktime(swap->bobcoin->symbol,swap->alicecoin->symbol); + swap->I.putduration = swap->I.callduration = LP_atomic_locktime(swap->I.bobstr,swap->I.alicestr); if ( optionduration < 0 ) swap->I.putduration -= optionduration; else if ( optionduration > 0 ) @@ -1028,8 +1046,6 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.bobinsurance = LP_MIN_TXFEE; if ( (swap->I.aliceinsurance= (swap->I.alicesatoshis / INSTANTDEX_INSURANCEDIV)) < LP_MIN_TXFEE ) swap->I.aliceinsurance = LP_MIN_TXFEE; - strcpy(swap->I.bobstr,swap->I.req.src); - strcpy(swap->I.alicestr,swap->I.req.dest); swap->I.started = (uint32_t)time(NULL); swap->I.expiration = swap->I.req.timestamp + swap->I.putduration + swap->I.callduration; OS_randombytes((uint8_t *)&swap->I.choosei,sizeof(swap->I.choosei)); @@ -1057,22 +1073,6 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 char str[65]; printf("couldnt generate privkeys %d %s\n",x,bits256_str(str,privkey)); return(0); } - if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) - swap->alicecoin = coin; - else - { - printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); - free(swap); - return(0); - } - if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) - swap->bobcoin = coin; - else - { - printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); - free(swap); - return(0); - } if ( strcmp("BTC",swap->bobcoin->symbol) == 0 ) { swap->I.bobconfirms = (1 + sqrt(dstr(swap->I.bobsatoshis) * .1)); From fa9f638ebec8105b53dd3a94928b1a1e46750273 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 01:46:28 +0200 Subject: [PATCH 2480/2732] Use decker's condition --- iguana/exchanges/LP_tradebots.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index ce3a6a65a..12d93436c 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -481,7 +481,8 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl else balance = LP_RTsmartbalance(relcoin); sum = (SATOSHIDEN*relvolume+2*dstr(txfees)) + 3 * ((SATOSHIDEN*relvolume+2*dstr(txfees))/777); printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); - if ( dstr(abalance) < relvolume && balance > sum+2*txfee ) + if ( (dstr(abalance + txfees) < relvolume) || (dstr(balance - abalance) < dstr(balance - abalance + txfees)) ) + //if ( dstr(abalance) < relvolume && balance > sum+2*txfee ) { retjson = cJSON_CreateObject(); jaddstr(retjson,"error","not enough funds"); From 7e70c96a1a7fc7ee1b63e6439f3d1b224d404115 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 01:51:05 +0200 Subject: [PATCH 2481/2732] Test --- iguana/exchanges/LP_swap.c | 3 ++- iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 008bdf45f..c98cc0dd9 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -969,6 +969,7 @@ void basilisk_rawtx_setparms(char *name,uint32_t quoteid,struct basilisk_rawtx * #endif strcpy(rawtx->name,name); rawtx->coin = coin; + printf("set coin.%s %s -> %s\n",coin->symbol,coin->smartaddr,name); strcpy(rawtx->I.coinstr,coin->symbol); rawtx->I.numconfirms = numconfirms; if ( (rawtx->I.amount= satoshis) < LP_MIN_TXFEE ) @@ -1152,7 +1153,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->myfee.utxotxid = qp->feetxid, swap->myfee.utxovout = qp->feevout; LP_mark_spent(swap->alicecoin->symbol,qp->feetxid,qp->feevout); } - char str[65],str2[65],str3[65]; printf("IAMBOB.%d %s %s %s\n",swap->I.iambob,bits256_str(str,qp->txid),bits256_str(str2,qp->txid2),bits256_str(str3,qp->feetxid)); + char str[65],str2[65],str3[65]; printf("IAMBOB.%d %s %s %s [%s %s]\n",swap->I.iambob,bits256_str(str,qp->txid),bits256_str(str2,qp->txid2),bits256_str(str3,qp->feetxid),swap->bobcoin->symbol,swap->alicecoin->symbol); return(swap); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 54c3045c0..453cd0fd4 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1230,8 +1230,8 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub return(-1); if ( strcmp(coin->smartaddr,vinaddr) != 0 ) { - printf("basilisk_rawtx_gen mismatched %s vinaddr.%s != (%s)\n",coin->symbol,vinaddr,coin->smartaddr); - return(-1); + printf("???????????????????????? basilisk_rawtx_gen mismatched %s vinaddr.%s != (%s)\n",coin->symbol,vinaddr,coin->smartaddr); + //return(-1); } argjson = cJSON_CreateObject(); jaddbits256(argjson,"utxotxid",rawtx->utxotxid); From e1b227ef25cec4998d7d8bf7f85810cdcd3a7f00 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 02:32:32 +0200 Subject: [PATCH 2482/2732] Test --- iguana/exchanges/LP_include.h | 7 +- iguana/exchanges/LP_remember.c | 20 +- iguana/exchanges/LP_statemachine.c | 18 - iguana/exchanges/LP_swap.c | 130 ++++---- iguana/exchanges/LP_tradebots.c | 2 +- iguana/exchanges/LP_transaction.c | 516 +++++++++++++++-------------- 6 files changed, 354 insertions(+), 339 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ec9a2eca5..839333523 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -166,7 +166,7 @@ struct basilisk_swap; struct basilisk_rawtxinfo { - char destaddr[64],coinstr[128]; + char destaddr[64]; bits256 txid,signedtxid,actualtxid; int64_t amount,change,inputsum; int32_t redeemlen,datalen,completed,vintype,vouttype,numconfirms,spendlen,secretstart,suppress_pubkeys; @@ -187,10 +187,9 @@ struct basilisk_request struct basilisk_rawtx { - char name[32]; + char name[32],symbol[65]; struct iguana_msgtx msgtx; struct basilisk_rawtxinfo I; - struct iguana_info *coin; char vinstr[8192],p2shaddr[64]; cJSON *vins; bits256 utxotxid; int32_t utxovout; @@ -347,7 +346,7 @@ struct LP_endpoint { int32_t pair; char ipaddr[64]; uint16_t port; }; struct basilisk_swap { - void *ctx; struct iguana_info *bobcoin,*alicecoin; struct LP_utxoinfo *utxo; + void *ctx; struct LP_utxoinfo *utxo; struct LP_endpoint N; void (*balancingtrade)(struct basilisk_swap *swap,int32_t iambob); int32_t subsock,pushsock,connected,aliceunconf,depositunconf,paymentunconf; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 0820bf82b..d8b264e7c 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -32,13 +32,15 @@ void basilisk_dontforget_userdata(char *userdataname,FILE *fp,uint8_t *script,in void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx,int32_t locktime,bits256 triggertxid) { - char zeroes[32],fname[512],str[65],coinaddr[64],secretAmstr[41],secretAm256str[65],secretBnstr[41],secretBn256str[65]; FILE *fp; int32_t i,len; uint8_t redeemscript[256],script[256]; + char zeroes[32],fname[512],str[65],coinaddr[64],secretAmstr[41],secretAm256str[65],secretBnstr[41],secretBn256str[65]; FILE *fp; int32_t i,len; uint8_t redeemscript[256],script[256]; struct iguana_info *bobcoin,*alicecoin; sprintf(fname,"%s/SWAPS/%u-%u.%s",GLOBAL_DBDIR,swap->I.req.requestid,swap->I.req.quoteid,rawtx->name), OS_compatible_path(fname); + bobcoin = LP_coinfind(swap->I.bobstr); + alicecoin = LP_coinfind(swap->I.alicestr); coinaddr[0] = secretAmstr[0] = secretAm256str[0] = secretBnstr[0] = secretBn256str[0] = 0; memset(zeroes,0,sizeof(zeroes)); - if ( rawtx != 0 && (fp= fopen(fname,"wb")) != 0 ) + if ( alicecoin != 0 && bobcoin != 0 && rawtx != 0 && (fp= fopen(fname,"wb")) != 0 ) { - fprintf(fp,"{\"name\":\"%s\",\"coin\":\"%s\"",rawtx->name,rawtx->coin->symbol); + fprintf(fp,"{\"name\":\"%s\",\"coin\":\"%s\"",rawtx->name,rawtx->symbol); if ( rawtx->I.datalen > 0 ) { fprintf(fp,",\"tx\":\""); @@ -47,10 +49,10 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,"\",\"txid\":\"%s\"",bits256_str(str,bits256_doublesha256(0,rawtx->txbytes,rawtx->I.datalen))); if ( rawtx == &swap->bobdeposit || rawtx == &swap->bobpayment ) { - LP_swap_coinaddr(swap->bobcoin,coinaddr,0,rawtx->txbytes,rawtx->I.datalen,0); + LP_swap_coinaddr(bobcoin,coinaddr,0,rawtx->txbytes,rawtx->I.datalen,0); if ( coinaddr[0] != 0 ) { - LP_importaddress(swap->bobcoin->symbol,coinaddr); + LP_importaddress(swap->I.bobstr,coinaddr); if ( rawtx == &swap->bobdeposit ) safecopy(swap->Bdeposit,coinaddr,sizeof(swap->Bdeposit)); else safecopy(swap->Bpayment,coinaddr,sizeof(swap->Bpayment)); @@ -63,16 +65,16 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx fprintf(fp,",\"%s\":\"%s\"","Bpayment",swap->Bpayment); fprintf(fp,",\"expiration\":%u",swap->I.expiration); fprintf(fp,",\"iambob\":%d",swap->I.iambob); - fprintf(fp,",\"bobcoin\":\"%s\"",swap->bobcoin->symbol); - fprintf(fp,",\"alicecoin\":\"%s\"",swap->alicecoin->symbol); + fprintf(fp,",\"bobcoin\":\"%s\"",swap->I.bobstr); + fprintf(fp,",\"alicecoin\":\"%s\"",swap->I.alicestr); fprintf(fp,",\"lock\":%u",locktime); fprintf(fp,",\"amount\":%.8f",dstr(rawtx->I.amount)); if ( bits256_nonz(triggertxid) != 0 ) fprintf(fp,",\"trigger\":\"%s\"",bits256_str(str,triggertxid)); if ( bits256_nonz(swap->I.pubAm) != 0 && bits256_nonz(swap->I.pubBn) != 0 ) { - basilisk_alicescript(redeemscript,&len,script,0,coinaddr,swap->alicecoin->taddr,swap->alicecoin->p2shtype,swap->I.pubAm,swap->I.pubBn); - LP_importaddress(swap->alicecoin->symbol,coinaddr); + basilisk_alicescript(redeemscript,&len,script,0,coinaddr,alicecoin->taddr,alicecoin->p2shtype,swap->I.pubAm,swap->I.pubBn); + LP_importaddress(swap->I.alicestr,coinaddr); fprintf(fp,",\"Apayment\":\"%s\"",coinaddr); } if ( rawtx->I.redeemlen > 0 ) diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 6bb33ffcc..b267364df 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -595,24 +595,6 @@ void basilisk_swap_saveupdate(struct basilisk_swap *swap) } } -/*int32_t basilisk_swap_loadtx(struct basilisk_rawtx *rawtx,FILE *fp,char *bobcoinstr,char *alicecoinstr) - { - if ( fread(rawtx,1,sizeof(*rawtx),fp) == sizeof(*rawtx) ) - { - rawtx->coin = 0; - rawtx->vins = 0; - if ( strcmp(rawtx->I.coinstr,bobcoinstr) == 0 || strcmp(rawtx->I.coinstr,alicecoinstr) == 0 ) - { - rawtx->coin = LP_coinfind(rawtx->I.coinstr); - if ( rawtx->vinstr[0] != 0 ) - rawtx->vins = cJSON_Parse(rawtx->vinstr); - printf("loaded.%s len.%d\n",rawtx->name,rawtx->I.datalen); - return(0); - } - } - return(-1); - }*/ - void basilisk_swap_sendabort(struct basilisk_swap *swap) { uint32_t msgbits = 0; uint8_t buf[sizeof(msgbits) + sizeof(swap->I.req.quoteid) + sizeof(bits256)*2]; int32_t sentbytes,offset=0; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index c98cc0dd9..ce1b725da 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -556,7 +556,12 @@ struct basilisk_rawtx *LP_swapdata_rawtx(struct basilisk_swap *swap,uint8_t *dat int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct basilisk_rawtx *rawtx,int32_t v,uint8_t *recvbuf,int32_t recvlen,int32_t suppress_pubkeys) { - bits256 otherhash,myhash,txid; int64_t txfee,val; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; + bits256 otherhash,myhash,txid; int64_t txfee,val; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; struct iguana_info *coin; + if ( (coin= LP_coinfind(rawtx->symbol)) == 0 ) + { + printf("LP_rawtx_spendscript couldnt find coin.(%s)\n",rawtx->symbol); + return(-1); + } for (i=0; i<32; i++) otherhash.bytes[i] = recvbuf[offset++]; for (i=0; i<32; i++) @@ -577,9 +582,9 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba memcpy(rawtx->redeemscript,&data[datalen],rawtx->I.redeemlen); //for (i=0; iI.redeemlen; i++) // printf("%02x",rawtx->redeemscript[i]); - bitcoin_address(redeemaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->redeemscript,rawtx->I.redeemlen); - //printf(" received redeemscript.(%s) %s taddr.%d\n",redeemaddr,rawtx->coin->symbol,rawtx->coin->taddr); - LP_swap_coinaddr(rawtx->coin,checkaddr,0,data,datalen,0); + bitcoin_address(redeemaddr,coin->taddr,coin->p2shtype,rawtx->redeemscript,rawtx->I.redeemlen); + //printf(" received redeemscript.(%s) %s taddr.%d\n",redeemaddr,coin->symbol,coin->taddr); + LP_swap_coinaddr(coin,checkaddr,0,data,datalen,0); if ( strcmp(redeemaddr,checkaddr) != 0 ) { printf("REDEEMADDR MISMATCH??? %s != %s\n",redeemaddr,checkaddr); @@ -609,20 +614,20 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba char str[65]; printf("rawtx.%s txid %s\n",rawtx->name,bits256_str(str,txid)); if ( bits256_cmp(txid,rawtx->I.actualtxid) != 0 && bits256_nonz(rawtx->I.actualtxid) == 0 ) rawtx->I.actualtxid = txid; - if ( (txobj= bitcoin_data2json(rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->coin->p2shtype,rawtx->coin->isPoS,height,&rawtx->I.signedtxid,&rawtx->msgtx,rawtx->extraspace,sizeof(rawtx->extraspace),data,datalen,0,suppress_pubkeys,rawtx->coin->zcash)) != 0 ) + if ( (txobj= bitcoin_data2json(coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,height,&rawtx->I.signedtxid,&rawtx->msgtx,rawtx->extraspace,sizeof(rawtx->extraspace),data,datalen,0,suppress_pubkeys,coin->zcash)) != 0 ) { rawtx->I.actualtxid = rawtx->I.signedtxid; rawtx->I.locktime = rawtx->msgtx.lock_time; if ( (vouts= jarray(&n,txobj,"vout")) != 0 && v < n ) { vout = jitem(vouts,v); - if ( strcmp("BTC",rawtx->coin->symbol) == 0 && rawtx == &swap->otherfee ) + if ( strcmp("BTC",coin->symbol) == 0 && rawtx == &swap->otherfee ) txfee = LP_MIN_TXFEE; else { - if ( strcmp(rawtx->coin->symbol,swap->bobcoin->symbol) == 0 ) + if ( strcmp(coin->symbol,swap->I.bobstr) == 0 ) txfee = swap->I.Btxfee; - else if ( strcmp(rawtx->coin->symbol,swap->alicecoin->symbol) == 0 ) + else if ( strcmp(coin->symbol,swap->I.alicestr) == 0 ) txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } @@ -641,9 +646,9 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( rawtx == &swap->otherfee ) { char str[65]; - LP_swap_coinaddr(rawtx->coin,rawtx->p2shaddr,0,data,datalen,0); + LP_swap_coinaddr(coin,rawtx->p2shaddr,0,data,datalen,0); printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); - } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); + } else bitcoin_address(rawtx->p2shaddr,coin->taddr,coin->p2shtype,rawtx->spendscript,hexlen); } } else printf("%s satoshis %.8f ERROR.(%s) txfees.[%.8f %.8f: %.8f] amount.%.8f -> %.8f\n",rawtx->name,dstr(j64bits(vout,"satoshis")),jprint(txobj,0),dstr(swap->I.Atxfee),dstr(swap->I.Btxfee),dstr(txfee),dstr(rawtx->I.amount),dstr(rawtx->I.amount)-dstr(txfee)); } @@ -659,7 +664,7 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 { if ( bits256_nonz(rawtx->I.signedtxid) != 0 && bits256_nonz(rawtx->I.actualtxid) == 0 ) { - rawtx->I.actualtxid = LP_broadcast_tx(rawtx->name,rawtx->coin->symbol,rawtx->txbytes,rawtx->I.datalen); + rawtx->I.actualtxid = LP_broadcast_tx(rawtx->name,rawtx->symbol,rawtx->txbytes,rawtx->I.datalen); if ( bits256_cmp(rawtx->I.actualtxid,rawtx->I.signedtxid) != 0 ) { char str[65],str2[65]; @@ -687,7 +692,7 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 if ( suppress_swapsend == 0 ) { retval = LP_swapsend(pairsock,swap,msgbits,sendbuf,sendlen,nextbits,rawtx->I.crcs); - if ( LP_waitmempool(rawtx->coin->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,0,LP_SWAPSTEP_TIMEOUT*10) < 0 ) + if ( LP_waitmempool(rawtx->symbol,rawtx->I.destaddr,rawtx->I.signedtxid,0,LP_SWAPSTEP_TIMEOUT*10) < 0 ) { char str[65]; printf("failed to find %s %s %s in the mempool?\n",rawtx->name,rawtx->I.destaddr,bits256_str(str,rawtx->I.actualtxid)); retval = -1; @@ -783,12 +788,12 @@ void LP_bobloop(void *_swap) printf("error bobscripts payment\n"); else { - if ( strcmp(swap->alicecoin->symbol,"BTC") == 0 ) + if ( strcmp(swap->I.alicestr,"BTC") == 0 ) m = 0; else m = swap->I.aliceconfirms; - while ( (n= LP_numconfirms(swap->alicecoin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice + while ( (n= LP_numconfirms(swap->I.alicestr,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { - char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin->symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->I.alicestr,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) @@ -840,12 +845,12 @@ void LP_aliceloop(void *_swap) printf("error sending alicepayment\n"); else { - if ( strcmp(swap->alicecoin->symbol,"BTC") == 0 ) + if ( strcmp(swap->I.alicestr,"BTC") == 0 ) m = 0; else m = swap->I.aliceconfirms; - while ( (n= LP_numconfirms(swap->alicecoin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) + while ( (n= LP_numconfirms(swap->I.alicestr,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { - char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->alicecoin->symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); + char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->I.alicestr,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } swap->sentflag = 1; @@ -853,16 +858,16 @@ void LP_aliceloop(void *_swap) printf("error waiting for bobpayment\n"); else { - while ( (n= LP_numconfirms(swap->bobcoin->symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) + while ( (n= LP_numconfirms(swap->I.bobstr,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { - char str[65];printf("%d wait for bobpayment %s numconfs.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->bobcoin->symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); + char str[65];printf("%d wait for bobpayment %s numconfs.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->I.bobstr,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(10); } /*if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); - while ( (n= LP_numconfirms(swap->alicecoin->symbol,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) + while ( (n= LP_numconfirms(swap->I.alicestr,swap->alicespend.I.destaddr,swap->alicespend.I.signedtxid,0,1)) < swap->I.aliceconfirms ) { - char str[65];printf("%d wait for alicespend %s numconfs.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->bobcoin->symbol,bits256_str(str,swap->alicespend.I.signedtxid)); + char str[65];printf("%d wait for alicespend %s numconfs.%d %s %s\n",n,swap->alicespend.I.destaddr,swap->I.aliceconfirms,swap->I.bobstr,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); }*/ if ( swap->N.pair >= 0 ) @@ -968,9 +973,8 @@ void basilisk_rawtx_setparms(char *name,uint32_t quoteid,struct basilisk_rawtx * numconfirms = 0; #endif strcpy(rawtx->name,name); - rawtx->coin = coin; printf("set coin.%s %s -> %s\n",coin->symbol,coin->smartaddr,name); - strcpy(rawtx->I.coinstr,coin->symbol); + strcpy(rawtx->symbol,coin->symbol); rawtx->I.numconfirms = numconfirms; if ( (rawtx->I.amount= satoshis) < LP_MIN_TXFEE ) rawtx->I.amount = LP_MIN_TXFEE; @@ -981,13 +985,13 @@ void basilisk_rawtx_setparms(char *name,uint32_t quoteid,struct basilisk_rawtx * if ( strcmp(coin->symbol,"BTC") == 0 && (quoteid % 10) == 0 ) decode_hex(rawtx->I.rmd160,20,TIERNOLAN_RMD160); else decode_hex(rawtx->I.rmd160,20,INSTANTDEX_RMD160); - bitcoin_address(rawtx->I.destaddr,rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->I.rmd160,20); + bitcoin_address(rawtx->I.destaddr,coin->taddr,coin->pubtype,rawtx->I.rmd160,20); } if ( pubkey33 != 0 ) { memcpy(rawtx->I.pubkey33,pubkey33,33); - bitcoin_address(rawtx->I.destaddr,rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->I.pubkey33,33); - bitcoin_addr2rmd160(rawtx->coin->taddr,&rawtx->I.addrtype,rawtx->I.rmd160,rawtx->I.destaddr); + bitcoin_address(rawtx->I.destaddr,coin->taddr,coin->pubtype,rawtx->I.pubkey33,33); + bitcoin_addr2rmd160(coin->taddr,&rawtx->I.addrtype,rawtx->I.rmd160,rawtx->I.destaddr); } if ( rawtx->I.vouttype <= 1 && rawtx->I.destaddr[0] != 0 ) { @@ -999,22 +1003,18 @@ void basilisk_rawtx_setparms(char *name,uint32_t quoteid,struct basilisk_rawtx * struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 pubkey25519,struct basilisk_swap *swap,int32_t optionduration,uint32_t statebits,struct LP_quoteinfo *qp) { //FILE *fp; char fname[512]; - uint8_t *alicepub33=0,*bobpub33=0; int32_t jumblrflag=-2,x = -1; struct iguana_info *coin; + uint8_t *alicepub33=0,*bobpub33=0; int32_t jumblrflag=-2,x = -1; struct iguana_info *bobcoin,*alicecoin; strcpy(swap->I.bobstr,swap->I.req.src); strcpy(swap->I.alicestr,swap->I.req.dest); - if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) - swap->alicecoin = coin; - else + if ( (alicecoin= LP_coinfind(swap->I.alicestr)) == 0 ) { - printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); + printf("missing alicecoin src.%p dest.%p\n",LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); free(swap); return(0); } - if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) - swap->bobcoin = coin; - else + if ( (bobcoin= LP_coinfind(swap->I.bobstr)) == 0 ) { - printf("missing bobcoin->%p or missing alicecoin->%p src.%p dest.%p\n",swap->bobcoin,swap->alicecoin,LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); + printf("missing bobcoin src.%p dest.%p\n",LP_coinfind(swap->I.req.src),LP_coinfind(swap->I.req.dest)); free(swap); return(0); } @@ -1074,12 +1074,12 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 char str[65]; printf("couldnt generate privkeys %d %s\n",x,bits256_str(str,privkey)); return(0); } - if ( strcmp("BTC",swap->bobcoin->symbol) == 0 ) + if ( strcmp("BTC",swap->I.bobstr) == 0 ) { swap->I.bobconfirms = (1 + sqrt(dstr(swap->I.bobsatoshis) * .1)); swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } - else if ( strcmp("BTC",swap->alicecoin->symbol) == 0 ) + else if ( strcmp("BTC",swap->I.alicestr) == 0 ) { swap->I.aliceconfirms = (1 + sqrt(dstr(swap->I.alicesatoshis) * .1)); swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; @@ -1089,17 +1089,17 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.bobconfirms = BASILISK_DEFAULT_NUMCONFIRMS; swap->I.aliceconfirms = BASILISK_DEFAULT_NUMCONFIRMS; } - if ( swap->bobcoin->isassetchain != 0 ) + if ( bobcoin->isassetchain != 0 ) swap->I.bobconfirms = 1; - if ( swap->alicecoin->isassetchain != 0 ) + if ( alicecoin->isassetchain != 0 ) swap->I.aliceconfirms = 1; - if ( swap->bobcoin->userconfirms > 0 ) - swap->I.bobconfirms = swap->bobcoin->userconfirms; - if ( swap->alicecoin->userconfirms > 0 ) - swap->I.aliceconfirms = swap->alicecoin->userconfirms; - if ( (swap->I.bobmaxconfirms= swap->bobcoin->maxconfirms) == 0 ) + if ( bobcoin->userconfirms > 0 ) + swap->I.bobconfirms = bobcoin->userconfirms; + if ( alicecoin->userconfirms > 0 ) + swap->I.aliceconfirms = alicecoin->userconfirms; + if ( (swap->I.bobmaxconfirms= bobcoin->maxconfirms) == 0 ) swap->I.bobmaxconfirms = BASILISK_DEFAULT_MAXCONFIRMS; - if ( (swap->I.alicemaxconfirms= swap->alicecoin->maxconfirms) == 0 ) + if ( (swap->I.alicemaxconfirms= alicecoin->maxconfirms) == 0 ) swap->I.alicemaxconfirms = BASILISK_DEFAULT_MAXCONFIRMS; if ( swap->I.bobconfirms > swap->I.bobmaxconfirms ) swap->I.bobconfirms = swap->I.bobmaxconfirms; @@ -1107,53 +1107,53 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.aliceconfirms = swap->I.alicemaxconfirms; swap->I.bobconfirms *= !swap->I.bobistrusted; swap->I.aliceconfirms *= !swap->I.aliceistrusted; - printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,swap->bobcoin->taddr,swap->alicecoin->taddr); + printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,bobcoin->taddr,alicecoin->taddr); if ( swap->I.iambob != 0 ) { - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin->txfee,0,0,jumblrflag); - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin->txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*bobcoin->txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*alicecoin->txfee,0,0,jumblrflag); bobpub33 = pubkey33; } else { - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*swap->bobcoin->txfee,0,0,jumblrflag); - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*swap->alicecoin->txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*bobcoin->txfee,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,alicecoin,0,0,LP_DEXFEE(swap->I.alicesatoshis) + 0*alicecoin->txfee,0,0,jumblrflag); alicepub33 = pubkey33; } swap->myfee.I.locktime = swap->I.started + 1; swap->otherfee.I.locktime = swap->I.started + 1; - basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,swap->bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + swap->bobcoin->txfee,4,0,jumblrflag); - basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); + basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,bobcoin,swap->I.bobconfirms,0,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis) + bobcoin->txfee,4,0,jumblrflag); + basilisk_rawtx_setparms("bobrefund",swap->I.req.quoteid,&swap->bobrefund,bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,bobpub33,jumblrflag); swap->bobrefund.I.suppress_pubkeys = 1; - basilisk_rawtx_setparms("aliceclaim",swap->I.req.quoteid,&swap->aliceclaim,swap->bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,alicepub33,jumblrflag); + basilisk_rawtx_setparms("aliceclaim",swap->I.req.quoteid,&swap->aliceclaim,bobcoin,1,4,LP_DEPOSITSATOSHIS(swap->I.bobsatoshis),1,alicepub33,jumblrflag); swap->aliceclaim.I.suppress_pubkeys = 1; swap->aliceclaim.I.locktime = swap->I.started + swap->I.putduration+swap->I.callduration + 1; - basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + swap->bobcoin->txfee,3,0,jumblrflag); - basilisk_rawtx_setparms("alicespend",swap->I.req.quoteid,&swap->alicespend,swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,alicepub33,jumblrflag); + basilisk_rawtx_setparms("bobpayment",swap->I.req.quoteid,&swap->bobpayment,bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + bobcoin->txfee,3,0,jumblrflag); + basilisk_rawtx_setparms("alicespend",swap->I.req.quoteid,&swap->alicespend,bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,alicepub33,jumblrflag); swap->alicespend.I.suppress_pubkeys = 1; - basilisk_rawtx_setparms("bobreclaim",swap->I.req.quoteid,&swap->bobreclaim,swap->bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,bobpub33,jumblrflag); + basilisk_rawtx_setparms("bobreclaim",swap->I.req.quoteid,&swap->bobreclaim,bobcoin,swap->I.bobconfirms,3,swap->I.bobsatoshis,1,bobpub33,jumblrflag); swap->bobreclaim.I.suppress_pubkeys = 1; swap->bobreclaim.I.locktime = swap->I.started + swap->I.putduration + 1; - basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,swap->alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + swap->alicecoin->txfee,2,0,jumblrflag); - basilisk_rawtx_setparms("bobspend",swap->I.req.quoteid,&swap->bobspend,swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,bobpub33,jumblrflag); + basilisk_rawtx_setparms("alicepayment",swap->I.req.quoteid,&swap->alicepayment,alicecoin,swap->I.aliceconfirms,0,swap->I.alicesatoshis + alicecoin->txfee,2,0,jumblrflag); + basilisk_rawtx_setparms("bobspend",swap->I.req.quoteid,&swap->bobspend,alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,bobpub33,jumblrflag); swap->bobspend.I.suppress_pubkeys = 1; - basilisk_rawtx_setparms("alicereclaim",swap->I.req.quoteid,&swap->alicereclaim,swap->alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,alicepub33,jumblrflag); + basilisk_rawtx_setparms("alicereclaim",swap->I.req.quoteid,&swap->alicereclaim,alicecoin,swap->I.aliceconfirms,2,swap->I.alicesatoshis,1,alicepub33,jumblrflag); swap->alicereclaim.I.suppress_pubkeys = 1; swap->bobpayment.utxotxid = qp->txid, swap->bobpayment.utxovout = qp->vout; swap->bobdeposit.utxotxid = qp->txid2, swap->bobdeposit.utxovout = qp->vout2; swap->alicepayment.utxotxid = qp->desttxid, swap->alicepayment.utxovout = qp->destvout; - LP_mark_spent(swap->bobcoin->symbol,qp->txid,qp->vout); - LP_mark_spent(swap->bobcoin->symbol,qp->txid2,qp->vout2); - LP_mark_spent(swap->alicecoin->symbol,qp->desttxid,qp->destvout); + LP_mark_spent(swap->I.bobstr,qp->txid,qp->vout); + LP_mark_spent(swap->I.bobstr,qp->txid2,qp->vout2); + LP_mark_spent(swap->I.alicestr,qp->desttxid,qp->destvout); if ( swap->I.iambob != 0 ) swap->otherfee.utxotxid = qp->feetxid, swap->otherfee.utxovout = qp->feevout; else { swap->myfee.utxotxid = qp->feetxid, swap->myfee.utxovout = qp->feevout; - LP_mark_spent(swap->alicecoin->symbol,qp->feetxid,qp->feevout); + LP_mark_spent(swap->I.alicestr,qp->feetxid,qp->feevout); } - char str[65],str2[65],str3[65]; printf("IAMBOB.%d %s %s %s [%s %s]\n",swap->I.iambob,bits256_str(str,qp->txid),bits256_str(str2,qp->txid2),bits256_str(str3,qp->feetxid),swap->bobcoin->symbol,swap->alicecoin->symbol); + char str[65],str2[65],str3[65]; printf("IAMBOB.%d %s %s %s [%s %s]\n",swap->I.iambob,bits256_str(str,qp->txid),bits256_str(str2,qp->txid2),bits256_str(str3,qp->feetxid),swap->I.bobstr,swap->I.alicestr); return(swap); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 12d93436c..762a5c6bf 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -481,7 +481,7 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl else balance = LP_RTsmartbalance(relcoin); sum = (SATOSHIDEN*relvolume+2*dstr(txfees)) + 3 * ((SATOSHIDEN*relvolume+2*dstr(txfees))/777); printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); - if ( (dstr(abalance + txfees) < relvolume) || (dstr(balance - abalance) < dstr(balance - abalance + txfees)) ) + if ( (abalance < SATOSHIDEN*relvolume + txfees) || ((balance-abalance) < (uint64_t)(SATOSHIDEN*relvolume)/777 + txfees) ) //if ( dstr(abalance) < relvolume && balance > sum+2*txfee ) { retjson = cJSON_CreateObject(); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 453cd0fd4..c2a07a804 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1226,7 +1226,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pubkey33,int32_t iambob,int32_t lockinputs,struct basilisk_rawtx *rawtx,uint32_t locktime,uint8_t *script,int32_t scriptlen,int64_t txfee,int32_t minconf,int32_t delay,bits256 privkey,uint8_t *changermd160,char *vinaddr) { struct iguana_info *coin; int32_t len,retval=-1; char *retstr,*hexstr; cJSON *argjson,*outputs,*item,*retjson,*obj; - if ( (coin= rawtx->coin) == 0 ) + if ( (coin= LP_coinfind(rawtx->symbol)) == 0 ) return(-1); if ( strcmp(coin->smartaddr,vinaddr) != 0 ) { @@ -1608,36 +1608,44 @@ int32_t basilisk_swapuserdata(uint8_t *userdata,bits256 privkey,int32_t ifpath,b int32_t basilisk_bobpayment_reclaim(struct basilisk_swap *swap,int32_t delay) { - uint8_t userdata[512]; int32_t retval,i,len = 0; static bits256 zero; - //printf("basilisk_bobpayment_reclaim\n"); - len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); - memcpy(swap->I.userdata_bobreclaim,userdata,len); - swap->I.userdata_bobreclaimlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr,swap->bobcoin->zcash)) == 0 ) - { - for (i=0; ibobreclaim.I.datalen; i++) - printf("%02x",swap->bobreclaim.txbytes[i]); - printf(" <- bobreclaim\n"); - //basilisk_txlog(swap,&swap->bobreclaim,delay); - return(retval); - } + static bits256 zero; + uint8_t userdata[512]; int32_t retval,i,len = 0; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) + { + //printf("basilisk_bobpayment_reclaim\n"); + len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); + memcpy(swap->I.userdata_bobreclaim,userdata,len); + swap->I.userdata_bobreclaimlen = len; + if ( (retval= basilisk_rawtx_sign(coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr,coin->zcash)) == 0 ) + { + for (i=0; ibobreclaim.I.datalen; i++) + printf("%02x",swap->bobreclaim.txbytes[i]); + printf(" <- bobreclaim\n"); + //basilisk_txlog(swap,&swap->bobreclaim,delay); + return(retval); + } + } else printf("basilisk_bobpayment_reclaim cant find (%s)\n",swap->I.bobstr); return(-1); } int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) { - uint8_t userdata[512]; int32_t i,retval,len = 0; char str[65]; - len = basilisk_swapuserdata(userdata,swap->I.privBn,0,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); - memcpy(swap->I.userdata_bobrefund,userdata,len); - swap->I.userdata_bobrefundlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin->zcash)) == 0 ) - { - for (i=0; ibobrefund.I.datalen; i++) - printf("%02x",swap->bobrefund.txbytes[i]); - printf(" <- bobrefund.(%s)\n",bits256_str(str,swap->bobrefund.I.txid)); - //basilisk_txlog(swap,&swap->bobrefund,delay); - return(retval); - } + uint8_t userdata[512]; int32_t i,retval,len = 0; char str[65]; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) + { + len = basilisk_swapuserdata(userdata,swap->I.privBn,0,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + memcpy(swap->I.userdata_bobrefund,userdata,len); + swap->I.userdata_bobrefundlen = len; + if ( (retval= basilisk_rawtx_sign(coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr,coin->zcash)) == 0 ) + { + for (i=0; ibobrefund.I.datalen; i++) + printf("%02x",swap->bobrefund.txbytes[i]); + printf(" <- bobrefund.(%s)\n",bits256_str(str,swap->bobrefund.I.txid)); + //basilisk_txlog(swap,&swap->bobrefund,delay); + return(retval); + } + } else printf("basilisk_bobdeposit_refund cant find (%s)\n",swap->I.bobstr); + return(-1); } @@ -1673,81 +1681,84 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u int32_t basilisk_bobscripts_set(struct basilisk_swap *swap,int32_t depositflag,int32_t genflag) { - int32_t j; char coinaddr[64],checkaddr[64]; - bitcoin_address(coinaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->changermd160,20); - if ( genflag != 0 && swap->I.iambob == 0 ) - printf("basilisk_bobscripts_set WARNING: alice generating BOB tx\n"); - if ( depositflag == 0 ) - { - swap->bobpayment.I.spendlen = basilisk_bobscript(swap->bobpayment.I.rmd160,swap->bobpayment.redeemscript,&swap->bobpayment.I.redeemlen,swap->bobpayment.spendscript,0,&swap->bobpayment.I.locktime,&swap->bobpayment.I.secretstart,&swap->I,0); - bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); - strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); - //LP_importaddress(swap->bobcoin->symbol,swap->bobpayment.I.destaddr); - //int32_t i; for (i=0; ibobpayment.I.redeemlen; i++) - // printf("%02x",swap->bobpayment.redeemscript[i]); - //printf(" <- bobpayment redeem %d %s\n",i,swap->bobpayment.I.destaddr); - if ( genflag != 0 && bits256_nonz(*(bits256 *)swap->I.secretBn256) != 0 && swap->bobpayment.I.datalen == 0 ) - { - basilisk_rawtx_gen(swap->ctx,"payment",swap->I.started,swap->persistent_pubkey33,1,1,&swap->bobpayment,swap->bobpayment.I.locktime,swap->bobpayment.spendscript,swap->bobpayment.I.spendlen,swap->bobpayment.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); - if ( swap->bobpayment.I.spendlen == 0 || swap->bobpayment.I.datalen == 0 ) - { - printf("error bob generating %p payment.%d\n",swap->bobpayment.txbytes,swap->bobpayment.I.spendlen); - sleep(DEX_SLEEP); - } - else + int32_t j; char coinaddr[64],checkaddr[64]; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) + { + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,swap->changermd160,20); + if ( genflag != 0 && swap->I.iambob == 0 ) + printf("basilisk_bobscripts_set WARNING: alice generating BOB tx\n"); + if ( depositflag == 0 ) + { + swap->bobpayment.I.spendlen = basilisk_bobscript(swap->bobpayment.I.rmd160,swap->bobpayment.redeemscript,&swap->bobpayment.I.redeemlen,swap->bobpayment.spendscript,0,&swap->bobpayment.I.locktime,&swap->bobpayment.I.secretstart,&swap->I,0); + bitcoin_address(swap->bobpayment.p2shaddr,coin->taddr,coin->p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); + strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); + //LP_importaddress(coin->symbol,swap->bobpayment.I.destaddr); + //int32_t i; for (i=0; ibobpayment.I.redeemlen; i++) + // printf("%02x",swap->bobpayment.redeemscript[i]); + //printf(" <- bobpayment redeem %d %s\n",i,swap->bobpayment.I.destaddr); + if ( genflag != 0 && bits256_nonz(*(bits256 *)swap->I.secretBn256) != 0 && swap->bobpayment.I.datalen == 0 ) { - for (j=0; jbobpayment.I.datalen; j++) - printf("%02x",swap->bobpayment.txbytes[j]); - printf(" <- bobpayment.%d\n",swap->bobpayment.I.datalen); - for (j=0; jbobpayment.I.redeemlen; j++) - printf("%02x",swap->bobpayment.redeemscript[j]); - printf(" <- redeem.%d\n",swap->bobpayment.I.redeemlen); - printf(" <- GENERATED BOB PAYMENT.%d destaddr.(%s)\n",swap->bobpayment.I.datalen,swap->bobpayment.I.destaddr); - LP_swap_coinaddr(swap->bobcoin,checkaddr,0,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); - if ( strcmp(swap->bobpayment.I.destaddr,checkaddr) != 0 ) + basilisk_rawtx_gen(swap->ctx,"payment",swap->I.started,swap->persistent_pubkey33,1,1,&swap->bobpayment,swap->bobpayment.I.locktime,swap->bobpayment.spendscript,swap->bobpayment.I.spendlen,coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); + if ( swap->bobpayment.I.spendlen == 0 || swap->bobpayment.I.datalen == 0 ) { - printf("BOBPAYMENT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobpayment.I.destaddr,checkaddr); - return(-1); + printf("error bob generating %p payment.%d\n",swap->bobpayment.txbytes,swap->bobpayment.I.spendlen); + sleep(DEX_SLEEP); + } + else + { + for (j=0; jbobpayment.I.datalen; j++) + printf("%02x",swap->bobpayment.txbytes[j]); + printf(" <- bobpayment.%d\n",swap->bobpayment.I.datalen); + for (j=0; jbobpayment.I.redeemlen; j++) + printf("%02x",swap->bobpayment.redeemscript[j]); + printf(" <- redeem.%d\n",swap->bobpayment.I.redeemlen); + printf(" <- GENERATED BOB PAYMENT.%d destaddr.(%s)\n",swap->bobpayment.I.datalen,swap->bobpayment.I.destaddr); + LP_swap_coinaddr(coin,checkaddr,0,swap->bobpayment.txbytes,swap->bobpayment.I.datalen,0); + if ( strcmp(swap->bobpayment.I.destaddr,checkaddr) != 0 ) + { + printf("BOBPAYMENT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobpayment.I.destaddr,checkaddr); + return(-1); + } + LP_unspents_mark(coin->symbol,swap->bobpayment.vins); + //printf("bobscripts set completed\n"); + return(0); } - LP_unspents_mark(swap->bobcoin->symbol,swap->bobpayment.vins); - //printf("bobscripts set completed\n"); - return(0); } } - } - else - { - swap->bobdeposit.I.spendlen = basilisk_bobscript(swap->bobdeposit.I.rmd160,swap->bobdeposit.redeemscript,&swap->bobdeposit.I.redeemlen,swap->bobdeposit.spendscript,0,&swap->bobdeposit.I.locktime,&swap->bobdeposit.I.secretstart,&swap->I,1); - bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); - strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); - //int32_t i; for (i=0; ibobdeposit.I.redeemlen; i++) - // printf("%02x",swap->bobdeposit.redeemscript[i]); - //printf(" <- bobdeposit redeem %d %s\n",i,swap->bobdeposit.I.destaddr); - if ( genflag != 0 && (swap->bobdeposit.I.datalen == 0 || swap->bobrefund.I.datalen == 0) ) + else { - basilisk_rawtx_gen(swap->ctx,"deposit",swap->I.started,swap->persistent_pubkey33,1,1,&swap->bobdeposit,swap->bobdeposit.I.locktime,swap->bobdeposit.spendscript,swap->bobdeposit.I.spendlen,swap->bobdeposit.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); - if ( swap->bobdeposit.I.datalen == 0 || swap->bobdeposit.I.spendlen == 0 ) + swap->bobdeposit.I.spendlen = basilisk_bobscript(swap->bobdeposit.I.rmd160,swap->bobdeposit.redeemscript,&swap->bobdeposit.I.redeemlen,swap->bobdeposit.spendscript,0,&swap->bobdeposit.I.locktime,&swap->bobdeposit.I.secretstart,&swap->I,1); + bitcoin_address(swap->bobdeposit.p2shaddr,coin->taddr,coin->p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); + //int32_t i; for (i=0; ibobdeposit.I.redeemlen; i++) + // printf("%02x",swap->bobdeposit.redeemscript[i]); + //printf(" <- bobdeposit redeem %d %s\n",i,swap->bobdeposit.I.destaddr); + if ( genflag != 0 && (swap->bobdeposit.I.datalen == 0 || swap->bobrefund.I.datalen == 0) ) { - printf("error bob generating %p deposit.%d\n",swap->bobdeposit.txbytes,swap->bobdeposit.I.spendlen); - sleep(DEX_SLEEP); - } - else - { - for (j=0; jbobdeposit.I.datalen; j++) - printf("%02x",swap->bobdeposit.txbytes[j]); - printf(" <- GENERATED BOB DEPOSIT.%d (%s)\n",swap->bobdeposit.I.datalen,swap->bobdeposit.I.destaddr); - LP_swap_coinaddr(swap->bobcoin,checkaddr,0,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); - if ( strcmp(swap->bobdeposit.I.destaddr,checkaddr) != 0 ) + basilisk_rawtx_gen(swap->ctx,"deposit",swap->I.started,swap->persistent_pubkey33,1,1,&swap->bobdeposit,swap->bobdeposit.I.locktime,swap->bobdeposit.spendscript,swap->bobdeposit.I.spendlen,coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); + if ( swap->bobdeposit.I.datalen == 0 || swap->bobdeposit.I.spendlen == 0 ) { - printf("BOBDEPOSIT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobdeposit.I.destaddr,checkaddr); - return(-1); + printf("error bob generating %p deposit.%d\n",swap->bobdeposit.txbytes,swap->bobdeposit.I.spendlen); + sleep(DEX_SLEEP); + } + else + { + for (j=0; jbobdeposit.I.datalen; j++) + printf("%02x",swap->bobdeposit.txbytes[j]); + printf(" <- GENERATED BOB DEPOSIT.%d (%s)\n",swap->bobdeposit.I.datalen,swap->bobdeposit.I.destaddr); + LP_swap_coinaddr(coin,checkaddr,0,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen,0); + if ( strcmp(swap->bobdeposit.I.destaddr,checkaddr) != 0 ) + { + printf("BOBDEPOSIT REDEEMADDR MISMATCH??? %s != %s\n",swap->bobdeposit.I.destaddr,checkaddr); + return(-1); + } + LP_unspents_mark(coin->symbol,swap->bobdeposit.vins); + printf("bobscripts set completed\n"); + return(0); } - LP_unspents_mark(swap->bobcoin->symbol,swap->bobdeposit.vins); - printf("bobscripts set completed\n"); - return(0); } } - } + } else printf("bobscripts set cant find (%s)\n",swap->I.bobstr); return(0); } @@ -1758,7 +1769,7 @@ int32_t basilisk_alicepayment_spend(struct basilisk_swap *swap,struct basilisk_r { int32_t i,retval; printf("alicepayment_spend\n"); - swap->alicepayment.I.spendlen = basilisk_alicescript(swap->alicepayment.redeemscript,&swap->alicepayment.I.redeemlen,swap->alicepayment.spendscript,0,swap->alicepayment.I.destaddr,swap->alicecoin->p2shtype,swap->I.pubAm,swap->I.pubBn); + swap->alicepayment.I.spendlen = basilisk_alicescript(swap->alicepayment.redeemscript,&swap->alicepayment.I.redeemlen,swap->alicepayment.spendscript,0,swap->alicepayment.I.destaddr,coin->p2shtype,swap->I.pubAm,swap->I.pubBn); printf("alicepayment_spend len.%d\n",swap->alicepayment.I.spendlen); if ( swap->I.iambob == 0 ) { @@ -1770,7 +1781,7 @@ int32_t basilisk_alicepayment_spend(struct basilisk_swap *swap,struct basilisk_r memcpy(swap->I.userdata_bobspend,swap->alicepayment.redeemscript,swap->alicepayment.I.spendlen); swap->I.userdata_bobspendlen = swap->alicepayment.I.spendlen; } - if ( (retval= basilisk_rawtx_sign(swap->alicecoin->symbol,swap->alicecoin->pubtype,swap->alicecoin->p2shtype,swap->alicecoin->isPoS,swap->alicecoin->wiftype,swap,dest,&swap->alicepayment,swap->I.privAm,&swap->I.privBn,0,0,1,swap->changermd160)) == 0 ) + if ( (retval= basilisk_rawtx_sign(coin->symbol,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,swap,dest,&swap->alicepayment,swap->I.privAm,&swap->I.privBn,0,0,1,swap->changermd160)) == 0 ) { for (i=0; iI.datalen; i++) printf("%02x",dest->txbytes[i]); @@ -1795,84 +1806,94 @@ void basilisk_alicepayment(struct basilisk_swap *swap,struct iguana_info *coin,s int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) { - char coinaddr[64]; int32_t i,retval = -1; - if ( swap->alicepayment.I.datalen == 0 ) - basilisk_alicepayment(swap,swap->alicepayment.coin,&swap->alicepayment,swap->I.pubAm,swap->I.pubBn); - if ( swap->alicepayment.I.datalen == 0 || swap->alicepayment.I.spendlen == 0 ) - printf("error alice generating payment.%d\n",swap->alicepayment.I.spendlen); - else + char coinaddr[64]; int32_t i,retval = -1; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) { - bitcoin_address(swap->alicepayment.I.destaddr,swap->alicecoin->taddr,swap->alicecoin->p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); - //LP_importaddress(swap->alicecoin->symbol,swap->alicepayment.I.destaddr); - strcpy(swap->alicepayment.p2shaddr,swap->alicepayment.I.destaddr); - retval = 0; - for (i=0; ialicepayment.I.datalen; i++) - printf("%02x",swap->alicepayment.txbytes[i]); - printf(" ALICE PAYMENT created.(%s)\n",swap->alicepayment.I.destaddr); - LP_unspents_mark(swap->alicecoin->symbol,swap->alicepayment.vins); - //LP_importaddress(swap->alicecoin->symbol,swap->alicepayment.I.destaddr); - //basilisk_txlog(swap,&swap->alicepayment,-1); - } - if ( swap->myfee.I.datalen == 0 ) - { - printf("%s generate fee %.8f from.%s\n",swap->alicecoin->symbol,dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee),swap->alicecoin->smartaddr); - bitcoin_address(coinaddr,swap->alicecoin->taddr,swap->alicecoin->pubtype,swap->changermd160,20); - if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,swap->myfee.I.locktime,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) - { - printf("rawtxsend %s %.8f\n",swap->myfee.coin->symbol,dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); - swap->I.statebits |= LP_swapdata_rawtxsend(pairsock,swap,0x80,data,maxlen,&swap->myfee,0x40,0); - LP_unspents_mark(swap->I.iambob!=0?swap->bobcoin->symbol:swap->alicecoin->symbol,swap->myfee.vins); - //basilisk_txlog(swap,&swap->myfee,-1); - for (i=0; imyfee.I.datalen; i++) - printf("%02x",swap->myfee.txbytes[i]); - printf(" <- fee state.%x\n",swap->I.statebits); - swap->I.statebits |= 0x40; - } + if ( swap->alicepayment.I.datalen == 0 ) + basilisk_alicepayment(swap,coin,&swap->alicepayment,swap->I.pubAm,swap->I.pubBn); + if ( swap->alicepayment.I.datalen == 0 || swap->alicepayment.I.spendlen == 0 ) + printf("error alice generating payment.%d\n",swap->alicepayment.I.spendlen); else { - printf("error creating myfee\n"); - return(-2); + bitcoin_address(swap->alicepayment.I.destaddr,coin->taddr,coin->p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); + //LP_importaddress(coin->symbol,swap->alicepayment.I.destaddr); + strcpy(swap->alicepayment.p2shaddr,swap->alicepayment.I.destaddr); + retval = 0; + for (i=0; ialicepayment.I.datalen; i++) + printf("%02x",swap->alicepayment.txbytes[i]); + printf(" ALICE PAYMENT created.(%s)\n",swap->alicepayment.I.destaddr); + LP_unspents_mark(coin->symbol,swap->alicepayment.vins); + //LP_importaddress(coin->symbol,swap->alicepayment.I.destaddr); + //basilisk_txlog(swap,&swap->alicepayment,-1); } - } - if ( swap->alicepayment.I.datalen != 0 && swap->alicepayment.I.spendlen > 0 && swap->myfee.I.datalen != 0 && swap->myfee.I.spendlen > 0 ) - { - printf("fee sent\n"); - return(0); - } + if ( swap->myfee.I.datalen == 0 ) + { + printf("%s generate fee %.8f from.%s\n",coin->symbol,dstr(strcmp(coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : coin->txfee),coin->smartaddr); + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,swap->changermd160,20); + if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,swap->myfee.I.locktime,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) + { + printf("rawtxsend %s %.8f\n",coin->symbol,dstr(strcmp(coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : coin->txfee)); + swap->I.statebits |= LP_swapdata_rawtxsend(pairsock,swap,0x80,data,maxlen,&swap->myfee,0x40,0); + LP_unspents_mark(swap->I.iambob!=0?coin->symbol:coin->symbol,swap->myfee.vins); + //basilisk_txlog(swap,&swap->myfee,-1); + for (i=0; imyfee.I.datalen; i++) + printf("%02x",swap->myfee.txbytes[i]); + printf(" <- fee state.%x\n",swap->I.statebits); + swap->I.statebits |= 0x40; + } + else + { + printf("error creating myfee\n"); + return(-2); + } + } + if ( swap->alicepayment.I.datalen != 0 && swap->alicepayment.I.spendlen > 0 && swap->myfee.I.datalen != 0 && swap->myfee.I.spendlen > 0 ) + { + printf("fee sent\n"); + return(0); + } + } else printf("basilisk alicetx cant find (%s)\n",swap->I.alicestr); return(-1); } int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - int32_t diff; - if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) - { - printf("otherfee amount %.8f -> %s vs %s locktime %u vs %u\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr,swap->otherfee.I.locktime,swap->I.started+1); - if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) - { - diff = swap->otherfee.I.locktime - (swap->I.started+1); - if ( diff < 0 ) - diff = -diff; - if ( diff < 10 ) - printf("dexfee verified\n"); - else printf("locktime mismatch in otherfee, reject %u vs %u\n",swap->otherfee.I.locktime,swap->I.started+1); - return(0); - } else printf("destaddress mismatch in other fee, reject (%s) vs (%s)\n",swap->otherfee.I.destaddr,swap->otherfee.p2shaddr); - } + int32_t diff; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.iambob != 0 ? swap->I.alicestr : swap->I.bobstr)) != 0 ) + { + if ( LP_rawtx_spendscript(swap,coin->longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) + { + printf("otherfee amount %.8f -> %s vs %s locktime %u vs %u\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr,swap->otherfee.I.locktime,swap->I.started+1); + if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) + { + diff = swap->otherfee.I.locktime - (swap->I.started+1); + if ( diff < 0 ) + diff = -diff; + if ( diff < 10 ) + printf("dexfee verified\n"); + else printf("locktime mismatch in otherfee, reject %u vs %u\n",swap->otherfee.I.locktime,swap->I.started+1); + return(0); + } else printf("destaddress mismatch in other fee, reject (%s) vs (%s)\n",swap->otherfee.I.destaddr,swap->otherfee.p2shaddr); + } + } else printf("cant find other coin iambob.%d\n",swap->I.iambob); return(-1); } int32_t LP_verify_alicespend(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->alicespend,0,data,datalen,0) == 0 ) + struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) { - printf("alicespend amount %.8f -> %s vs %s\n",dstr(swap->alicespend.I.amount),swap->alicespend.p2shaddr,swap->alicespend.I.destaddr); - if ( strcmp(swap->alicespend.I.destaddr,swap->alicespend.p2shaddr) == 0 ) + if ( LP_rawtx_spendscript(swap,coin->longestchain,&swap->alicespend,0,data,datalen,0) == 0 ) { - printf("alicespend verified\n"); - return(0); + printf("alicespend amount %.8f -> %s vs %s\n",dstr(swap->alicespend.I.amount),swap->alicespend.p2shaddr,swap->alicespend.I.destaddr); + if ( strcmp(swap->alicespend.I.destaddr,swap->alicespend.p2shaddr) == 0 ) + { + printf("alicespend verified\n"); + return(0); + } } - } + } else printf("verify alicespend cant find (%s)\n",swap->I.alicestr); return(-1); } @@ -1885,109 +1906,120 @@ int32_t LP_verify_alicespend(struct basilisk_swap *swap,uint8_t *data,int32_t da int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - uint8_t userdata[512]; int32_t retval=-1,len = 0; static bits256 zero; - if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->bobdeposit,0,data,datalen,0) == 0 ) - { - swap->aliceclaim.utxovout = 0; - swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,swap->bobcoin->symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); - if ( bits256_nonz(swap->bobdeposit.I.signedtxid) != 0 ) - swap->depositunconf = 1; - else swap->bobdeposit.I.signedtxid = swap->bobdeposit.I.actualtxid; - len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); - swap->aliceclaim.utxotxid = swap->bobdeposit.I.signedtxid; - memcpy(swap->I.userdata_aliceclaim,userdata,len); - swap->I.userdata_aliceclaimlen = len; - bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); - strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); - basilisk_dontforget_update(swap,&swap->bobdeposit); - //int32_t i; char str[65]; for (i=0; ibobdeposit.I.datalen; i++) - // printf("%02x",swap->bobdeposit.txbytes[i]); - //printf(" <- bobdeposit.%d %s\n",swap->bobdeposit.I.datalen,bits256_str(str,swap->bobdeposit.I.signedtxid)); - //for (i=0; ibobdeposit.I.redeemlen; i++) - // printf("%02x",swap->bobdeposit.redeemscript[i]); - //printf(" <- bobdeposit redeem %d %s suppress.%d\n",i,swap->bobdeposit.I.destaddr,swap->aliceclaim.I.suppress_pubkeys); - memcpy(swap->aliceclaim.redeemscript,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); - swap->aliceclaim.I.redeemlen = swap->bobdeposit.I.redeemlen; - memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); - bitcoin_address(swap->aliceclaim.I.destaddr,swap->alicecoin->taddr,swap->alicecoin->pubtype,swap->persistent_pubkey33,33); - retval = 0; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr,swap->bobcoin->zcash)) == 0 ) - { - int32_t i; for (i=0; ibobdeposit.I.datalen; i++) - printf("%02x",swap->bobdeposit.txbytes[i]); - printf(" <- bobdeposit\n"); - for (i=0; ialiceclaim.I.datalen; i++) - printf("%02x",swap->aliceclaim.txbytes[i]); - printf(" <- aliceclaim\n"); - //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); - return(LP_waitmempool(swap->bobcoin->symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,0,60)); - } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); - } + static bits256 zero; + uint8_t userdata[512]; int32_t retval=-1,len = 0; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) + { + if ( LP_rawtx_spendscript(swap,coin->longestchain,&swap->bobdeposit,0,data,datalen,0) == 0 ) + { + swap->aliceclaim.utxovout = 0; + swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,coin->symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); + if ( bits256_nonz(swap->bobdeposit.I.signedtxid) != 0 ) + swap->depositunconf = 1; + else swap->bobdeposit.I.signedtxid = swap->bobdeposit.I.actualtxid; + len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + swap->aliceclaim.utxotxid = swap->bobdeposit.I.signedtxid; + memcpy(swap->I.userdata_aliceclaim,userdata,len); + swap->I.userdata_aliceclaimlen = len; + bitcoin_address(swap->bobdeposit.p2shaddr,coin->taddr,coin->p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); + basilisk_dontforget_update(swap,&swap->bobdeposit); + //int32_t i; char str[65]; for (i=0; ibobdeposit.I.datalen; i++) + // printf("%02x",swap->bobdeposit.txbytes[i]); + //printf(" <- bobdeposit.%d %s\n",swap->bobdeposit.I.datalen,bits256_str(str,swap->bobdeposit.I.signedtxid)); + //for (i=0; ibobdeposit.I.redeemlen; i++) + // printf("%02x",swap->bobdeposit.redeemscript[i]); + //printf(" <- bobdeposit redeem %d %s suppress.%d\n",i,swap->bobdeposit.I.destaddr,swap->aliceclaim.I.suppress_pubkeys); + memcpy(swap->aliceclaim.redeemscript,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); + swap->aliceclaim.I.redeemlen = swap->bobdeposit.I.redeemlen; + memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); + bitcoin_address(swap->aliceclaim.I.destaddr,coin->taddr,coin->pubtype,swap->persistent_pubkey33,33); + retval = 0; + if ( (retval= basilisk_rawtx_sign(coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr,coin->zcash)) == 0 ) + { + int32_t i; for (i=0; ibobdeposit.I.datalen; i++) + printf("%02x",swap->bobdeposit.txbytes[i]); + printf(" <- bobdeposit\n"); + for (i=0; ialiceclaim.I.datalen; i++) + printf("%02x",swap->aliceclaim.txbytes[i]); + printf(" <- aliceclaim\n"); + //basilisk_txlog(swap,&swap->aliceclaim,swap->I.putduration+swap->I.callduration); + return(LP_waitmempool(coin->symbol,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,0,60)); + } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->aliceclaim.I.suppress_pubkeys,swap->bobdeposit.I.destaddr); + } + } else printf("verify bob depositcant find bob coin (%s)\n",swap->I.bobstr); printf("error with bobdeposit\n"); return(retval); } int32_t LP_verify_alicepayment(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - if ( LP_rawtx_spendscript(swap,swap->alicecoin->longestchain,&swap->alicepayment,0,data,datalen,0) == 0 ) - { - swap->bobspend.utxovout = 0; - swap->bobspend.utxotxid = swap->alicepayment.I.signedtxid = LP_broadcast_tx(swap->alicepayment.name,swap->alicecoin->symbol,swap->alicepayment.txbytes,swap->alicepayment.I.datalen); - bitcoin_address(swap->alicepayment.p2shaddr,swap->alicecoin->taddr,swap->alicecoin->p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); - strcpy(swap->alicepayment.I.destaddr,swap->alicepayment.p2shaddr); - if ( bits256_nonz(swap->alicepayment.I.signedtxid) != 0 ) - swap->aliceunconf = 1; - basilisk_dontforget_update(swap,&swap->alicepayment); - return(LP_waitmempool(swap->alicecoin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,60)); - //printf("import alicepayment address.(%s)\n",swap->alicepayment.p2shaddr); - //LP_importaddress(swap->alicecoin->symbol,swap->alicepayment.p2shaddr); - return(0); - } + struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.alicestr)) != 0 ) + { + if ( LP_rawtx_spendscript(swap,coin->longestchain,&swap->alicepayment,0,data,datalen,0) == 0 ) + { + swap->bobspend.utxovout = 0; + swap->bobspend.utxotxid = swap->alicepayment.I.signedtxid = LP_broadcast_tx(swap->alicepayment.name,coin->symbol,swap->alicepayment.txbytes,swap->alicepayment.I.datalen); + bitcoin_address(swap->alicepayment.p2shaddr,coin->taddr,coin->p2shtype,swap->alicepayment.redeemscript,swap->alicepayment.I.redeemlen); + strcpy(swap->alicepayment.I.destaddr,swap->alicepayment.p2shaddr); + if ( bits256_nonz(swap->alicepayment.I.signedtxid) != 0 ) + swap->aliceunconf = 1; + basilisk_dontforget_update(swap,&swap->alicepayment); + return(LP_waitmempool(coin->symbol,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,60)); + //printf("import alicepayment address.(%s)\n",swap->alicepayment.p2shaddr); + //LP_importaddress(coin->symbol,swap->alicepayment.p2shaddr); + return(0); + } + } else printf("verify alicepayment couldnt find coin.(%s)\n",swap->I.alicestr); printf("error validating alicepayment\n"); return(-1); } int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - uint8_t userdata[512]; int32_t i,retval=-1,len = 0; bits256 revAm; - memset(revAm.bytes,0,sizeof(revAm)); - if ( LP_rawtx_spendscript(swap,swap->bobcoin->longestchain,&swap->bobpayment,0,data,datalen,0) == 0 ) - { - swap->alicespend.utxovout = 0; - swap->alicespend.utxotxid = swap->bobpayment.I.signedtxid = LP_broadcast_tx(swap->bobpayment.name,swap->bobpayment.coin->symbol,swap->bobpayment.txbytes,swap->bobpayment.I.datalen); - if ( bits256_nonz(swap->bobpayment.I.signedtxid) != 0 ) - swap->paymentunconf = 1; - for (i=0; i<32; i++) - revAm.bytes[i] = swap->I.privAm.bytes[31-i]; - len = basilisk_swapuserdata(userdata,revAm,0,swap->I.myprivs[0],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); - bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin->taddr,swap->bobcoin->p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); - strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); - basilisk_dontforget_update(swap,&swap->bobpayment); - //LP_importaddress(swap->bobcoin->symbol,swap->bobpayment.I.destaddr); - /*for (i=0; ibobpayment.I.datalen; i++) - printf("%02x",swap->bobpayment.txbytes[i]); - printf(" <- bobpayment.%d\n",swap->bobpayment.I.datalen); - for (i=0; ibobpayment.I.redeemlen; i++) - printf("%02x",swap->bobpayment.redeemscript[i]); - printf(" <- bobpayment redeem %d %s %s\n",i,swap->bobpayment.I.destaddr,bits256_str(str,swap->bobpayment.I.signedtxid));*/ - memcpy(swap->I.userdata_alicespend,userdata,len); - swap->I.userdata_alicespendlen = len; - retval = 0; - memcpy(swap->alicespend.I.pubkey33,swap->persistent_pubkey33,33); - bitcoin_address(swap->alicespend.I.destaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->persistent_pubkey33,33); - //char str[65],str2[65]; printf("bobpaid privAm.(%s) myprivs[0].(%s)\n",bits256_str(str,swap->I.privAm),bits256_str(str2,swap->I.myprivs[0])); - if ( (retval= basilisk_rawtx_sign(swap->bobcoin->symbol,swap->bobcoin->wiftaddr,swap->bobcoin->taddr,swap->bobcoin->pubtype,swap->bobcoin->p2shtype,swap->bobcoin->isPoS,swap->bobcoin->wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr,swap->bobcoin->zcash)) == 0 ) + uint8_t userdata[512]; int32_t i,retval=-1,len = 0; bits256 revAm; struct iguana_info *coin; + if ( (coin= LP_coinfind(swap->I.bobstr)) != 0 ) + { + memset(revAm.bytes,0,sizeof(revAm)); + if ( LP_rawtx_spendscript(swap,coin->longestchain,&swap->bobpayment,0,data,datalen,0) == 0 ) { + swap->alicespend.utxovout = 0; + swap->alicespend.utxotxid = swap->bobpayment.I.signedtxid = LP_broadcast_tx(swap->bobpayment.name,coin->symbol,swap->bobpayment.txbytes,swap->bobpayment.I.datalen); + if ( bits256_nonz(swap->bobpayment.I.signedtxid) != 0 ) + swap->paymentunconf = 1; + for (i=0; i<32; i++) + revAm.bytes[i] = swap->I.privAm.bytes[31-i]; + len = basilisk_swapuserdata(userdata,revAm,0,swap->I.myprivs[0],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); + bitcoin_address(swap->bobpayment.p2shaddr,coin->taddr,coin->p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); + strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); + basilisk_dontforget_update(swap,&swap->bobpayment); + //LP_importaddress(coin->symbol,swap->bobpayment.I.destaddr); /*for (i=0; ibobpayment.I.datalen; i++) - printf("%02x",swap->bobpayment.txbytes[i]); - printf(" <- bobpayment\n"); - for (i=0; ialicespend.I.datalen; i++) - printf("%02x",swap->alicespend.txbytes[i]); - printf(" <- alicespend\n\n");*/ - swap->I.alicespent = 1; - return(LP_waitmempool(swap->bobcoin->symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,60)); - } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->alicespend.I.suppress_pubkeys,swap->bobpayment.I.destaddr); - } + printf("%02x",swap->bobpayment.txbytes[i]); + printf(" <- bobpayment.%d\n",swap->bobpayment.I.datalen); + for (i=0; ibobpayment.I.redeemlen; i++) + printf("%02x",swap->bobpayment.redeemscript[i]); + printf(" <- bobpayment redeem %d %s %s\n",i,swap->bobpayment.I.destaddr,bits256_str(str,swap->bobpayment.I.signedtxid));*/ + memcpy(swap->I.userdata_alicespend,userdata,len); + swap->I.userdata_alicespendlen = len; + retval = 0; + memcpy(swap->alicespend.I.pubkey33,swap->persistent_pubkey33,33); + bitcoin_address(swap->alicespend.I.destaddr,coin->taddr,coin->pubtype,swap->persistent_pubkey33,33); + //char str[65],str2[65]; printf("bobpaid privAm.(%s) myprivs[0].(%s)\n",bits256_str(str,swap->I.privAm),bits256_str(str2,swap->I.myprivs[0])); + if ( (retval= basilisk_rawtx_sign(coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr,coin->zcash)) == 0 ) + { + /*for (i=0; ibobpayment.I.datalen; i++) + printf("%02x",swap->bobpayment.txbytes[i]); + printf(" <- bobpayment\n"); + for (i=0; ialicespend.I.datalen; i++) + printf("%02x",swap->alicespend.txbytes[i]); + printf(" <- alicespend\n\n");*/ + swap->I.alicespent = 1; + return(LP_waitmempool(coin->symbol,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,60)); + } else printf("error signing aliceclaim suppress.%d vin.(%s)\n",swap->alicespend.I.suppress_pubkeys,swap->bobpayment.I.destaddr); + } + } else printf("verify bobpayment cant find (%s)\n",swap->I.bobstr); printf("error validating bobpayment\n"); return(-1); } From 574014c366ce041e09487bab4416a7913d0d379c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 02:43:17 +0200 Subject: [PATCH 2483/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 430b104dd..497aebe75 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -133,7 +133,7 @@ char GLOBAL_DBDIR[] = { "DB" }; char LP_myipaddr[64],LP_publicaddr[64],USERHOME[512] = { "/root" }; char LP_gui[16] = { "cli" }; -char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", //"5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", +char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", //"24.54.206.138", "173.212.225.176", "136.243.45.140", "107.72.162.127", "72.50.16.86", "51.15.202.191", "173.228.198.88", "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f65f88370..4f99f2298 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -158,6 +158,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str { if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { + //alice not eligible 0.36893923 -> dest 0.55020000 1.49130251 (0.61732249 0.00104324) 14b8b74808d2d34a70e5eddd1cad47d855858f8b23cac802576d4d37b5f8af8f/v1 abec6e76169bcb738235ca67fab02cc55390f39e422aa71f1badf8747c290cc4/v1 char str[65],str2[65]; printf("alice not eligible %.8f -> dest %.8f %.8f (%.8f %.8f) %s/v%d %s/v%d\n",dstr(qp->satoshis),dstr(qp->destsatoshis),(double)qp->destsatoshis/qp->satoshis,dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(-3); } From 6e73032283844d668b7e0f78d08fee596c85f3d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 02:45:42 +0200 Subject: [PATCH 2484/2732] Test --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index c2a07a804..82120368d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1230,8 +1230,8 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub return(-1); if ( strcmp(coin->smartaddr,vinaddr) != 0 ) { - printf("???????????????????????? basilisk_rawtx_gen mismatched %s vinaddr.%s != (%s)\n",coin->symbol,vinaddr,coin->smartaddr); - //return(-1); + printf("???????????????????????? basilisk_rawtx_gen mismatched %s %s vinaddr.%s != (%s)\n",rawtx->symbol,coin->symbol,vinaddr,coin->smartaddr); + return(-1); } argjson = cJSON_CreateObject(); jaddbits256(argjson,"utxotxid",rawtx->utxotxid); From 08d4dc192b55a7d38949fdf22874704efae85409 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 02:49:43 +0200 Subject: [PATCH 2485/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3aca6ee1c..41df9bd17 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -486,7 +486,7 @@ bot_resume(botid)\n\ { ptr->privkeydepth = 0; LP_address(ptr,ptr->smartaddr); - if ( jint(argjson,"reset") != 0 ) + if ( 0 && jint(argjson,"reset") != 0 ) { LP_address_utxo_reset(ptr); LP_passphrase_init(jstr(argjson,"passphrase"),G.gui); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 497aebe75..bd0bb193a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -518,6 +518,8 @@ void LP_coinsloop(void *_coins) continue; } } + if ( coin->smartaddr[0] == 0 ) + printf("%s has no smartaddress??\n",coin->symbol); memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; From d7a48f542cecb8b99702779660a57ff5cafb13ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:00:37 +0200 Subject: [PATCH 2486/2732] Test --- iguana/exchanges/LP_bitcoin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 373af373b..8eaeafd86 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3198,6 +3198,7 @@ cJSON *iguana_voutjson(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,struct igu jadd(json,"scriptPubKey",skey); } } + free(vp); return(json); } From 7432c82dc5c4521ff80c7ac11113c435ef4461ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:05:38 +0200 Subject: [PATCH 2487/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/LP_utxo.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 82120368d..6f54db403 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -910,7 +910,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ printf("have utxotxid but wasnt found up.%p\n",up); if ( up == 0 ) { - value = LP_txvalue(coin->smartaddr,coin->symbol,utxotxid,utxovout); + value = LP_txvalue(0,coin->symbol,utxotxid,utxovout); LP_address_utxoadd("withdraw",coin,coin->smartaddr,utxotxid,utxovout,value,1,-1); printf("added after not finding\n"); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bfd1103f3..5d4b5b482 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -765,13 +765,12 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) } else if ( coin->electrum == 0 ) { - uint64_t value; char _coinaddr[64]; + uint64_t value; if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) != 0 ) { value = LP_value_extract(txobj,0);//SATOSHIDEN * (jdouble(txobj,"value") + jdouble(txobj,"interest")); - if ( coinaddr == 0 ) - coinaddr = _coinaddr; - LP_destaddr(coinaddr,txobj); + if ( coinaddr != 0 ) + LP_destaddr(coinaddr,txobj); //printf("pruned node? LP_txvalue couldnt find %s tx %s, but gettxout %.8f\n",coin->symbol,bits256_str(str,txid),dstr(value)); if ( value != 0 ) { From cea1ddfe59664030786be3851404dddd0dbbcadf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:24:54 +0200 Subject: [PATCH 2488/2732] Test --- iguana/exchanges/LP_bitcoin.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 8eaeafd86..a86473d61 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3331,7 +3331,7 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { - int32_t i,n,len = 0,extraused=0; uint32_t seglen; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + int32_t i,n,len = 0,extraused=0; uint32_t seglen,tmp,segitems; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) @@ -3441,10 +3441,18 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is printf("unsupported rwflag.%d when segwitflag\n",rwflag); else { - len += iguana_rwvarint32(rwflag,&serialized[len],&seglen); - printf("witness len.%d sum %d vs max.%d\n",seglen,seglen+len,maxsize); - if ( seglen+len < maxsize ) - len += maxsize; + len += iguana_rwvarint32(rwflag,&serialized[len],&segitems); + printf("witness segitems.%d sum %d vs max.%d\n",segitems,len,maxsize); + for (i=0; i= maxsize ) + { + printf("i.%d of segitems.%d overflowed %d+%d >= max.%d\n",i,segitems,len,tmp,maxsize); + break; + } else len += tmp; + } } } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); From cfacf467cabe9a1fc5360d15ec87e99cb589a776 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:38:11 +0200 Subject: [PATCH 2489/2732] Test --- iguana/exchanges/LP_bitcoin.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index a86473d61..7d945ebb2 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3331,7 +3331,7 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { - int32_t i,n,len = 0,extraused=0; uint32_t seglen,tmp,segitems; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + int32_t i,j,n,len = 0,extraused=0; uint32_t tmp,segitems; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) @@ -3441,18 +3441,23 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is printf("unsupported rwflag.%d when segwitflag\n",rwflag); else { - len += iguana_rwvarint32(rwflag,&serialized[len],&segitems); - printf("witness segitems.%d sum %d vs max.%d\n",segitems,len,maxsize); - for (i=0; itx_in; i++) { - len += iguana_rwvarint32(rwflag,&serialized[len],&tmp); - printf("%d ",tmp); - if ( len+tmp >= maxsize ) + len += iguana_rwvarint32(rwflag,&serialized[len],&segitems); + printf("vini.%d (%d:",i,segitems); + for (j=0; j= max.%d\n",i,segitems,len,tmp,maxsize); - break; - } else len += tmp; + len += iguana_rwvarint32(rwflag,&serialized[len],&tmp); + printf(" %d",tmp); + if ( len+tmp >= maxsize ) + { + printf("vini.%d of %d, j.%d of segitems.%d overflowed %d+%d >= max.%d\n",i,msg->tx_in,j,segitems,len,tmp,maxsize); + break; + } else len += tmp; + } + printf("), "); } + printf("witness sum %d vs max.%d\n",len,maxsize); } } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); From 142b72804e238182766746e05345a0fed738ffa0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:46:41 +0200 Subject: [PATCH 2490/2732] Test --- iguana/exchanges/LP_bitcoin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 7d945ebb2..772e4aa34 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3457,7 +3457,8 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } printf("), "); } - printf("witness sum %d vs max.%d\n",len,maxsize); + bits256 txid = bits256_doublesha256(0,serialized,len+sizeof(msg->lock_time)); + char str[65]; printf("witness sum %d vs max.%d txid %s\n",len,maxsize,bits256_str(str,txid)); } } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); From b1de4ec3032e19fcf3219c8db3bc899d2fe0234c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:54:00 +0200 Subject: [PATCH 2491/2732] Test --- iguana/exchanges/LP_bitcoin.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 772e4aa34..657672b64 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3331,7 +3331,7 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { - int32_t i,j,n,len = 0,extraused=0; uint32_t tmp,segitems; uint8_t segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + int32_t i,j,n,segtxlen,len = 0,extraused=0; uint32_t tmp,segitems; uint8_t *segtx,segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) @@ -3436,6 +3436,11 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } if ( segwitflag != 0 ) { + segtxlen = len - 2 + sizeof(msg->lock_time); + segtx = malloc(segtxlen); + memcpy(segtx,serialized,sizeof(int32_t)); + memcpy(&segtx[sizeof(int32_t)],&serialized[sizeof(int32_t)+2],len-2-sizeof(int32_t)); + printf("tx_out %d, tx_in %d %02x %02x %02x\n",msg->tx_out,msg->tx_in,serialized[len],serialized[len+1],serialized[len+2]); if ( rwflag != 0 ) printf("unsupported rwflag.%d when segwitflag\n",rwflag); @@ -3457,7 +3462,8 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } printf("), "); } - bits256 txid = bits256_doublesha256(0,serialized,len+sizeof(msg->lock_time)); + memcpy(&segtx[segtxlen-sizeof(int32_t)],&serialized[len],sizeof(int32_t)); + bits256 txid = bits256_doublesha256(0,segtx,segtxlen); char str[65]; printf("witness sum %d vs max.%d txid %s\n",len,maxsize,bits256_str(str,txid)); } } From 825115c4a28e06d2c3a435845b032e6c01b2af6d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:56:32 +0200 Subject: [PATCH 2492/2732] Test --- iguana/exchanges/LP_bitcoin.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 657672b64..97ca24817 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3449,22 +3449,22 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is for (i=0; itx_in; i++) { len += iguana_rwvarint32(rwflag,&serialized[len],&segitems); - printf("vini.%d (%d:",i,segitems); + //printf("vini.%d (%d:",i,segitems); for (j=0; j= maxsize ) { printf("vini.%d of %d, j.%d of segitems.%d overflowed %d+%d >= max.%d\n",i,msg->tx_in,j,segitems,len,tmp,maxsize); break; } else len += tmp; } - printf("), "); + //printf("), "); } memcpy(&segtx[segtxlen-sizeof(int32_t)],&serialized[len],sizeof(int32_t)); - bits256 txid = bits256_doublesha256(0,segtx,segtxlen); - char str[65]; printf("witness sum %d vs max.%d txid %s\n",len,maxsize,bits256_str(str,txid)); + *txidp = bits256_doublesha256(0,segtx,segtxlen); + //char str[65]; printf("witness sum %d vs max.%d txid %s\n",len,maxsize,bits256_str(str,txid)); } } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); @@ -3519,7 +3519,8 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is jadd(json,"vout",voutarray); jaddnum(json,"numvouts",msg->tx_out); } - *txidp = bits256_doublesha256(txidstr,txstart,len); + if ( segwitflag == 0 ) + *txidp = bits256_doublesha256(txidstr,txstart,len); if ( json != 0 ) { jaddnum(json,"locktime",msg->lock_time); From a2d3150dd5d64a43faeea07845878613326616d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 03:58:27 +0200 Subject: [PATCH 2493/2732] Test --- iguana/exchanges/LP_bitcoin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 97ca24817..0c8e9abc6 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3364,7 +3364,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is if ( serialized[len] == 0x00 && (segwitflag= serialized[len+1]) == 0x01 ) { len += 2; - printf("SEGWIT transaction\n"); + //printf("SEGWIT transaction\n"); } } len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_in); @@ -3441,7 +3441,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is memcpy(segtx,serialized,sizeof(int32_t)); memcpy(&segtx[sizeof(int32_t)],&serialized[sizeof(int32_t)+2],len-2-sizeof(int32_t)); - printf("tx_out %d, tx_in %d %02x %02x %02x\n",msg->tx_out,msg->tx_in,serialized[len],serialized[len+1],serialized[len+2]); + //printf("tx_out %d, tx_in %d %02x %02x %02x\n",msg->tx_out,msg->tx_in,serialized[len],serialized[len+1],serialized[len+2]); if ( rwflag != 0 ) printf("unsupported rwflag.%d when segwitflag\n",rwflag); else From e480e2d7e38b2ac99dd8d8f493f078580fe36aed Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:04:44 +0200 Subject: [PATCH 2494/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 16 +--------------- iguana/exchanges/LP_transaction.c | 7 +++++-- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 41df9bd17..3aca6ee1c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -486,7 +486,7 @@ bot_resume(botid)\n\ { ptr->privkeydepth = 0; LP_address(ptr,ptr->smartaddr); - if ( 0 && jint(argjson,"reset") != 0 ) + if ( jint(argjson,"reset") != 0 ) { LP_address_utxo_reset(ptr); LP_passphrase_init(jstr(argjson,"passphrase"),G.gui); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bd0bb193a..123c461be 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,26 +19,12 @@ // marketmaker // // alice waiting for bestprice -// regen inventory -// previously, it used to show amount, kmd equiv, perc // bot safe to exit? // // BCH signing +// previously, it used to show amount, kmd equiv, perc // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs -//BTC LP_transaction_fromdata mismatched txid f78c80e831c02c89c0888e7d4438287030238e09e33f88da6df4dc84b949959b vs 1390f386f5997607e646be9c93f30018aa68ea971790b92b7b06e892656f0769 -//failed blockchain.transaction.get BTC f78c80e831c02c89c0888e7d4438287030238e09e33f88da6df4dc84b949959b -//02000000000101242344292f9117c8318adb84f7991239361da2ff0a15ad2106d402945072cc110a0000001716001470eb5212b558cfc10b31f0849ef88ecf17097ac1ffffffff0c4a8321000000000017a914baed1c79cc6325333d5013b44dc17e8256bf5b718704bf3c000000000017a914255cf2809a1f42569c5c47c71e6234aac35a800f873099f400000000001976a914049877b81a8d6d8592919b75b9bcb4182f7c52cd88acb907e200000000001976a9140614fc114940e867210b09cc900db14d8bc58d2b88ac40771b00000000001976a9148cadbb1d7002d22d60e38ca238678d00f04ed22988ac002d3101000000001976a9140d05714431cf478846cea1435f9eabae9ad5c65388acc0f280010000000017a914c17a70c74154fc53263652aaca26c8d71683f1ba87aa2a4e00000000001976a914feea6b867954b1072962083233796d47e4c1665e88ace0e1de02000000001976a91445b71fbb02df53be5563257b77780b9afcc55bdc88acf6fe6700000000001976a91492332f8ff3b26e3ce2666afa5fee2e45308225af88ace74c1500000000001976a914fc7580f1ce24b2c85c80b2c8e641592b9bbf974588ac081ad000000000001976a9145e61c81c9b3ac55bf90ab00240023e8ddaf43e1788ac02483045022100a74be4e00585637c6792eeff9279508f09163db525f8b16c03e57283d12b0a6a022042cc061d70e78e9260ff30635db4f4e0b317831a8cb1f30473a25b93b4d1b4fb01210238288b60e8c50785809a69517ae3ca2fe3e407cac8b5868c5fb3803c233dfbcc00000000 data2json n.219 vs len.586 - - -//BTC LP_transaction_fromdata mismatched txid ae7af65215554964b7af01babb58fce10fc51d9812ced07ee4a62a1ffe10c0bb vs 051ef4f75898b511dd3aebd687d5a5bdb004226d811aaf13e64be741dbe81ff2 -//failed blockchain.transaction.get BTC ae7af65215554964b7af01babb58fce10fc51d9812ced07ee4a62a1ffe10c0bb -//errortxobj.({"version":1}) -//010000000001010c590740b0c558f75b64cc0d00b0533ff951e403d993b866a87c7c52981388a60300000017160014cd2b7646f9931c85bb9d4d353b652c76b40aff84ffffffff0240420f000000000017a914239ae54cd403a91b084d3244e7e423f05c25ec268728fe28010000000017a914b96e21dd6e11bb67479f9072df55881e7fb17f788702473044022076e4c1cfba0dab889598efdfdcbc7a1046cc0eecfb8fec379994d559143d271c02206b16d9a0e3c425434d1b793d61e1e491f269abc7e7d3af52d95f6a26c1c2aa0d0121037f88a6ccdd608645024b05f408324550cf6fa1c74e3d7c1f94a1e9b57369d10600000000 data2json n.-1 vs len.247 - - -//ScriptSig: PUSHDATA(34)[002072d8f7debd607b94c95ced6cff38265ed99c7c1ee58b67d0a3f3ed43b6d9a977] -//Witness: 040047304402206f23bb2dd06bc70d78312e27d53954420d0defbda7ad638718b9dc2c1efb93100220270f79bfb3230194d2e625875073799f6f07d96d5bce43b19cfe6be9957d95540148304502210081842f5987009e65f1d7de6140433da541b9da52ed211e87e1ae6fc25260d7680220798de97c682541d7b26b0795b19994f045f3ef4f433c55da0b5f1506ddeec413014752210305345798069ac85285628732485a3ce7e96b85696ed7da72287f6eae3b275363210268aace9c841b8d61fe3532981c8b25e235690003916c5a90c23a708e5d8f929752ae #include struct LP_millistats diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6f54db403..8431e90fb 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1082,8 +1082,11 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf memset(utxos,0,sizeof(utxos)); if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) { - printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); - //return(0); + if ( bits256_nonz(utxotxid) == 0 ) + { + printf("LP_createrawtransaction: address_utxo_ptrs %d, error\n",numutxos); + return(0); + } } char str[65]; for (i=0; i Date: Tue, 14 Nov 2017 04:07:33 +0200 Subject: [PATCH 2495/2732] Test --- iguana/exchanges/LP_ordermatch.c | 7 ++++--- iguana/exchanges/LP_transaction.c | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4f99f2298..d2b7b9e79 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -844,7 +844,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( bits256_nonz(Q.txid2) != 0 ) LP_utxos_remove(Q.txid2,Q.vout2); else recalc = 1; - printf("price %.8f qprice %.8f\n",price,qprice); + //printf("price %.8f qprice %.8f\n",price,qprice); if ( recalc == 0 ) { value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); @@ -941,14 +941,15 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddstr(retjson,"method","reserved"); msg = jprint(retjson,0); butxo->T.lasttime = (uint32_t)time(NULL); - printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,ask,msg); + //printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,ask,msg); // LP_addsig //msg2 = clonestr(msg); LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); sleep(1); bits256 zero; memset(zero.bytes,0,sizeof(zero)); - LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); + //LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); + LP_reserved_msg(0,Q.srccoin,Q.destcoin,zero,msg); //LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); free_json(retjson); return(retval); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 8431e90fb..6e4642f3e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -907,12 +907,12 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ if ( bits256_nonz(utxotxid) != 0 && numpre == 0 ) { up = LP_address_utxofind(coin,coin->smartaddr,utxotxid,utxovout); - printf("have utxotxid but wasnt found up.%p\n",up); + //printf("have utxotxid but wasnt found up.%p\n",up); if ( up == 0 ) { value = LP_txvalue(0,coin->symbol,utxotxid,utxovout); LP_address_utxoadd("withdraw",coin,coin->smartaddr,utxotxid,utxovout,value,1,-1); - printf("added after not finding\n"); + //printf("added after not finding\n"); } if ( (up= LP_address_utxofind(coin,coin->smartaddr,utxotxid,utxovout)) != 0 ) preselected[numpre++] = up; @@ -978,7 +978,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); } } - printf("numunspents.%d vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f %s/v%d\n",numunspents,n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum),bits256_str(str,up->U.txid),up->U.vout); + //printf("numunspents.%d vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f %s/v%d\n",numunspents,n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum),bits256_str(str,up->U.txid),up->U.vout); vp = &V[n++]; vp->N = vp->M = 1; vp->signers[0].privkey = privkey; @@ -1088,9 +1088,9 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } } - char str[65]; - for (i=0; iU.txid),utxos[i]->U.vout,dstr(utxos[i]->U.value)); + //char str[65]; + //for (i=0; iU.txid),utxos[i]->U.vout,dstr(utxos[i]->U.value)); ignore_cltverr = 0; suppress_pubkeys = 1; From 3c1fc577da6cc1cdb256ffcb17a4b00478958536 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:17:12 +0200 Subject: [PATCH 2496/2732] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++----- iguana/exchanges/LP_stats.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d2b7b9e79..86ca8afc4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -34,7 +34,7 @@ double LP_bob_competition(int32_t *counterp,uint64_t aliceid,double price,int32_ { if ( now > Bob_competition[i].starttime+LP_AUTOTRADE_TIMEOUT ) { - //printf("aliceid.%llx expired\n",(long long)aliceid); + //printf("aliceid.%llu expired\n",(long long)aliceid); Bob_competition[i].bestprice = 0.; Bob_competition[i].starttime = now; Bob_competition[i].counter = 0; @@ -42,7 +42,7 @@ double LP_bob_competition(int32_t *counterp,uint64_t aliceid,double price,int32_ if ( price != 0. && (Bob_competition[i].bestprice == 0. || price < Bob_competition[i].bestprice) ) { Bob_competition[i].bestprice = price; - //printf("Bob competition aliceid.%llx <- bestprice %.8f\n",(long long)aliceid,price); + //printf("Bob competition aliceid.%llu <- bestprice %.8f\n",(long long)aliceid,price); } Bob_competition[i].counter += counter; *counterp = Bob_competition[i].counter; @@ -58,7 +58,7 @@ double LP_bob_competition(int32_t *counterp,uint64_t aliceid,double price,int32_ Bob_competition[firsti].aliceid = aliceid; Bob_competition[firsti].bestprice = price; *counterp = counter; - //printf("Bob competition aliceid.%llx %.8f\n",(long long)aliceid,price); + //printf("Bob competition aliceid.%llu %.8f\n",(long long)aliceid,price); return(price); } @@ -720,7 +720,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: check received method %12s aliceid.%16llx %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); + printf("LP_tradecommand: received %12s aliceid.%22llu %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; @@ -732,7 +732,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"reserved") == 0 ) { bestprice = LP_bob_competition(&counter,aliceid,qprice,1); - //printf("aliceid.%llx price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); + //printf("aliceid.%llu price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 853ce8bd0..40569f027 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -209,7 +209,7 @@ int32_t LP_swapstats_update(struct LP_swapstats *sp,struct LP_quoteinfo *qp,cJSO else { if ( requestid == sp->Q.R.requestid && quoteid == sp->Q.R.quoteid ) - printf("mismatched tradestatus aliceid.%016llx b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); + printf("mismatched tradestatus aliceid.%22llu b%s/%s r%s/%s r%u/%u q%u/%u %.8f/%.8f -> %.8f/%.8f\n",(long long)sp->aliceid,base,sp->Q.srccoin,rel,sp->Q.destcoin,requestid,sp->Q.R.requestid,quoteid,sp->Q.R.quoteid,dstr(satoshis+2*sp->Q.txfee),dstr(sp->Q.satoshis),dstr(destsatoshis+2*sp->Q.desttxfee),dstr(sp->Q.destsatoshis)); return(-1); } From 7e6479b0a23a418100cb5446ffa81921e31473c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:27:04 +0200 Subject: [PATCH 2497/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 86ca8afc4..da83aeb26 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -863,7 +863,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price += (r * range) / 100.; bestprice = LP_bob_competition(&counter,aliceid,price,0); printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",ask,qprice,r,range,price,bestprice,counter); - if ( counter > 2 || price > bestprice*1.1 ) + if ( counter > 10 )//2 || price > bestprice*1.1 ) return(retval); } else return(retval); //printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); @@ -948,8 +948,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, sleep(1); bits256 zero; memset(zero.bytes,0,sizeof(zero)); - //LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); - LP_reserved_msg(0,Q.srccoin,Q.destcoin,zero,msg); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); + //LP_reserved_msg(0,Q.srccoin,Q.destcoin,zero,msg); //LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); free_json(retjson); return(retval); From 0902ea2c030085a407a734591d4ad33f158cdf47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:36:27 +0200 Subject: [PATCH 2498/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index da83aeb26..95278302d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -801,7 +801,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } price = ask; - //printf("MYPRICE %s/%s %.8f\n",Q.srccoin,Q.destcoin,price); + printf("MYPRICE %s/%s %.8f vs qprice %.8f\n",Q.srccoin,Q.destcoin,price,qprice); if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) { printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); @@ -891,7 +891,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - //printf("cant find utxopair\n"); + printf("cant find utxopair\n"); return(retval); } } @@ -941,7 +941,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddstr(retjson,"method","reserved"); msg = jprint(retjson,0); butxo->T.lasttime = (uint32_t)time(NULL); - //printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,ask,msg); + printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,ask,msg); // LP_addsig //msg2 = clonestr(msg); LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); From 7d9fdd77eb5d6b70162800aea98222410ddc0df7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:42:07 +0200 Subject: [PATCH 2499/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 95278302d..88171d831 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -863,7 +863,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price += (r * range) / 100.; bestprice = LP_bob_competition(&counter,aliceid,price,0); printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",ask,qprice,r,range,price,bestprice,counter); - if ( counter > 10 )//2 || price > bestprice*1.1 ) + if ( counter > 5 || price > bestprice*1.1 ) return(retval); } else return(retval); //printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); From b695221cb19237c232e851d0a672af8d62e6d84e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:49:26 +0200 Subject: [PATCH 2500/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 5d4b5b482..3257f6096 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -189,7 +189,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a continue; } } - if ( LP_allocated(up->U.txid,up->U.vout) == 0 && (iambob == 0 || (_LP_utxofind(iambob,up->U.txid,up->U.vout) == 0 && _LP_utxo2find(iambob,up->U.txid,up->U.vout) == 0)) ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 )//&& (iambob == 0 || (_LP_utxofind(iambob,up->U.txid,up->U.vout) == 0 && _LP_utxo2find(iambob,up->U.txid,up->U.vout) == 0)) ) { utxos[n++] = up; if ( n >= max ) From e8e6fd263330dac03fae301b582f9bf7760ce210 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 04:50:58 +0200 Subject: [PATCH 2501/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3aca6ee1c..56ed047e4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -484,10 +484,10 @@ bot_resume(botid)\n\ struct iguana_info *ptr; if ( (ptr= LP_coinfind(coin)) != 0 ) { - ptr->privkeydepth = 0; LP_address(ptr,ptr->smartaddr); if ( jint(argjson,"reset") != 0 ) { + ptr->privkeydepth = 0; LP_address_utxo_reset(ptr); LP_passphrase_init(jstr(argjson,"passphrase"),G.gui); } From 818fceb3e260082a097a1faa3b2e24cdc508cb5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 13:20:24 +0200 Subject: [PATCH 2502/2732] Test --- iguana/exchanges/LP_bitcoin.c | 3 ++- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 0c8e9abc6..a9aa5751b 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -3331,7 +3331,7 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash) { - int32_t i,j,n,segtxlen,len = 0,extraused=0; uint32_t tmp,segitems; uint8_t *segtx,segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; + int32_t i,j,n,segtxlen,len = 0,extraused=0; uint32_t tmp,segitems; uint8_t *segtx=0,segwitflag=0,spendscript[IGUANA_MAXSCRIPTSIZE],*txstart = serialized,*sigser=0; char txidstr[65]; cJSON *vinarray=0,*voutarray=0; bits256 sigtxid; len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->version),&msg->version); if ( json != 0 ) @@ -3464,6 +3464,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is } memcpy(&segtx[segtxlen-sizeof(int32_t)],&serialized[len],sizeof(int32_t)); *txidp = bits256_doublesha256(0,segtx,segtxlen); + free(segtx); //char str[65]; printf("witness sum %d vs max.%d txid %s\n",len,maxsize,bits256_str(str,txid)); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 123c461be..455845d77 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,11 +13,11 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ - // // LP_nativeDEX.c // marketmaker // +// single utxo allocations, reject result, latency // alice waiting for bestprice // bot safe to exit? // diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 88171d831..7f7e946c1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -891,7 +891,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - printf("cant find utxopair\n"); + printf("cant find utxopair %s/%s\n",Q.srccoin,Q.destcoin); return(retval); } } From c7d175dac94a82a86be3a85248827c806bafdfb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 18:39:22 +0200 Subject: [PATCH 2503/2732] Dynamic inventory --- iguana/exchanges/LP_cache.c | 4 +- iguana/exchanges/LP_include.h | 15 +- iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_ordermatch.c | 320 +++++++++++++++--------------- iguana/exchanges/LP_signatures.c | 11 +- iguana/exchanges/LP_socket.c | 6 +- iguana/exchanges/LP_swap.c | 12 +- iguana/exchanges/LP_transaction.c | 39 +--- iguana/exchanges/LP_utxo.c | 206 +++++++++++++++---- iguana/exchanges/LP_utxos.c | 52 +++-- 10 files changed, 405 insertions(+), 263 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 65140dc2c..a08828966 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -58,7 +58,7 @@ struct LP_transaction *LP_create_transaction(struct iguana_info *coin,bits256 tx tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); //printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); - LP_address_utxoadd("LP_create_transaction",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); + LP_address_utxoadd((uint32_t)time(NULL),"LP_create_transaction",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } for (i=0; ioutpoints[spentvout].spendtxid = txid; tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; - LP_address_utxoadd("LP_transactioninit iter1",coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + LP_address_utxoadd((uint32_t)time(NULL),"LP_transactioninit iter1",coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); if ( 0 && strcmp(coin->symbol,"REVS") == 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 839333523..c24ad9bf4 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "14336" +#define LP_BUILD_NUMBER "14414" #ifdef FROM_JS #include @@ -43,7 +43,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MAXVINS 64 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) -#define LP_AUTOTRADE_TIMEOUT 60 +#define LP_AUTOTRADE_TIMEOUT 30 +#define LP_RESERVETIME (LP_AUTOTRADE_TIMEOUT * 2) #define ELECTRUM_TIMEOUT 7 #define LP_ELECTRUM_KEEPALIVE 60 #define LP_ELECTRUM_MAXERRORS 777 @@ -103,7 +104,6 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_RPCPORT 7783 #define LP_PROPAGATION_SLACK 100 // txid ordering is not enforced, so getting extra recent txid -#define LP_RESERVETIME 60 #define LP_AVETXSIZE 256 #define LP_CACHEDURATION 60 #define BASILISK_DEFAULT_NUMCONFIRMS 1 @@ -288,7 +288,7 @@ struct LP_utxobob { struct _LP_utxoinfo utxo,deposit; }; struct LP_utxoalice { struct _LP_utxoinfo utxo,fee; }; -struct LP_utxoswap { bits256 otherpubkey; void *swap; uint64_t satoshis; }; +struct LP_utxoswap { bits256 otherpubkey; uint64_t satoshis; }; struct LP_utxoinfo { @@ -308,6 +308,7 @@ struct LP_address_utxo struct LP_address_utxo *next,*prev; struct _LP_utxoinfo U; int32_t SPV,spendheight; + uint32_t timestamp; }; struct LP_address @@ -346,7 +347,7 @@ struct LP_endpoint { int32_t pair; char ipaddr[64]; uint16_t port; }; struct basilisk_swap { - void *ctx; struct LP_utxoinfo *utxo; + void *ctx; //struct LP_utxoinfo *utxo; struct LP_endpoint N; void (*balancingtrade)(struct basilisk_swap *swap,int32_t iambob); int32_t subsock,pushsock,connected,aliceunconf,depositunconf,paymentunconf; @@ -410,7 +411,7 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest); int32_t LP_swap_getcoinaddr(char *symbol,char *coinaddr,bits256 txid,int32_t vout); char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen); int64_t LP_komodo_interest(bits256 txid,int64_t value); -void LP_availableset(struct LP_utxoinfo *utxo); +void LP_availableset(bits256 txid,int32_t vout); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedflag); @@ -452,7 +453,7 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid); int32_t LP_numpeers(); char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid); uint64_t LP_KMDvalue(struct iguana_info *coin,uint64_t balance); -int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); +int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight); void LP_smartutxos_push(struct iguana_info *coin); void LP_cacheptrs_init(struct iguana_info *coin); cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 455845d77..713e8e7de 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -78,7 +78,7 @@ void LP_millistats_update(struct LP_millistats *mp) } #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex,LP_inusemutex; int32_t LP_canbind; char *Broadcaststr,*Reserved_msgs[2][1000]; int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; @@ -923,6 +923,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_networkmutex); portable_mutex_init(&LP_gcmutex); portable_mutex_init(&LP_forwardmutex); + portable_mutex_init(&LP_inusemutex); portable_mutex_init(&LP_psockmutex); portable_mutex_init(&LP_coinmutex); portable_mutex_init(&LP_pubkeymutex); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7f7e946c1..0ef73ab65 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -290,7 +290,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a //printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight); if ( up->spendheight <= 0 ) { - if ( dist >= 0 && dist < mindist ) //(coin->electrum == 0 || up->SPV > 0) && + if ( dist >= 0 && dist < mindist ) { //printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); mini = i; @@ -303,6 +303,55 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a return(mini); } +void LP_butxo_set(struct LP_utxoinfo *butxo,struct iguana_info *coin,struct LP_address_utxo *up,struct LP_address_utxo *up2,int64_t satoshis) +{ + butxo->pubkey = G.LP_mypub25519; + safecopy(butxo->coin,coin->symbol,sizeof(butxo->coin)); + safecopy(butxo->coinaddr,coin->smartaddr,sizeof(butxo->coinaddr)); + butxo->payment.txid = up->U.txid; + butxo->payment.vout = up->U.vout; + butxo->payment.value = up->U.value; + butxo->iambob = 1; + butxo->deposit.txid = up2->U.txid; + butxo->deposit.vout = up2->U.vout; + butxo->deposit.value = up2->U.value; + butxo->S.satoshis = satoshis; +} + +void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) +{ + if ( butxo != 0 ) + { + memset(butxo,0,sizeof(*butxo)); + butxo->pubkey = qp->srchash; + safecopy(butxo->coin,qp->srccoin,sizeof(butxo->coin)); + safecopy(butxo->coinaddr,qp->coinaddr,sizeof(butxo->coinaddr)); + butxo->payment.txid = qp->txid; + butxo->payment.vout = qp->vout; + //butxo->payment.value = qp->value; + butxo->iambob = 1; + butxo->deposit.txid = qp->txid2; + butxo->deposit.vout = qp->vout2; + //butxo->deposit.value = up2->U.value; + butxo->S.satoshis = qp->satoshis; + } + if ( autxo != 0 ) + { + memset(autxo,0,sizeof(*autxo)); + autxo->pubkey = qp->desthash; + safecopy(autxo->coin,qp->destcoin,sizeof(autxo->coin)); + safecopy(autxo->coinaddr,qp->destaddr,sizeof(autxo->coinaddr)); + autxo->payment.txid = qp->desttxid; + autxo->payment.vout = qp->destvout; + //autxo->payment.value = qp->value; + autxo->iambob = 0; + autxo->fee.txid = qp->feetxid; + autxo->fee.vout = qp->feevout; + //autxo->deposit.value = up2->U.value; + autxo->S.satoshis = qp->destsatoshis; + } +} + uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee) { //printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume) / price) + 2*txfee),relvolume,price); @@ -311,9 +360,10 @@ uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t d else return(0); } -struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price,uint64_t desttxfee) +struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct iguana_info *coin,char *coinaddr,uint64_t txfee,double relvolume,double price,uint64_t desttxfee) { - struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; struct LP_utxoinfo *utxo = 0;//,*utmp; + struct LP_address *ap; uint64_t targetval,targetval2; int32_t m,mini; struct LP_address_utxo *up,*up2; + memset(butxo,0,sizeof(*butxo)); targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); targetval2 = (targetval / 8) * 9 + 2*txfee; if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) @@ -340,12 +390,13 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** { if ( up != 0 && (up2= utxos[mini]) != 0 ) { - if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 ) + /*if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 ) { utxo->S.satoshis = targetval; char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid)); - return(utxo); - } + return(butxo); + }*/ + LP_butxo_set(butxo,coin,up,up2,targetval); } } //else printf("cant find targetval2 %.8f\n",dstr(targetval2)); } //else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); @@ -353,64 +404,21 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } //else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); - /*HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,utmp) - { - if ( LP_isavailable(utxo) != 0 && utxo->payment.value >= targetval && targetval >= utxo->payment.value/2 && utxo->deposit.value >= targetval2 ) - { - utxo->S.satoshis = targetval; - printf("backup method found utxo!\n"); - return(utxo); - } - }*/ return(0); } -void LP_abutxo_set(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,struct LP_quoteinfo *qp) -{ - if ( butxo != 0 ) - { - memset(butxo,0,sizeof(*butxo)); - butxo->pubkey = qp->srchash; - safecopy(butxo->coin,qp->srccoin,sizeof(butxo->coin)); - safecopy(butxo->coinaddr,qp->coinaddr,sizeof(butxo->coinaddr)); - butxo->payment.txid = qp->txid; - butxo->payment.vout = qp->vout; - //butxo->payment.value = qp->value; - butxo->iambob = 1; - butxo->deposit.txid = qp->txid2; - butxo->deposit.vout = qp->vout2; - //butxo->deposit.value = up2->U.value; - butxo->S.satoshis = qp->satoshis; - } - if ( autxo != 0 ) - { - memset(autxo,0,sizeof(*autxo)); - autxo->pubkey = qp->desthash; - safecopy(autxo->coin,qp->destcoin,sizeof(autxo->coin)); - safecopy(autxo->coinaddr,qp->destaddr,sizeof(autxo->coinaddr)); - autxo->payment.txid = qp->desttxid; - autxo->payment.vout = qp->destvout; - //autxo->payment.value = qp->value; - autxo->iambob = 0; - autxo->fee.txid = qp->feetxid; - autxo->fee.vout = qp->feevout; - //autxo->deposit.value = up2->U.value; - autxo->S.satoshis = qp->destsatoshis; - } -} - -int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *base,char *rel,double price,struct LP_quoteinfo *qp) +int32_t LP_connectstartbob(void *ctx,int32_t pubsock,cJSON *argjson,char *base,char *rel,double price,struct LP_quoteinfo *qp) { char pairstr[512]; cJSON *retjson; bits256 privkey; int32_t pair=-1,retval = -1,DEXselector = 0; struct basilisk_swap *swap; struct iguana_info *coin; printf("LP_connectstartbob.(%s) with.(%s) %s\n",LP_myipaddr,jprint(argjson,0),LP_myipaddr); qp->quotetime = (uint32_t)time(NULL); - if ( (coin= LP_coinfind(utxo->coin)) == 0 ) + if ( (coin= LP_coinfind(qp->srccoin)) == 0 ) { - printf("cant find coin.%s\n",utxo->coin); + printf("cant find coin.%s\n",qp->srccoin); return(-1); } - privkey = LP_privkey(utxo->coinaddr,coin->taddr); - if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) //qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && + privkey = LP_privkey(coin->smartaddr,coin->taddr); + if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) { LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); if ( (swap= LP_swapinit(1,0,privkey,&qp->R,qp)) == 0 ) @@ -421,45 +429,37 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { swap->N.pair = pair; - utxo->S.swap = swap; - swap->utxo = utxo; + //utxo->S.swap = swap; + //swap->utxo = utxo; if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_bobloop,(void *)swap) == 0 ) { retjson = LP_quotejson(qp); jaddstr(retjson,"method","connected"); jaddstr(retjson,"pair",pairstr); - //jaddnum(retjson,"requestid",qp->R.requestid); - //jaddnum(retjson,"quoteid",qp->R.quoteid); - // LP_addsig - char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); - LP_reserved_msg(1,base,rel,utxo->S.otherpubkey,jprint(retjson,0)); + char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,qp->desthash)); + LP_reserved_msg(1,base,rel,qp->desthash,jprint(retjson,0)); sleep(1); bits256 zero; memset(zero.bytes,0,sizeof(zero)); LP_reserved_msg(1,base,rel,zero,jprint(retjson,0)); - //LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->desthash,jprint(retjson,0)); free_json(retjson); retval = 0; } else printf("error launching swaploop\n"); } else printf("couldnt bind to any port %s\n",pairstr); } - else - { - printf("dest %.8f vs required %.8f (%d %d %d %d %d)\n",dstr(qp->destsatoshis),dstr(price*(utxo->S.satoshis-qp->txfee)),bits256_nonz(privkey) != 0 ,qp->timestamp == utxo->T.swappending-LP_RESERVETIME,qp->quotetime >= qp->timestamp-3,qp->quotetime < utxo->T.swappending,bits256_cmp(G.LP_mypub25519,qp->srchash) == 0); - } if ( retval < 0 ) { if ( pair >= 0 ) nn_close(pair); - LP_availableset(utxo); - } else LP_unavailableset(utxo,utxo->S.otherpubkey); - //LP_butxo_swapfields(utxo); + LP_availableset(qp->txid,qp->vout); + LP_availableset(qp->txid2,qp->vout2); + } return(retval); } char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration,uint32_t tradeid,bits256 destpubkey) { - struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap; + struct LP_utxoinfo *aliceutxo; double price; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) { char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); @@ -491,15 +491,20 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) else return(-1); } +void LP_alicequery_clear() +{ + memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); + memset(&LP_Alicedestpubkey,0,sizeof(LP_Alicedestpubkey)); + LP_Alicemaxprice = 0.; + Alice_expiration = 0; +} + int32_t LP_alice_eligible() { if ( Alice_expiration != 0 && time(NULL) > Alice_expiration ) { printf("time expired for Alice_request\n"); - memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - memset(&LP_Alicedestpubkey,0,sizeof(LP_Alicedestpubkey)); - LP_Alicemaxprice = 0.; - Alice_expiration = 0; + LP_alicequery_clear(); } return(Alice_expiration == 0 || time(NULL) < Alice_expiration); } @@ -513,10 +518,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice*1.005 ) { qp->tradeid = LP_Alicequery.tradeid; - memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - memset(&LP_Alicedestpubkey,0,sizeof(LP_Alicedestpubkey)); - LP_Alicemaxprice = 0.; - Alice_expiration = 0; + LP_alicequery_clear(); printf("send CONNECT\n"); LP_query(ctx,myipaddr,mypubsock,"connect",qp); } else printf("LP_reserved price %.8f vs maxprice %.8f\n",price,maxprice*1.005); @@ -543,19 +545,20 @@ char *LP_connectedalice(cJSON *argjson) // alice LP_aliceid(Q.tradeid,Q.aliceid,"error2",0,0); return(clonestr("{\"error\":\"cant find autxo\"}")); } - if ( autxo->S.swap != 0 ) + /*if ( autxo->S.swap != 0 ) { printf("ignore duplicate swap\n"); LP_aliceid(Q.tradeid,Q.aliceid,"error3",0,0); return(clonestr("{\"error\":\"ignore duplicate swap\"}")); - } + }*/ LP_aliceid(Q.tradeid,Q.aliceid,"connected",Q.R.requestid,Q.R.quoteid); butxo = &B; memset(butxo,0,sizeof(*butxo)); LP_abutxo_set(0,butxo,&Q); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { - LP_availableset(autxo); + LP_availableset(Q.desttxid,Q.vout); + LP_availableset(Q.feetxid,Q.feevout); LP_aliceid(Q.tradeid,Q.aliceid,"error4",0,0); printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); @@ -563,7 +566,8 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin) <= SMALLVAL || bid <= SMALLVAL ) { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); - LP_availableset(autxo); + LP_availableset(Q.desttxid,Q.vout); + LP_availableset(Q.feetxid,Q.feevout); LP_aliceid(Q.tradeid,Q.aliceid,"error5",0,0); return(clonestr("{\"error\":\"no price set\"}")); } @@ -582,7 +586,8 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( (swap= LP_swapinit(0,0,Q.privkey,&Q.R,&Q)) == 0 ) { jaddstr(retjson,"error","couldnt swapinit"); - LP_availableset(autxo); + LP_availableset(Q.desttxid,Q.vout); + LP_availableset(Q.feetxid,Q.feevout); LP_aliceid(Q.tradeid,Q.aliceid,"error7",Q.R.requestid,Q.R.quoteid); return(jprint(retjson,1)); } @@ -598,8 +603,8 @@ char *LP_connectedalice(cJSON *argjson) // alice //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); swap->tradeid = Q.tradeid; swap->N.pair = pairsock; - autxo->S.swap = swap; - swap->utxo = autxo; + //autxo->S.swap = swap; + //swap->utxo = autxo; LP_aliceid(Q.tradeid,Q.aliceid,"started",Q.R.requestid,Q.R.quoteid); printf("alice pairstr.(%s) pairsock.%d\n",pairstr,pairsock); if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_aliceloop,(void *)swap) == 0 ) @@ -622,12 +627,16 @@ char *LP_connectedalice(cJSON *argjson) // alice } printf("connected result.(%s)\n",jprint(retjson,0)); if ( jobj(retjson,"error") != 0 ) - LP_availableset(autxo); + { + LP_availableset(Q.desttxid,Q.vout); + LP_availableset(Q.feetxid,Q.feevout); + } return(jprint(retjson,1)); } else { - LP_availableset(autxo); + LP_availableset(Q.desttxid,Q.vout); + LP_availableset(Q.feetxid,Q.feevout); LP_aliceid(Q.tradeid,Q.aliceid,"error11",0,0); printf("no privkey found coin.%s %s taddr.%u\n",Q.destcoin,Q.destaddr,coin->taddr); return(clonestr("{\"error\",\"no privkey\"}")); @@ -636,7 +645,7 @@ char *LP_connectedalice(cJSON *argjson) // alice int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) { - int32_t i,v,numconfs,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; struct iguana_info *coin = LP_coinfind(symbol); + int32_t i,v,numconfs,height,n=0; uint64_t value; bits256 txid; char buf[512]; cJSON *array,*item; uint32_t now; struct iguana_info *coin = LP_coinfind(symbol); if ( coin != 0 )//&& (IAMLP != 0 || coin->inactive == 0) ) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) @@ -657,6 +666,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) { if ( (n= cJSON_GetArraySize(array)) > 0 ) { + now = (uint32_t)time(NULL); for (i=0; icoinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) + char str[65]; + if ( bits256_nonz(Q.srchash) == 0 || bits256_cmp(Q.srchash,G.LP_mypub25519) == 0 ) + { + qprice = (double)Q.destsatoshis / Q.satoshis; + strcpy(Q.gui,G.gui); + strcpy(Q.coinaddr,coin->smartaddr); + strcpy(butxo->coinaddr,coin->smartaddr); + Q.srchash = G.LP_mypub25519; + memset(&Q.txid,0,sizeof(Q.txid)); + memset(&Q.txid2,0,sizeof(Q.txid2)); + Q.vout = Q.vout2 = -1; + } else return(retval); + /*if ( bits256_nonz(Q.srchash) == 0 || bits256_cmp(Q.srchash,G.LP_mypub25519) == 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) { qprice = (double)Q.destsatoshis / Q.satoshis; strcpy(Q.gui,G.gui); @@ -855,7 +875,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) recalc = 1; } - } else return(retval); + } else return(retval);*/ if ( qprice > price ) { r = (rand() % 100); @@ -863,45 +883,33 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price += (r * range) / 100.; bestprice = LP_bob_competition(&counter,aliceid,price,0); printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",ask,qprice,r,range,price,bestprice,counter); - if ( counter > 5 || price > bestprice*1.1 ) + if ( counter > 5 || price > bestprice*1.1 ) // skip if late or bad price return(retval); } else return(retval); - //printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); - if ( recalc != 0 ) + LP_RTmetrics_update(Q.srccoin,Q.destcoin); + if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) { - LP_RTmetrics_update(Q.srccoin,Q.destcoin); - if ( LP_RTmetrics_blacklisted(Q.desthash) >= 0 ) - { - printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); - return(retval); - } - LP_listunspent_both(Q.srccoin,Q.coinaddr,0); - if ( (butxo= LP_address_utxopair(1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) - { - strcpy(Q.gui,G.gui); - strcpy(Q.coinaddr,coin->smartaddr); - Q.srchash = G.LP_mypub25519; - Q.txid = butxo->payment.txid; - Q.vout = butxo->payment.vout; - Q.txid2 = butxo->deposit.txid; - Q.vout2 = butxo->deposit.vout; - Q.satoshis = butxo->S.satoshis; - printf("found %.8f -> %.8f newprice %.8f vs ask %.8f += %.8f qprice %.8f\n",dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis,ask,price,qprice); - //printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); - } - else - { - printf("cant find utxopair %s/%s\n",Q.srccoin,Q.destcoin); - return(retval); - } + printf("request from blacklisted %s, ignore\n",bits256_str(str,Q.desthash)); + return(retval); } - } - else // "connect" - { - if ( bits256_cmp(G.LP_mypub25519,Q.srchash) == 0 && bits256_cmp(G.LP_mypub25519,Q.desthash) != 0 ) + LP_address_utxo_reset(coin); + if ( (butxo= LP_address_myutxopair(butxo,1,utxos,max,LP_coinfind(Q.srccoin),Q.coinaddr,Q.txfee,dstr(Q.destsatoshis),price,Q.desttxfee)) != 0 ) { - butxo = LP_utxopairfind(1,Q.txid,Q.vout,Q.txid2,Q.vout2); // better work! - } else return(retval); + strcpy(Q.gui,G.gui); + strcpy(Q.coinaddr,coin->smartaddr); + Q.srchash = G.LP_mypub25519; + Q.txid = butxo->payment.txid; + Q.vout = butxo->payment.vout; + Q.txid2 = butxo->deposit.txid; + Q.vout2 = butxo->deposit.vout; + Q.satoshis = butxo->S.satoshis; + printf("found %.8f -> %.8f newprice %.8f vs ask %.8f += %.8f qprice %.8f\n",dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis,ask,price,qprice); + } + else + { + printf("cant find utxopair aliceid.%llu %s/%s\n",(long long)aliceid,Q.srccoin,Q.destcoin); + return(retval); + } } if ( strcmp(Q.coinaddr,coin->smartaddr) != 0 ) { @@ -923,55 +931,46 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s %.8f < %.8f\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin,qprice,(ask - 0.00000001) * 0.998); return(retval); } - char str[65],str2[65]; printf("butxo.%p (%s %s) TRADECOMMAND.(%s)\n",butxo,butxo!=0?bits256_str(str,butxo->payment.txid):"",butxo!=0?bits256_str(str2,butxo->deposit.txid):"",jprint(argjson,0)); - if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) - butxo->T.swappending = 0; + char str[65],str2[65]; printf("(%s/v%d %s/v%d) TRADECOMMAND.(%s)\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,jprint(argjson,0)); if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's { - if ( LP_isavailable(butxo) > 0 ) + if ( LP_allocated(Q.txid,Q.vout) == 0 && LP_allocated(Q.txid2,Q.vout2) == 0 ) { - autxo->T.swappending = butxo->T.swappending = Q.timestamp + LP_RESERVETIME; retjson = LP_quotejson(&Q); - butxo->S.otherpubkey = jbits256(argjson,"desthash"); - LP_unavailableset(butxo,butxo->S.otherpubkey); - jaddnum(retjson,"quotetime",juint(argjson,"quotetime")); - jaddnum(retjson,"pending",butxo->T.swappending); - jaddbits256(retjson,"desthash",butxo->S.otherpubkey); - jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); + LP_unavailableset(Q.txid,Q.vout,Q.timestamp + LP_RESERVETIME,Q.desthash); + LP_unavailableset(Q.txid2,Q.vout2,Q.timestamp + LP_RESERVETIME,Q.desthash); + jaddnum(retjson,"quotetime",Q.quotetime); + jaddnum(retjson,"pending",Q.timestamp + LP_RESERVETIME); + jaddbits256(retjson,"desthash",Q.desthash); jaddstr(retjson,"method","reserved"); msg = jprint(retjson,0); - butxo->T.lasttime = (uint32_t)time(NULL); - printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,ask,msg); - // LP_addsig - //msg2 = clonestr(msg); - LP_reserved_msg(1,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,clonestr(msg)); + printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",Q.timestamp + LP_RESERVETIME,qprice,ask,msg); + LP_reserved_msg(1,Q.srccoin,Q.destcoin,Q.desthash,clonestr(msg)); sleep(1); bits256 zero; memset(zero.bytes,0,sizeof(zero)); LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); - //LP_reserved_msg(0,Q.srccoin,Q.destcoin,zero,msg); - //LP_broadcast_message(LP_mypubsock,Q.srccoin,Q.destcoin,Q.desthash,jprint(retjson,0)); free_json(retjson); + butxo->T.lasttime = (uint32_t)time(NULL); return(retval); - } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); + } else printf("request processing selected ineligible utxos?\n"); } else if ( strcmp(method,"connect") == 0 ) // bob { retval = 4; - if ( butxo->S.swap == 0 && butxo->T.swappending != 0 ) + if ( bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 || bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 ) + return(retval); + else if ( LP_reservation_check(Q.txid,Q.vout,Q.desthash) == 0 && LP_reservation_check(Q.txid2,Q.vout2,Q.desthash) == 0 ) { - // validate SPV alice - LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); - //LP_butxo_swapfields_set(butxo); + LP_connectstartbob(ctx,pubsock,argjson,Q.srccoin,Q.destcoin,qprice,&Q); return(retval); - } - else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); + } else printf("connect message from non-reserved (%s)\n",jprint(argjson,0)); } - //LP_butxo_swapfields_set(butxo); } return(retval); } +#ifdef oldway struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t max,double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct iguana_info *basecoin,char *coinaddr,uint64_t asatoshis,double price,uint64_t txfee,uint64_t desttxfee,bits256 pubkey,char *gui) { uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; @@ -1076,10 +1075,11 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } +#endif char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid) { - uint64_t desttxfee,txfee; uint32_t lastnonce; int32_t i,maxiters,numpubs = 0; int64_t bestsatoshis=0,destsatoshis,bestdestsatoshis=0; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; bits256 pubkeys[100]; + uint64_t desttxfee,txfee; uint32_t lastnonce; int64_t bestsatoshis=0,destsatoshis; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B; struct LP_quoteinfo Q; bits256 pubkeys[100]; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( gui == 0 ) @@ -1111,12 +1111,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel } if ( time(NULL) < Alice_expiration ) return(clonestr("{\"error\":\"only one pending request at a time\"}")); - else - { - Alice_expiration = 0; - memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); - LP_Alicemaxprice = 0.; - } + else LP_alicequery_clear(); if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); if ( strcmp("BTC",rel) == 0 ) @@ -1155,7 +1150,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel int32_t changed; LP_mypriceset(&changed,autxo->coin,base,1. / maxprice); return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid,destpubkey)); - +#ifdef oldway LP_RTmetrics_update(base,rel); while ( 1 ) { @@ -1197,6 +1192,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid,destpubkey)); } return(clonestr("{\"error\":\"cant get here\"}")); +#endif } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 6b5643bb6..fee4a1189 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -658,7 +658,7 @@ char *LP_uitem_recv(cJSON *argjson) { //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",symbol,coinaddr,bits256_str(str,txid),vout,dstr(value),height); if ( strcmp(coin->smartaddr,coinaddr) != 0 ) - LP_address_utxoadd("LP_uitem_recv",coin,coinaddr,txid,vout,value,height,-1); + LP_address_utxoadd((uint32_t)time(NULL),"LP_uitem_recv",coin,coinaddr,txid,vout,value,height,-1); //else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); } return(clonestr("{\"result\":\"success\"}")); @@ -676,11 +676,14 @@ void LP_listunspent_query(char *symbol,char *coinaddr) void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { - cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; struct LP_utxoinfo *utxo; + cJSON *reqjson; bits256 zero; char *msg,*msg2; int32_t flag = 0; if ( strcmp(method,"request") == 0 ) { - if ( (utxo= LP_utxofind(0,qp->desttxid,qp->destvout)) != 0 && LP_ismine(utxo) > 0 && LP_isavailable(utxo) > 0 ) - LP_unavailableset(utxo,qp->srchash); + if ( LP_allocated(qp->desttxid,qp->destvout) == 0 && LP_allocated(qp->feetxid,qp->feevout) == 0 ) + { + LP_unavailableset(qp->desttxid,qp->destvout,qp->timestamp+LP_AUTOTRADE_TIMEOUT,qp->srchash); + LP_unavailableset(qp->feetxid,qp->feevout,qp->timestamp+LP_AUTOTRADE_TIMEOUT,qp->srchash); + } else { printf("couldnt find my txid to make request\n"); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index f345e9ab6..870543904 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -303,7 +303,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep else { //printf("external unspent has no gettxout\n"); - flag += LP_address_utxoadd("electrum process",coin,coinaddr,txid,v,value,0,1); + flag += LP_address_utxoadd((uint32_t)time(NULL),"electrum process",coin,coinaddr,txid,v,value,0,1); } } else @@ -345,7 +345,7 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep if ( tx->height > 0 ) { //printf("from electrum_process_array\n"); - flag += LP_address_utxoadd("electrum process2",coin,coinaddr,txid,v,value,tx->height,-1); + flag += LP_address_utxoadd((uint32_t)time(NULL),"electrum process2",coin,coinaddr,txid,v,value,tx->height,-1); } //printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } //else printf("cant find tx\n"); @@ -544,7 +544,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * if ( tx->height > 0 && tx->height != height ) printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; - LP_address_utxoadd("electrum history",coin,addr,txid,0,0,height,-1); + LP_address_utxoadd((uint32_t)time(NULL),"electrum history",coin,addr,txid,0,0,height,-1); } } } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index ce1b725da..03d08d69e 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -120,11 +120,21 @@ void basilisk_rawtx_purge(struct basilisk_rawtx *rawtx) void basilisk_swap_finished(struct basilisk_swap *swap) { int32_t i; - if ( swap->utxo != 0 && swap->sentflag == 0 ) + /*if ( swap->utxo != 0 && swap->sentflag == 0 ) { LP_availableset(swap->utxo); swap->utxo = 0; //LP_butxo_swapfields_set(swap->utxo); + }*/ + if ( swap->I.iambob != 0 ) + { + LP_availableset(swap->bobdeposit.utxotxid,swap->bobdeposit.utxovout); + LP_availableset(swap->bobpayment.utxotxid,swap->bobpayment.utxovout); + } + else + { + LP_availableset(swap->alicepayment.utxotxid,swap->alicepayment.utxovout); + LP_availableset(swap->myfee.utxotxid,swap->myfee.utxovout); } swap->I.finished = (uint32_t)time(NULL); // save to permanent storage diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6e4642f3e..4d9ee5fe1 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -911,7 +911,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ if ( up == 0 ) { value = LP_txvalue(0,coin->symbol,utxotxid,utxovout); - LP_address_utxoadd("withdraw",coin,coin->smartaddr,utxotxid,utxovout,value,1,-1); + LP_address_utxoadd((uint32_t)time(NULL),"withdraw",coin,coin->smartaddr,utxotxid,utxovout,value,1,-1); //printf("added after not finding\n"); } if ( (up= LP_address_utxofind(coin,coin->smartaddr,utxotxid,utxovout)) != 0 ) @@ -999,36 +999,6 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ return(n); } -struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) -{ - struct LP_address *ap; int32_t i,n; cJSON *array,*item; int64_t value; bits256 txid; int32_t vout,height; - LP_listunspent_issue(coin->symbol,coin->smartaddr,2); - if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) - { - printf("LP_createrawtransaction: cant find address data\n"); - return(0); - } - if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) - { - ap->utxos = 0; - if ( (n= cJSON_GetArraySize(array)) > 0 ) - { - for (i=0; ismartaddr,txid,vout,value,height,-1); - } - } - free_json(array); - } - return(ap); -} - char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_info *coin,struct vin_info *V,int32_t max,bits256 privkey,cJSON *outputs,cJSON *vins,cJSON *privkeys,int64_t txfee,bits256 utxotxid,int32_t utxovout,uint32_t locktime) { static void *ctx; @@ -1077,7 +1047,12 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } } - if ( (ap= LP_address_utxo_reset(coin)) == 0 ) + if ( bits256_nonz(utxotxid) == 0 ) + { + if ( (ap= LP_address_utxo_reset(coin)) == 0 ) + return(0); + } + else if ( (ap= LP_address(coin,coin->smartaddr)) == 0 ) return(0); memset(utxos,0,sizeof(utxos)); if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3257f6096..f8fab79a7 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -18,6 +18,124 @@ // marketmaker // + +struct LP_inuse_info +{ + bits256 txid,otherpub; + uint32_t expiration; + int32_t vout,ind; +} LP_inuse[1024]; +int32_t LP_numinuse; + +struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) +{ + int32_t i; + if ( bits256_nonz(txid) != 0 ) + { + for (i=0; iind; + *lp = LP_inuse[--LP_numinuse]; + lp->ind = ind; + memset(&LP_inuse[LP_numinuse],0,sizeof(struct LP_inuse_info)); + for (ind=0; indtxid = txid; + lp->vout = vout; + lp->expiration = expiration; + lp->otherpub = otherpub; + lp->ind = LP_numinuse++; + } + else + { + if ( bits256_nonz(otherpub) != 0 ) + lp->otherpub = otherpub; + if ( expiration > lp->expiration || expiration == 0 ) + lp->expiration = expiration; + } + return(lp); + } else printf("_LP_inuse_add [%d] overflow\n",LP_numinuse); + return(0); +} + +int32_t LP_reservation_check(bits256 txid,int32_t vout,bits256 pubkey) +{ + struct LP_inuse_info *lp; int32_t retval = -1; + if ( bits256_nonz(pubkey) != 0 ) + { + portable_mutex_lock(&LP_inusemutex); + if ( (lp= _LP_inuse_find(txid,vout)) != 0 ) + { + if ( bits256_cmp(lp->otherpub,pubkey) == 0 ) + retval = 0; + } + portable_mutex_unlock(&LP_inusemutex); + } + return(retval); +} + +uint32_t LP_allocated(bits256 txid,int32_t vout) +{ + struct LP_inuse_info *lp; uint32_t now,duration = 0; + now = (uint32_t)time(NULL); + portable_mutex_lock(&LP_inusemutex); + if ( (lp= _LP_inuse_find(txid,vout)) != 0 ) + { + if ( lp->expiration != 0 && now < lp->expiration ) + duration = (lp->expiration - now); + } + portable_mutex_unlock(&LP_inusemutex); + return(duration); +} + +void LP_unavailableset(bits256 txid,int32_t vout,uint32_t expiration,bits256 otherpub) +{ + portable_mutex_lock(&LP_inusemutex); + _LP_inuse_add(expiration,otherpub,txid,vout); + portable_mutex_unlock(&LP_inusemutex); +} + +void LP_availableset(bits256 txid,int32_t vout) +{ + portable_mutex_lock(&LP_inusemutex); + _LP_inuse_delete(txid,vout); + portable_mutex_unlock(&LP_inusemutex); +} + +int32_t LP_isavailable(struct LP_utxoinfo *utxo) +{ + struct _LP_utxoinfo u; + u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; + if ( LP_allocated(utxo->payment.txid,utxo->payment.vout) == 0 && LP_allocated(u.txid,u.vout) == 0 ) + return(1); + else return(0); +} + uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { double val = 0.; uint64_t value = 0; int32_t electrumflag; @@ -116,36 +234,9 @@ int32_t LP_address_minmax(uint64_t *balancep,uint64_t *minp,uint64_t *maxp,struc return(n); } -struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) -{ - struct LP_utxoinfo *utxo; - if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) - { - //char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); - return(utxo); - } - if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) - { - //char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); - return(utxo); - } - if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) - { - //char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); - return(utxo); - } - if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) - { - //char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); - return(utxo); - } - return(0); -} - int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) { struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; - //printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr); if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); LP_listunspent_issue(coin->symbol,coin->smartaddr,2); @@ -189,7 +280,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a continue; } } - if ( LP_allocated(up->U.txid,up->U.vout) == 0 )//&& (iambob == 0 || (_LP_utxofind(iambob,up->U.txid,up->U.vout) == 0 && _LP_utxo2find(iambob,up->U.txid,up->U.vout) == 0)) ) + if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max ) @@ -239,7 +330,7 @@ void LP_mark_spent(char *symbol,bits256 txid,int32_t vout) } } -int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) +int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //char str[65]; if ( coin == 0 ) @@ -262,6 +353,7 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b up->spendheight = spendheight, flag |= 4; if ( value != 0 && up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; + up->timestamp = timestamp; //printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } @@ -282,21 +374,61 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b up->U.height = height; up->U.value = value; up->spendheight = spendheight; - portable_mutex_lock(&coin->addrmutex); - DL_APPEND(ap->utxos,up); - portable_mutex_unlock(&coin->addrmutex); + up->timestamp = timestamp; retval = 1; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) { up->SPV = tx->SPV; //printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } + portable_mutex_lock(&coin->addrmutex); + DL_APPEND(ap->utxos,up); + portable_mutex_unlock(&coin->addrmutex); } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); return(retval); } +struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) +{ + struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,vout,height; cJSON *array,*item; int64_t value; bits256 txid; uint32_t now; + LP_listunspent_issue(coin->symbol,coin->smartaddr,2); + if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) + { + printf("LP_createrawtransaction: cant find address data\n"); + return(0); + } + if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) + { + //ap->utxos = 0; + now = (uint32_t)time(NULL); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; ismartaddr,txid,vout,value,height,-1); + } + } + free_json(array); + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + if ( up->timestamp < now ) + { + char str[65]; printf("purge %s/v%d as it wasnt in listunspent\n",bits256_str(str,up->U.txid),up->U.vout); + up->spendheight = 1; + } + } + } + return(ap); +} + cJSON *LP_address_item(struct iguana_info *coin,struct LP_address_utxo *up,int32_t electrumret) { cJSON *item = cJSON_CreateObject(); @@ -422,7 +554,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) { - int32_t i,n,v,ht,errs,height,count=0; uint64_t value,val; cJSON *item,*txobj; bits256 txid; + int32_t i,n,v,errs,height,count=0; uint64_t value,val; cJSON *item,*txobj; bits256 txid; if ( (n= cJSON_GetArraySize(array)) <= 0 ) return(0); //printf("%s %s LP_unspents.(%s)\n",coin->symbol,coinaddr,jprint(array,0)); @@ -442,7 +574,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) char str[65]; printf("REJECT %s %s/v%d value.%llu vs %llu (%s)\n",coin->symbol,bits256_str(str,txid),v,(long long)value,(long long)val,jprint(txobj,0)); errs++; } - ht = LP_txheight(coin,txid); + //ht = LP_txheight(coin,txid); //if ( coin->height != 0 ) // ht = LP_getheight(coin) - jint(txobj,"confirmations") + 1; //else ht = 0; @@ -456,7 +588,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) if ( errs == 0 ) { //printf("from LP_unspents_array\n"); - LP_address_utxoadd("LP_unspents_array",coin,coinaddr,txid,v,val,height,-1); + LP_address_utxoadd((uint32_t)time(NULL),"LP_unspents_array",coin,coinaddr,txid,v,val,height,-1); count++; } } @@ -580,7 +712,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); LP_destaddr(tx->outpoints[i].coinaddr,vout); //printf("from transaction init %s %s %s/v%d <- %.8f\n",coin->symbol,tx->outpoints[i].coinaddr,bits256_str(str,txid),i,dstr(tx->outpoints[i].value)); - LP_address_utxoadd("LP_transactioninit iter0",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); + LP_address_utxoadd((uint32_t)time(NULL),"LP_transactioninit iter0",coin,tx->outpoints[i].coinaddr,txid,i,tx->outpoints[i].value,height,-1); } //printf("numvouts.%d\n",numvouts); } @@ -602,7 +734,7 @@ cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJS tx->outpoints[spentvout].spendtxid = txid; tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height > 0 ? height : 1; - LP_address_utxoadd("LP_transactioninit iter1",coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); + LP_address_utxoadd((uint32_t)time(NULL),"LP_transactioninit iter1",coin,tx->outpoints[spentvout].coinaddr,spenttxid,spentvout,tx->outpoints[spentvout].value,-1,height>0?height:1); if ( 0 && strcmp(coin->symbol,"REVS") == 0 ) printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b24c47ff3..c09e7e6c4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -19,8 +19,6 @@ // - - int32_t LP_ismine(struct LP_utxoinfo *utxo) { if ( utxo != 0 && bits256_cmp(utxo->pubkey,G.LP_mypub25519) == 0 ) @@ -28,15 +26,6 @@ int32_t LP_ismine(struct LP_utxoinfo *utxo) else return(0); } -int32_t LP_isavailable(struct LP_utxoinfo *utxo) -{ - if ( time(NULL) > utxo->T.swappending ) - utxo->T.swappending = 0; - if ( utxo != 0 && utxo->T.swappending == 0 && utxo->S.swap == 0 ) - return(1); - else return(0); -} - int32_t LP_isunspent(struct LP_utxoinfo *utxo) { struct LP_address_utxo *up; struct _LP_utxoinfo u; struct iguana_info *coin; @@ -88,6 +77,41 @@ int32_t LP_utxoaddptrs(struct LP_utxoinfo *ptrs[],int32_t n,struct LP_utxoinfo * return(n); } +/*uint32_t LP_allocated(bits256 txid,int32_t vout) +{ + struct LP_utxoinfo *utxo; + if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + //char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); + return(utxo); + } + if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + //char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); + return(utxo); + } + if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + //char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); + return(utxo); + } + if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + //char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); + return(utxo); + } + return(0); +} + +int32_t LP_isavailable(struct LP_utxoinfo *utxo) +{ + if ( time(NULL) > utxo->T.swappending ) + utxo->T.swappending = 0; + if ( utxo != 0 && utxo->T.swappending == 0 && utxo->S.swap == 0 ) + return(1); + else return(0); +} + int32_t LP_utxocollisions(struct LP_utxoinfo *ptrs[],struct LP_utxoinfo *refutxo) { int32_t iambob,n = 0; struct LP_utxoinfo *utxo; struct _LP_utxoinfo u; @@ -170,6 +194,7 @@ void LP_availableset(struct LP_utxoinfo *utxo) } } } +*/ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { @@ -208,8 +233,8 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) if ( bits256_nonz(utxo->S.otherpubkey) != 0 ) jaddbits256(item,"srchash",utxo->S.otherpubkey); } - if ( utxo->S.swap != 0 ) - jaddstr(item,"swap","in progress"); + //if ( utxo->S.swap != 0 ) + // jaddstr(item,"swap","in progress"); if ( utxo->T.spentflag != 0 ) jaddnum(item,"spent",utxo->T.spentflag); jaddnum(item,"session",utxo->T.sessionid); @@ -235,7 +260,6 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) printf("LP_utxo_bestfit error symbol.%p %.8f\n",symbol,dstr(destsatoshis)); return(0); } - // jl777 remove mempool HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp) { if ( strcmp(symbol,utxo->coin) != 0 ) From bf6c9969aea363188daaf2d58b421a7bbfbf0158 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 18:45:41 +0200 Subject: [PATCH 2504/2732] Test --- iguana/exchanges/LP_utxo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f8fab79a7..481250689 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -419,11 +419,12 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) free_json(array); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - if ( up->timestamp < now ) + char str[65]; + if ( up->timestamp < now && up->spendheight <= 0 ) { - char str[65]; printf("purge %s/v%d as it wasnt in listunspent\n",bits256_str(str,up->U.txid),up->U.vout); + printf("purge %s/v%d as it wasnt in listunspent\n",bits256_str(str,up->U.txid),up->U.vout); up->spendheight = 1; - } + } else printf("%s/v%d %.8f avail\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value)); } } return(ap); From 2173fc7abb41073e3f48b73b5384641802228111 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 18:47:15 +0200 Subject: [PATCH 2505/2732] Test --- iguana/exchanges/LP_ordermatch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0ef73ab65..0dcf2bdeb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -911,6 +911,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } } + else if ( strcmp(method,"connect") == 0 ) + { + if ( bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 || bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 ) + return(retval); + } if ( strcmp(Q.coinaddr,coin->smartaddr) != 0 ) { printf("bob is patching Q.coinaddr %s mismatch != %s\n",Q.coinaddr,coin->smartaddr); @@ -958,9 +963,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else if ( strcmp(method,"connect") == 0 ) // bob { retval = 4; - if ( bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 || bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 ) - return(retval); - else if ( LP_reservation_check(Q.txid,Q.vout,Q.desthash) == 0 && LP_reservation_check(Q.txid2,Q.vout2,Q.desthash) == 0 ) + if ( LP_reservation_check(Q.txid,Q.vout,Q.desthash) == 0 && LP_reservation_check(Q.txid2,Q.vout2,Q.desthash) == 0 ) { LP_connectstartbob(ctx,pubsock,argjson,Q.srccoin,Q.destcoin,qprice,&Q); return(retval); From 5b3d32166247efac6dd283c09552428c248fbc45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 18:52:54 +0200 Subject: [PATCH 2506/2732] Test --- iguana/exchanges/LP_utxo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 481250689..c43d2e02c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -393,10 +393,11 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,vout,height; cJSON *array,*item; int64_t value; bits256 txid; uint32_t now; + LP_address(coin,coin->smartaddr); LP_listunspent_issue(coin->symbol,coin->smartaddr,2); if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) { - printf("LP_createrawtransaction: cant find address data\n"); + printf("LP_address_utxo_reset: cant find address data\n"); return(0); } if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) From 9b896d4d4a4c8ee4616d351c60095403f9ded856 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 18:56:03 +0200 Subject: [PATCH 2507/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c43d2e02c..715c103a8 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -354,7 +354,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co if ( value != 0 && up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; up->timestamp = timestamp; -//printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + char str[65]; printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } @@ -379,8 +379,8 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) { up->SPV = tx->SPV; - //printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } + char str[65]; printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); From d2314e8a25c1f63f788f2c9c7060cbf90f17fe97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:02:03 +0200 Subject: [PATCH 2508/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 715c103a8..8d35d9ea5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -354,7 +354,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co if ( value != 0 && up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; up->timestamp = timestamp; - char str[65]; printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); + //char str[65]; printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } } @@ -379,8 +379,8 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) { up->SPV = tx->SPV; + //char str[65]; printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } - char str[65]; printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); From 12408f15db8c2367fd96273ab05b72b607593d45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:07:32 +0200 Subject: [PATCH 2509/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0dcf2bdeb..1b8103090 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -370,7 +370,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); +printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { @@ -397,6 +397,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb return(butxo); }*/ LP_butxo_set(butxo,coin,up,up2,targetval); + return(butxo); } } //else printf("cant find targetval2 %.8f\n",dstr(targetval2)); } //else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); From accfa2bc627d35f1eda979f7886300be1cf4e33a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:15:34 +0200 Subject: [PATCH 2510/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8d35d9ea5..268a6362c 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -349,7 +349,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co flag = 1; if ( height > 0 && up->U.height != height ) up->U.height = height, flag |= 2; - if ( spendheight > 0 && up->spendheight != spendheight ) + if ( up->spendheight != spendheight ) up->spendheight = spendheight, flag |= 4; if ( value != 0 && up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; From a286a2339316c4a92d6858b65c7a7213fdc081ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:22:48 +0200 Subject: [PATCH 2511/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxo.c | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c24ad9bf4..1b0394f95 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -308,7 +308,7 @@ struct LP_address_utxo struct LP_address_utxo *next,*prev; struct _LP_utxoinfo U; int32_t SPV,spendheight; - uint32_t timestamp; + //uint32_t timestamp; }; struct LP_address diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 268a6362c..007178e94 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -243,7 +243,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); + char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 && LP_RTmetrics_avoidtxid(up->U.txid) < 0 ) { if ( coin->electrum == 0 ) @@ -349,11 +349,11 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co flag = 1; if ( height > 0 && up->U.height != height ) up->U.height = height, flag |= 2; - if ( up->spendheight != spendheight ) + if ( spendheight > 0 && up->spendheight != spendheight ) up->spendheight = spendheight, flag |= 4; if ( value != 0 && up->U.value == 0 && up->U.value != value ) up->U.value = value, flag |= 8; - up->timestamp = timestamp; + //up->timestamp = timestamp; //char str[65]; printf("found >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); break; } @@ -374,7 +374,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co up->U.height = height; up->U.value = value; up->spendheight = spendheight; - up->timestamp = timestamp; + //up->timestamp = timestamp; retval = 1; if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) { @@ -402,7 +402,13 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) } if ( (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { - //ap->utxos = 0; + DL_FOREACH_SAFE(ap->utxos,up,tmp) + { + portable_mutex_lock(&coin->addrmutex); + DL_DELETE(ap->utxos,up); + portable_mutex_unlock(&coin->addrmutex); + free(up); + } now = (uint32_t)time(NULL); if ( (n= cJSON_GetArraySize(array)) > 0 ) { @@ -418,15 +424,6 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) } } free_json(array); - DL_FOREACH_SAFE(ap->utxos,up,tmp) - { - char str[65]; - if ( up->timestamp < now && up->spendheight <= 0 ) - { - printf("purge %s/v%d as it wasnt in listunspent\n",bits256_str(str,up->U.txid),up->U.vout); - up->spendheight = 1; - } else printf("%s/v%d %.8f avail\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value)); - } } return(ap); } From 1be8574932fdfc0df0de45e7dbf4aca5f04d0a20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:28:32 +0200 Subject: [PATCH 2512/2732] Test --- iguana/exchanges/LP_utxo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 007178e94..7d36a9eab 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -252,7 +252,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( LP_value_extract(txout,0) == 0 ) { - //printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); + printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); free_json(txout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) @@ -263,7 +263,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a } else { - //printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); + printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; @@ -274,7 +274,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( up->SPV < 0 || up->U.height == 0 ) { -//printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); +printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; continue; @@ -285,7 +285,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a utxos[n++] = up; if ( n >= max ) break; - } + } else printf("LP_allocated skip\n"); } else { @@ -422,6 +422,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) height = jint(item,"height"); LP_address_utxoadd(now,"withdraw",coin,coin->smartaddr,txid,vout,value,height,-1); } + printf("added %d from listunspents\n",n); } free_json(array); } From 58896cc3b8be5fcbaf53e0b23a77dade8671a1b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:32:45 +0200 Subject: [PATCH 2513/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_utxo.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1b8103090..1c8524d06 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -366,7 +366,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb memset(butxo,0,sizeof(*butxo)); targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); targetval2 = (targetval / 8) * 9 + 2*txfee; - if ( coin != 0 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) + if ( coin != 0 && (ap= LP_address(coin,coinaddr)) != 0 ) { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { @@ -403,7 +403,7 @@ printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n", } //else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); - } //else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); + } else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); return(0); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7d36a9eab..b63ee8673 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -239,8 +239,8 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; if ( strcmp(ap->coinaddr,coinaddr) != 0 ) printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); - LP_listunspent_issue(coin->symbol,coin->smartaddr,2); - portable_mutex_lock(&LP_utxomutex); + //LP_listunspent_issue(coin->symbol,coin->smartaddr,2); + //portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); @@ -293,8 +293,8 @@ printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str tx->outpoints[up->U.vout].spendheight = 1; } } - portable_mutex_unlock(&LP_utxomutex); - //printf("return n.%d\n",n); + //portable_mutex_unlock(&LP_utxomutex); + printf("return n.%d for %s %s\n",n,coin->symbol,coinaddr); return(n); } From e15152011322a7c1006e288c6064c939232388cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:36:21 +0200 Subject: [PATCH 2514/2732] Test --- iguana/exchanges/LP_utxo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b63ee8673..250e5c1c2 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -364,7 +364,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - //printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); + char str[65]; printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); return(0); } else free_json(txobj); } @@ -379,8 +379,10 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->SPV > 0 ) { up->SPV = tx->SPV; - //char str[65]; printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); } + char str[65]; + if ( strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) + printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); From 4057fd6f59ecf4a68d014a0ba1337fac3b20753f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:41:20 +0200 Subject: [PATCH 2515/2732] Test --- iguana/exchanges/LP_utxo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 250e5c1c2..1d0770e44 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -414,6 +414,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) now = (uint32_t)time(NULL); if ( (n= cJSON_GetArraySize(array)) > 0 ) { + char str[65]; for (i=0; ismartaddr,txid,vout,value,height,-1); + if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) + printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); } printf("added %d from listunspents\n",n); } From f0063628c38e000cc7ef0aba9826768644206e6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:44:44 +0200 Subject: [PATCH 2516/2732] Test --- iguana/exchanges/LP_utxo.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1d0770e44..c695ffae6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -419,10 +419,20 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) { //{"tx_hash":"38d1b7c73015e1b1d6cb7fc314cae402a635b7d7ea294970ab857df8777a66f4","tx_pos":0,"height":577975,"value":238700} item = jitem(array,i); - txid = jbits256(item,"tx_hash"); - vout = juint(item,"tx_pos"); - value = j64bits(item,"value"); - height = jint(item,"height"); + if ( coin->electrum != 0 ) + { + txid = jbits256(item,"tx_hash"); + vout = juint(item,"tx_pos"); + value = j64bits(item,"value"); + height = jint(item,"height"); + } + else + { + txid = jbits256(item,"txid"); + vout = juint(item,"vout"); + value = LP_value_extract(item,0); + height = LP_txheight(coin,txid); + } LP_address_utxoadd(now,"withdraw",coin,coin->smartaddr,txid,vout,value,height,-1); if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); From c569b02a464982e328742698712e9892d4148d9c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 19:50:34 +0200 Subject: [PATCH 2517/2732] Test --- iguana/exchanges/LP_utxo.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c695ffae6..85d7df5ed 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -364,7 +364,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - char str[65]; printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); + //char str[65]; printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); return(0); } else free_json(txobj); } @@ -381,7 +381,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co up->SPV = tx->SPV; } char str[65]; - if ( strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) + if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); @@ -492,7 +492,10 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum } if ( up->spendheight <= 0 && up->U.value != 0 ) { - if ( coin->electrum == 0 || up->SPV > 0 ) + char str[65]; + if ( LP_allocated(up->U.txid,up->U.vout) != 0 ) + printf("%s %s/v%d allocated\n",coin->symbol,bits256_str(str,up->U.txid),up->U.vout); + else if ( coin->electrum == 0 || up->SPV > 0 ) { jaddi(array,LP_address_item(coin,up,electrumret)); n++; From 383adfe215b06060b56fcb30d0117dc6cfd0bf1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 20:06:45 +0200 Subject: [PATCH 2518/2732] Test --- iguana/exchanges/LP_utxo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 85d7df5ed..0fe71aa4e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -243,7 +243,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a //portable_mutex_lock(&LP_utxomutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) { - char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); + //char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%d\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout)); if ( up->spendheight <= 0 && LP_RTmetrics_avoidtxid(up->U.txid) < 0 ) { if ( coin->electrum == 0 ) @@ -252,7 +252,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( LP_value_extract(txout,0) == 0 ) { - printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); + //printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); free_json(txout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) @@ -263,7 +263,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a } else { - printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); + //printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; @@ -274,7 +274,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( up->SPV < 0 || up->U.height == 0 ) { -printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); +//printf("LP_address_utxo_ptrs skips %s/v%u due to SPV.%d ht.%d\n",bits256_str(str,up->U.txid),up->U.vout,up->SPV,up->U.height); if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; continue; From 434c96cd41b1e6d5d2f1531af202be2faeb17ed9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 21:02:34 +0200 Subject: [PATCH 2519/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_socket.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1c8524d06..a27dc1078 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -404,7 +404,7 @@ printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n", } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); - } else printf("couldnt find %s %s\n",coin->symbol,coinaddr); + } else printf("address_myutxopair couldnt find %s %s\n",coin->symbol,coinaddr); return(0); } @@ -812,7 +812,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } price = ask; - printf("MYPRICE %s/%s %.8f vs qprice %.8f\n",Q.srccoin,Q.destcoin,price,qprice); + //printf("MYPRICE %s/%s %.8f vs qprice %.8f\n",Q.srccoin,Q.destcoin,price,qprice); if ( LP_validSPV(Q.destcoin,Q.destaddr,Q.desttxid,Q.destvout) < 0 ) { printf("%s dest %s failed SPV check\n",Q.destcoin,bits256_str(str,Q.desttxid)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 870543904..e50e648d4 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -578,8 +578,8 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON cJSON *retjson=0; char *retstr; struct LP_address *ap; struct iguana_info *coin; int32_t updatedflag,height,usecache=1; if ( (coin= LP_coinfind(symbol)) == 0 ) return(0); - //if ( strcmp(addr,INSTANTDEX_KMD) == 0 ) - // return(cJSON_Parse("[]")); + if ( strcmp(addr,INSTANTDEX_KMD) == 0 ) + return(cJSON_Parse("[]")); if ( ep == 0 || ep->heightp == 0 ) height = coin->longestchain; else height = *(ep->heightp); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c09e7e6c4..2816dd303 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -516,7 +516,7 @@ cJSON *LP_inventory(char *symbol) { //if ( utxo->T.spentflag == 0 ) // utxo->T.spentflag = (uint32_t)time(NULL); - printf("%s %s ineligible %.8f %.8f\n",utxo->coin,bits256_str(str,u.txid),dstr(val),dstr(val2)); + //printf("%s %s ineligible %.8f %.8f\n",utxo->coin,bits256_str(str,u.txid),dstr(val),dstr(val2)); continue; } //if ( iambob != 0 ) From 437501f854783fe1a5995a4ed8c9a8593f646a53 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 21:55:30 +0200 Subject: [PATCH 2520/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 15 ++++++- iguana/exchanges/LP_ordermatch.c | 64 ++++++++++++------------------ iguana/exchanges/LP_statemachine.c | 35 ++++++++++++++++ iguana/exchanges/LP_utxo.c | 7 +++- 5 files changed, 81 insertions(+), 41 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 713e8e7de..64687dedc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -87,6 +87,7 @@ struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; struct LP_pubkeyinfo *LP_pubkeyinfos; struct rpcrequest_info *LP_garbage_collector; +struct LP_address_utxo *LP_garbage_collector2; //uint32_t LP_deadman_switch; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 101313348..49cefa778 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -267,7 +267,7 @@ int32_t LP_peerindsock(int32_t *peerindp) void gc_loop(void *arg) { - struct rpcrequest_info *req,*rtmp; int32_t flag = 0; + uint32_t now; struct LP_address_utxo *up,*utmp; struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(LP_gcloop_stats.name,"gc_loop"); LP_gcloop_stats.threshold = 1100.; while ( 1 ) @@ -282,6 +282,19 @@ void gc_loop(void *arg) free(req); flag++; } + now = (uint32_t)time(NULL); + DL_FOREACH_SAFE(LP_garbage_collector2,up,utmp) + { + if ( (uint32_t)up->spendheight > now-120 ) + printf("recent gc2 %u lag.%d\n",up->spendheight,now-up->spendheight); + else + { + DL_DELETE(LP_garbage_collector2,up); + char str[65]; printf("garbage collect %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); + free(up); + } + flag++; + } portable_mutex_unlock(&LP_gcmutex); if ( 0 && flag != 0 ) printf("gc_loop.%d\n",flag); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a27dc1078..c897f55f5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -275,7 +275,7 @@ int32_t LP_nanobind(void *ctx,char *pairstr) int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval) { - int32_t i,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; int64_t dist; uint64_t mindist = (1LL << 60); + int32_t i,replacei,bestheight,mini = -1; struct LP_address_utxo *up,*bestup; struct electrum_info *backupep=0,*ep; int64_t dist,bestdist; uint64_t mindist = (1LL << 60); if ( (ep= coin->electrum) != 0 ) { if ( (backupep= ep->prev) == 0 ) @@ -299,6 +299,29 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a } } } + if ( mini >= 0 && (bestup= utxos[mini]) != 0 ) + { + bestdist = (bestup->U.value - targetval); + replacei = -1; + bestheight = bestup->U.height; + for (i=0; iU.value - targetval); + if ( dist > 0 && (double)dist/bestdist < 1.1 && up->U.height < bestheight ) + { + replacei = i; + bestheight = up->U.height; + } + } + } + if ( replacei >= 0 ) + { + printf("REPLACE bestdist %.8f height %d with dist %.8f height %d\n",dstr(bestdist),bestup->U.height,dstr(utxos[replacei]->U.value - targetval),utxos[replacei]->U.height); + return(replacei); + } + } //printf("return mini.%d\n",mini); return(mini); } @@ -370,7 +393,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; i targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); +//printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); if ( (double)up->U.value/targetval < LP_MINVOL-1 ) { @@ -842,41 +865,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, memset(&Q.txid2,0,sizeof(Q.txid2)); Q.vout = Q.vout2 = -1; } else return(retval); - /*if ( bits256_nonz(Q.srchash) == 0 || bits256_cmp(Q.srchash,G.LP_mypub25519) == 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) - { - qprice = (double)Q.destsatoshis / Q.satoshis; - strcpy(Q.gui,G.gui); - strcpy(Q.coinaddr,coin->smartaddr); - strcpy(butxo->coinaddr,coin->smartaddr); - Q.srchash = G.LP_mypub25519; - memset(&Q.txid,0,sizeof(Q.txid)); - memset(&Q.txid2,0,sizeof(Q.txid2)); - Q.vout = Q.vout2 = -1; - recalc = 1; - } - else if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) - recalc = 1; - else if ( price < qprice ) - { - char tmp[64]; - if ( bits256_nonz(Q.txid) != 0 ) - LP_utxos_remove(Q.txid,Q.vout); - else recalc = 1; - if ( bits256_nonz(Q.txid2) != 0 ) - LP_utxos_remove(Q.txid2,Q.vout2); - else recalc = 1; - //printf("price %.8f qprice %.8f\n",price,qprice); - if ( recalc == 0 ) - { - value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); - value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); - //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); - if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) - recalc = 1; - else if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) - recalc = 1; - } - } else return(retval);*/ if ( qprice > price ) { r = (rand() % 100); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index b267364df..3c32b8cad 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1704,6 +1704,41 @@ int32_t bitcoin_coinptrs(bits256 pubkey,struct iguana_info **bobcoinp,struct igu } portable_mutex_unlock(&myinfo->DEX_swapmutex); }*/ +/*if ( bits256_nonz(Q.srchash) == 0 || bits256_cmp(Q.srchash,G.LP_mypub25519) == 0 || strcmp(butxo->coinaddr,coin->smartaddr) != 0 || bits256_nonz(butxo->payment.txid) == 0 || bits256_nonz(butxo->deposit.txid) == 0 ) + { + qprice = (double)Q.destsatoshis / Q.satoshis; + strcpy(Q.gui,G.gui); + strcpy(Q.coinaddr,coin->smartaddr); + strcpy(butxo->coinaddr,coin->smartaddr); + Q.srchash = G.LP_mypub25519; + memset(&Q.txid,0,sizeof(Q.txid)); + memset(&Q.txid2,0,sizeof(Q.txid2)); + Q.vout = Q.vout2 = -1; + recalc = 1; + } + else if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) < SMALLVAL ) + recalc = 1; + else if ( price < qprice ) + { + char tmp[64]; + if ( bits256_nonz(Q.txid) != 0 ) + LP_utxos_remove(Q.txid,Q.vout); + else recalc = 1; + if ( bits256_nonz(Q.txid2) != 0 ) + LP_utxos_remove(Q.txid2,Q.vout2); + else recalc = 1; + //printf("price %.8f qprice %.8f\n",price,qprice); + if ( recalc == 0 ) + { + value = LP_txvalue(tmp,Q.srccoin,Q.txid,Q.vout); + value2 = LP_txvalue(tmp,Q.srccoin,Q.txid2,Q.vout2); + //printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2)); + if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) + recalc = 1; + else if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) + recalc = 1; + } + } else return(retval);*/ /*int32_t LP_priceping(int32_t pubsock,struct LP_utxoinfo *utxo,char *rel,double origprice) { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0fe71aa4e..a89fc0cfe 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -409,8 +409,11 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) portable_mutex_lock(&coin->addrmutex); DL_DELETE(ap->utxos,up); portable_mutex_unlock(&coin->addrmutex); - free(up); - } + portable_mutex_lock(&LP_gcmutex); + up->spendheight = (int32_t)time(NULL); + DL_APPEND(LP_garbage_collector2,up); + portable_mutex_unlock(&LP_gcmutex); + } now = (uint32_t)time(NULL); if ( (n= cJSON_GetArraySize(array)) > 0 ) { From b93cf95bd9133837decadadf80146706ff96a021 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 21:59:35 +0200 Subject: [PATCH 2521/2732] Test --- iguana/exchanges/LP_network.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 49cefa778..63bfcdb44 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -285,9 +285,7 @@ void gc_loop(void *arg) now = (uint32_t)time(NULL); DL_FOREACH_SAFE(LP_garbage_collector2,up,utmp) { - if ( (uint32_t)up->spendheight > now-120 ) - printf("recent gc2 %u lag.%d\n",up->spendheight,now-up->spendheight); - else + if ( now > (uint32_t)up->spendheight+120 ) { DL_DELETE(LP_garbage_collector2,up); char str[65]; printf("garbage collect %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); @@ -298,7 +296,7 @@ void gc_loop(void *arg) portable_mutex_unlock(&LP_gcmutex); if ( 0 && flag != 0 ) printf("gc_loop.%d\n",flag); - sleep(1); + sleep(10); } } From 1e994506be3119545197a684997e618df75f4f5e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 22:00:09 +0200 Subject: [PATCH 2522/2732] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 63bfcdb44..dd6713e6d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -288,7 +288,7 @@ void gc_loop(void *arg) if ( now > (uint32_t)up->spendheight+120 ) { DL_DELETE(LP_garbage_collector2,up); - char str[65]; printf("garbage collect %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); + char str[65]; printf("garbage collect %s/v%d lag.%d\n",bits256_str(str,up->U.txid),up->U.vout,now-up->spendheight); free(up); } flag++; From 2dd9f64d536430e1c508c5991dca4ed9717ca2ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 22:05:11 +0200 Subject: [PATCH 2523/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 8 ++++---- iguana/exchanges/LP_utxo.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1b0394f95..b7dd79e03 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -82,7 +82,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_SWAPSTEP_TIMEOUT 30 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 -#define LP_MINCLIENTVOL 1000 +#define LP_MINCLIENTVOL 100 #define LP_MINSIZE_TXFEEMULT 10 #define LP_REQUIRED_TXFEE 0.8 diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index dd6713e6d..8fedbc1ab 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -269,7 +269,7 @@ void gc_loop(void *arg) { uint32_t now; struct LP_address_utxo *up,*utmp; struct rpcrequest_info *req,*rtmp; int32_t flag = 0; strcpy(LP_gcloop_stats.name,"gc_loop"); - LP_gcloop_stats.threshold = 1100.; + LP_gcloop_stats.threshold = 11000.; while ( 1 ) { flag = 0; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c897f55f5..3dd21d90c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -393,7 +393,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; iU.value/targetval); + } else printf("cant find targetval2 %.8f\n",dstr(targetval2)); + } else printf("failed ratio test %.8f\n",(double)up->U.value/targetval); } else if ( targetval != 0 && mini >= 0 ) printf("targetval %.8f mini.%d\n",dstr(targetval),mini); } else printf("no %s utxos pass LP_address_utxo_ptrs filter\n",coinaddr); @@ -896,7 +896,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - printf("cant find utxopair aliceid.%llu %s/%s\n",(long long)aliceid,Q.srccoin,Q.destcoin); + printf("cant find utxopair aliceid.%llu %s/%s %.8f -> relvol %.8f\n",(long long)aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis)); return(retval); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a89fc0cfe..2bd6ebdcd 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -294,7 +294,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a } } //portable_mutex_unlock(&LP_utxomutex); - printf("return n.%d for %s %s\n",n,coin->symbol,coinaddr); + //printf("return n.%d for %s %s\n",n,coin->symbol,coinaddr); return(n); } @@ -440,7 +440,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); } - printf("added %d from listunspents\n",n); + //printf("added %d from listunspents\n",n); } free_json(array); } From 63b0fe14e423b677f772bfdddf5dd0cc7c499dc2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 22:05:41 +0200 Subject: [PATCH 2524/2732] test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 8fedbc1ab..4b33a4717 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -288,7 +288,7 @@ void gc_loop(void *arg) if ( now > (uint32_t)up->spendheight+120 ) { DL_DELETE(LP_garbage_collector2,up); - char str[65]; printf("garbage collect %s/v%d lag.%d\n",bits256_str(str,up->U.txid),up->U.vout,now-up->spendheight); + //char str[65]; printf("garbage collect %s/v%d lag.%d\n",bits256_str(str,up->U.txid),up->U.vout,now-up->spendheight); free(up); } flag++; From a619fe39bd5c42ef299bb982acfcc8ddb8908fdb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 22:19:56 +0200 Subject: [PATCH 2525/2732] Test --- iguana/exchanges/LP_ordermatch.c | 16 ++++++++++------ iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3dd21d90c..1066284da 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -309,10 +309,13 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a if ( i != mini && (up= utxos[i]) != 0 ) { dist = (up->U.value - targetval); - if ( dist > 0 && (double)dist/bestdist < 1.1 && up->U.height < bestheight ) + if ( dist > 0 && up->U.height < bestheight ) { - replacei = i; - bestheight = up->U.height; + if ( (double)dist/bestdist < 1.1 ) + { + replacei = i; + bestheight = up->U.height; + } else printf("almost ratio %.3f dist %.8f vs best %.8f, ht %d vs best ht %d\n",(double)dist/bestdist,dstr(dist),dstr(bestdist),up->U.height,bestheight); } } } @@ -397,8 +400,9 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb { int32_t i; for (i=0; iU.value)); - printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr); + if ( utxos[i]->U.value >= targetval ) + printf("%.8f ",dstr(utxos[i]->U.value)); + printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s %s\n",dstr(targetval),relvolume,price,dstr(txfee),coin->symbol,coinaddr); } mini = -1; if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,targetval)) >= 0 ) @@ -896,7 +900,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else { - printf("cant find utxopair aliceid.%llu %s/%s %.8f -> relvol %.8f\n",(long long)aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis)); + printf("cant find utxopair aliceid.%llu %s/%s %.8f -> relvol %.8f\n",(long long)aliceid,Q.srccoin,Q.destcoin,dstr(LP_basesatoshis(dstr(Q.destsatoshis),price,Q.txfee,Q.desttxfee)),dstr(Q.destsatoshis)); return(retval); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 2bd6ebdcd..0f2aee2c3 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -52,7 +52,7 @@ int32_t _LP_inuse_delete(bits256 txid,int32_t vout) if ( LP_inuse[ind].ind != ind ) printf("ind.%d of %d: mismatched ind.%d\n",ind,LP_numinuse,LP_inuse[ind].ind); } - char str[65]; printf("_LP_inuse_delete cant find %s/v%d\n",bits256_str(str,txid),vout); + //char str[65]; printf("_LP_inuse_delete cant find %s/v%d\n",bits256_str(str,txid),vout); return(-1); } @@ -285,7 +285,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a utxos[n++] = up; if ( n >= max ) break; - } else printf("LP_allocated skip\n"); + } //else printf("LP_allocated skip\n"); } else { From 47490054aa33f130594d6cb5a136a928e641fb7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 22:25:33 +0200 Subject: [PATCH 2526/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1066284da..b9bb28e29 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -311,11 +311,11 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a dist = (up->U.value - targetval); if ( dist > 0 && up->U.height < bestheight ) { - if ( (double)dist/bestdist < 1.1 ) + if ( (double)dist/bestdist < sqrt(bestheight - up->U.height) ) { replacei = i; bestheight = up->U.height; - } else printf("almost ratio %.3f dist %.8f vs best %.8f, ht %d vs best ht %d\n",(double)dist/bestdist,dstr(dist),dstr(bestdist),up->U.height,bestheight); + } //else printf("almost ratio %.3f dist %.8f vs best %.8f, ht %d vs best ht %d\n",(double)dist/bestdist,dstr(dist),dstr(bestdist),up->U.height,bestheight); } } } From 1a0e13355c5e6a53a01029c355a22094f6be207f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 22:57:52 +0200 Subject: [PATCH 2527/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b9bb28e29..a8c061359 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -543,7 +543,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); - if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice*1.005 ) + if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) { qp->tradeid = LP_Alicequery.tradeid; LP_alicequery_clear(); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 30789efe7..2a66c9b94 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -544,7 +544,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) return(retjson); } } - printf("couldnt find %s (%s) %s/v%d\n",symbol,coinaddr,bits256_str(str,txid),vout); + //printf("couldnt find %s (%s) %s/v%d\n",symbol,coinaddr,bits256_str(str,txid),vout); return(cJSON_Parse("{\"error\":\"couldnt get tx\"}")); } } From 3cb25a8c237b5dac0f8372f25a347f55c9f8267b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:18:21 +0200 Subject: [PATCH 2528/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 64687dedc..4b33908b8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,8 +17,10 @@ // LP_nativeDEX.c // marketmaker // -// single utxo allocations, reject result, latency +// single utxo allocations alice, reject result, latency // alice waiting for bestprice +//if ( G.LP_pendingswaps != 0 ) +//return(-1); // bot safe to exit? // // BCH signing @@ -1054,37 +1056,37 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching gc_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) { printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) { printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); From 8c07a90770936fa667c3250611138b7f5d37ed03 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:21:55 +0200 Subject: [PATCH 2529/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4b33908b8..7510f368c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1020,7 +1020,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) { printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); @@ -1030,13 +1030,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); From 823e972eda4df41c9a4a467877ad76feedda2898 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:24:13 +0200 Subject: [PATCH 2530/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7510f368c..259053f1a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1025,7 +1025,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); @@ -1046,12 +1046,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) { printf("error launching gc_loop for port.%u\n",myport); exit(-1); From bbd790bf5582e4965de7968aa4164e1371937dff Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:25:51 +0200 Subject: [PATCH 2531/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 259053f1a..6108a2f87 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1101,7 +1101,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //fprintf(stderr,"."); sleep(3); } - if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) + if ( 0 && LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) usleep(1000); From 17ff863160d9684ab167a69fded6f3444a53084f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:27:11 +0200 Subject: [PATCH 2532/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6108a2f87..431500f4b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1041,7 +1041,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); From 7df0dbc54070b20302f099b52ba639a9ded2f901 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:29:50 +0200 Subject: [PATCH 2533/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 431500f4b..3703437f6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1020,23 +1020,23 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) { printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); @@ -1046,47 +1046,47 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) { printf("error launching gc_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) { printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) { printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); @@ -1101,7 +1101,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //fprintf(stderr,"."); sleep(3); } - if ( 0 && LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) + if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) usleep(1000); From 2e867f10f4a15a98d50786902ee68b0cb49e03a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:34:27 +0200 Subject: [PATCH 2534/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3703437f6..7e876b432 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -364,7 +364,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } else validreq = 1; recvlen -= sizeof(bits256); } - if ( validreq != 0 ) + if ( 0 && validreq != 0 ) { if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -1041,7 +1041,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); From c71b1ad57081979b0f5b62d72d3b995f2c84be6f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:37:12 +0200 Subject: [PATCH 2535/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7e876b432..ae1894ea9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -356,7 +356,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } } int32_t validreq = 0; - if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) + if ( 0 && strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) { From 40c3173ec20ad82c1e1181362d17a74da469932a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:40:05 +0200 Subject: [PATCH 2536/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ae1894ea9..4f82d0c4a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -338,6 +338,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) break; + ptr = 0; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { methodstr[0] = 0; @@ -387,9 +388,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int free(str); } } - if ( ptr != 0 ) - nn_freemsg(ptr), ptr = 0; } + if ( ptr != 0 ) + nn_freemsg(ptr), ptr = 0; } } return(nonz); From 9006c80202870a7eadbfd1bc6a62f45956db5f84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:44:00 +0200 Subject: [PATCH 2537/2732] Test --- iguana/exchanges/LP_network.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 4b33a4717..f45f5142d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -574,12 +574,19 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w else if ( (pfds[n].revents & POLLIN) != 0 ) { printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); + buf = 0; if ( (size= nn_recv(ptr->publicsock,&buf,NN_MSG,0)) > 0 ) { ptr->lasttime = now; sendsock = ptr->sendsock; break; } + else if ( buf != 0 ) + { + nn_freemsg(buf); + buf = 0; + size = 0; + } } } n++; @@ -606,12 +613,12 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w sendsock = ptr->publicsock; break; } - else - { - nn_freemsg(buf); - buf = 0; - size = 0; - } + } + if ( buf != 0 ) + { + nn_freemsg(buf); + buf = 0; + size = 0; } } } From 67a4e5191f995a8e690340b2e2c58f7d7694d080 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:45:58 +0200 Subject: [PATCH 2538/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4f82d0c4a..75e236dac 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,7 +357,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } } int32_t validreq = 0; - if ( 0 && strlen((char *)ptr)+sizeof(bits256) <= recvlen ) + if ( strlen((char *)ptr)+sizeof(bits256) <= recvlen ) { if ( LP_magic_check(ptr,recvlen,remoteaddr) <= 0 ) { @@ -365,7 +365,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } else validreq = 1; recvlen -= sizeof(bits256); } - if ( 0 && validreq != 0 ) + if ( validreq != 0 ) { if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); From 3bb38b13bc1e8c259c78d488baef5ee529af625d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:48:07 +0200 Subject: [PATCH 2539/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 75e236dac..98f4cc927 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -365,7 +365,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } else validreq = 1; recvlen -= sizeof(bits256); } - if ( validreq != 0 ) + if ( 0 && validreq != 0 ) { if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); From 83a6006d7e5bd687f63e9b3e1521244839dac090 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 14 Nov 2017 23:58:00 +0200 Subject: [PATCH 2540/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_ordermatch.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 98f4cc927..c5c34b353 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -315,8 +315,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); } - free_json(argjson); } + if ( argjson != 0 ) + free_json(argjson); } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); portable_mutex_unlock(&LP_commandmutex); @@ -365,7 +366,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } else validreq = 1; recvlen -= sizeof(bits256); } - if ( 0 && validreq != 0 ) + if ( validreq != 0 ) { if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a8c061359..0ab6faca0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -799,7 +799,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } LP_aliceid(Q.tradeid,Q.aliceid,"reserved",0,0); - printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); + //printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) free(retstr); LP_reserved(ctx,myipaddr,pubsock,&Q); @@ -929,7 +929,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s %.8f < %.8f\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin,qprice,(ask - 0.00000001) * 0.998); return(retval); } - char str[65],str2[65]; printf("(%s/v%d %s/v%d) TRADECOMMAND.(%s)\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,jprint(argjson,0)); + char *astr = jprint(argjson,0); + char str[65],str2[65]; printf("(%s/v%d %s/v%d) TRADECOMMAND.(%s)\n",bits256_str(str,Q.txid),Q.vout,bits256_str(str2,Q.txid2),Q.vout2,astr); + free(astr); if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's { if ( LP_allocated(Q.txid,Q.vout) == 0 && LP_allocated(Q.txid2,Q.vout2) == 0 ) From 0eb9fd4328fb9aa2ee4453484f09846ca5f40c3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 00:02:11 +0200 Subject: [PATCH 2541/2732] Test --- iguana/exchanges/LP_transaction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 4d9ee5fe1..4df4b3895 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1047,13 +1047,13 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf return(0); } } - if ( bits256_nonz(utxotxid) == 0 ) + //if ( bits256_nonz(utxotxid) == 0 ) { if ( (ap= LP_address_utxo_reset(coin)) == 0 ) return(0); } - else if ( (ap= LP_address(coin,coin->smartaddr)) == 0 ) - return(0); + //else if ( (ap= LP_address(coin,coin->smartaddr)) == 0 ) + // return(0); memset(utxos,0,sizeof(utxos)); if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) { From 1775a5dbea16212762b4991659b86b716649717e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 00:15:18 +0200 Subject: [PATCH 2542/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c5c34b353..d17299573 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -310,7 +310,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { - if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + if ( 0 && (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); From c871feeb8b57c7d7c6802c840b69da6967767a22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 00:19:55 +0200 Subject: [PATCH 2543/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d17299573..87360c470 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -179,18 +179,15 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson char *retstr=0; if ( jobj(argjson,"result") != 0 || jobj(argjson,"error") != 0 ) return(0); - //double millis = OS_milliseconds(); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { - if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) + if ( 0 && (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); - //if ( OS_milliseconds()-millis > 100 ) - // printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); return(retstr); } @@ -310,7 +307,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { - if ( 0 && (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); From 1fca97e9e6437a0e6207f8399471cb42e1a0a7f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 00:21:16 +0200 Subject: [PATCH 2544/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 87360c470..5969f11a1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -181,7 +181,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson return(0); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { - if ( 0 && (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) + if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && From dc5149ed0deceafd3855086ad56a6c057578852b Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 15 Nov 2017 04:56:35 +0400 Subject: [PATCH 2545/2732] added q/a in script use faq --- iguana/dexscripts.win32/how_to_use.md | 12 +++++++++--- iguana/dexscripts.win32/images/conemu_jq.png | Bin 0 -> 31836 bytes 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 iguana/dexscripts.win32/images/conemu_jq.png diff --git a/iguana/dexscripts.win32/how_to_use.md b/iguana/dexscripts.win32/how_to_use.md index 29fdcc537..5d1488885 100644 --- a/iguana/dexscripts.win32/how_to_use.md +++ b/iguana/dexscripts.win32/how_to_use.md @@ -1,15 +1,15 @@ ## DexScripts for Windows. How to use? ## -**1. ** Before start you should put scripts and following binaries into one folder: +**1.** Before start you should put scripts and following binaries into one folder: - curl.exe (required for all scripts) - marketmaker.exe - libcurl.dll (required to run marketmaker) - nanomsg.dll (required to run marketmaker) -**2. ** Don't forget to put `coins.json` file into a same folder. This file is available it this repo. +**2.** Don't forget to put `coins.json` file into a same folder. This file is available it this repo. -**3. ** Type your passphrase into passphrase file in this folder (you should create file with name `passphrase` and without extension) and run `1-client.cmd`. This will run marketmaker. Next step is to obtain userpass needed for other scripts, you can simply copy and paste it from marketmaker output on startup into userpass file. +**3.** Type your passphrase into passphrase file in this folder (you should create file with name `passphrase` and without extension) and run `1-client.cmd`. This will run marketmaker. Next step is to obtain userpass needed for other scripts, you can simply copy and paste it from marketmaker output on startup into userpass file. ![](./images/userpass.png) @@ -42,3 +42,9 @@ And nothing works. **A.** Before run `1-client.cmd` make sure in Task Manager that you haven't already running `marketmaker.exe`. If have - kill this process via Task Manager or via command line command `taskkill /f /im taskkill.exe` . +**Q.** How can i pretty print JSON answers of marketmaker? +**A.** You can get best results with 2 tools - [conemu](https://conemu.github.io/) and [jq](https://stedolan.github.io/jq/), conemu supports ANSI X3.64 and Xterm 256 colors and jq allow you to pretty-print json output with colors, like this: + +![](./images/conemu_jq.png) + +Also i'm always recommend to install [Far Manager](https://www.farmanager.com/index.php?l=en) - this is powerful console file manager for Windows, like Midnight Commander in *nix. \ No newline at end of file diff --git a/iguana/dexscripts.win32/images/conemu_jq.png b/iguana/dexscripts.win32/images/conemu_jq.png new file mode 100644 index 0000000000000000000000000000000000000000..e8eeaf523849b859d5b9a396090f3a3b59e4137b GIT binary patch literal 31836 zcmbrm2T)UM+lCuNK)Og1X#&zgP((T?MMQc>DG?BmE+D-M(xo@)2qL}r8mdTFdJnya z&_aL^I4kbGzrFYO|7Yeub7tZ&6G>QEYrXe#KiB=d2~|^(CnmT<00M!C6`sp#fI!#c zfqx=5t^vXh4$eMEq89kOT|5>`K2t6qnv3P|4EbY zZ9X***KO4h(%85Zi@OBr)C{-m?M!8EEPci=*ot7Qmu%EXz!5;Jb7ARSHk!8MyBq6ny2UL7ZMU8-MOeND;xj%c5`S*$StA(A9i4{A>h z3E^nxcOxewW4(=Q&&-^C{r~i$<&mZ&uqZ-`3>>>;ODc2u*=JIZdE?qMhK(|z<@;81P$+RlCRbM+Sf~AHM@=LHcn`+*i$SVz_?h{m#KN@EtZtX7fk7W zYwnGQm%_yzPmiB1B8Zdm^MYo>+g4W~rX- z(|RnCGGV5vd3X<)oNH!|z7Vu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kbyA%|>rTgg1`;yr>T7E%9bgJ-Q!qajAO4&14;~|?o&4%&^E>G!n7!ZrL-NnD( z=4CKgaI7hrqcxFi#s1y>w6g9-42ijFc$fEpE73OKCbFT!=gE_>Ug9ZvT zUUsoYh4Jg^Z@|ia3)2TM#)o@8LJ{mfkx1-6NT%lS78pu;YtP?oM#6z<3JP6Tvp&nG zyy*)w2W-gq+P@iKD91yQRl(pOlT2)?eWmBTgL`*Vh$WVZC0Yw+>}H6!0U5pfvh(16 z0`i7JS+;r&Y>w(A7tW)Z-q*6p&+`aZVJ7GrWG;aBVYdy*GLUNcu}wxjQ~*`T^JS5f4p1u@%Dlei zcuf-v@H%^{a{>IfZ2NluFR_dMa_4Sl_);?5 zDW$Ya?k5Jn2)dZ~Z$D|vq{VG}VZQn_on1;6NYG@-N{vm=V}_|}krT@q%I8Gj$XSTt z%`bn%uA;|BS@dBF_&jIX9vaUAO{ppUd!GC+P;959Un?itn%@^IiUD=#V(-;we0bVg za7B)rRBMpyO&jyPKsyFJ(K6mF(Ronz^NE8N`elSaxy~K+-+KP{u?#kmC>ylSWgl`o zYBLxDC-OX4#Dr7@YZ!ue z$OxuAdz7}j^Z5Z`c`Ny{?XPcO`Ae++b%_73(Ej_pry`fn(hhnr@y38}4Tn4vmlMl* IqWAj$0BxH_7ytkO literal 0 HcmV?d00001 From af80a8ed2ff70c3994a7ef29db82ab43902fb4a7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 11:40:24 +0200 Subject: [PATCH 2546/2732] mark as spent LP_withdraw --- iguana/exchanges/LP_nativeDEX.c | 5 ++++- iguana/exchanges/LP_transaction.c | 1 + iguana/exchanges/LP_utxo.c | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5969f11a1..6232d159b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,7 +17,10 @@ // LP_nativeDEX.c // marketmaker // -// single utxo allocations alice, reject result, latency +// single utxo allocations alice +// gc cJSON +// more retries for swap sendrawtransaction +// pbca26 unfinished swaps // alice waiting for bestprice //if ( G.LP_pendingswaps != 0 ) //return(-1); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 4df4b3895..098d2cb84 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -987,6 +987,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ vp->suppress_pubkeys = suppress_pubkeys; vp->ignore_cltverr = ignore_cltverr; jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr)); + LP_unavailableset(up->U.txid,up->U.vout,(uint32_t)time(NULL)+600,G.LP_mypub25519); if ( remains <= 0 && i >= numpre-1 ) break; if ( numunspents < 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 0f2aee2c3..f8b4d7fac 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -59,7 +59,11 @@ int32_t _LP_inuse_delete(bits256 txid,int32_t vout) struct LP_inuse_info *_LP_inuse_add(uint32_t expiration,bits256 otherpub,bits256 txid,int32_t vout) { struct LP_inuse_info *lp; - if ( bits256_nonz(txid) != 0 && LP_numinuse < sizeof(LP_inuse)/sizeof(*LP_inuse) ) + if ( LP_numinuse >= sizeof(LP_inuse)/sizeof(*LP_inuse) ) + { + + } + if ( bits256_nonz(txid) != 0 && ) { if ( (lp= _LP_inuse_find(txid,vout)) == 0 ) { From 57fd772dfc465dca44cf40e50afe2cb278d25a70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 11:45:41 +0200 Subject: [PATCH 2547/2732] Test --- iguana/exchanges/LP_utxo.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f8b4d7fac..6e49013b0 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -58,12 +58,32 @@ int32_t _LP_inuse_delete(bits256 txid,int32_t vout) struct LP_inuse_info *_LP_inuse_add(uint32_t expiration,bits256 otherpub,bits256 txid,int32_t vout) { - struct LP_inuse_info *lp; + struct LP_inuse_info *lp; int32_t i,n,oldesti; uint32_t now,oldest; if ( LP_numinuse >= sizeof(LP_inuse)/sizeof(*LP_inuse) ) { - + now = (uint32_t)time(NULL); + n = 0; + oldesti = -1; + oldest = 0; + for (i=0; i lp->expiration ) + _LP_inuse_delete(lp->txid,lp->vout), n++; + else if ( oldest == 0 || lp->expiration < oldest ) + { + oldest = lp->expiration; + oldesti = i; + } + } + if ( n == 0 ) + { + printf("_LP_inuse_add out of slots error, pick oldesti %d\n",oldesti); + lp = &LP_inuse[oldesti]; + _LP_inuse_delete(lp->txid,lp->vout); + } else printf("expired %d inuse slots\n",n); } - if ( bits256_nonz(txid) != 0 && ) + if ( bits256_nonz(txid) != 0 ) { if ( (lp= _LP_inuse_find(txid,vout)) == 0 ) { From cb09859e0e8975f2b736628cfa0140cf242fd77c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 11:59:39 +0200 Subject: [PATCH 2548/2732] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 098d2cb84..3f6ff3e43 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1020,7 +1020,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf } if ( coin->numutxos < LP_MINDESIRED_UTXOS ) dustcombine = 0; - else if ( coin->numutxos >= LP_MINDESIRED_UTXOS ) + else if ( coin->numutxos >= LP_MAXDESIRED_UTXOS ) dustcombine = 2; else dustcombine = 1; amount = txfee; From be324b6c5fabb94c86a462d9e3fdec26e1b877c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 12:17:10 +0200 Subject: [PATCH 2549/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b7dd79e03..5e530f9c1 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -53,8 +53,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_PEERS 8 #define LP_MAX_PEERS 32 -#define LP_MAXDESIRED_UTXOS 128 -#define LP_MINDESIRED_UTXOS 32 +#define LP_MAXDESIRED_UTXOS (IAMLP != 0 ? 128 : 64) +#define LP_MINDESIRED_UTXOS (IAMLP != 0 ? 32 : 16) #define LP_DUSTCOMBINE_THRESHOLD 1000000 // RTmetrics diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6232d159b..ae5fa57a7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,16 +17,15 @@ // LP_nativeDEX.c // marketmaker // -// single utxo allocations alice // gc cJSON -// more retries for swap sendrawtransaction +// more retries for swap sendrawtransaction? // pbca26 unfinished swaps -// alice waiting for bestprice -//if ( G.LP_pendingswaps != 0 ) -//return(-1); +// if ( G.LP_pendingswaps != 0 ) return(-1); // bot safe to exit? // // BCH signing +// single utxo allocations alice +// alice waiting for bestprice // previously, it used to show amount, kmd equiv, perc // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs From 48ffd56a48f7843f33eb5c043a41d04da7b608b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:04:17 +0200 Subject: [PATCH 2550/2732] Test --- crypto777/cJSON.c | 33 ++++++++++++++++++++++++++++++--- iguana/exchanges/mm.c | 1 + 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 8bce48b19..9674910b8 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -578,8 +578,6 @@ cJSON *cJSON_CreateFalse(void) {cJSON *item=cJSON_New_Item();if(item)item->t cJSON *cJSON_CreateBool(int32_t b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;} cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int64_t)num;}return item;} cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;} -cJSON *cJSON_CreateArray(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;} -cJSON *cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;} /* Create Arrays: */ cJSON *cJSON_CreateIntArray(int64_t *numbers,int32_t count) {int32_t i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} @@ -1129,4 +1127,33 @@ cJSON *addrs_jsonarray(uint64_t *addrs,int32_t num) return(array); } -void free_json(cJSON *json) { if ( json != 0 ) cJSON_Delete(json); } +cJSON *cJSON_CreateArray(void) +{ + cJSON *item = cJSON_New_Item(); + if ( item ) + item->type = cJSON_Array; +#ifdef CJSON_GARBAGECOLLECTION + cJSON_register(item); +#endif + return(item); +} + +cJSON *cJSON_CreateObject(void) +{ + cJSON *item = cJSON_New_Item(); + if ( item ) + item->type = cJSON_Object; +#ifdef CJSON_GARBAGECOLLECTION + cJSON_register(item); +#endif + return item; +} + +void free_json(cJSON *json) +{ +#ifdef CJSON_GARBAGECOLLECTION + cJSON_unregister(item); +#endif + if ( json != 0 ) + cJSON_Delete(json); +} diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 1d2a1bd5e..8ce073d1f 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -24,6 +24,7 @@ void PNACL_message(char *arg,...) } #define FROM_MARKETMAKER +#define CJSON_GARBAGECOLLECTION #include #include #ifndef NATIVE_WINDOWS From 7e999953c64612ea58110f01b0aa123621781814 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:16:29 +0200 Subject: [PATCH 2551/2732] Test --- crypto777/cJSON.c | 2 +- iguana/m_mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 9674910b8..404931fcf 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -1144,7 +1144,7 @@ cJSON *cJSON_CreateObject(void) if ( item ) item->type = cJSON_Object; #ifdef CJSON_GARBAGECOLLECTION - cJSON_register(item); + cJSON_register(item); fff #endif return item; } diff --git a/iguana/m_mm b/iguana/m_mm index b5ba405ca..3905b5d84 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -1,3 +1,3 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; ./m_LP; cd ../iguana -gcc -g -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm +gcc -DFROM_MARKETMAKER -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm From 32191a3f60704664049426d0242e0bf5753a36c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:26:24 +0200 Subject: [PATCH 2552/2732] Test --- crypto777/cJSON.c | 2 ++ iguana/exchanges/mm.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 404931fcf..a9bb74dd7 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -25,6 +25,8 @@ /* JSON parser in C. */ #include +#define CJSON_GARBAGECOLLECTION + #include "../includes/cJSON.h" #ifndef DBL_EPSILON diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 8ce073d1f..56498394a 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -23,7 +23,10 @@ void PNACL_message(char *arg,...) { } +#ifndef FROM_MARKETMAKER #define FROM_MARKETMAKER +#endif + #define CJSON_GARBAGECOLLECTION #include #include From 3df1acbc3b4bd1470d291f8c36c21d3a29477032 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:28:05 +0200 Subject: [PATCH 2553/2732] Test --- crypto777/cJSON.c | 2 -- iguana/exchanges/mm.c | 5 +++-- iguana/m_mm | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index a9bb74dd7..404931fcf 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -25,8 +25,6 @@ /* JSON parser in C. */ #include -#define CJSON_GARBAGECOLLECTION - #include "../includes/cJSON.h" #ifndef DBL_EPSILON diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 56498394a..e20b1dcb6 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -23,11 +23,12 @@ void PNACL_message(char *arg,...) { } -#ifndef FROM_MARKETMAKER #define FROM_MARKETMAKER -#endif +#ifndef CJSON_GARBAGECOLLECTION #define CJSON_GARBAGECOLLECTION +#endif + #include #include #ifndef NATIVE_WINDOWS diff --git a/iguana/m_mm b/iguana/m_mm index 3905b5d84..0609d842c 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -1,3 +1,3 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; ./m_LP; cd ../iguana -gcc -DFROM_MARKETMAKER -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm +gcc -DCJSON_GARBAGECOLLECTION -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm From 62ff96b246815feebf2e2d55e39f75d96cec226b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:29:15 +0200 Subject: [PATCH 2554/2732] Test --- crypto777/cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 404931fcf..9674910b8 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -1144,7 +1144,7 @@ cJSON *cJSON_CreateObject(void) if ( item ) item->type = cJSON_Object; #ifdef CJSON_GARBAGECOLLECTION - cJSON_register(item); fff + cJSON_register(item); #endif return item; } From 21b83eaf5fc3d5e978d247524c46dd2745834c15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:31:20 +0200 Subject: [PATCH 2555/2732] Test --- includes/cJSON.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/cJSON.h b/includes/cJSON.h index 77e0752e6..cd8e6d00f 100755 --- a/includes/cJSON.h +++ b/includes/cJSON.h @@ -218,6 +218,8 @@ extern "C" char *nxt64str2(uint64_t nxt64bits); cJSON *addrs_jsonarray(uint64_t *addrs,int32_t num); int32_t myatoi(char *str,int32_t range); + void cJSON_register(cJSON *item); + void cJSON_unregister(cJSON *item); char *stringifyM(char *str); #define replace_backslashquotes unstringify From fc1c161db6650d8cd989ae00d742596606d1116d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:47:36 +0200 Subject: [PATCH 2556/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_utxo.c | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ae5fa57a7..c7ba59d0b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -82,7 +82,7 @@ void LP_millistats_update(struct LP_millistats *mp) } #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex,LP_inusemutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex,LP_inusemutex,LP_cJSONmutex; int32_t LP_canbind; char *Broadcaststr,*Reserved_msgs[2][1000]; int32_t num_Reserved_msgs[2],max_Reserved_msgs[2]; @@ -938,6 +938,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_reservedmutex); portable_mutex_init(&LP_nanorecvsmutex); portable_mutex_init(&LP_tradebotsmutex); + portable_mutex_init(&LP_cJSONmutex); myipaddr = clonestr("127.0.0.1"); #ifndef _WIN32 #ifndef FROM_JS diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6e49013b0..cdfff09a1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -27,6 +27,42 @@ struct LP_inuse_info } LP_inuse[1024]; int32_t LP_numinuse; +struct cJSON_list +{ + struct cJSON_list *next,*prev; + cJSON *item; + uint32_t timestamp; +} *LP_cJSONlist; + +void cJSON_register(cJSON *item) +{ + struct cJSON_list *ptr; + ptr = calloc(1,sizeof(*ptr)); + ptr->timestamp = (uint32_t)time(NULL); + ptr->item = item; + portable_mutex_lock(&LP_cJSONmutex); + DL_APPEND(LP_cJSONlist,ptr); + portable_mutex_unlock(&LP_cJSONmutex); +} + +void cJSON_unregister(cJSON *item) +{ + struct cJSON_list *ptr,*tmp; + DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) + { + if ( ptr->item == item ) + break; + ptr = 0; + } + if ( ptr != 0 ) + { + portable_mutex_lock(&LP_cJSONmutex); + DL_DELETE(LP_cJSONlist,ptr); + free(ptr); + portable_mutex_unlock(&LP_cJSONmutex); + } +} + struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) { int32_t i; From 5770810c609ab69de70d92bebe61a202bf8fcb5f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:48:38 +0200 Subject: [PATCH 2557/2732] Test --- crypto777/cJSON.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 9674910b8..28f02bafc 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -1149,11 +1149,11 @@ cJSON *cJSON_CreateObject(void) return item; } -void free_json(cJSON *json) +void free_json(cJSON *item) { #ifdef CJSON_GARBAGECOLLECTION cJSON_unregister(item); #endif if ( json != 0 ) - cJSON_Delete(json); + cJSON_Delete(item); } From b86d13d6b503774c2c54b4c83c02560396b71f1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 13:49:30 +0200 Subject: [PATCH 2558/2732] Test --- crypto777/cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 28f02bafc..555fdf29c 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -1154,6 +1154,6 @@ void free_json(cJSON *item) #ifdef CJSON_GARBAGECOLLECTION cJSON_unregister(item); #endif - if ( json != 0 ) + if ( item != 0 ) cJSON_Delete(item); } From 2d23ba8dd6bf0d45f5bd5c8cb32d4498b354aa26 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:15:08 +0200 Subject: [PATCH 2559/2732] Test --- iguana/exchanges/LP_utxo.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index cdfff09a1..6d22d3faf 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -45,9 +45,25 @@ void cJSON_register(cJSON *item) portable_mutex_unlock(&LP_cJSONmutex); } +char *mbstr(char *str,double n); void cJSON_unregister(cJSON *item) { - struct cJSON_list *ptr,*tmp; + static uint32_t lasttime; + char *tmpstr,str[65]; int32_t n; uint64_t total; struct cJSON_list *ptr,*tmp; + if ( time(NULL) > lasttime+600 ) + { + n = 0; + total = 0; + DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) + { + tmpstr = jprint(ptr->item,0); + total += strlen(tmpstr); + free(tmpstr); + n++; + } + printf("total %d cJSON pending %s\n",n,mbstr(str,total)); + lasttime = (uint32_t)time(NULL); + } DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { if ( ptr->item == item ) @@ -60,7 +76,7 @@ void cJSON_unregister(cJSON *item) DL_DELETE(LP_cJSONlist,ptr); free(ptr); portable_mutex_unlock(&LP_cJSONmutex); - } + } else printf("cJSON_unregister of unknown %p\n",item); } struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) From 19634a3c9afa042ef0b92574c8f608ed3a55770a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:18:04 +0200 Subject: [PATCH 2560/2732] Test --- iguana/exchanges/LP_utxo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6d22d3faf..e36afaff5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -72,11 +72,12 @@ void cJSON_unregister(cJSON *item) } if ( ptr != 0 ) { + printf("found %p\n",item); portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_cJSONlist,ptr); free(ptr); portable_mutex_unlock(&LP_cJSONmutex); - } else printf("cJSON_unregister of unknown %p\n",item); + } //else printf("cJSON_unregister of unknown %p\n",item); } struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) From ce6caefbed81964237feb6d8715a6ca8dfc41b78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:24:45 +0200 Subject: [PATCH 2561/2732] Test --- iguana/exchanges/LP_utxo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e36afaff5..a807f2fcc 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -37,6 +37,7 @@ struct cJSON_list void cJSON_register(cJSON *item) { struct cJSON_list *ptr; + printf(" register %p\n",item); ptr = calloc(1,sizeof(*ptr)); ptr->timestamp = (uint32_t)time(NULL); ptr->item = item; @@ -50,6 +51,7 @@ void cJSON_unregister(cJSON *item) { static uint32_t lasttime; char *tmpstr,str[65]; int32_t n; uint64_t total; struct cJSON_list *ptr,*tmp; + printf("unregister %p\n",item); if ( time(NULL) > lasttime+600 ) { n = 0; From 240d250f68c28d0cfe50022e381918f472870639 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:34:25 +0200 Subject: [PATCH 2562/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/invreset | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a807f2fcc..ce9c0f4ca 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -52,7 +52,7 @@ void cJSON_unregister(cJSON *item) static uint32_t lasttime; char *tmpstr,str[65]; int32_t n; uint64_t total; struct cJSON_list *ptr,*tmp; printf("unregister %p\n",item); - if ( time(NULL) > lasttime+600 ) + if ( time(NULL) > lasttime+6 ) { n = 0; total = 0; diff --git a/iguana/exchanges/invreset b/iguana/exchanges/invreset index f0b1c79e3..0304c7503 100755 --- a/iguana/exchanges/invreset +++ b/iguana/exchanges/invreset @@ -1,3 +1,4 @@ +#!/bin/bash source userpass source passphrase curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"inventory\",\"coin\":\"KMD\",\"reset\":1,\"passphrase\":\"$passphrase\"}" From d70d5c835db1c4661513f8b3c9b2280154c09b23 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:41:16 +0200 Subject: [PATCH 2563/2732] Test --- iguana/exchanges/LP_utxo.c | 13 ++++++------- includes/cJSON.h | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index ce9c0f4ca..a329aaef5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -31,16 +31,17 @@ struct cJSON_list { struct cJSON_list *next,*prev; cJSON *item; - uint32_t timestamp; + uint32_t timestamp,cjsonid; } *LP_cJSONlist; void cJSON_register(cJSON *item) { struct cJSON_list *ptr; - printf(" register %p\n",item); ptr = calloc(1,sizeof(*ptr)); ptr->timestamp = (uint32_t)time(NULL); ptr->item = item; + item->cjsonid = rand(); + ptr->cjsonid = item->cjsonid; portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_cJSONlist,ptr); portable_mutex_unlock(&LP_cJSONmutex); @@ -51,8 +52,7 @@ void cJSON_unregister(cJSON *item) { static uint32_t lasttime; char *tmpstr,str[65]; int32_t n; uint64_t total; struct cJSON_list *ptr,*tmp; - printf("unregister %p\n",item); - if ( time(NULL) > lasttime+6 ) + //if ( time(NULL) > lasttime+6 ) { n = 0; total = 0; @@ -68,18 +68,17 @@ void cJSON_unregister(cJSON *item) } DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - if ( ptr->item == item ) + if ( ptr->cjsonid == item->cjsonid )//ptr->item == item ) break; ptr = 0; } if ( ptr != 0 ) { - printf("found %p\n",item); portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_cJSONlist,ptr); free(ptr); portable_mutex_unlock(&LP_cJSONmutex); - } //else printf("cJSON_unregister of unknown %p\n",item); + } else printf("cJSON_unregister of unknown %p\n",item); } struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) diff --git a/includes/cJSON.h b/includes/cJSON.h index cd8e6d00f..3ecdadc69 100755 --- a/includes/cJSON.h +++ b/includes/cJSON.h @@ -73,6 +73,7 @@ extern "C" double valuedouble; /* The item's number, if type==cJSON_Number */ char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + uint32_t cjsonid; } cJSON; typedef struct cJSON_Hooks { From 006fcdaea0a39052d5ff699b02cb3ea0fcff5639 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:42:32 +0200 Subject: [PATCH 2564/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a329aaef5..8a54d97ae 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -78,7 +78,7 @@ void cJSON_unregister(cJSON *item) DL_DELETE(LP_cJSONlist,ptr); free(ptr); portable_mutex_unlock(&LP_cJSONmutex); - } else printf("cJSON_unregister of unknown %p\n",item); + } else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); } struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) From 5e851f41eadad9b2f13beca5ef25db937970b535 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:46:40 +0200 Subject: [PATCH 2565/2732] Test --- iguana/exchanges/LP_utxo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8a54d97ae..d785ca933 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -58,9 +58,11 @@ void cJSON_unregister(cJSON *item) total = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - tmpstr = jprint(ptr->item,0); - total += strlen(tmpstr); - free(tmpstr); + if ( (tmpstr= jprint(ptr->item,0)) != 0 ) + { + total += strlen(tmpstr); + free(tmpstr); + } n++; } printf("total %d cJSON pending %s\n",n,mbstr(str,total)); From 86e4295c24ea27dfd2528426d565f0f158bca475 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:50:28 +0200 Subject: [PATCH 2566/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- iguana/exchanges/LP_utxo.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 4f0a9cdd4..98c7e7eb0 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -56,7 +56,7 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * char *retstr = 0; cJSON *json,*result,*error; #ifdef FROM_MARKETMAKER - usleep(5000); + usleep(3000); #endif //printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,rpcstr); if ( command == 0 || rpcstr == 0 || rpcstr[0] == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d785ca933..c78b475e7 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -58,10 +58,13 @@ void cJSON_unregister(cJSON *item) total = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - if ( (tmpstr= jprint(ptr->item,0)) != 0 ) + if ( ptr->item != 0 && ptr->item->child != 0 ) { - total += strlen(tmpstr); - free(tmpstr); + if ( (tmpstr= jprint(ptr->item,0)) != 0 ) + { + total += strlen(tmpstr); + free(tmpstr); + } } n++; } From 54a26a1ebad8d4f05dc943e21de0d681cac5b94a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:54:30 +0200 Subject: [PATCH 2567/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c78b475e7..fa1210cfa 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -58,14 +58,14 @@ void cJSON_unregister(cJSON *item) total = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - if ( ptr->item != 0 && ptr->item->child != 0 ) + /*if ( ptr->item != 0 && ptr->item->child != 0 ) { if ( (tmpstr= jprint(ptr->item,0)) != 0 ) { total += strlen(tmpstr); free(tmpstr); } - } + }*/ n++; } printf("total %d cJSON pending %s\n",n,mbstr(str,total)); From 66c434d82d697843a93ff2bca53449cc9e7a1353 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 14:55:57 +0200 Subject: [PATCH 2568/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fa1210cfa..de6660b86 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -58,14 +58,14 @@ void cJSON_unregister(cJSON *item) total = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - /*if ( ptr->item != 0 && ptr->item->child != 0 ) + if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) { if ( (tmpstr= jprint(ptr->item,0)) != 0 ) { total += strlen(tmpstr); free(tmpstr); } - }*/ + } n++; } printf("total %d cJSON pending %s\n",n,mbstr(str,total)); From a25ab17cbbe7c727b44469f96794a3e0b56f3832 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:00:04 +0200 Subject: [PATCH 2569/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index de6660b86..933af800a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -58,14 +58,14 @@ void cJSON_unregister(cJSON *item) total = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) + /*if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) { if ( (tmpstr= jprint(ptr->item,0)) != 0 ) { total += strlen(tmpstr); free(tmpstr); } - } + }*/ n++; } printf("total %d cJSON pending %s\n",n,mbstr(str,total)); From 7c29efc217e67da5540e904df1fd2e96d933c7ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:08:29 +0200 Subject: [PATCH 2570/2732] Test --- iguana/exchanges/LP_utxo.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 933af800a..8512572e6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -51,11 +51,10 @@ char *mbstr(char *str,double n); void cJSON_unregister(cJSON *item) { static uint32_t lasttime; - char *tmpstr,str[65]; int32_t n; uint64_t total; struct cJSON_list *ptr,*tmp; - //if ( time(NULL) > lasttime+6 ) + int32_t n; struct cJSON_list *ptr,*tmp; uint32_t now; + if ( (now= time(NULL)) > lasttime+6 ) { n = 0; - total = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { /*if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) @@ -68,13 +67,21 @@ void cJSON_unregister(cJSON *item) }*/ n++; } - printf("total %d cJSON pending %s\n",n,mbstr(str,total)); + printf("total %d cJSON pending\n",n); lasttime = (uint32_t)time(NULL); } DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - if ( ptr->cjsonid == item->cjsonid )//ptr->item == item ) + if ( ptr->item == item ) break; + else if ( now > ptr->timestamp+60 ) + { + portable_mutex_lock(&LP_cJSONmutex); + DL_DELETE(LP_cJSONlist,ptr); + portable_mutex_unlock(&LP_cJSONmutex); + cJSON_Delete(ptr->item); + free(ptr); + } ptr = 0; } if ( ptr != 0 ) From 02df7289d30f72ab6d33331aeba4808a012da5ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:10:11 +0200 Subject: [PATCH 2571/2732] Test --- iguana/exchanges/LP_utxo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8512572e6..4b0828a3b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -79,6 +79,7 @@ void cJSON_unregister(cJSON *item) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_cJSONlist,ptr); portable_mutex_unlock(&LP_cJSONmutex); + printf("free expired\n"); cJSON_Delete(ptr->item); free(ptr); } @@ -90,7 +91,7 @@ void cJSON_unregister(cJSON *item) DL_DELETE(LP_cJSONlist,ptr); free(ptr); portable_mutex_unlock(&LP_cJSONmutex); - } else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); + } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); } struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) From 49c0feed90b0686b8210d85d8d808e09f2240e19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:12:56 +0200 Subject: [PATCH 2572/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4b0828a3b..1befc1dcf 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -72,9 +72,9 @@ void cJSON_unregister(cJSON *item) } DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - if ( ptr->item == item ) + if ( ptr->cjsonid == item->cjsonid ) break; - else if ( now > ptr->timestamp+60 ) + else if ( now > ptr->timestamp+60 && item->cjsonid != 0 ) { portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_cJSONlist,ptr); From bea2f74a87beb53592f02099935c6b01a883853b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:16:16 +0200 Subject: [PATCH 2573/2732] Test --- crypto777/cJSON.c | 18 +++++++++--------- iguana/m_mm | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 555fdf29c..93438fe79 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -1132,9 +1132,9 @@ cJSON *cJSON_CreateArray(void) cJSON *item = cJSON_New_Item(); if ( item ) item->type = cJSON_Array; -#ifdef CJSON_GARBAGECOLLECTION - cJSON_register(item); -#endif +//#ifdef CJSON_GARBAGECOLLECTION +// cJSON_register(item); +//#endif return(item); } @@ -1143,17 +1143,17 @@ cJSON *cJSON_CreateObject(void) cJSON *item = cJSON_New_Item(); if ( item ) item->type = cJSON_Object; -#ifdef CJSON_GARBAGECOLLECTION - cJSON_register(item); -#endif +//#ifdef CJSON_GARBAGECOLLECTION +// cJSON_register(item); +//#endif return item; } void free_json(cJSON *item) { -#ifdef CJSON_GARBAGECOLLECTION - cJSON_unregister(item); -#endif +//#ifdef CJSON_GARBAGECOLLECTION +// cJSON_unregister(item); +//#endif if ( item != 0 ) cJSON_Delete(item); } diff --git a/iguana/m_mm b/iguana/m_mm index 0609d842c..36a0acad1 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -1,3 +1,3 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; ./m_LP; cd ../iguana -gcc -DCJSON_GARBAGECOLLECTION -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm +gcc -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm From b435fe804c7af8da3ce399b9320346f851a2cf5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:18:53 +0200 Subject: [PATCH 2574/2732] Test --- iguana/exchanges/LP_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 56ed047e4..a241aa4ab 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,9 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; - //printf("stats_JSON(%s)\n",jprint(argjson,0)); + retstr = jprint(argjson,0); + printf("stats_JSON(%s)\n",retstr); + free(retstr), retstr = 0; method = jstr(argjson,"method"); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { From cd61cdb07f517ed47b0294890917cc67ae8bb53d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:25:35 +0200 Subject: [PATCH 2575/2732] Test --- iguana/exchanges/LP_commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a241aa4ab..b06fab289 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,10 +35,12 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; - retstr = jprint(argjson,0); - printf("stats_JSON(%s)\n",retstr); - free(retstr), retstr = 0; - method = jstr(argjson,"method"); +retstr = jprint(argjson,0); +printf("stats_JSON(%s)\n",retstr); +free(retstr), retstr = 0; +method = jstr(argjson,"method"); +if ( strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 ) + return(clonestr("{}")); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From db088b68ae6cafedf1e013d802ddc030ec2ecaea Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:28:56 +0200 Subject: [PATCH 2576/2732] Test --- iguana/exchanges/LP_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b06fab289..c583c5346 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,12 +35,12 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -retstr = jprint(argjson,0); -printf("stats_JSON(%s)\n",retstr); -free(retstr), retstr = 0; method = jstr(argjson,"method"); if ( strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 ) return(clonestr("{}")); +retstr = jprint(argjson,0); +printf("stats_JSON(%s)\n",retstr); +free(retstr), retstr = 0; /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From ecce4d9c0855bc60f49b675836b7ea4ba5272383 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 15:49:57 +0200 Subject: [PATCH 2577/2732] Test --- iguana/exchanges/LP_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c583c5346..d4487782d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,7 +36,9 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); -if ( strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 ) +if ( strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 + || strcmp(method,"notify") == 0 || strcmp(method,"postprice") == 0 + ) return(clonestr("{}")); retstr = jprint(argjson,0); printf("stats_JSON(%s)\n",retstr); From 3843e3d1e843b7cc034f8b2fad849016c976f60f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 16:02:17 +0200 Subject: [PATCH 2578/2732] Test --- iguana/exchanges/LP_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d4487782d..fdc2bc6ff 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -37,7 +37,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); if ( strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 - || strcmp(method,"notify") == 0 || strcmp(method,"postprice") == 0 + || strcmp(method,"notify") == 0 + //|| strcmp(method,"postprice") == 0 ) return(clonestr("{}")); retstr = jprint(argjson,0); From 48623418bbeafdae3cc01059f872e52811e3a416 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 16:04:05 +0200 Subject: [PATCH 2579/2732] Test --- iguana/exchanges/LP_commands.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index fdc2bc6ff..3fc34e752 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,14 +36,11 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); -if ( strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 - || strcmp(method,"notify") == 0 +if ( //strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 || + strcmp(method,"notify") == 0 //|| strcmp(method,"postprice") == 0 ) return(clonestr("{}")); -retstr = jprint(argjson,0); -printf("stats_JSON(%s)\n",retstr); -free(retstr), retstr = 0; /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From 12a6db1ac053c50ca87cde167292b5df8f11dcfc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 16:06:28 +0200 Subject: [PATCH 2580/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3fc34e752..40f7151c3 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -38,7 +38,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r method = jstr(argjson,"method"); if ( //strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 || strcmp(method,"notify") == 0 - //|| strcmp(method,"postprice") == 0 + || strcmp(method,"postprice") == 0 ) return(clonestr("{}")); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) From 8743a5701fb5265647f5f03f36e1dccfd9074061 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 16:37:34 +0200 Subject: [PATCH 2581/2732] Test --- iguana/exchanges/LP_cache.c | 6 +++--- iguana/exchanges/LP_commands.c | 6 +++--- iguana/exchanges/LP_swap.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index a08828966..fdc734fe9 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -45,10 +45,10 @@ struct LP_transaction *LP_create_transaction(struct iguana_info *coin,bits256 tx vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); tx = LP_transactionadd(coin,txid,height,numvouts,numvins); - tx->serialized = serialized; - //free(serialized); + tx->serialized = 0;//serialized; + free(serialized); tx->fpos = fpos; - tx->len = tx->len; + tx->len = 0;//tx->len; tx->SPV = tx->height = height; //printf("tx.%s numvins.%d numvouts.%d\n",bits256_str(str,txid),numvins,numvouts); for (i=0; i= 1000 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 03d08d69e..7e31d21e8 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -895,7 +895,7 @@ void LP_aliceloop(void *_swap) } basilisk_swap_finished(swap); printf("finish swap.%p\n",swap); - //free(swap); + free(swap); G.LP_pendingswaps--; } From 6b98102ea39de321667e0dac15bc985fc70bf047 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 16:39:27 +0200 Subject: [PATCH 2582/2732] Test --- iguana/exchanges/LP_utxo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1befc1dcf..da6f97cc1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -51,20 +51,20 @@ char *mbstr(char *str,double n); void cJSON_unregister(cJSON *item) { static uint32_t lasttime; - int32_t n; struct cJSON_list *ptr,*tmp; uint32_t now; - if ( (now= time(NULL)) > lasttime+6 ) + int32_t n; char *tmpstr; uint64_t total = 0; struct cJSON_list *ptr,*tmp; uint32_t now; + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) { - /*if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) + if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) { if ( (tmpstr= jprint(ptr->item,0)) != 0 ) { total += strlen(tmpstr); free(tmpstr); } - }*/ + } n++; } printf("total %d cJSON pending\n",n); From 3ef3f0603e5519e6f4c9e393270f272cf81f72c7 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 15 Nov 2017 18:45:53 +0400 Subject: [PATCH 2583/2732] added batch script to automate Windows builds (both 32/64-bit) script can be used to automate Windows builds of marketmaker using MSVC 2015 without jenkins. just follow to repo directory and launch marketmaker_build_32_64.cmd . It will generate 32-bit and 64-bit executables in Release and x64/Release directories. Also it has example how to add executables into archive. You can add any custom automate actions, for example, put archive with release on FTP, or syncing it somewhere with rsync, or any other. --- marketmaker_build_32_64.cmd | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 marketmaker_build_32_64.cmd diff --git a/marketmaker_build_32_64.cmd b/marketmaker_build_32_64.cmd new file mode 100644 index 000000000..bac8df5e0 --- /dev/null +++ b/marketmaker_build_32_64.cmd @@ -0,0 +1,47 @@ +@echo off + +@REM Check for Visual Studio +call set "VSPATH=" +if defined VS140COMNTOOLS ( if not defined VSPATH ( + call set "VSPATH=%%VS140COMNTOOLS%%" +) ) + +@REM check if we already have the tools in the environment +if exist "%VCINSTALLDIR%" ( + goto compile +) + +if not defined VSPATH ( + echo You need Microsoft Visual Studio 15 installed + pause + exit +) + +@REM set up the environment +if exist "%VSPATH%..\..\vc\vcvarsall.bat" ( + call "%%VSPATH%%..\..\vc\vcvarsall.bat" amd64 + goto compile +) + +echo Unable to set up the environment +pause +exit + +:compile +rem MSBuild /help +MSBuild marketmaker.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 +MSBuild marketmaker.sln /t:Rebuild /p:Configuration=Release /p:Platform=x86 + +rem Using to add in marketmaker_release.7z +set host=%COMPUTERNAME% +IF "%host%"=="VM-81" ( + mkdir package_content\win32 + mkdir package_content\win64 + copy /y Release\marketmaker.exe package_content\win32 + copy /y x64\Release\marketmaker.exe package_content\win64 + cd package_content + "C:\Program Files\7-Zip\7z.exe" a C:\komodo\marketmaker_release\marketmaker_release.7z win32\marketmaker.exe + "C:\Program Files\7-Zip\7z.exe" a C:\komodo\marketmaker_release\marketmaker_release.7z win64\marketmaker.exe + cd .. + rd package_content /s /q + ) From 86e95d081609a713cd77fd95f73e3c051e879522 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 15 Nov 2017 19:33:33 +0400 Subject: [PATCH 2584/2732] added new examples of dexscripts for windows and updated it's description --- iguana/dexscripts.win32/bot_buy.cmd | 7 ++++ iguana/dexscripts.win32/bot_list.cmd | 7 ++++ iguana/dexscripts.win32/bot_statuslist.cmd | 7 ++++ iguana/dexscripts.win32/bot_stop.cmd | 7 ++++ iguana/dexscripts.win32/electrum.cmd | 9 +++++ iguana/dexscripts.win32/help.cmd | 2 ++ iguana/dexscripts.win32/how_to_use.md | 33 +++++++++++++++++++ .../dexscripts.win32/sendrawtransaction.cmd | 5 +++ iguana/dexscripts.win32/withdraw.cmd | 8 +++++ iguana/dexscripts.win32/withdraw_10_send.cmd | 14 ++++++++ iguana/dexscripts.win32/withdraw_send.cmd | 14 ++++++++ 11 files changed, 113 insertions(+) create mode 100644 iguana/dexscripts.win32/bot_buy.cmd create mode 100644 iguana/dexscripts.win32/bot_list.cmd create mode 100644 iguana/dexscripts.win32/bot_statuslist.cmd create mode 100644 iguana/dexscripts.win32/bot_stop.cmd create mode 100644 iguana/dexscripts.win32/electrum.cmd create mode 100644 iguana/dexscripts.win32/help.cmd create mode 100644 iguana/dexscripts.win32/sendrawtransaction.cmd create mode 100644 iguana/dexscripts.win32/withdraw.cmd create mode 100644 iguana/dexscripts.win32/withdraw_10_send.cmd create mode 100644 iguana/dexscripts.win32/withdraw_send.cmd diff --git a/iguana/dexscripts.win32/bot_buy.cmd b/iguana/dexscripts.win32/bot_buy.cmd new file mode 100644 index 000000000..641ef1d7b --- /dev/null +++ b/iguana/dexscripts.win32/bot_buy.cmd @@ -0,0 +1,7 @@ +@echo off +set /p TMPUSERPASS= UTXO PAIRS to understand the basics. This script is just for example how you can split your coins in (X, X/777) to start trading them. + ## F.A.Q. ## **Q.** Is any simple way how i can display JSON results returned by all scripts, like orderbook and others, in human readable form? + **A.** Yes, you can use this service [JSON Editor Online](http://jsoneditoronline.org/), just copy and paste output of script in left column and see structured output in right. **Q.** I see an output like this when i'm start `1-client.cmd` : @@ -43,6 +75,7 @@ And nothing works. **A.** Before run `1-client.cmd` make sure in Task Manager that you haven't already running `marketmaker.exe`. If have - kill this process via Task Manager or via command line command `taskkill /f /im taskkill.exe` . **Q.** How can i pretty print JSON answers of marketmaker? + **A.** You can get best results with 2 tools - [conemu](https://conemu.github.io/) and [jq](https://stedolan.github.io/jq/), conemu supports ANSI X3.64 and Xterm 256 colors and jq allow you to pretty-print json output with colors, like this: ![](./images/conemu_jq.png) diff --git a/iguana/dexscripts.win32/sendrawtransaction.cmd b/iguana/dexscripts.win32/sendrawtransaction.cmd new file mode 100644 index 000000000..a19d77355 --- /dev/null +++ b/iguana/dexscripts.win32/sendrawtransaction.cmd @@ -0,0 +1,5 @@ +@echo off +set /p TMPUSERPASS= withdraw.txt +type withdraw.txt diff --git a/iguana/dexscripts.win32/withdraw_10_send.cmd b/iguana/dexscripts.win32/withdraw_10_send.cmd new file mode 100644 index 000000000..44a947787 --- /dev/null +++ b/iguana/dexscripts.win32/withdraw_10_send.cmd @@ -0,0 +1,14 @@ +@echo off +set /p TMPUSERPASS= withdraw.txt +type withdraw.txt +timeout /t 5 /nobreak +for /f "tokens=4 delims=:," %%a in (' find "hex" "withdraw.txt" ') do ( +rem echo [%%~a] +curl -s --url "http://127.0.0.1:7783" --data "{\"userpass\":\"%USERPASS%\",\"method\":\"sendrawtransaction\",\"coin\":\"%COIN%\",\"signedtx\":\"%%~a\"}" +) diff --git a/iguana/dexscripts.win32/withdraw_send.cmd b/iguana/dexscripts.win32/withdraw_send.cmd new file mode 100644 index 000000000..a26b9bf56 --- /dev/null +++ b/iguana/dexscripts.win32/withdraw_send.cmd @@ -0,0 +1,14 @@ +@echo off +set /p TMPUSERPASS= withdraw.txt +type withdraw.txt +timeout /t 5 /nobreak +for /f "tokens=4 delims=:," %%a in (' find "hex" "withdraw.txt" ') do ( +rem echo [%%~a] +curl -s --url "http://127.0.0.1:7783" --data "{\"userpass\":\"%USERPASS%\",\"method\":\"sendrawtransaction\",\"coin\":\"%COIN%\",\"signedtx\":\"%%~a\"}" +) + From 39d2c7a879c5cdfd281322b45ecf14b82730b60c Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 15 Nov 2017 19:56:36 +0400 Subject: [PATCH 2585/2732] append faq (q/a: required dlls) --- iguana/dexscripts.win32/how_to_use.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/iguana/dexscripts.win32/how_to_use.md b/iguana/dexscripts.win32/how_to_use.md index e04c14ac1..27b8af5be 100644 --- a/iguana/dexscripts.win32/how_to_use.md +++ b/iguana/dexscripts.win32/how_to_use.md @@ -80,4 +80,21 @@ And nothing works. ![](./images/conemu_jq.png) -Also i'm always recommend to install [Far Manager](https://www.farmanager.com/index.php?l=en) - this is powerful console file manager for Windows, like Midnight Commander in *nix. \ No newline at end of file +Also i'm always recommend to install [Far Manager](https://www.farmanager.com/index.php?l=en) - this is powerful console file manager for Windows, like Midnight Commander in *nix. + +**Q.** What additional dependencies required by marketmaker? + +**A.** Currently marketmaker (Windows) used the following DLLs: + +*32 bit:* +- libcrypto-1_1.dll +- libcurl.dll +- libssl-1_1.dll +- nanomsg.dll +- pthreadvc2.dll + +*64-bit:* +- libcurl.dll +- nanomsg.dll + +It already included in repo and in archive with release. \ No newline at end of file From 496a89c6aa32867a7f232aa49df69d26e932927a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 18:30:29 +0200 Subject: [PATCH 2586/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c7ba59d0b..6f90ed93c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,7 +17,6 @@ // LP_nativeDEX.c // marketmaker // -// gc cJSON // more retries for swap sendrawtransaction? // pbca26 unfinished swaps // if ( G.LP_pendingswaps != 0 ) return(-1); @@ -327,7 +326,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr,int32_t maxdepth) { - int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char methodstr[64],*retstr,*str; struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr,*buf; char methodstr[64],*retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < maxdepth && recvlen > 0 ) @@ -339,8 +338,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( nn_poll(&pfd,1,1) != 1 ) break; ptr = 0; - if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) + buf = malloc(1000000); + if ( (recvlen= nn_recv(sock,buf,1000000,0)) > 0 ) + //if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { + ptr = buf; methodstr[0] = 0; //printf("%s.(%s)\n",typestr,(char *)ptr); if ( 0 ) @@ -390,7 +392,10 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } } if ( ptr != 0 ) - nn_freemsg(ptr), ptr = 0; + { + //nn_freemsg(ptr), ptr = 0; + free(buf); + } } } return(nonz); From 401f4d8a35f67ceeb4ca8a2b134ac1f158f75b84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 18:58:29 +0200 Subject: [PATCH 2587/2732] Require requestid/quoteid match --- iguana/exchanges/LP_swap.c | 15 ++++++++++++--- iguana/exchanges/mm.c | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 7e31d21e8..f551b862b 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -187,6 +187,8 @@ uint32_t basilisk_requestid(struct basilisk_request *rp) int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) { int32_t i,datalen = 0; + datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->I.req.requestid),&swap->I.req.requestid); + datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->I.req.quoteid),&swap->I.req.quoteid); data[datalen++] = swap->I.aliceconfirms; data[datalen++] = swap->I.bobconfirms; data[datalen++] = swap->I.alicemaxconfirms; @@ -201,9 +203,16 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - int32_t i,nonz=0,alicemaxconfirms,bobmaxconfirms,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; - if ( datalen == sizeof(swap->otherdeck)+38 ) + uint32_t requestid,quoteid; int32_t i,nonz=0,alicemaxconfirms,bobmaxconfirms,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; + if ( datalen == sizeof(swap->otherdeck)+38+sizeof(uint32_t)*2 ) { + datalen += iguana_rwnum(0,&data[len],sizeof(requestid),&requestid); + datalen += iguana_rwnum(0,&data[len],sizeof(quoteid),"eid); + if ( requestid != swap->I.req.requestid || quoteid != swap->I.req.quoteid ) + { + printf("SWAP requestid.%u quoteid.%u mismatch received r.%u q.%u\n",swap->I.req.requestid,swap->I.req.quoteid,requestid,quoteid); + return(-1); + } aliceconfirms = data[len++]; bobconfirms = data[len++]; alicemaxconfirms = data[len++]; @@ -243,7 +252,7 @@ int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datal len += iguana_rwnum(0,&data[len],sizeof(swap->otherdeck[i>>1][i&1]),&swap->otherdeck[i>>1][i&1]); return(0); } - printf("pubkeys verify size mismatch %d != %d\n",datalen,(int32_t)sizeof(swap->otherdeck)+36); + printf("pubkeys verify size mismatch %d != %d\n",datalen,(int32_t)sizeof(swap->otherdeck)+38+sizeof(uint32_t)*2); return(-1); } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index e20b1dcb6..f906390b8 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -19,6 +19,11 @@ // Copyright © 2017 SuperNET. All rights reserved. // +/* +#define malloc(n) LP_alloc(n) +#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) +#define free(ptr) LP_free(ptr)*/ + void PNACL_message(char *arg,...) { From cb8cdd25980f5f3117d0c97494cf064711df1c5d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 19:11:05 +0200 Subject: [PATCH 2588/2732] Test --- iguana/exchanges/LP_swap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index f551b862b..1b6a17ab3 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -206,8 +206,8 @@ int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datal uint32_t requestid,quoteid; int32_t i,nonz=0,alicemaxconfirms,bobmaxconfirms,aliceconfirms,bobconfirms,len = 0; uint8_t other33[33]; if ( datalen == sizeof(swap->otherdeck)+38+sizeof(uint32_t)*2 ) { - datalen += iguana_rwnum(0,&data[len],sizeof(requestid),&requestid); - datalen += iguana_rwnum(0,&data[len],sizeof(quoteid),"eid); + len += iguana_rwnum(0,&data[len],sizeof(requestid),&requestid); + len += iguana_rwnum(0,&data[len],sizeof(quoteid),"eid); if ( requestid != swap->I.req.requestid || quoteid != swap->I.req.quoteid ) { printf("SWAP requestid.%u quoteid.%u mismatch received r.%u q.%u\n",swap->I.req.requestid,swap->I.req.quoteid,requestid,quoteid); @@ -252,7 +252,7 @@ int32_t LP_pubkeys_verify(struct basilisk_swap *swap,uint8_t *data,int32_t datal len += iguana_rwnum(0,&data[len],sizeof(swap->otherdeck[i>>1][i&1]),&swap->otherdeck[i>>1][i&1]); return(0); } - printf("pubkeys verify size mismatch %d != %d\n",datalen,(int32_t)sizeof(swap->otherdeck)+38+sizeof(uint32_t)*2); + printf("pubkeys verify size mismatch %d != %d\n",datalen,(int32_t)(sizeof(swap->otherdeck)+38+sizeof(uint32_t)*2)); return(-1); } From a3d3b00649f363abf262567b47eed4f00cee86f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 19:15:09 +0200 Subject: [PATCH 2589/2732] Test --- iguana/exchanges/LP_swap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 1b6a17ab3..616ee46f7 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -189,6 +189,7 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t i,datalen = 0; datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->I.req.requestid),&swap->I.req.requestid); datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->I.req.quoteid),&swap->I.req.quoteid); + printf("send >>>>>>>>> r.%u q.%u\n",swap->I.req.requestid,swap->I.req.quoteid); data[datalen++] = swap->I.aliceconfirms; data[datalen++] = swap->I.bobconfirms; data[datalen++] = swap->I.alicemaxconfirms; From 46bd310f62dd4b7ae47ac79ae0079f5602415c3b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 19:19:53 +0200 Subject: [PATCH 2590/2732] Test --- iguana/exchanges/LP_swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 616ee46f7..1002517b0 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -189,7 +189,6 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) int32_t i,datalen = 0; datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->I.req.requestid),&swap->I.req.requestid); datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->I.req.quoteid),&swap->I.req.quoteid); - printf("send >>>>>>>>> r.%u q.%u\n",swap->I.req.requestid,swap->I.req.quoteid); data[datalen++] = swap->I.aliceconfirms; data[datalen++] = swap->I.bobconfirms; data[datalen++] = swap->I.alicemaxconfirms; @@ -199,6 +198,7 @@ int32_t LP_pubkeys_data(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) data[datalen++] = swap->persistent_pubkey33[i]; for (i=0; ideck)/sizeof(swap->deck[0][0]); i++) datalen += iguana_rwnum(1,&data[datalen],sizeof(swap->deck[i>>1][i&1]),&swap->deck[i>>1][i&1]); + printf("send >>>>>>>>> r.%u q.%u datalen.%d\n",swap->I.req.requestid,swap->I.req.quoteid,datalen); return(datalen); } From 3a84ed7eb6ee140ebbab59cb3e0deec871fa1c43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 19:39:16 +0200 Subject: [PATCH 2591/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 11 ++++++++++ iguana/exchanges/LP_remember.c | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5e530f9c1..b1a78c694 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "14414" +#define LP_BUILD_NUMBER "14498" #ifdef FROM_JS #include diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0ab6faca0..7d60f336d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -449,6 +449,11 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,cJSON *argjson,char *base,c if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) { LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); + if ( LP_pendingswap(qp->R.requestid,qp->R.quoteid) > 0 ) + { + printf("requestid.%u quoteid.%u is already in progres\n",qp->R.requestid,qp->R.quoteid); + return(-1); + } if ( (swap= LP_swapinit(1,0,privkey,&qp->R,qp)) == 0 ) { printf("cant initialize swap\n"); @@ -611,6 +616,12 @@ char *LP_connectedalice(cJSON *argjson) // alice { retjson = cJSON_CreateObject(); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + if ( LP_pendingswap(Q.R.requestid,Q.R.quoteid) > 0 ) + { + printf("requestid.%u quoteid.%u is already in progres\n",Q.R.requestid,Q.R.quoteid); + jaddstr(retjson,"error","swap already in progress"); + return(jprint(retjson,1)); + } if ( (swap= LP_swapinit(0,0,Q.privkey,&Q.R,&Q)) == 0 ) { jaddstr(retjson,"error","couldnt swapinit"); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index d8b264e7c..c0ef0efd7 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1441,3 +1441,40 @@ char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit) return(jprint(retarray,1)); } +int32_t LP_pendingswap(uint32_t requestid,uint32_t quoteid) +{ + cJSON *retjson,*array,*pending,*item; uint32_t r,q; char *retstr; int32_t i,n,retval = 0; + if ( (retstr= LP_recent_swaps(1000)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (array= jarray(&n,retjson,"swaps")) != 0 ) + { + for (i=0; i Date: Wed, 15 Nov 2017 19:43:04 +0200 Subject: [PATCH 2592/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b1a78c694..b6c24be52 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "14498" +#define LP_BUILD_NUMBER "15000" #ifdef FROM_JS #include From 55837efe446da7e9c77907e03a125f887e52bc49 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 19:50:11 +0200 Subject: [PATCH 2593/2732] Test --- iguana/exchanges/LP_ordermatch.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7d60f336d..04faf3715 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -571,7 +571,14 @@ char *LP_connectedalice(cJSON *argjson) // alice LP_aliceid(Q.tradeid,Q.aliceid,"error1",0,0); return(clonestr("{\"result\",\"update stats\"}")); } - printf("CONNECTED.(%s) numpending.%d tradeid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid); + printf("CONNECTED.(%s) numpending.%d tradeid.%u requestid.%u quoteid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid,Q.R.requestid,Q.R.quoteid); + if ( LP_pendingswap(Q.R.requestid,Q.R.quoteid) > 0 ) + { + printf("requestid.%u quoteid.%u is already in progres\n",Q.R.requestid,Q.R.quoteid); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"error","swap already in progress"); + return(jprint(retjson,1)); + } if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) { printf("cant find autxo\n"); @@ -616,12 +623,6 @@ char *LP_connectedalice(cJSON *argjson) // alice { retjson = cJSON_CreateObject(); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); - if ( LP_pendingswap(Q.R.requestid,Q.R.quoteid) > 0 ) - { - printf("requestid.%u quoteid.%u is already in progres\n",Q.R.requestid,Q.R.quoteid); - jaddstr(retjson,"error","swap already in progress"); - return(jprint(retjson,1)); - } if ( (swap= LP_swapinit(0,0,Q.privkey,&Q.R,&Q)) == 0 ) { jaddstr(retjson,"error","couldnt swapinit"); From 30e638296800bfeae1f9be87d355af83ae95a15f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 20:38:55 +0200 Subject: [PATCH 2594/2732] Test --- iguana/exchanges/LP_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index e50e648d4..979a0ad0c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1034,7 +1034,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) retjson = cJSON_CreateObject(); jaddstr(retjson,"ipaddr",ipaddr); jaddnum(retjson,"port",port); - if ( (ep= LP_electrum_info(&already,coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE * 10)) == 0 ) + if ( (ep= LP_electrum_info(&already,coin->symbol,ipaddr,port,IGUANA_MAXPACKETSIZE)) == 0 ) { jaddstr(retjson,"error","couldnt connect to electrum server"); return(retjson); From 61ebc0b09176a9c9480588af5b7bce402324f587 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 20:45:40 +0200 Subject: [PATCH 2595/2732] Test --- iguana/exchanges/LP_transaction.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3f6ff3e43..d414b2847 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -78,7 +78,8 @@ int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid) bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxid) { - char *retstr; bits256 txid; uint8_t *ptr; cJSON *retjson,*errorobj; int32_t i,len,sentflag = 0; + char *retstr,*errstr; bits256 txid; uint8_t *ptr; cJSON *retjson,*errorobj; struct iguana_info *coin; int32_t i,totalretries=0,len,sentflag = 0; + coin = LP_coinfind(symbol); memset(&txid,0,sizeof(txid)); if ( txbytes == 0 || txbytes[0] == 0 ) return(txid); @@ -115,6 +116,15 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi txid = expectedtxid; sentflag = 1; } + else if ( (errstr= jstr(retjson,"error")) != 0 && strcmp(errstr,"timeout") == 0 && coin != 0 && coin->electrum != 0 ) + { + if ( totalretries < 10 ) + { + printf("time error with electrum, retry\n"); + totalretries++; + i--; + } + } else printf("broadcast error.(%s)\n",retstr); } free_json(retjson); From e61d0a0fc4d85dfdd577d929a4cb0b6f64cb0271 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 15 Nov 2017 23:28:31 +0400 Subject: [PATCH 2596/2732] added obtaining version number of mm and commit hash in build script --- marketmaker_build_32_64.cmd | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/marketmaker_build_32_64.cmd b/marketmaker_build_32_64.cmd index bac8df5e0..730081702 100644 --- a/marketmaker_build_32_64.cmd +++ b/marketmaker_build_32_64.cmd @@ -32,6 +32,39 @@ rem MSBuild /help MSBuild marketmaker.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 MSBuild marketmaker.sln /t:Rebuild /p:Configuration=Release /p:Platform=x86 +rem Obtain version number and latest git commit number + +FOR /F "tokens=* USEBACKQ" %%F IN (`find /i "LP_MAJOR_VERSION" "iguana\exchanges\LP_include.h"`) DO ( +SET LP_MAJOR_VERSION_STR=%%F +) +FOR /F "tokens=* USEBACKQ" %%F IN (`find /i "LP_MINOR_VERSION" "iguana\exchanges\LP_include.h"`) DO ( +SET LP_MINOR_VERSION_STR=%%F +) +FOR /F "tokens=* USEBACKQ" %%F IN (`find /i "LP_BUILD_NUMBER" "iguana\exchanges\LP_include.h"`) DO ( +SET LP_BUILD_NUMBER_STR=%%F +) + +for /f delims^=^"^ tokens^=2 %%a in ('echo %LP_MAJOR_VERSION_STR%') do ( +set LP_MAJOR_VERSION=%%a +) +for /f delims^=^"^ tokens^=2 %%a in ('echo %LP_MINOR_VERSION_STR%') do ( +set LP_MINOR_VERSION=%%a +) +for /f delims^=^"^ tokens^=2 %%a in ('echo %LP_BUILD_NUMBER_STR%') do ( +set LP_BUILD_NUMBER=%%a +) + +rem Check if git command exist and if does - receive latest GIT_COMMIT +git --version >nul 2>&1 && ( + for /f "tokens=1" %%a in ('git rev-parse --short HEAD') do ( + set GIT_COMMIT=_%%a + ) +) || ( + set GIT_COMMIT= +) + +rem echo Marketmaker_%LP_MAJOR_VERSION%.%LP_MINOR_VERSION%_%LP_BUILD_NUMBER%%GIT_COMMIT% + rem Using to add in marketmaker_release.7z set host=%COMPUTERNAME% IF "%host%"=="VM-81" ( @@ -39,9 +72,11 @@ IF "%host%"=="VM-81" ( mkdir package_content\win64 copy /y Release\marketmaker.exe package_content\win32 copy /y x64\Release\marketmaker.exe package_content\win64 + echo Marketmaker_%LP_MAJOR_VERSION%.%LP_MINOR_VERSION%_%LP_BUILD_NUMBER%%GIT_COMMIT% > package_content\version.txt cd package_content "C:\Program Files\7-Zip\7z.exe" a C:\komodo\marketmaker_release\marketmaker_release.7z win32\marketmaker.exe "C:\Program Files\7-Zip\7z.exe" a C:\komodo\marketmaker_release\marketmaker_release.7z win64\marketmaker.exe + "C:\Program Files\7-Zip\7z.exe" a C:\komodo\marketmaker_release\marketmaker_release.7z version.txt cd .. rd package_content /s /q ) From 6738004bf87a671c5b28c3f89bc03ec8e6d4248b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 21:55:30 +0200 Subject: [PATCH 2597/2732] Meatiest --- iguana/exchanges/LP_nativeDEX.c | 14 ++++++++++++-- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/mm.c | 11 +++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6f90ed93c..b195a292d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,8 +17,6 @@ // LP_nativeDEX.c // marketmaker // -// more retries for swap sendrawtransaction? -// pbca26 unfinished swaps // if ( G.LP_pendingswaps != 0 ) return(-1); // bot safe to exit? // @@ -1190,4 +1188,16 @@ void LP_fromjs_iter() #endif +#undef calloc +#undef free + +void *LP_alloc(uint64_t len) +{ + return(calloc(1,len)); +} + +void LP_free(void *ptr) +{ + free(ptr); +} diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d414b2847..cfd1a6060 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -120,7 +120,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi { if ( totalretries < 10 ) { - printf("time error with electrum, retry\n"); + printf("time error with electrum, retry.%d\n",totalretries); totalretries++; i--; } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index f906390b8..e199b6bfd 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -19,10 +19,7 @@ // Copyright © 2017 SuperNET. All rights reserved. // -/* -#define malloc(n) LP_alloc(n) -#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) -#define free(ptr) LP_free(ptr)*/ + void PNACL_message(char *arg,...) { @@ -42,6 +39,12 @@ void PNACL_message(char *arg,...) #include "../../crypto777/OS_portable.h" #endif // !_WIN_32 +#define malloc(n) LP_alloc(n) +#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) +#define free(ptr) LP_free(ptr) + +void *LP_alloc(uint64_t len); +void LP_free(void *ptr); #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); From c02faaadfd525da058d0e75d0fb19e7a2792272a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:19:28 +0200 Subject: [PATCH 2598/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 40 +++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b195a292d..1bb412af5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1191,13 +1191,49 @@ void LP_fromjs_iter() #undef calloc #undef free +struct LP_memory_list +{ + struct LP_memory_list *next,*prev; + void *ptr; + uint32_t timestamp,len; +} *LP_memory_list; + void *LP_alloc(uint64_t len) { - return(calloc(1,len)); + struct LP_memory_list *mp; + mp = calloc(1,sizeof(*mp) + len); + mp->timestamp = (uint32_t)time(NULL); + mp->ptr = calloc(1,len); + mp->len = (uint32_t)len; + portable_mutex_lock(&LP_cJSONmutex); + DL_APPEND(LP_memory_list,mp); + portable_mutex_unlock(&LP_cJSONmutex); + return(&mp[1]); } void LP_free(void *ptr) { - free(ptr); + static uint32_t lasttime; + uint32_t now; int32_t n; uint64_t total = 0; char str[65]; struct LP_memory_list *mp,*tmp,*freemp = ptr; + --freemp; + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) + { + n = 0; + DL_FOREACH_SAFE(LP_memory_list,mp,tmp) + { + total += mp->len; + n++; + } + printf("total %d allocated total size %s\n",n,mbstr(str,total)); + lasttime = (uint32_t)time(NULL); + } + if ( freemp != 0 ) + { + portable_mutex_lock(&LP_cJSONmutex); + DL_DELETE(LP_memory_list,freemp); + free(freemp); + portable_mutex_unlock(&LP_cJSONmutex); + } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); } + From 146b98afffaa6929f2f1c59c25af3ee73f384da9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:24:03 +0200 Subject: [PATCH 2599/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1bb412af5..ef97d7d4d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1194,7 +1194,6 @@ void LP_fromjs_iter() struct LP_memory_list { struct LP_memory_list *next,*prev; - void *ptr; uint32_t timestamp,len; } *LP_memory_list; @@ -1202,8 +1201,8 @@ void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); + printf("mp.%p ptr.%p\n",mp,&mp[1]); mp->timestamp = (uint32_t)time(NULL); - mp->ptr = calloc(1,len); mp->len = (uint32_t)len; portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_memory_list,mp); @@ -1216,6 +1215,7 @@ void LP_free(void *ptr) static uint32_t lasttime; uint32_t now; int32_t n; uint64_t total = 0; char str[65]; struct LP_memory_list *mp,*tmp,*freemp = ptr; --freemp; + printf("freemp.%p\n",freemp); if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; From 2fe9584e526296c37a59308dd41d1180aa02b5e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:35:45 +0200 Subject: [PATCH 2600/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 +++++----- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ef97d7d4d..0828a393a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1201,7 +1201,7 @@ void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); - printf("mp.%p ptr.%p\n",mp,&mp[1]); + printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; portable_mutex_lock(&LP_cJSONmutex); @@ -1213,9 +1213,9 @@ void *LP_alloc(uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime; - uint32_t now; int32_t n; uint64_t total = 0; char str[65]; struct LP_memory_list *mp,*tmp,*freemp = ptr; + uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp,*freemp = ptr; --freemp; - printf("freemp.%p\n",freemp); + printf("\n>>>>>>>>>>> LP_free freemp.%p\n",freemp); if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; @@ -1224,15 +1224,15 @@ void LP_free(void *ptr) total += mp->len; n++; } - printf("total %d allocated total size %s\n",n,mbstr(str,total)); + printf("total %d allocated total %llu\n",n,(long long)total); lasttime = (uint32_t)time(NULL); } if ( freemp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,freemp); - free(freemp); portable_mutex_unlock(&LP_cJSONmutex); + free(freemp); } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index da6f97cc1..fcd05feb3 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -27,7 +27,7 @@ struct LP_inuse_info } LP_inuse[1024]; int32_t LP_numinuse; -struct cJSON_list +/*struct cJSON_list { struct cJSON_list *next,*prev; cJSON *item; @@ -92,7 +92,7 @@ void cJSON_unregister(cJSON *item) free(ptr); portable_mutex_unlock(&LP_cJSONmutex); } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); -} +}*/ struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) { From 21594133c08e482a2861e0d4ff66c0eb97b9a2cb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:46:12 +0200 Subject: [PATCH 2601/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 +++++++ iguana/exchanges/mm.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0828a393a..4834fd8e8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1190,6 +1190,7 @@ void LP_fromjs_iter() #undef calloc #undef free +#undef clonestr struct LP_memory_list { @@ -1236,4 +1237,10 @@ void LP_free(void *ptr) } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); } +char *LP_clonestr(char *str) +{ + char *retstr = LP_alloc(strlen(str)+1); + strcpy(retstr,str); + return(retstr); +} diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index e199b6bfd..f10241da7 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -42,9 +42,11 @@ void PNACL_message(char *arg,...) #define malloc(n) LP_alloc(n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) +#define clonestr(str) LP_clonestr(str) void *LP_alloc(uint64_t len); void LP_free(void *ptr); +char *LP_clonestr(char *str); #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); From abec32f1b69c8655ad3d2f3415b130fc042d0d83 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:48:56 +0200 Subject: [PATCH 2602/2732] Test --- crypto777/bitcoind_RPC.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 98c7e7eb0..0a9157b84 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -13,6 +13,12 @@ * * ******************************************************************************/ + +#define malloc(n) LP_alloc(n) +#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) +#define free(ptr) LP_free(ptr) +#define clonestr(str) LP_clonestr(str) + #ifndef FROM_JS #include "OS_portable.h" #define LIQUIDITY_PROVIDER 1 From edefcaffe16e55c94da50f49aedf36910bc66469 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:49:39 +0200 Subject: [PATCH 2603/2732] Test --- crypto777/bitcoind_RPC.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 0a9157b84..22c6ebceb 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -14,15 +14,16 @@ ******************************************************************************/ -#define malloc(n) LP_alloc(n) -#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) -#define free(ptr) LP_free(ptr) -#define clonestr(str) LP_clonestr(str) #ifndef FROM_JS #include "OS_portable.h" #define LIQUIDITY_PROVIDER 1 +#define malloc(n) LP_alloc(n) +#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) +#define free(ptr) LP_free(ptr) +#define clonestr(str) LP_clonestr(str) + #if LIQUIDITY_PROVIDER #include #include From eaaaea9d67537414a1767d481bdbff7bc0dacb2f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:50:49 +0200 Subject: [PATCH 2604/2732] Test --- crypto777/bitcoind_RPC.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 22c6ebceb..05144b82a 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -23,6 +23,9 @@ #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) #define clonestr(str) LP_clonestr(str) +void *LP_alloc(uint64_t len); +void LP_free(void *ptr); +char *LP_clonestr(char *str); #if LIQUIDITY_PROVIDER #include From da58c22fda6440b59f856ee4bce2ea765f397832 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 22:58:23 +0200 Subject: [PATCH 2605/2732] Test --- crypto777/bitcoind_RPC.c | 4 ++++ iguana/exchanges/LP_nativeDEX.c | 11 +++++++++++ iguana/exchanges/mm.c | 2 ++ 3 files changed, 17 insertions(+) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 05144b82a..a3488aeae 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -20,13 +20,17 @@ #define LIQUIDITY_PROVIDER 1 #define malloc(n) LP_alloc(n) +#define realloc(ptr,n) LP_realloc(ptr,n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) #define clonestr(str) LP_clonestr(str) + +void *LP_realloc(void *ptr,uint64_t len); void *LP_alloc(uint64_t len); void LP_free(void *ptr); char *LP_clonestr(char *str); + #if LIQUIDITY_PROVIDER #include #include diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4834fd8e8..cf18369f2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1190,6 +1190,7 @@ void LP_fromjs_iter() #undef calloc #undef free +#undef realloc #undef clonestr struct LP_memory_list @@ -1211,6 +1212,16 @@ void *LP_alloc(uint64_t len) return(&mp[1]); } +void *LP_realloc(void *ptr,uint64_t len) +{ + struct LP_memory_list *mp = ptr; + --mp; + mp = realloc(mp,len + sizeof(*mp)); + mp->timestamp = (uint32_t)time(NULL); + mp->len = (uint32_t)len; + return(&mp[1]); +} + void LP_free(void *ptr) { static uint32_t lasttime; diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index f10241da7..d8ce0ed0d 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -40,10 +40,12 @@ void PNACL_message(char *arg,...) #endif // !_WIN_32 #define malloc(n) LP_alloc(n) +#define realloc(ptr,n) LP_realloc(ptr,n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) #define clonestr(str) LP_clonestr(str) +void *LP_realloc(void *ptr,uint64_t len); void *LP_alloc(uint64_t len); void LP_free(void *ptr); char *LP_clonestr(char *str); From b6366f824ce0e9d0c7c66806170bcf6a10842a4b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:00:48 +0200 Subject: [PATCH 2606/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cf18369f2..91eadb613 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1215,11 +1215,15 @@ void *LP_alloc(uint64_t len) void *LP_realloc(void *ptr,uint64_t len) { struct LP_memory_list *mp = ptr; - --mp; - mp = realloc(mp,len + sizeof(*mp)); - mp->timestamp = (uint32_t)time(NULL); - mp->len = (uint32_t)len; - return(&mp[1]); + if ( mp != 0 ) + { + --mp; + printf("\n>>>>>>>>>>> LP_realloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len); + mp = realloc(mp,len + sizeof(*mp)); + mp->timestamp = (uint32_t)time(NULL); + mp->len = (uint32_t)len; + return(&mp[1]); + } else return(LP_alloc(len)); } void LP_free(void *ptr) From 1b5bd6e2ea96136ac374203253cf38abd1081653 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:04:30 +0200 Subject: [PATCH 2607/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 91eadb613..b7489c3f3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1243,13 +1243,19 @@ void LP_free(void *ptr) printf("total %d allocated total %llu\n",n,(long long)total); lasttime = (uint32_t)time(NULL); } - if ( freemp != 0 ) + DL_FOREACH_SAFE(LP_memory_list,mp,tmp) + { + if ( mp == freemp ) + break; + mp = 0; + } + if ( mp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); - DL_DELETE(LP_memory_list,freemp); + DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - free(freemp); - } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); + free(mp); + } // free from source file with #define redirect for alloc that wasnt } char *LP_clonestr(char *str) From c75d6641712214a0ebc0f17754cc2420d8bc2508 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:08:31 +0200 Subject: [PATCH 2608/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b7489c3f3..05d9a36fd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1197,41 +1197,33 @@ struct LP_memory_list { struct LP_memory_list *next,*prev; uint32_t timestamp,len; + void *ptr; } *LP_memory_list; void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; - mp = calloc(1,sizeof(*mp) + len); + mp = calloc(1,sizeof(*mp)); printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; + mp->ptr = calloc(1,len); portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - return(&mp[1]); + return(mp->ptr); } void *LP_realloc(void *ptr,uint64_t len) { - struct LP_memory_list *mp = ptr; - if ( mp != 0 ) - { - --mp; - printf("\n>>>>>>>>>>> LP_realloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len); - mp = realloc(mp,len + sizeof(*mp)); - mp->timestamp = (uint32_t)time(NULL); - mp->len = (uint32_t)len; - return(&mp[1]); - } else return(LP_alloc(len)); + return(realloc(ptr,len)); } void LP_free(void *ptr) { static uint32_t lasttime; - uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp,*freemp = ptr; - --freemp; - printf("\n>>>>>>>>>>> LP_free freemp.%p\n",freemp); + uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; + printf("\n>>>>>>>>>>> LP_free ptr.%p\n",ptr); if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; @@ -1245,7 +1237,7 @@ void LP_free(void *ptr) } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { - if ( mp == freemp ) + if ( mp->ptr == ptr ) break; mp = 0; } @@ -1254,6 +1246,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); + free(mp->ptr); free(mp); } // free from source file with #define redirect for alloc that wasnt } From 3e0217af2bfe48433a01d1d55562fffe3eca2cd8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:11:15 +0200 Subject: [PATCH 2609/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 05d9a36fd..ae0491bd2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1204,7 +1204,7 @@ void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp)); - printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len); + //printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; mp->ptr = calloc(1,len); @@ -1223,7 +1223,6 @@ void LP_free(void *ptr) { static uint32_t lasttime; uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - printf("\n>>>>>>>>>>> LP_free ptr.%p\n",ptr); if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; @@ -1246,6 +1245,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); + printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); free(mp->ptr); free(mp); } // free from source file with #define redirect for alloc that wasnt From 2f9c6d37f033bbfa47e2caaae1ad56114157d7d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:14:20 +0200 Subject: [PATCH 2610/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ae0491bd2..15f431a6f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1228,6 +1228,7 @@ void LP_free(void *ptr) n = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { + printf("%d ",mp->len); total += mp->len; n++; } @@ -1245,7 +1246,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); + //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); free(mp->ptr); free(mp); } // free from source file with #define redirect for alloc that wasnt From 52f6758c4da6cbada73cf6fce0ed2a07fe8dcca3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:25:50 +0200 Subject: [PATCH 2611/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index a3488aeae..d799d5997 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -277,7 +277,7 @@ try_again: void init_string(struct return_string *s) { - s->len = 0; + s->len = 511; s->ptr = (char *)calloc(1,s->len+1); if ( s->ptr == NULL ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 15f431a6f..3e44cfeb4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1221,7 +1221,7 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { - static uint32_t lasttime; + static uint32_t lasttime,unknown; uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { @@ -1232,7 +1232,7 @@ void LP_free(void *ptr) total += mp->len; n++; } - printf("total %d allocated total %llu\n",n,(long long)total); + printf("total %d allocated total %llu unknown.%u\n",n,(long long)total,unknown); lasttime = (uint32_t)time(NULL); } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) @@ -1249,7 +1249,7 @@ void LP_free(void *ptr) //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); free(mp->ptr); free(mp); - } // free from source file with #define redirect for alloc that wasnt + } else unknown++; // free from source file with #define redirect for alloc that wasnt } char *LP_clonestr(char *str) From f855d1de39ff283cf0adcf82355d18753e44b07d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:32:12 +0200 Subject: [PATCH 2612/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3e44cfeb4..306328470 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1200,10 +1200,14 @@ struct LP_memory_list void *ptr; } *LP_memory_list; +int32_t zeroval() { return(0); } + void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp)); + if ( len == 72 ) + printf("%d\n",1/zeroval()); //printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; From 02c8de08cdc491f04143ba1353947b993fefe766 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:33:44 +0200 Subject: [PATCH 2613/2732] Test --- crypto777/iguana_utils.c | 2 -- iguana/exchanges/LP_nativeDEX.c | 1 - 2 files changed, 3 deletions(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index e75257149..2e8f8e18b 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -446,8 +446,6 @@ char *clonestr(char *str) return(clone); } -int32_t zeroval() { return(0); } - int32_t safecopy(char *dest,char *src,long len) { int32_t i = -1; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 306328470..b79e3f74c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1199,7 +1199,6 @@ struct LP_memory_list uint32_t timestamp,len; void *ptr; } *LP_memory_list; - int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) From 4180e3df314da920fc270385d1e3a2312304ee79 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:36:20 +0200 Subject: [PATCH 2614/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index d799d5997..f54394d90 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -277,7 +277,7 @@ try_again: void init_string(struct return_string *s) { - s->len = 511; + s->len = 8191; s->ptr = (char *)calloc(1,s->len+1); if ( s->ptr == NULL ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b79e3f74c..141cfca81 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1205,8 +1205,8 @@ void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp)); - if ( len == 72 ) - printf("%d\n",1/zeroval()); + //if ( len == 72 ) + // printf("%d\n",1/zeroval()); //printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; @@ -1231,7 +1231,8 @@ void LP_free(void *ptr) n = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { - printf("%d ",mp->len); + if ( mp->len != 72 ) + printf("%d ",mp->len); total += mp->len; n++; } From f8d51fe7398f70aa1845882f60a9268f2281c51a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:38:32 +0200 Subject: [PATCH 2615/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 141cfca81..9980c7d3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1226,7 +1226,7 @@ void LP_free(void *ptr) { static uint32_t lasttime,unknown; uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+600 ) { n = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) From 1626b9f7ac4d7131c5ef4cdfd8c9c7e3cc7e0549 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:40:21 +0200 Subject: [PATCH 2616/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index f54394d90..a3488aeae 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -277,7 +277,7 @@ try_again: void init_string(struct return_string *s) { - s->len = 8191; + s->len = 0; s->ptr = (char *)calloc(1,s->len+1); if ( s->ptr == NULL ) { From 75ae3df6778c3b7063bdc184eebd0be3f62ffa8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:56:15 +0200 Subject: [PATCH 2617/2732] Test --- crypto777/bitcoind_RPC.c | 6 ++++-- crypto777/cJSON.c | 6 ++++-- iguana/exchanges/LP_nativeDEX.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index a3488aeae..1116526fc 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -47,6 +47,7 @@ struct return_string { size_t accumulate(void *ptr, size_t size, size_t nmemb, struct return_string *s); void init_string(struct return_string *s); +static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data); /************************************************************************ @@ -161,13 +162,14 @@ try_again: *retstrp = 0; starttime = OS_milliseconds(); curl_handle = curl_easy_init(); - init_string(&s); + //init_string(&s); headers = curl_slist_append(0,"Expect:"); curl_easy_setopt(curl_handle,CURLOPT_USERAGENT,"mozilla/4.0");//"Mozilla/4.0 (compatible; )"); curl_easy_setopt(curl_handle,CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl_handle,CURLOPT_URL, url); - curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + //curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)WriteMemoryCallback); curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA, &s); // we pass our 's' struct to the callback 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 diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 93438fe79..4c0777656 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -54,8 +54,10 @@ static int32_t cJSON_strcasecmp(const char *s1,const char *s2) return tolower((int32_t)(*(const unsigned char *)s1)) - tolower((int32_t)(*(const unsigned char *)s2)); } -static void *(*cJSON_malloc)(size_t sz) = malloc; -static void (*cJSON_free)(void *ptr) = free; +void *LP_alloc(uint64_t len); +void LP_free(void *ptr); +static void *(*cJSON_malloc)(size_t sz) = (void *)LP_alloc; +static void (*cJSON_free)(void *ptr) = LP_free; static char* cJSON_strdup(const char* str) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9980c7d3e..141cfca81 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1226,7 +1226,7 @@ void LP_free(void *ptr) { static uint32_t lasttime,unknown; uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+600 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) From b4e579eb1caa6b592c31646dc268170f35db9c87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:03:20 +0200 Subject: [PATCH 2618/2732] Test --- crypto777/bitcoind_RPC.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 1116526fc..435e88c22 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -45,6 +45,8 @@ struct return_string { size_t len; }; +struct MemoryStruct { char *memory; size_t size; }; + size_t accumulate(void *ptr, size_t size, size_t nmemb, struct return_string *s); void init_string(struct return_string *s); static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data); @@ -137,8 +139,9 @@ char *Jay_NXTrequest(char *command,char *params) char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) { static int didinit,count,count2; static double elapsedsum,elapsedsum2; extern int32_t USE_JAY; + struct MemoryStruct chunk; struct curl_slist *headers = NULL; struct return_string s; CURLcode res; CURL *curl_handle; - char *bracket0,*bracket1,*databuf = 0; long len; int32_t specialcase,numretries; double starttime; + char *bracket0,*bracket1,*retstr,*databuf = 0; long len; int32_t specialcase,numretries; double starttime; if ( didinit == 0 ) { didinit = 1; @@ -162,13 +165,23 @@ try_again: *retstrp = 0; starttime = OS_milliseconds(); curl_handle = curl_easy_init(); - //init_string(&s); headers = curl_slist_append(0,"Expect:"); curl_easy_setopt(curl_handle,CURLOPT_USERAGENT,"mozilla/4.0");//"Mozilla/4.0 (compatible; )"); curl_easy_setopt(curl_handle,CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl_handle,CURLOPT_URL, url); - //curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + if ( (0) ) + { + init_string(&s); + curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + } + else + { + memset(&chunk,0,sizeof(chunk)); + curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION,WriteMemoryCallback); + curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA,(void *)&chunk); + + } curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)WriteMemoryCallback); curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA, &s); // we pass our 's' struct to the callback curl_easy_setopt(curl_handle,CURLOPT_NOSIGNAL, 1L); // supposed to fix "Alarm clock" and long jump crash @@ -225,23 +238,24 @@ try_again: if ( specialcase != 0 || timeout != 0 ) { //printf("<<<<<<<<<<< bitcoind_RPC.(%s): BTCD.%s timeout params.(%s) s.ptr.(%s) err.%d\n",url,command,params,s.ptr,res); - free(s.ptr); + free(chunk.memory); //free(s.ptr); return(0); } else if ( numretries >= 4 ) { printf( "curl_easy_perform() failed: %s %s.(%s %s), retries: %d\n",curl_easy_strerror(res),debugstr,url,command,numretries); //printf("Maximum number of retries exceeded!\n"); - free(s.ptr); + free(chunk.memory);//free(s.ptr); return(0); } - free(s.ptr); + free(chunk.memory);//free(s.ptr); sleep((1< (%s)\n",params,s.ptr); + fprintf(stderr,"<<<<<<<<<<< bitcoind_RPC: BTCD.(%s) -> (%s)\n",params,retstr); count2++; elapsedsum2 += (OS_milliseconds() - starttime); if ( (count2 % 10000) == 0) printf("%d: ave %9.6f | elapsed %.3f millis | NXT calls.(%s) cmd.(%s)\n",count2,elapsedsum2/count2,(double)(OS_milliseconds() - starttime),url,command); - return(s.ptr); + return(retstr); } } //printf("bitcoind_RPC: impossible case\n"); @@ -310,8 +324,6 @@ size_t accumulate(void *ptr,size_t size,size_t nmemb,struct return_string *s) return(size * nmemb); } -struct MemoryStruct { char *memory; size_t size; }; - static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data) { size_t realsize = (size * nmemb); From 626c5c905110a3b36eca7c407bfc0628b2be9d02 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:06:18 +0200 Subject: [PATCH 2619/2732] Test --- crypto777/bitcoind_RPC.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 435e88c22..865d45387 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -174,6 +174,7 @@ try_again: { init_string(&s); curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA, &s); // we pass our 's' struct to the callback } else { @@ -182,8 +183,6 @@ try_again: curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA,(void *)&chunk); } - curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)WriteMemoryCallback); - curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA, &s); // we pass our 's' struct to the callback 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 if ( timeout > 0 ) From f222f8f4eb513e91b6e5880fd60e4de44b325361 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:10:13 +0200 Subject: [PATCH 2620/2732] Test --- crypto777/bitcoind_RPC.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 865d45387..89e4dd28c 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -19,7 +19,7 @@ #include "OS_portable.h" #define LIQUIDITY_PROVIDER 1 -#define malloc(n) LP_alloc(n) +/*#define malloc(n) LP_alloc(n) #define realloc(ptr,n) LP_realloc(ptr,n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) @@ -28,7 +28,7 @@ void *LP_realloc(void *ptr,uint64_t len); void *LP_alloc(uint64_t len); void LP_free(void *ptr); -char *LP_clonestr(char *str); +char *LP_clonestr(char *str);*/ #if LIQUIDITY_PROVIDER From 92360e9a6319e8faca1811b36be4bf4dfc52a6ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:19:30 +0200 Subject: [PATCH 2621/2732] Test --- crypto777/bitcoind_RPC.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 89e4dd28c..2a85a48d4 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -19,7 +19,7 @@ #include "OS_portable.h" #define LIQUIDITY_PROVIDER 1 -/*#define malloc(n) LP_alloc(n) +#define malloc(n) LP_alloc(n) #define realloc(ptr,n) LP_realloc(ptr,n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) @@ -28,7 +28,7 @@ void *LP_realloc(void *ptr,uint64_t len); void *LP_alloc(uint64_t len); void LP_free(void *ptr); -char *LP_clonestr(char *str);*/ +char *LP_clonestr(char *str); #if LIQUIDITY_PROVIDER @@ -45,7 +45,7 @@ struct return_string { size_t len; }; -struct MemoryStruct { char *memory; size_t size; }; +struct MemoryStruct { char *memory; size_t size,allocsize; }; size_t accumulate(void *ptr, size_t size, size_t nmemb, struct return_string *s); void init_string(struct return_string *s); @@ -325,9 +325,20 @@ size_t accumulate(void *ptr,size_t size,size_t nmemb,struct return_string *s) static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data) { - size_t realsize = (size * nmemb); + size_t needed,realsize = (size * nmemb); struct MemoryStruct *mem = (struct MemoryStruct *)data; - mem->memory = (ptr != 0) ? realloc(mem->memory,mem->size + realsize + 1) : malloc(mem->size + realsize + 1); + needed = mem->size + realsize + 1; + if ( ptr == 0 && needed < 512 ) + { + mem->allocsize = 511; + mem->memory = malloc(mem->allocsize); + } + if ( mem->allocsize < needed ) + { + mem->memory = realloc(mem->memory,needed); + mem->allocsize = needed; + } + //mem->memory = (ptr != 0) ? realloc(mem->memory,mem->size + realsize + 1) : malloc(mem->size + realsize + 1); if ( mem->memory != 0 ) { if ( ptr != 0 ) From f9ed653c8abf9fb428fe8813b70639ff8821b243 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:21:26 +0200 Subject: [PATCH 2622/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 2a85a48d4..4d9c21c13 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -335,7 +335,7 @@ static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data) } if ( mem->allocsize < needed ) { - mem->memory = realloc(mem->memory,needed); + mem->memory = (ptr != 0) ? realloc(mem->memory,needed) : malloc(needed); mem->allocsize = needed; } //mem->memory = (ptr != 0) ? realloc(mem->memory,mem->size + realsize + 1) : malloc(mem->size + realsize + 1); From f38279383e4c4cc4cfe1cf20717575de82d2b4c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:25:43 +0200 Subject: [PATCH 2623/2732] Test --- crypto777/bitcoind_RPC.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 4d9c21c13..d2e5f7b7f 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -330,11 +330,12 @@ static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data) needed = mem->size + realsize + 1; if ( ptr == 0 && needed < 512 ) { - mem->allocsize = 511; + mem->allocsize = 512; mem->memory = malloc(mem->allocsize); } if ( mem->allocsize < needed ) { + printf("curl needs %d more\n",(int32_t)realsize); mem->memory = (ptr != 0) ? realloc(mem->memory,needed) : malloc(needed); mem->allocsize = needed; } From ada5679cd48ee9f33e0d0ab5f71064841fded96b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:28:08 +0200 Subject: [PATCH 2624/2732] Test --- crypto777/bitcoind_RPC.c | 8 ++++---- iguana/exchanges/mm.c | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index d2e5f7b7f..2708f8b96 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -19,7 +19,7 @@ #include "OS_portable.h" #define LIQUIDITY_PROVIDER 1 -#define malloc(n) LP_alloc(n) +/*#define malloc(n) LP_alloc(n) #define realloc(ptr,n) LP_realloc(ptr,n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) @@ -28,7 +28,7 @@ void *LP_realloc(void *ptr,uint64_t len); void *LP_alloc(uint64_t len); void LP_free(void *ptr); -char *LP_clonestr(char *str); +char *LP_clonestr(char *str);*/ #if LIQUIDITY_PROVIDER @@ -328,9 +328,9 @@ static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data) size_t needed,realsize = (size * nmemb); struct MemoryStruct *mem = (struct MemoryStruct *)data; needed = mem->size + realsize + 1; - if ( ptr == 0 && needed < 512 ) + if ( ptr == 0 && needed < 1024 ) { - mem->allocsize = 512; + mem->allocsize = 1024; mem->memory = malloc(mem->allocsize); } if ( mem->allocsize < needed ) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index d8ce0ed0d..2fb69cf65 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -27,10 +27,6 @@ void PNACL_message(char *arg,...) } #define FROM_MARKETMAKER -#ifndef CJSON_GARBAGECOLLECTION -#define CJSON_GARBAGECOLLECTION -#endif - #include #include #ifndef NATIVE_WINDOWS @@ -39,7 +35,7 @@ void PNACL_message(char *arg,...) #include "../../crypto777/OS_portable.h" #endif // !_WIN_32 -#define malloc(n) LP_alloc(n) +/*#define malloc(n) LP_alloc(n) #define realloc(ptr,n) LP_realloc(ptr,n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) @@ -48,7 +44,7 @@ void PNACL_message(char *arg,...) void *LP_realloc(void *ptr,uint64_t len); void *LP_alloc(uint64_t len); void LP_free(void *ptr); -char *LP_clonestr(char *str); +char *LP_clonestr(char *str);*/ #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); From ed4935142505a850e7945323886620d90536461b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:29:52 +0200 Subject: [PATCH 2625/2732] Test --- crypto777/bitcoind_RPC.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 2708f8b96..15934cc11 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -328,14 +328,14 @@ static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data) size_t needed,realsize = (size * nmemb); struct MemoryStruct *mem = (struct MemoryStruct *)data; needed = mem->size + realsize + 1; - if ( ptr == 0 && needed < 1024 ) + if ( ptr == 0 && needed < 256 ) { - mem->allocsize = 1024; + mem->allocsize = 256; mem->memory = malloc(mem->allocsize); } if ( mem->allocsize < needed ) { - printf("curl needs %d more\n",(int32_t)realsize); + //printf("curl needs %d more\n",(int32_t)realsize); mem->memory = (ptr != 0) ? realloc(mem->memory,needed) : malloc(needed); mem->allocsize = needed; } From 2ad3f0b9d705a8eec2e3919dc023bcc44422524a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:31:42 +0200 Subject: [PATCH 2626/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 141cfca81..7f7c4a4b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1225,18 +1225,18 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; + uint32_t now; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { - n = 0; + n = lagging = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { - if ( mp->len != 72 ) - printf("%d ",mp->len); + if ( now > mp->timestamp+60 ) + lagging++; total += mp->len; n++; } - printf("total %d allocated total %llu unknown.%u\n",n,(long long)total,unknown); + printf("total %d allocated total %llu unknown.%u lagging.%d\n",n,(long long)total,unknown,lagging); lasttime = (uint32_t)time(NULL); } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) From bac171ae6058b60d63b3b0448803c570ebd61094 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:37:35 +0200 Subject: [PATCH 2627/2732] Test --- crypto777/OS_portable.h | 1 + iguana/exchanges/LP_nativeDEX.c | 15 +++++++++++---- iguana/exchanges/LP_utxo.c | 1 - 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 605eb544e..3d90521bd 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -276,6 +276,7 @@ void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_ void *queue_free(queue_t *queue); void *queue_clone(queue_t *clone,queue_t *queue,int32_t size); int32_t queue_size(queue_t *queue); +char *mbstr(char *str,double n); void iguana_memreset(struct OS_memspace *mem); void iguana_mempurge(struct OS_memspace *mem); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7f7c4a4b5..e45b1a08d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1225,18 +1225,25 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - uint32_t now; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; + uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; + portable_mutex_lock(&LP_cJSONmutex); DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { - if ( now > mp->timestamp+60 ) - lagging++; total += mp->len; n++; + if ( now > mp->timestamp+60 ) + { + lagging++; + DL_DELETE(LP_memory_list,mp); + free(mp->ptr); + free(mp); + } } - printf("total %d allocated total %llu unknown.%u lagging.%d\n",n,(long long)total,unknown,lagging); + portable_mutex_unlock(&LP_cJSONmutex); + printf("total %d allocated total %llu %s unknown.%u lagging.%d\n",n,(long long)total,mbstr(str,total),unknown,lagging); lasttime = (uint32_t)time(NULL); } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fcd05feb3..73a8e0260 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -47,7 +47,6 @@ void cJSON_register(cJSON *item) portable_mutex_unlock(&LP_cJSONmutex); } -char *mbstr(char *str,double n); void cJSON_unregister(cJSON *item) { static uint32_t lasttime; From 6fd921733c9a0adc29bf907c3feda6ab6466e353 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:49:48 +0200 Subject: [PATCH 2628/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e45b1a08d..e38ac69fe 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1234,7 +1234,7 @@ void LP_free(void *ptr) { total += mp->len; n++; - if ( now > mp->timestamp+60 ) + if ( now > mp->timestamp+600 ) { lagging++; DL_DELETE(LP_memory_list,mp); From 88b4d2ba7939e8afd7bd5a6e32548c613c2f7ae0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 00:58:06 +0200 Subject: [PATCH 2629/2732] Test --- crypto777/cJSON.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 4c0777656..d6c43f2fa 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -829,7 +829,7 @@ char *jstr(cJSON *json,char *field) { if ( json == 0 ) return(0); if ( field == char *jstri(cJSON *json,int32_t i) { return(cJSON_str(cJSON_GetArrayItem(json,i))); } char *jprint(cJSON *json,int32_t freeflag) { - char *str; + char *str,*retstr; /*static portable_mutex_t mutex; static int32_t initflag; if ( initflag == 0 ) { @@ -843,8 +843,11 @@ char *jprint(cJSON *json,int32_t freeflag) str = cJSON_Print(json), _stripwhite(str,' '); if ( freeflag != 0 ) free_json(json); + retstr = malloc(strlen(str) + 1); + strcpy(retstr,str); + cJSON_free(str); //portable_mutex_unlock(&mutex); - return(str); + return(retstr); } bits256 get_API_bits256(cJSON *obj) From a9874c2456f5c8d22eb903517ae3669e13a03427 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:08:08 +0200 Subject: [PATCH 2630/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e38ac69fe..27f4b57bd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1204,13 +1204,13 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { struct LP_memory_list *mp; - mp = calloc(1,sizeof(*mp)); + mp = calloc(1,sizeof(*mp) + len); //if ( len == 72 ) // printf("%d\n",1/zeroval()); //printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; - mp->ptr = calloc(1,len); + mp->ptr = &mp[1]; portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); @@ -1225,7 +1225,8 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; + uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp,*freemp = ptr; + --freemp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; @@ -1234,11 +1235,11 @@ void LP_free(void *ptr) { total += mp->len; n++; - if ( now > mp->timestamp+600 ) + if ( now > mp->timestamp+60 ) { lagging++; DL_DELETE(LP_memory_list,mp); - free(mp->ptr); + //free(mp->ptr); free(mp); } } @@ -1258,7 +1259,7 @@ void LP_free(void *ptr) DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); - free(mp->ptr); + //free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt } From e092b8a80f2c6c4be71f6332097421d6076bdd1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:09:06 +0200 Subject: [PATCH 2631/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 27f4b57bd..1f71f2c01 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1253,6 +1253,8 @@ void LP_free(void *ptr) break; mp = 0; } + if ( mp != freemp ) + printf("mp %p != %p\n",mp,freemp); if ( mp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); From 53b669a481ddca9ed644a23306ca9e79b81366af Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:11:21 +0200 Subject: [PATCH 2632/2732] Test --- crypto777/bitcoind_RPC.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/stats.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 15934cc11..f624cd342 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -95,7 +95,7 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * { if ( (error->type&0xff) == cJSON_NULL && (result->type&0xff) != cJSON_NULL ) { - retstr = cJSON_Print(result); + retstr = jprint(result,0); len = strlen(retstr); if ( retstr[0] == '"' && retstr[len-1] == '"' ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1f71f2c01..542eb5909 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1254,7 +1254,7 @@ void LP_free(void *ptr) mp = 0; } if ( mp != freemp ) - printf("mp %p != %p\n",mp,freemp); + printf("mp %p != %p\n",mp,freemp);` if ( mp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index d283b1301..179612c4e 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -529,7 +529,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po free(retstr); } #endif - //printf("(%s) {%s} -> (%s) postflag.%d (%s)\n",urlstr,jprint(argjson,0),cJSON_Print(json),*postflagp,retstr); + //printf("(%s) {%s} -> (%s) postflag.%d (%s)\n",urlstr,jprint(argjson,0),jprint(json,0),*postflagp,retstr); } free_json(origargjson); retstr = jprint(retarray,1); From 2ddc69d8fb6353a6016196ef2243f8ec30adaef0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:12:39 +0200 Subject: [PATCH 2633/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 542eb5909..a543f8c27 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1188,10 +1188,10 @@ void LP_fromjs_iter() #endif -#undef calloc +/*#undef calloc #undef free #undef realloc -#undef clonestr +#undef clonestr*/ struct LP_memory_list { @@ -1254,7 +1254,7 @@ void LP_free(void *ptr) mp = 0; } if ( mp != freemp ) - printf("mp %p != %p\n",mp,freemp);` + printf("mp %p != %p\n",mp,freemp); if ( mp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); From fa5a2a0b6fc6f16168113941881f602bfc82ee53 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:17:03 +0200 Subject: [PATCH 2634/2732] Test --- crypto777/cJSON.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index d6c43f2fa..3c8c376db 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -843,7 +843,7 @@ char *jprint(cJSON *json,int32_t freeflag) str = cJSON_Print(json), _stripwhite(str,' '); if ( freeflag != 0 ) free_json(json); - retstr = malloc(strlen(str) + 1); + retstr = LP_alloc(strlen(str) + 1); strcpy(retstr,str); cJSON_free(str); //portable_mutex_unlock(&mutex); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a543f8c27..1f71f2c01 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1188,10 +1188,10 @@ void LP_fromjs_iter() #endif -/*#undef calloc +#undef calloc #undef free #undef realloc -#undef clonestr*/ +#undef clonestr struct LP_memory_list { From f0845127e978cf4485154f39b399f4008fe2d210 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:19:17 +0200 Subject: [PATCH 2635/2732] Test --- crypto777/cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 3c8c376db..a1007d34a 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -845,7 +845,7 @@ char *jprint(cJSON *json,int32_t freeflag) free_json(json); retstr = LP_alloc(strlen(str) + 1); strcpy(retstr,str); - cJSON_free(str); + //cJSON_free(str); //portable_mutex_unlock(&mutex); return(retstr); } From 17e0abbe28731ba6b3300db360e5d1105839e7c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:21:18 +0200 Subject: [PATCH 2636/2732] Test --- crypto777/cJSON.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index a1007d34a..c79287421 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -829,7 +829,7 @@ char *jstr(cJSON *json,char *field) { if ( json == 0 ) return(0); if ( field == char *jstri(cJSON *json,int32_t i) { return(cJSON_str(cJSON_GetArrayItem(json,i))); } char *jprint(cJSON *json,int32_t freeflag) { - char *str,*retstr; + char *str; /*static portable_mutex_t mutex; static int32_t initflag; if ( initflag == 0 ) { @@ -843,11 +843,11 @@ char *jprint(cJSON *json,int32_t freeflag) str = cJSON_Print(json), _stripwhite(str,' '); if ( freeflag != 0 ) free_json(json); - retstr = LP_alloc(strlen(str) + 1); - strcpy(retstr,str); - //cJSON_free(str); + //retstr = LP_alloc(strlen(str) + 1); + //strcpy(retstr,str); + //cJSON_free(str); garbage collected //portable_mutex_unlock(&mutex); - return(retstr); + return(str); } bits256 get_API_bits256(cJSON *obj) From 3e87ced94cca68c241ad25b088f6756e2274b31d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:23:17 +0200 Subject: [PATCH 2637/2732] Test --- crypto777/cJSON.c | 10 +++++----- iguana/exchanges/LP_nativeDEX.c | 11 ++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index c79287421..3c8c376db 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -829,7 +829,7 @@ char *jstr(cJSON *json,char *field) { if ( json == 0 ) return(0); if ( field == char *jstri(cJSON *json,int32_t i) { return(cJSON_str(cJSON_GetArrayItem(json,i))); } char *jprint(cJSON *json,int32_t freeflag) { - char *str; + char *str,*retstr; /*static portable_mutex_t mutex; static int32_t initflag; if ( initflag == 0 ) { @@ -843,11 +843,11 @@ char *jprint(cJSON *json,int32_t freeflag) str = cJSON_Print(json), _stripwhite(str,' '); if ( freeflag != 0 ) free_json(json); - //retstr = LP_alloc(strlen(str) + 1); - //strcpy(retstr,str); - //cJSON_free(str); garbage collected + retstr = LP_alloc(strlen(str) + 1); + strcpy(retstr,str); + cJSON_free(str); //portable_mutex_unlock(&mutex); - return(str); + return(retstr); } bits256 get_API_bits256(cJSON *obj) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1f71f2c01..d1cbba606 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1210,7 +1210,7 @@ void *LP_alloc(uint64_t len) //printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; - mp->ptr = &mp[1]; + mp->ptr = calloc(1,len); portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); @@ -1225,8 +1225,7 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp,*freemp = ptr; - --freemp; + uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; @@ -1239,7 +1238,7 @@ void LP_free(void *ptr) { lagging++; DL_DELETE(LP_memory_list,mp); - //free(mp->ptr); + free(mp->ptr); free(mp); } } @@ -1253,15 +1252,13 @@ void LP_free(void *ptr) break; mp = 0; } - if ( mp != freemp ) - printf("mp %p != %p\n",mp,freemp); if ( mp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); - //free(mp->ptr); + free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt } From 8e2feae84c53e05013d15ae18674ddccd5b07a2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:26:35 +0200 Subject: [PATCH 2638/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d1cbba606..a4e5131f5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1229,7 +1229,6 @@ void LP_free(void *ptr) if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; - portable_mutex_lock(&LP_cJSONmutex); DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { total += mp->len; @@ -1237,12 +1236,16 @@ void LP_free(void *ptr) if ( now > mp->timestamp+60 ) { lagging++; - DL_DELETE(LP_memory_list,mp); - free(mp->ptr); - free(mp); + if ( now > mp->timestamp+600 ) + { + portable_mutex_lock(&LP_cJSONmutex); + DL_DELETE(LP_memory_list,mp); + portable_mutex_unlock(&LP_cJSONmutex); + free(mp->ptr); + free(mp); + } } } - portable_mutex_unlock(&LP_cJSONmutex); printf("total %d allocated total %llu %s unknown.%u lagging.%d\n",n,(long long)total,mbstr(str,total),unknown,lagging); lasttime = (uint32_t)time(NULL); } From 1ffc1e3cb3a2122e1c8d041c16d2cd3da473651e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:32:46 +0200 Subject: [PATCH 2639/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a4e5131f5..45d188cbc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1225,7 +1225,7 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; + uint32_t now; char str[65],*tmpstr; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; @@ -1241,6 +1241,10 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); + tmpstr = jprint(mp->ptr,0); + if ( strlen(tmpstr) > 32 ) + printf("laggged.(%s)\n",tmpstr); + free(tmpstr); free(mp->ptr); free(mp); } From 24a4574097e4f5d43d1025048444a6d5b899302a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:40:08 +0200 Subject: [PATCH 2640/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 45d188cbc..25b7f7d6b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1236,7 +1236,7 @@ void LP_free(void *ptr) if ( now > mp->timestamp+60 ) { lagging++; - if ( now > mp->timestamp+600 ) + if ( now > mp->timestamp+60 ) { portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); From fdfc1e05b9aa62035ecaefa90bb22ff2fb62e751 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:42:46 +0200 Subject: [PATCH 2641/2732] Test --- crypto777/cJSON.c | 7 ++----- iguana/exchanges/mm.c | 11 ----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 3c8c376db..4c0777656 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -829,7 +829,7 @@ char *jstr(cJSON *json,char *field) { if ( json == 0 ) return(0); if ( field == char *jstri(cJSON *json,int32_t i) { return(cJSON_str(cJSON_GetArrayItem(json,i))); } char *jprint(cJSON *json,int32_t freeflag) { - char *str,*retstr; + char *str; /*static portable_mutex_t mutex; static int32_t initflag; if ( initflag == 0 ) { @@ -843,11 +843,8 @@ char *jprint(cJSON *json,int32_t freeflag) str = cJSON_Print(json), _stripwhite(str,' '); if ( freeflag != 0 ) free_json(json); - retstr = LP_alloc(strlen(str) + 1); - strcpy(retstr,str); - cJSON_free(str); //portable_mutex_unlock(&mutex); - return(retstr); + return(str); } bits256 get_API_bits256(cJSON *obj) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 2fb69cf65..a87481f15 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -35,17 +35,6 @@ void PNACL_message(char *arg,...) #include "../../crypto777/OS_portable.h" #endif // !_WIN_32 -/*#define malloc(n) LP_alloc(n) -#define realloc(ptr,n) LP_realloc(ptr,n) -#define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) -#define free(ptr) LP_free(ptr) -#define clonestr(str) LP_clonestr(str) - -void *LP_realloc(void *ptr,uint64_t len); -void *LP_alloc(uint64_t len); -void LP_free(void *ptr); -char *LP_clonestr(char *str);*/ - #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #include "stats.c" From 368b115e6937a2b336cf2e99e09bc8a92afe7822 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:45:10 +0200 Subject: [PATCH 2642/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 25b7f7d6b..9dc817283 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1225,7 +1225,7 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - uint32_t now; char str[65],*tmpstr; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; + uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; @@ -1241,10 +1241,6 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - tmpstr = jprint(mp->ptr,0); - if ( strlen(tmpstr) > 32 ) - printf("laggged.(%s)\n",tmpstr); - free(tmpstr); free(mp->ptr); free(mp); } From 11810f2ecec55a7429c9b0a1e5f9b8b7b51aa1ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 01:48:22 +0200 Subject: [PATCH 2643/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9dc817283..9fb89373c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1203,6 +1203,7 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { + return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); //if ( len == 72 ) @@ -1225,6 +1226,8 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; + free(ptr); + return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { From 49395f34353d560f24e11c0fc7dc957e51022077 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 02:18:09 +0200 Subject: [PATCH 2644/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9fb89373c..420224863 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1200,10 +1200,12 @@ struct LP_memory_list void *ptr; } *LP_memory_list; int32_t zeroval() { return(0); } +long LP_cjson_allocated; void *LP_alloc(uint64_t len) { - return(calloc(1,len)); + LP_cjson_allocated += len; + //return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); //if ( len == 72 ) @@ -1226,8 +1228,8 @@ void *LP_realloc(void *ptr,uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - free(ptr); - return; + //free(ptr); + //return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { @@ -1236,7 +1238,7 @@ void LP_free(void *ptr) { total += mp->len; n++; - if ( now > mp->timestamp+60 ) + if ( 0 && now > mp->timestamp+60 ) { lagging++; if ( now > mp->timestamp+60 ) @@ -1249,7 +1251,7 @@ void LP_free(void *ptr) } } } - printf("total %d allocated total %llu %s unknown.%u lagging.%d\n",n,(long long)total,mbstr(str,total),unknown,lagging); + printf("total %d allocated total %llu/%llu %s unknown.%u lagging.%d\n",n,(long long)total,(long long)LP_cjson_allocated,mbstr(str,total),unknown,lagging); lasttime = (uint32_t)time(NULL); } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) @@ -1260,6 +1262,7 @@ void LP_free(void *ptr) } if ( mp != 0 ) { + LP_cjson_allocated -= mp->len; portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); From ac69ce359cf0e34d1e21d5180898194153183029 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 02:21:43 +0200 Subject: [PATCH 2645/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 420224863..68b481beb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1200,11 +1200,13 @@ struct LP_memory_list void *ptr; } *LP_memory_list; int32_t zeroval() { return(0); } -long LP_cjson_allocated; +long LP_cjson_allocated,LP_cjson_total,LP_cjson_count; void *LP_alloc(uint64_t len) { LP_cjson_allocated += len; + LP_cjson_total += len; + LP_cjson_count++; //return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); @@ -1231,7 +1233,7 @@ void LP_free(void *ptr) //free(ptr); //return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) { n = lagging = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) @@ -1251,7 +1253,7 @@ void LP_free(void *ptr) } } } - printf("total %d allocated total %llu/%llu %s unknown.%u lagging.%d\n",n,(long long)total,(long long)LP_cjson_allocated,mbstr(str,total),unknown,lagging); + printf("total %d allocated total %llu/%llu [%llu %llu] %.1f ave %s unknown.%u lagging.%d\n",n,(long long)total,(long long)LP_cjson_allocated,(long long)LP_cjson_total,(long long)LP_cjson_count,(double)LP_cjson_total/LP_cjson_count,mbstr(str,total),unknown,lagging); lasttime = (uint32_t)time(NULL); } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) From 42374bec95a96f6f7c88644a1914b998250f429f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:07:26 +0200 Subject: [PATCH 2646/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 68b481beb..8647c628b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -28,6 +28,9 @@ // bigendian architectures need to use little endian for sighash calcs #include + +long LP_cjson_allocated,LP_cjson_total,LP_cjson_count; + struct LP_millistats { double lastmilli,millisum,threshold; @@ -367,8 +370,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } if ( validreq != 0 ) { + long startval = LP_cjson_allocated; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); + if ( LP_cjson_allocated > startval ) + printf("leaked.%ld (%s)\n",LP_cjson_allocated - startval,(char *)ptr); if ( Broadcaststr != 0 ) { //printf("self broadcast.(%s)\n",Broadcaststr); @@ -1200,7 +1206,6 @@ struct LP_memory_list void *ptr; } *LP_memory_list; int32_t zeroval() { return(0); } -long LP_cjson_allocated,LP_cjson_total,LP_cjson_count; void *LP_alloc(uint64_t len) { From 4dcee59450b1dae62ec6e735336bc1b10c723778 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:10:35 +0200 Subject: [PATCH 2647/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8647c628b..69b61d57b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -309,10 +309,15 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { + long startval = LP_cjson_allocated; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); + if ( LP_cjson_allocated > startval ) + { + char *str = jprint(argjson,0); + printf("leaked.%ld (%s)\n",LP_cjson_allocated - startval,str); + } } } if ( argjson != 0 ) From be43224300ad87717201451d82f9adaa398c64aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:13:33 +0200 Subject: [PATCH 2648/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 69b61d57b..4c2d45d39 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -183,12 +183,19 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson return(0); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { + long startval = LP_cjson_allocated; if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } + if ( LP_cjson_allocated > startval ) + { + char *leakstr = jprint(argjson,0); + printf("stats_JSON leaked.%ld (%s)\n",LP_cjson_allocated - startval,leakstr); + free(leakstr); + } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); return(retstr); } @@ -315,8 +322,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } if ( LP_cjson_allocated > startval ) { - char *str = jprint(argjson,0); - printf("leaked.%ld (%s)\n",LP_cjson_allocated - startval,str); + char *leakstr = jprint(argjson,0); + printf("LP_command_process leaked.%ld (%s)\n",LP_cjson_allocated - startval,leakstr); + free(leakstr); } } } From 5a085dfe780cbbbb4711646a46ebd61b3cdd19ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:19:01 +0200 Subject: [PATCH 2649/2732] Test --- iguana/exchanges/LP_commands.c | 4 ++++ iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 28931cd17..72734536e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,6 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; + printf("stats_JSON.0 %ld\n",LP_cjson_allocated); method = jstr(argjson,"method"); /*if ( //strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 || strcmp(method,"notify") == 0 @@ -158,6 +159,7 @@ bot_resume(botid)\n\ rel = ""; if ( (coin= jstr(argjson,"coin")) == 0 ) coin = ""; + printf("stats_JSON.1 %ld %s\n",LP_cjson_allocated,method); if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) // protected localhost { if ( G.USERPASS_COUNTER == 0 ) @@ -640,8 +642,10 @@ bot_resume(botid)\n\ } if ( retstr == 0 ) printf("ERROR.(%s)\n",jprint(argjson,0)); + printf("stats_JSON.2 %ld reqjson.%p\n",LP_cjson_allocated,reqjson); if ( reqjson != 0 ) free_json(reqjson); + printf("stats_JSON.3 %ld retstr.%p\n",LP_cjson_allocated,retstr); if ( retstr != 0 ) { free(retstr); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4c2d45d39..a92a7ca06 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -195,6 +195,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson char *leakstr = jprint(argjson,0); printf("stats_JSON leaked.%ld (%s)\n",LP_cjson_allocated - startval,leakstr); free(leakstr); + exit(-1); } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); return(retstr); From e013029c47ac0b86209297b69fee0911dae7c315 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:22:23 +0200 Subject: [PATCH 2650/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++---- iguana/exchanges/LP_signatures.c | 3 +++ iguana/exchanges/LP_utxo.c | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a92a7ca06..61c324f6c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1229,9 +1229,7 @@ void *LP_alloc(uint64_t len) //return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); - //if ( len == 72 ) - // printf("%d\n",1/zeroval()); - //printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); + printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; mp->ptr = calloc(1,len); @@ -1287,7 +1285,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); + printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index fee4a1189..0742f49d5 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -649,6 +649,7 @@ void LP_smartutxos_push(struct iguana_info *coin) char *LP_uitem_recv(cJSON *argjson) { bits256 txid; int32_t vout,height; uint64_t value; struct iguana_info *coin; char *coinaddr,*symbol; + printf("LP_uitem_recv.0 %ld\n",LP_cjson_allocated); txid = jbits256(argjson,"txid"); vout = jint(argjson,"vout"); height = jint(argjson,"ht"); @@ -660,7 +661,9 @@ char *LP_uitem_recv(cJSON *argjson) if ( strcmp(coin->smartaddr,coinaddr) != 0 ) LP_address_utxoadd((uint32_t)time(NULL),"LP_uitem_recv",coin,coinaddr,txid,vout,value,height,-1); //else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); + printf("LP_uitem_recv.1 %ld\n",LP_cjson_allocated); } + printf("LP_uitem_recv.2 %ld\n",LP_cjson_allocated); return(clonestr("{\"result\":\"success\"}")); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 73a8e0260..1ebb7039e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -423,6 +423,7 @@ void LP_mark_spent(char *symbol,bits256 txid,int32_t vout) int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //char str[65]; + printf("LP_address_utxoadd.0 %ld\n",LP_cjson_allocated); if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about @@ -479,6 +480,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + printf("LP_address_utxoadd.1 %ld\n",LP_cjson_allocated); return(retval); } From 5b5433d4eafc161758a4b3443ed4e0d7a5a9f715 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:25:50 +0200 Subject: [PATCH 2651/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 61c324f6c..18261cabd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1066,7 +1066,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); @@ -1229,7 +1229,7 @@ void *LP_alloc(uint64_t len) //return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); - printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len); + printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; mp->ptr = calloc(1,len); @@ -1285,7 +1285,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len); + printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt From 281a757d014c6e47a03fc044cc78c7f07cd5aa2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:27:55 +0200 Subject: [PATCH 2652/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 18261cabd..7ae493eb7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1045,23 +1045,23 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) { printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); @@ -1071,12 +1071,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) { printf("error launching gc_loop for port.%u\n",myport); exit(-1); @@ -1229,10 +1229,10 @@ void *LP_alloc(uint64_t len) //return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); + mp->ptr = calloc(1,len); printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; - mp->ptr = calloc(1,len); portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); From b41fc50aa81b4c5407b6045d988a8e5733de45bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:29:46 +0200 Subject: [PATCH 2653/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7ae493eb7..539d78dd6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1081,37 +1081,37 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching gc_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) { printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) { printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); From 5bb144797c799039368c7b06b3374177570f7b7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:31:40 +0200 Subject: [PATCH 2654/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 539d78dd6..b7bb0f3a2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1126,7 +1126,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //fprintf(stderr,"."); sleep(3); } - if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) + if ( 0 && LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) usleep(1000); From ab34e551a25b545f8f897a45a7f627e20c3b3e05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:33:43 +0200 Subject: [PATCH 2655/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b7bb0f3a2..539d78dd6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1126,7 +1126,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //fprintf(stderr,"."); sleep(3); } - if ( 0 && LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) + if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) nonz++; if ( nonz == 0 ) usleep(1000); From c7a4d3ecaf681904cbea3d8bb18d0d1ff19a0187 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:35:08 +0200 Subject: [PATCH 2656/2732] test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 539d78dd6..071f3bad7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1045,7 +1045,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) { printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); From 33975fa1138c77a9205377996578fffe8f5751dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:36:01 +0200 Subject: [PATCH 2657/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 071f3bad7..49cffb4ae 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1050,7 +1050,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); From 1e228137e2fda1e626a818e95aca486cf4b95f34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:37:20 +0200 Subject: [PATCH 2658/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 49cffb4ae..1e5554648 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1055,13 +1055,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); From 931763427bf30aad10a3a4627d1ce9cd3dc4b8d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:38:22 +0200 Subject: [PATCH 2659/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1e5554648..b54e1d82c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1071,12 +1071,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) { printf("error launching gc_loop for port.%u\n",myport); exit(-1); From ae5497af8f0fe73594a5df8cd7ecc74992522216 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:40:01 +0200 Subject: [PATCH 2660/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b54e1d82c..c5410aed6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1086,17 +1086,17 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) { printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) { printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); From 22310de9f3b9f59e5612948c3f91ec93c9b2cd03 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:41:20 +0200 Subject: [PATCH 2661/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c5410aed6..6327c5337 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1106,7 +1106,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); From 1f61ce249a26d8bb0e543ca10f9aa76ee30b61b1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:43:45 +0200 Subject: [PATCH 2662/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6327c5337..92ee37ced 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1050,18 +1050,18 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); @@ -1076,7 +1076,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) { printf("error launching gc_loop for port.%u\n",myport); exit(-1); @@ -1086,17 +1086,17 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) { printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) { printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); From 6585624a988e751e2878f37d579150a21ace5556 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:54:49 +0200 Subject: [PATCH 2663/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxos.c | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b6c24be52..72f99d81f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -275,7 +275,7 @@ struct iguana_info void *electrum; void *ctx; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33],zcash; - bits256 lastprivkey; uint32_t lastprivkeytime; int32_t privkeydepth; + int32_t privkeydepth; bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen; bits256 cachedmerkle; int32_t cachedmerkleheight; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 92ee37ced..8309305d5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1066,7 +1066,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) { printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2816dd303..497760624 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -568,19 +568,17 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri //printf("coin not active\n"); return(0); } - /*if ( bits256_cmp(myprivkey,coin->lastprivkey) == 0 && time(NULL) < coin->lastprivkeytime+60 ) - return(0);*/ - coin->lastprivkey = myprivkey; - coin->lastprivkeytime = (uint32_t)time(NULL); if ( coin->privkeydepth > 0 ) return(0); + printf("LP_privkey_init.0 %ld\n",LP_cjson_allocated); coin->privkeydepth++; LP_address(coin,coin->smartaddr); - //printf("privkey init.(%s) %s depth.%d\n",coin->symbol,coin->smartaddr,coin->privkeydepth); + printf("LP_privkey_init.1 %ld\n",LP_cjson_allocated); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); + printf("LP_privkey_init.2 %ld\n",LP_cjson_allocated); array = LP_listunspent(coin->symbol,coin->smartaddr); - //printf("unspent array %ld\n",strlen(jprint(array,0))); + printf("LP_privkey_init.3 %ld\n",LP_cjson_allocated); if ( array != 0 ) { txfee = LP_txfeecalc(coin,0,0); @@ -709,6 +707,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( flag != 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } + printf("LP_privkey_init.4 %ld\n",LP_cjson_allocated); if ( values != 0 ) free(values); if ( coin->privkeydepth > 0 ) From 77f1f8f6a756be38fa0c69c4691f98e7b3995805 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 06:56:00 +0200 Subject: [PATCH 2664/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8309305d5..7fcdd92ed 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -195,7 +195,6 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson char *leakstr = jprint(argjson,0); printf("stats_JSON leaked.%ld (%s)\n",LP_cjson_allocated - startval,leakstr); free(leakstr); - exit(-1); } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); return(retstr); From d27ffaf556acbded1f8eb4737ee51399bac552ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 07:19:06 +0200 Subject: [PATCH 2665/2732] Test --- iguana/exchanges/LP_commands.c | 11 +--------- iguana/exchanges/LP_nativeDEX.c | 34 ++++++++---------------------- iguana/exchanges/LP_ordermatch.c | 1 + iguana/exchanges/LP_prices.c | 1 + iguana/exchanges/LP_rpc.c | 9 -------- iguana/exchanges/LP_signatures.c | 3 --- iguana/exchanges/LP_statemachine.c | 10 +++++++++ iguana/exchanges/LP_utxo.c | 6 +++--- iguana/exchanges/LP_utxos.c | 8 ++----- 9 files changed, 27 insertions(+), 56 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 72734536e..72c64d04b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,13 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; - printf("stats_JSON.0 %ld\n",LP_cjson_allocated); method = jstr(argjson,"method"); -/*if ( //strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0 || - strcmp(method,"notify") == 0 - || strcmp(method,"postprice") == 0 - ) - return(clonestr("{}"));*/ /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) @@ -159,7 +153,6 @@ bot_resume(botid)\n\ rel = ""; if ( (coin= jstr(argjson,"coin")) == 0 ) coin = ""; - printf("stats_JSON.1 %ld %s\n",LP_cjson_allocated,method); if ( G.USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) // protected localhost { if ( G.USERPASS_COUNTER == 0 ) @@ -437,7 +430,7 @@ bot_resume(botid)\n\ } else if ( strcmp(method,"getrawtransaction") == 0 ) { - return(jprint(LP_gettx(coin,jbits256(argjson,"txid")),0)); + return(jprint(LP_gettx(coin,jbits256(argjson,"txid")),1)); } else if ( strcmp(method,"withdraw") == 0 ) { @@ -642,10 +635,8 @@ bot_resume(botid)\n\ } if ( retstr == 0 ) printf("ERROR.(%s)\n",jprint(argjson,0)); - printf("stats_JSON.2 %ld reqjson.%p\n",LP_cjson_allocated,reqjson); if ( reqjson != 0 ) free_json(reqjson); - printf("stats_JSON.3 %ld retstr.%p\n",LP_cjson_allocated,retstr); if ( retstr != 0 ) { free(retstr); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7fcdd92ed..9c260bdaa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -183,19 +183,12 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson return(0); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { - long startval = LP_cjson_allocated; if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } - if ( LP_cjson_allocated > startval ) - { - char *leakstr = jprint(argjson,0); - printf("stats_JSON leaked.%ld (%s)\n",LP_cjson_allocated - startval,leakstr); - free(leakstr); - } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); return(retstr); } @@ -316,16 +309,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { - long startval = LP_cjson_allocated; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - if ( LP_cjson_allocated > startval ) - { - char *leakstr = jprint(argjson,0); - printf("LP_command_process leaked.%ld (%s)\n",LP_cjson_allocated - startval,leakstr); - free(leakstr); - } } } if ( argjson != 0 ) @@ -383,11 +369,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } if ( validreq != 0 ) { - long startval = LP_cjson_allocated; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); - if ( LP_cjson_allocated > startval ) - printf("leaked.%ld (%s)\n",LP_cjson_allocated - startval,(char *)ptr); if ( Broadcaststr != 0 ) { //printf("self broadcast.(%s)\n",Broadcaststr); @@ -1222,10 +1205,10 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { + return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; - //return(calloc(1,len)); struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); mp->ptr = calloc(1,len); @@ -1238,16 +1221,11 @@ void *LP_alloc(uint64_t len) return(mp->ptr); } -void *LP_realloc(void *ptr,uint64_t len) -{ - return(realloc(ptr,len)); -} - void LP_free(void *ptr) { static uint32_t lasttime,unknown; - //free(ptr); - //return; + free(ptr); + return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) { @@ -1297,3 +1275,9 @@ char *LP_clonestr(char *str) return(retstr); } +void *LP_realloc(void *ptr,uint64_t len) +{ + return(realloc(ptr,len)); +} + + diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 04faf3715..b541200a1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -718,6 +718,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr,int32_t fullflag) LP_address_utxoadd(now,"LP_listunspent_both",coin,coinaddr,txid,v,value,height,-1); } } + free_json(array); } } } //else printf("%s coin.%p inactive.%d\n",symbol,coin,coin!=0?coin->inactive:-1); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7313c733b..d299b8368 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -265,6 +265,7 @@ uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) } } metric = _LP_unspents_metric(total,n); + free_json(array); } return(metric); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2a66c9b94..320eec701 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -682,15 +682,6 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag) { //printf("LP_listunspent_query.(%s %s)\n",symbol,coinaddr); LP_listunspent_query(coin->symbol,coin->smartaddr); - /*if ( fullflag != 0 ) - { - if ( (destport= LP_randpeer(destip)) > 0 ) - { - retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); - //printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); - retjson = cJSON_Parse(retstr); - } else printf("LP_listunspent_issue couldnt get a random peer?\n"); - }*/ } if ( retjson != 0 ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0742f49d5..fee4a1189 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -649,7 +649,6 @@ void LP_smartutxos_push(struct iguana_info *coin) char *LP_uitem_recv(cJSON *argjson) { bits256 txid; int32_t vout,height; uint64_t value; struct iguana_info *coin; char *coinaddr,*symbol; - printf("LP_uitem_recv.0 %ld\n",LP_cjson_allocated); txid = jbits256(argjson,"txid"); vout = jint(argjson,"vout"); height = jint(argjson,"ht"); @@ -661,9 +660,7 @@ char *LP_uitem_recv(cJSON *argjson) if ( strcmp(coin->smartaddr,coinaddr) != 0 ) LP_address_utxoadd((uint32_t)time(NULL),"LP_uitem_recv",coin,coinaddr,txid,vout,value,height,-1); //else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr); - printf("LP_uitem_recv.1 %ld\n",LP_cjson_allocated); } - printf("LP_uitem_recv.2 %ld\n",LP_cjson_allocated); return(clonestr("{\"result\":\"success\"}")); } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 3c32b8cad..86997fcd5 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -355,6 +355,16 @@ char *issue_LP_getprices(char *destip,uint16_t destport) return(LP_issue_curl("getprices",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } +/*if ( fullflag != 0 ) + { + if ( (destport= LP_randpeer(destip)) > 0 ) + { + retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); + //printf("issue %s %s %s -> (%s)\n",coin->symbol,coinaddr,destip,retstr); + retjson = cJSON_Parse(retstr); + } else printf("LP_listunspent_issue couldnt get a random peer?\n"); + }*/ + void issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) { cJSON *reqjson = cJSON_CreateObject(); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1ebb7039e..c93f5e0fc 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -423,7 +423,6 @@ void LP_mark_spent(char *symbol,bits256 txid,int32_t vout) int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight) { struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //char str[65]; - printf("LP_address_utxoadd.0 %ld\n",LP_cjson_allocated); if ( coin == 0 ) return(0); if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about @@ -480,7 +479,6 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co } } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); - printf("LP_address_utxoadd.1 %ld\n",LP_cjson_allocated); return(retval); } @@ -505,7 +503,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) up->spendheight = (int32_t)time(NULL); DL_APPEND(LP_garbage_collector2,up); portable_mutex_unlock(&LP_gcmutex); - } + } now = (uint32_t)time(NULL); if ( (n= cJSON_GetArraySize(array)) > 0 ) { @@ -636,6 +634,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr balance += LP_value_extract(item,1); } } + free_json(array); } } else @@ -654,6 +653,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr balance += j64bits(item,"value"); } } + free_json(array); } } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 497760624..2498d4da4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -570,15 +570,11 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } if ( coin->privkeydepth > 0 ) return(0); - printf("LP_privkey_init.0 %ld\n",LP_cjson_allocated); coin->privkeydepth++; LP_address(coin,coin->smartaddr); - printf("LP_privkey_init.1 %ld\n",LP_cjson_allocated); if ( coin->inactive == 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr,0); - printf("LP_privkey_init.2 %ld\n",LP_cjson_allocated); array = LP_listunspent(coin->symbol,coin->smartaddr); - printf("LP_privkey_init.3 %ld\n",LP_cjson_allocated); if ( array != 0 ) { txfee = LP_txfeecalc(coin,0,0); @@ -707,7 +703,6 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri if ( flag != 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } - printf("LP_privkey_init.4 %ld\n",LP_cjson_allocated); if ( values != 0 ) free(values); if ( coin->privkeydepth > 0 ) @@ -819,7 +814,8 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1)); exit(-1); } - } else free_json(retjson); + free_json(retjson); + } coin->importedprivkey = (uint32_t)time(NULL); } vcalc_sha256(0,checkkey.bytes,privkey.bytes,sizeof(privkey)); From d596bcfc940bd1683894a5a6573be71084529108 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 07:21:01 +0200 Subject: [PATCH 2666/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9c260bdaa..9fb48bb7f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1032,18 +1032,18 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); @@ -1058,32 +1058,32 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching queue_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)gc_loop,(void *)myipaddr) != 0 ) { printf("error launching gc_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,ctx) != 0 ) { printf("error launching prices_loop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) { printf("error launching LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) { printf("error launching BTC LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"KMD") != 0 ) { printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); @@ -1093,7 +1093,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); From dce7ba29d7d29fff92dde3e0be9e7c306dcd32c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 09:53:37 +0200 Subject: [PATCH 2667/2732] Test --- iguana/exchanges/LP_RTmetrics.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 3 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_remember.c | 23 ------- iguana/exchanges/LP_rpc.c | 61 +++++++++--------- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_statemachine.c | 100 +++++++++++++++++++++++++++++ iguana/exchanges/LP_transaction.c | 11 ---- iguana/exchanges/LP_utxo.c | 66 ------------------- 10 files changed, 138 insertions(+), 134 deletions(-) diff --git a/iguana/exchanges/LP_RTmetrics.c b/iguana/exchanges/LP_RTmetrics.c index ac01d3025..53466e5e7 100644 --- a/iguana/exchanges/LP_RTmetrics.c +++ b/iguana/exchanges/LP_RTmetrics.c @@ -161,7 +161,7 @@ void LP_RTmetrics_update(char *base,char *rel) { if ( (swaps= jarray(&numswaps,statsjson,"swaps")) != 0 ) { - printf("LP_RTmetrics_update for (%s)\n",jprint(swaps,0)); + //printf("LP_RTmetrics_update for (%s)\n",jprint(swaps,0)); if ( numswaps > 0 ) LP_RTmetrics_swapsinfo(base,rel,swaps,numswaps); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9fb48bb7f..b265c8d7b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,10 +19,11 @@ // // if ( G.LP_pendingswaps != 0 ) return(-1); // bot safe to exit? -// +// 324744 and 50mb // BCH signing // single utxo allocations alice // alice waiting for bestprice +// // previously, it used to show amount, kmd equiv, perc // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b541200a1..e1f7bf62e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -889,7 +889,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, price += (r * range) / 100.; bestprice = LP_bob_competition(&counter,aliceid,price,0); printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",ask,qprice,r,range,price,bestprice,counter); - if ( counter > 5 || price > bestprice*1.1 ) // skip if late or bad price + if ( counter > 3 || price > bestprice ) // skip if late or bad price return(retval); } else return(retval); LP_RTmetrics_update(Q.srccoin,Q.destcoin); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index c0ef0efd7..7889181bf 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1247,29 +1247,6 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid) if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) return(jprint(item,1)); else return(clonestr("{\"error\":\"cant find requestid-quoteid\"}")); - /*if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) - { - //printf("swapentry.(%s)\n",liststr); - if ( (retjson= cJSON_Parse(liststr)) != 0 ) - { - if ( (array= jarray(&n,retjson,"swaps")) != 0 ) - { - for (i=0; iserverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) + if ( (0) ) { - if ( (json= cJSON_Parse(retstr)) != 0 ) + array = cJSON_CreateArray(); + jaddistr(array,rawtx); + jaddi(array,jduplicate(vins)); + jaddi(array,jduplicate(privkeys)); + paramstr = jprint(array,1); + //printf("signrawtransaction\n"); + if ( (retstr= bitcoind_passthru(symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) { - if ( (hexstr= jstr(json,"hex")) != 0 ) + if ( (json= cJSON_Parse(retstr)) != 0 ) { - len = (int32_t)strlen(hexstr); - signedtx = calloc(1,len+1); - strcpy(signedtx,hexstr); - *completedp = is_cJSON_True(jobj(json,"complete")); - len >>= 1; - data = malloc(len); - decode_hex(data,len,hexstr); - *signedtxidp = bits256_doublesha256(0,data,len); + if ( (hexstr= jstr(json,"hex")) != 0 ) + { + len = (int32_t)strlen(hexstr); + signedtx = calloc(1,len+1); + strcpy(signedtx,hexstr); + *completedp = is_cJSON_True(jobj(json,"complete")); + len >>= 1; + data = malloc(len); + decode_hex(data,len,hexstr); + *signedtxidp = bits256_doublesha256(0,data,len); + } + //else + printf("%s signrawtransaction.(%s) params.(%s)\n",coin->symbol,retstr,paramstr); + free_json(json); } - //else - printf("%s signrawtransaction.(%s) params.(%s)\n",coin->symbol,retstr,paramstr); - free_json(json); + free(retstr); } - free(retstr); + free(paramstr); + return(signedtx); } - free(paramstr); - return(signedtx); } cJSON *LP_getblock(char *symbol,bits256 txid) @@ -1032,7 +1035,7 @@ uint32_t LP_heighttime(char *symbol,int32_t height) { if ( (retjson= cJSON_Parse(blockhashstr)) != 0 ) { - printf("height.(%s)\n",jprint(retjson,0)); + //printf("height.(%s)\n",jprint(retjson,0)); timestamp = juint(retjson,"time"); free_json(retjson); } @@ -1043,7 +1046,7 @@ uint32_t LP_heighttime(char *symbol,int32_t height) { if ( (retjson= electrum_getheader(coin->symbol,ep,&retjson,height)) != 0 ) { - printf("%s\n",jprint(retjson,0)); + //printf("%s\n",jprint(retjson,0)); timestamp = juint(retjson,"timestamp"); free_json(retjson); } @@ -1074,7 +1077,7 @@ cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t hei *heightp = juint(json,"height"); if ( height >= 0 && *heightp != height ) { - printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); + //printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); *heightp = -1; free_json(json); json = 0; @@ -1255,7 +1258,7 @@ int32_t LP_notarization_latest(int32_t *bestheightp,struct iguana_info *coin) blockhash = jbits256(blockjson,"previousblockhash"); if ( bits256_nonz(blockhash) == 0 ) { - printf("null prev.(%s)\n",jprint(blockjson,0)); + //printf("null prev.(%s)\n",jprint(blockjson,0)); free_json(blockjson); break; } diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5a5a12051..f3b67476b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -466,7 +466,7 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int { if ( (array= electrum_address_getmempool(symbol,coin->electrum,&array,coinaddr)) != 0 ) { - char str[65]; printf("check %s mempool.(%s)\n",bits256_str(str,txid),jprint(array,0)); + //char str[65]; printf("check %s mempool.(%s)\n",bits256_str(str,txid),jprint(array,0)); if ( (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; i lasthello+600 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; @@ -347,6 +359,94 @@ void issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr,b return(retstr);*/ } +/*if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 ) + { + //printf("swapentry.(%s)\n",liststr); + if ( (retjson= cJSON_Parse(liststr)) != 0 ) + { + if ( (array= jarray(&n,retjson,"swaps")) != 0 ) + { + for (i=0; itimestamp = (uint32_t)time(NULL); + ptr->item = item; + item->cjsonid = rand(); + ptr->cjsonid = item->cjsonid; + portable_mutex_lock(&LP_cJSONmutex); + DL_APPEND(LP_cJSONlist,ptr); + portable_mutex_unlock(&LP_cJSONmutex); + } + + void cJSON_unregister(cJSON *item) + { + static uint32_t lasttime; + int32_t n; char *tmpstr; uint64_t total = 0; struct cJSON_list *ptr,*tmp; uint32_t now; + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) + { + n = 0; + DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) + { + if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) + { + if ( (tmpstr= jprint(ptr->item,0)) != 0 ) + { + total += strlen(tmpstr); + free(tmpstr); + } + } + n++; + } + printf("total %d cJSON pending\n",n); + lasttime = (uint32_t)time(NULL); + } + DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) + { + if ( ptr->cjsonid == item->cjsonid ) + break; + else if ( now > ptr->timestamp+60 && item->cjsonid != 0 ) + { + portable_mutex_lock(&LP_cJSONmutex); + DL_DELETE(LP_cJSONlist,ptr); + portable_mutex_unlock(&LP_cJSONmutex); + printf("free expired\n"); + cJSON_Delete(ptr->item); + free(ptr); + } + ptr = 0; + } + if ( ptr != 0 ) + { + portable_mutex_lock(&LP_cJSONmutex); + DL_DELETE(LP_cJSONlist,ptr); + free(ptr); + portable_mutex_unlock(&LP_cJSONmutex); + } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); + }*/ char *issue_LP_getprices(char *destip,uint16_t destport) { char url[512]; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index cfd1a6060..f90a87170 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1651,17 +1651,6 @@ void LP_swap_coinaddr(struct iguana_info *coin,char *coinaddr,uint64_t *valuep,u vout = jitem(vouts,v); if ( valuep != 0 ) *valuep = LP_value_extract(vout,1); - //printf("VOUT.(%s)\n",jprint(vout,0)); - /*if ( (skey= jobj(vout,"scriptPubKey")) != 0 && (addresses= jarray(&m,skey,"addresses")) != 0 ) - { - item = jitem(addresses,0); - //printf("item.(%s)\n",jprint(item,0)); - if ( (addr= jstr(item,0)) != 0 ) - { - safecopy(coinaddr,addr,64); - //printf("extracted.(%s)\n",coinaddr); - } - }*/ LP_destaddr(coinaddr,vout); } free_json(txobj); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index c93f5e0fc..59b8b8b8e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -27,72 +27,6 @@ struct LP_inuse_info } LP_inuse[1024]; int32_t LP_numinuse; -/*struct cJSON_list -{ - struct cJSON_list *next,*prev; - cJSON *item; - uint32_t timestamp,cjsonid; -} *LP_cJSONlist; - -void cJSON_register(cJSON *item) -{ - struct cJSON_list *ptr; - ptr = calloc(1,sizeof(*ptr)); - ptr->timestamp = (uint32_t)time(NULL); - ptr->item = item; - item->cjsonid = rand(); - ptr->cjsonid = item->cjsonid; - portable_mutex_lock(&LP_cJSONmutex); - DL_APPEND(LP_cJSONlist,ptr); - portable_mutex_unlock(&LP_cJSONmutex); -} - -void cJSON_unregister(cJSON *item) -{ - static uint32_t lasttime; - int32_t n; char *tmpstr; uint64_t total = 0; struct cJSON_list *ptr,*tmp; uint32_t now; - if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) - { - n = 0; - DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) - { - if ( ptr->item != 0 && ptr->item->child != 0 && ptr->cjsonid != 0 ) - { - if ( (tmpstr= jprint(ptr->item,0)) != 0 ) - { - total += strlen(tmpstr); - free(tmpstr); - } - } - n++; - } - printf("total %d cJSON pending\n",n); - lasttime = (uint32_t)time(NULL); - } - DL_FOREACH_SAFE(LP_cJSONlist,ptr,tmp) - { - if ( ptr->cjsonid == item->cjsonid ) - break; - else if ( now > ptr->timestamp+60 && item->cjsonid != 0 ) - { - portable_mutex_lock(&LP_cJSONmutex); - DL_DELETE(LP_cJSONlist,ptr); - portable_mutex_unlock(&LP_cJSONmutex); - printf("free expired\n"); - cJSON_Delete(ptr->item); - free(ptr); - } - ptr = 0; - } - if ( ptr != 0 ) - { - portable_mutex_lock(&LP_cJSONmutex); - DL_DELETE(LP_cJSONlist,ptr); - free(ptr); - portable_mutex_unlock(&LP_cJSONmutex); - } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); -}*/ - struct LP_inuse_info *_LP_inuse_find(bits256 txid,int32_t vout) { int32_t i; From 838df594ae564cefd091bd7e5bc673edfbb61c18 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 10:33:10 +0200 Subject: [PATCH 2668/2732] Test --- crypto777/cJSON.c | 93 +++++++++++++++++++++++---------- iguana/exchanges/LP_nativeDEX.c | 11 ++-- 2 files changed, 69 insertions(+), 35 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 4c0777656..901e6fc98 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -59,13 +59,46 @@ void LP_free(void *ptr); static void *(*cJSON_malloc)(size_t sz) = (void *)LP_alloc; static void (*cJSON_free)(void *ptr) = LP_free; +static void *cJSON_mallocstr(int32_t len) +{ + return(cJSON_malloc(len)); +} + +static char **cJSON_mallocptrs(int32_t num,char **space,int32_t max) +{ + if ( num < max ) + return(space); + else return(cJSON_malloc(num * sizeof(char *))); +} + +static void *cJSON_mallocnode() +{ + return(cJSON_malloc(sizeof(cJSON))); +} + +static void cJSON_freeptrs(char **ptrs,int32_t num,char **space) +{ + if ( ptrs != space ) + cJSON_free(ptrs); +} + +static void cJSON_freestr(char *str) +{ + cJSON_free(str); +} + +static void cJSON_freenode(cJSON *item) +{ + cJSON_free(item); +} + static char* cJSON_strdup(const char* str) { size_t len; char* copy; len = strlen(str) + 1; - if (!(copy = (char*)cJSON_malloc(len+1))) return 0; + if (!(copy = (char*)cJSON_mallocstr((int32_t)len+1))) return 0; memcpy(copy,str,len); return copy; } @@ -78,14 +111,14 @@ void cJSON_InitHooks(cJSON_Hooks* hooks) return; } - cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc; - cJSON_free = (hooks->free_fn)?hooks->free_fn:free; + cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc; + cJSON_free = (hooks->free_fn)?hooks->free_fn:free; } /* Internal constructor. */ static cJSON *cJSON_New_Item(void) { - cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON)); + cJSON* node = (cJSON*)cJSON_mallocnode(); if (node) memset(node,0,sizeof(cJSON)); return node; } @@ -98,9 +131,9 @@ void cJSON_Delete(cJSON *c) { next=c->next; if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); - if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); - if (c->string) cJSON_free(c->string); - cJSON_free(c); + if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_freestr(c->valuestring); + if (c->string) cJSON_freestr(c->string); + cJSON_freenode(c); c=next; } } @@ -134,13 +167,13 @@ static char *print_number(cJSON *item) double d = item->valuedouble; if ( fabs(((double)item->valueint) - d) <= DBL_EPSILON && d >= (1. - DBL_EPSILON) && d < (1LL << 62) )//d <= INT_MAX && d >= INT_MIN ) { - str = (char *)cJSON_malloc(24); /* 2^64+1 can be represented in 21 chars + sign. */ + str = (char *)cJSON_mallocstr(24); /* 2^64+1 can be represented in 21 chars + sign. */ if ( str != 0 ) sprintf(str,"%lld",(long long)item->valueint); } else { - str = (char *)cJSON_malloc(66); /* This is a nice tradeoff. */ + str = (char *)cJSON_mallocstr(66); /* This is a nice tradeoff. */ if ( str != 0 ) { if ( fabs(floor(d) - d) <= DBL_EPSILON && fabs(d) < 1.0e60 ) @@ -175,7 +208,7 @@ static const char *parse_string(cJSON *item,const char *str) while (*ptr!='\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++; // Skip escaped quotes - out=(char*)cJSON_malloc(len+2); /* This is how long we need for the string, roughly. */ + out=(char*)cJSON_mallocstr(len+2); /* This is how long we need for the string, roughly. */ if (!out) return 0; ptr=str+1;ptr2=out; @@ -240,7 +273,7 @@ static char *print_string_ptr(const char *str) if (!str) return cJSON_strdup(""); ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;} - out=(char*)cJSON_malloc(len+3+1); + out=(char*)cJSON_mallocstr(len+3+1); if (!out) return 0; ptr2=out;ptr=str; @@ -374,7 +407,7 @@ static const char *parse_array(cJSON *item,const char *value) /* Render an array to text */ static char *print_array(cJSON *item,int32_t depth,int32_t fmt) { - char **entries; + char **entries,*space_entries[512]; char *out=0,*ptr,*ret;int32_t len=5; cJSON *child=item->child; int32_t numentries=0,i=0,fail=0; @@ -384,12 +417,12 @@ static char *print_array(cJSON *item,int32_t depth,int32_t fmt) /* Explicitly handle numentries==0 */ if (!numentries) { - out=(char*)cJSON_malloc(3+1); + out=(char*)cJSON_mallocstr(3+1); if (out) strcpy(out,"[]"); return out; } /* Allocate an array to hold the values for each */ - entries=(char**)cJSON_malloc((1+numentries)*sizeof(char*)); + entries=cJSON_mallocptrs(1+numentries,space_entries,sizeof(space_entries)/sizeof(*space_entries)); if (!entries) return 0; memset(entries,0,numentries*sizeof(char*)); /* Retrieve all the results: */ @@ -403,15 +436,15 @@ static char *print_array(cJSON *item,int32_t depth,int32_t fmt) } /* If we didn't fail, try to malloc the output string */ - if (!fail) out=(char*)cJSON_malloc(len+1); + if (!fail) out=(char*)cJSON_mallocstr(len+1); /* If that fails, we fail. */ if (!out) fail=1; /* Handle failure. */ if (fail) { - for (i=0;ichild,*firstchild; int32_t numentries=0,fail=0; @@ -487,7 +520,7 @@ static char *print_object(cJSON *item,int32_t depth,int32_t fmt) /* Explicitly handle empty object case */ if (!numentries) { - out=(char*)cJSON_malloc(fmt?depth+4+1:3+1); + out=(char*)cJSON_mallocstr(fmt?depth+4+1:3+1); if (!out) return 0; ptr=out;*ptr++='{'; if (fmt) {*ptr++='\n';for (i=0;i 32 && cipherlen <= sizeof(decoded)*2 ) + if ( 0 && (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) { method2 = jstr(argjson,"method2"); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"encrypted") == 0 ||(method2 != 0 && strcmp(method2,"encrypted") == 0)) ) @@ -1206,14 +1206,14 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { - return(calloc(1,len)); + //return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); mp->ptr = calloc(1,len); - printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); + //printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; portable_mutex_lock(&LP_cJSONmutex); @@ -1225,8 +1225,7 @@ void *LP_alloc(uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - free(ptr); - return; + // free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) { @@ -1263,7 +1262,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); + //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt From ef31b37fce7919122c121f751f4f6b3a9dbd5146 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 10:35:53 +0200 Subject: [PATCH 2669/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e10ce33be..93f37280e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -250,7 +250,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; //printf("[%s]\n",jsonstr); cipherlen = 0; - if ( 0 && (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) + if ( (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) { method2 = jstr(argjson,"method2"); if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"encrypted") == 0 ||(method2 != 0 && strcmp(method2,"encrypted") == 0)) ) @@ -1084,17 +1084,17 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); From 83bb9a061b7de944c876e586dd40540d9965f0cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 10:39:33 +0200 Subject: [PATCH 2670/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 72c64d04b..c7b2b84fb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -542,7 +542,7 @@ bot_resume(botid)\n\ return(LP_postprice_recv(argjson)); else if ( strcmp(method,"postutxos") == 0 ) return(LP_postutxos_recv(argjson)); - else if ( strcmp(method,"uitem") == 0 ) + else if ( 0 && strcmp(method,"uitem") == 0 ) return(LP_uitem_recv(argjson)); else if ( strcmp(method,"notify") == 0 ) return(LP_notify_recv(argjson)); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 93f37280e..30548d1c6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -327,7 +327,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr,int32_t maxdepth) { - int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr,*buf; char methodstr[64],*retstr,*str; struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char methodstr[64],*retstr,*str; struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < maxdepth && recvlen > 0 ) @@ -339,11 +339,11 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( nn_poll(&pfd,1,1) != 1 ) break; ptr = 0; - buf = malloc(1000000); - if ( (recvlen= nn_recv(sock,buf,1000000,0)) > 0 ) - //if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) + //buf = malloc(1000000); + //if ( (recvlen= nn_recv(sock,buf,1000000,0)) > 0 ) + if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - ptr = buf; + //ptr = buf; methodstr[0] = 0; //printf("%s.(%s)\n",typestr,(char *)ptr); if ( 0 ) @@ -394,8 +394,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } if ( ptr != 0 ) { - //nn_freemsg(ptr), ptr = 0; - free(buf); + nn_freemsg(ptr), ptr = 0; + //free(buf); } } } From ce6dd7022046a38b3187243f35396c2d6678fe12 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 10:48:30 +0200 Subject: [PATCH 2671/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c7b2b84fb..72c64d04b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -542,7 +542,7 @@ bot_resume(botid)\n\ return(LP_postprice_recv(argjson)); else if ( strcmp(method,"postutxos") == 0 ) return(LP_postutxos_recv(argjson)); - else if ( 0 && strcmp(method,"uitem") == 0 ) + else if ( strcmp(method,"uitem") == 0 ) return(LP_uitem_recv(argjson)); else if ( strcmp(method,"notify") == 0 ) return(LP_notify_recv(argjson)); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 30548d1c6..dce105e65 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1028,23 +1028,23 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) { printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); @@ -1054,7 +1054,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); @@ -1084,17 +1084,17 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching KMD LP_coinsloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_privkeysloop,(void *)myipaddr) != 0 ) { printf("error launching LP_privkeysloop for ctx.%p\n",ctx); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_swapsloop,(void *)myipaddr) != 0 ) { printf("error launching LP_swapsloop for port.%u\n",myport); exit(-1); From 83293ad5b26a1343066b5c726579bc1326183f95 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 10:52:49 +0200 Subject: [PATCH 2672/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 18 +++++++++--------- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index dce105e65..220770d43 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1028,23 +1028,23 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_psockloop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_reserved_msgs,(void *)myipaddr) != 0 ) { printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } uint16_t myport2 = myport-1; - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport2) != 0 ) { printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); @@ -1054,7 +1054,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching command_rpcloop for port.%u\n",myport); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) { printf("error launching queue_loop for port.%u\n",myport); exit(-1); @@ -1206,7 +1206,7 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { - //return(calloc(1,len)); +return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; @@ -1225,7 +1225,7 @@ void *LP_alloc(uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; - // free(ptr); return; +free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) { @@ -1268,7 +1268,7 @@ void LP_free(void *ptr) } else unknown++; // free from source file with #define redirect for alloc that wasnt } -char *LP_clonestr(char *str) +/*char *LP_clonestr(char *str) { char *retstr = LP_alloc(strlen(str)+1); strcpy(retstr,str); @@ -1278,6 +1278,6 @@ char *LP_clonestr(char *str) void *LP_realloc(void *ptr,uint64_t len) { return(realloc(ptr,len)); -} +}*/ diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 59b8b8b8e..4458feaa1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -382,7 +382,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co break; } } - if ( flag == 0 && value != 0 ) + if ( 0 && flag == 0 && value != 0 ) { if ( coin->electrum == 0 ) { @@ -739,7 +739,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; - if ( coin->inactive != 0 ) + //if ( coin->inactive != 0 ) return(0); if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { From 2af1ae8f4055b79674137666e019832883484f67 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 10:54:17 +0200 Subject: [PATCH 2673/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4458feaa1..59b8b8b8e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -382,7 +382,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co break; } } - if ( 0 && flag == 0 && value != 0 ) + if ( flag == 0 && value != 0 ) { if ( coin->electrum == 0 ) { @@ -739,7 +739,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; - //if ( coin->inactive != 0 ) + if ( coin->inactive != 0 ) return(0); if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { From 6cf6360c1315751c398535c046629338a46158f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 11:10:48 +0200 Subject: [PATCH 2674/2732] Test --- iguana/exchanges/LP_swap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 1002517b0..8df54f58d 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -113,8 +113,8 @@ void basilisk_rawtx_purge(struct basilisk_rawtx *rawtx) { if ( rawtx->vins != 0 ) free_json(rawtx->vins); - //if ( rawtx->txbytes != 0 ) - // free(rawtx->txbytes), rawtx->txbytes = 0; + if ( rawtx->txbytes != 0 ) + free(rawtx->txbytes), rawtx->txbytes = 0; } void basilisk_swap_finished(struct basilisk_swap *swap) @@ -831,7 +831,7 @@ void LP_bobloop(void *_swap) } } basilisk_swap_finished(swap); - //free(swap); + free(swap); } else printf("swap timed out\n"); G.LP_pendingswaps--; } From 5472f4ed20716503c51377c18f6bcaa349d8b656 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 11:12:40 +0200 Subject: [PATCH 2675/2732] Test --- iguana/exchanges/LP_swap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 8df54f58d..ba323ae97 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -112,9 +112,9 @@ void basilisk_rawtx_purge(struct basilisk_rawtx *rawtx) { if ( rawtx->vins != 0 ) - free_json(rawtx->vins); - if ( rawtx->txbytes != 0 ) - free(rawtx->txbytes), rawtx->txbytes = 0; + free_json(rawtx->vins), rawtx->vins = 0; + //if ( rawtx->txbytes != 0 ) + // free(rawtx->txbytes), rawtx->txbytes = 0; } void basilisk_swap_finished(struct basilisk_swap *swap) From 36a1ae9fb4f1b45a4464fd03d4b3e43d43447140 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 13:35:51 +0200 Subject: [PATCH 2676/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- iguana/exchanges/LP_statemachine.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 220770d43..ef26d9882 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1206,14 +1206,14 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { -return(calloc(1,len)); +//return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); mp->ptr = calloc(1,len); - //printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); + printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; portable_mutex_lock(&LP_cJSONmutex); @@ -1225,7 +1225,7 @@ return(calloc(1,len)); void LP_free(void *ptr) { static uint32_t lasttime,unknown; -free(ptr); return; +//free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) { @@ -1262,7 +1262,7 @@ free(ptr); return; portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); + printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 1832e2895..593bc3330 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1765,7 +1765,7 @@ void basilisk_swaploop(void *_utxo) else tradebot_pendingadd(swapjson(swap),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.src,dstr(swap->I.req.srcamount)); } printf("%s swap finished statebits %x\n",swap->I.iambob!=0?"BOB":"ALICE",swap->I.statebits); - //basilisk_swap_purge(swap); + basilisk_swap_purge(swap); free(data); } #endif From a30ecba4d7464ab92f62c929781c3aff9ac7bfc1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 13:40:07 +0200 Subject: [PATCH 2677/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ef26d9882..b63b8ecb9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1213,7 +1213,7 @@ void *LP_alloc(uint64_t len) struct LP_memory_list *mp; mp = calloc(1,sizeof(*mp) + len); mp->ptr = calloc(1,len); - printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); + //printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); mp->timestamp = (uint32_t)time(NULL); mp->len = (uint32_t)len; portable_mutex_lock(&LP_cJSONmutex); @@ -1234,10 +1234,10 @@ void LP_free(void *ptr) { total += mp->len; n++; - if ( 0 && now > mp->timestamp+60 ) + if ( now > mp->timestamp+120 ) { lagging++; - if ( now > mp->timestamp+60 ) + if ( now > mp->timestamp+240 ) { portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); @@ -1262,7 +1262,7 @@ void LP_free(void *ptr) portable_mutex_lock(&LP_cJSONmutex); DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); + //printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); free(mp->ptr); free(mp); } else unknown++; // free from source file with #define redirect for alloc that wasnt From c5a41e2cc100941e6d938b817735f5e8862d2050 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 13:48:00 +0200 Subject: [PATCH 2678/2732] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_nativeDEX.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 72c64d04b..c9ef8b70b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,6 +36,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); + printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b63b8ecb9..3af21780f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -768,7 +768,7 @@ void LP_pubkeysloop(void *ctx) } if ( time(NULL) > lasttime+LP_ORDERBOOK_DURATION*0.5 ) { - //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); +printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); lasttime = (uint32_t)time(NULL); } @@ -785,7 +785,7 @@ void LP_privkeysloop(void *ctx) { LP_millistats_update(&LP_privkeysloop_stats); LP_counter += 1000; - //printf("LP_privkeysloop %u\n",LP_counter); +printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); sleep(LP_ORDERBOOK_DURATION * .777); } @@ -801,10 +801,9 @@ void LP_swapsloop(void *ignore) { LP_millistats_update(&LP_swapsloop_stats); LP_counter += 10000; - //printf("LP_swapsloop %u\n",LP_counter); +printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); - //LP_millistats_update(0); sleep(600); } } @@ -837,14 +836,14 @@ void LP_reserved_msgs(void *ignore) if ( num_Reserved_msgs[1] > 0 ) { num_Reserved_msgs[1]--; - //printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); +printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); Reserved_msgs[1][num_Reserved_msgs[1]] = 0; } else if ( num_Reserved_msgs[0] > 0 ) { num_Reserved_msgs[0]--; - //printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); +printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); Reserved_msgs[0][num_Reserved_msgs[0]] = 0; } @@ -1227,14 +1226,14 @@ void LP_free(void *ptr) static uint32_t lasttime,unknown; //free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { total += mp->len; n++; - if ( now > mp->timestamp+120 ) + if ( 0 && now > mp->timestamp+120 ) { lagging++; if ( now > mp->timestamp+240 ) From 8138f553cd7faa610d703a093899479e138535c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 13:51:37 +0200 Subject: [PATCH 2679/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 59b8b8b8e..d94c1c5b9 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -405,7 +405,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co up->SPV = tx->SPV; } char str[65]; - if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) + //if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); From 06b926112bb173cb4525119e07888bfe8cfa7608 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 13:53:13 +0200 Subject: [PATCH 2680/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3af21780f..f0c378bf5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1223,7 +1223,7 @@ void *LP_alloc(uint64_t len) void LP_free(void *ptr) { - static uint32_t lasttime,unknown; + static uint32_t lasttime,unknown; static int64_t lasttotal; //free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) @@ -1246,8 +1246,9 @@ void LP_free(void *ptr) } } } - printf("total %d allocated total %llu/%llu [%llu %llu] %.1f ave %s unknown.%u lagging.%d\n",n,(long long)total,(long long)LP_cjson_allocated,(long long)LP_cjson_total,(long long)LP_cjson_count,(double)LP_cjson_total/LP_cjson_count,mbstr(str,total),unknown,lagging); + printf("[%lld] total %d allocated total %llu/%llu [%llu %llu] %.1f ave %s unknown.%u lagging.%d\n",(long long)(total-lasttotal),n,(long long)total,(long long)LP_cjson_allocated,(long long)LP_cjson_total,(long long)LP_cjson_count,(double)LP_cjson_total/LP_cjson_count,mbstr(str,total),unknown,lagging); lasttime = (uint32_t)time(NULL); + lasttotal = total; } DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { From b977dff87b62f3413a466fcb20453be0e51893e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 14:20:30 +0200 Subject: [PATCH 2681/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 20 +++++++++++++++----- iguana/exchanges/LP_network.c | 10 +++++----- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_peers.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_signatures.c | 8 ++++---- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_statemachine.c | 22 +++++++++++----------- iguana/exchanges/LP_tradebots.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 13 files changed, 47 insertions(+), 37 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c9ef8b70b..3b0734349 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,7 +36,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); - printf("stats_JSON %s\n",method); + //printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f0c378bf5..6725bbf34 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -118,6 +118,16 @@ struct LP_globals struct LP_privkey LP_privkeys[100]; } G; +uint32_t LP_rand() +{ + uint32_t retval; + retval = rand(); + retval = (retval << 7) ^ (retval >> 17) ^ rand(); + retval = (retval << 13) ^ (retval >> 13) ^ rand(); + retval = (retval << 17) ^ (retval >> 7) ^ rand(); + return(retval); +} + #include "LP_network.c" char *activecoins[] = { "BTC", "KMD" }; @@ -130,7 +140,6 @@ char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.25 "51.15.203.171", "51.15.86.136", "51.15.94.249", "51.15.80.18", "51.15.91.40", "51.15.54.2", "51.15.86.31", "51.15.82.29", "51.15.89.155", };//"5.9.253.204" }; // - // stubs void tradebot_swap_balancingtrade(struct basilisk_swap *swap,int32_t iambob) @@ -230,7 +239,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, dup++; else uniq++; portable_mutex_lock(&LP_commandmutex); - if ( (rand() % 10000) == 0 ) + if ( (LP_rand() % 10000) == 0 ) printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); if ( duplicate == 0 ) { @@ -412,7 +421,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 10000) == 0 ) + if ( (LP_rand() % 10000) == 0 ) peer->errors--; else { @@ -896,6 +905,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu } #endif OS_randombytes((void *)&n,sizeof(n)); + srand((uint32_t)n); if ( jobj(argjson,"gui") != 0 ) safecopy(LP_gui,jstr(argjson,"gui"),sizeof(LP_gui)); if ( jobj(argjson,"canbind") == 0 ) @@ -1205,7 +1215,7 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { -//return(calloc(1,len)); +return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; @@ -1224,7 +1234,7 @@ void *LP_alloc(uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; static int64_t lasttotal; -//free(ptr); return; +free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f45f5142d..d1b147bc8 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -183,7 +183,7 @@ bits256 LP_calc_magic(uint8_t *msg,int32_t len) sum += (OS_milliseconds() - millis); nsum += n; counter++; - if ( n > maxn || (rand() % 10000) == 0 ) + if ( n > maxn || (LP_rand() % 10000) == 0 ) { if ( n > maxn ) { @@ -237,7 +237,7 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) break; } if ( i >= sizeof(crcs)/sizeof(*crcs) ) - i = (rand() % (sizeof(crcs)/sizeof(*crcs))); + i = (LP_rand() % (sizeof(crcs)/sizeof(*crcs))); return(i); } else @@ -316,7 +316,7 @@ void queue_loop(void *arg) flag = 0; if ( ptr->sock >= 0 ) { - if ( ptr->notready == 0 || (rand() % ptr->notready) == 0 ) + if ( ptr->notready == 0 || (LP_rand() % ptr->notready) == 0 ) { if ( LP_sockcheck(ptr->sock) > 0 ) { @@ -387,11 +387,11 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 if ( sock0 < 0 && sock1 < 0 ) { if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind) + 1; + peerind = (LP_rand() % maxind) + 1; else peerind = 1; sock0 = LP_peerindsock(&peerind); if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind) + 1; + peerind = (LP_rand() % maxind) + 1; else peerind = 1; sock1 = LP_peerindsock(&peerind); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e1f7bf62e..3ad0fe345 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -52,7 +52,7 @@ double LP_bob_competition(int32_t *counterp,uint64_t aliceid,double price,int32_ firsti = i; } if ( firsti < 0 ) - firsti = (rand() % (sizeof(Bob_competition)/sizeof(*Bob_competition))); + firsti = (LP_rand() % (sizeof(Bob_competition)/sizeof(*Bob_competition))); Bob_competition[firsti].starttime = (uint32_t)time(NULL); Bob_competition[firsti].counter = counter; Bob_competition[firsti].aliceid = aliceid; @@ -252,7 +252,7 @@ int32_t LP_nanobind(void *ctx,char *pairstr) { for (i=0; i<10; i++) { - r = (10000 + (rand() % 50000)) & 0xffff; + r = (10000 + (LP_rand() % 50000)) & 0xffff; if ( LP_fixed_pairport != 0 ) r = LP_fixed_pairport; nanomsg_transportname(0,pairstr,LP_myipaddr,r); @@ -884,7 +884,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } else return(retval); if ( qprice > price ) { - r = (rand() % 100); + r = (LP_rand() % 100); range = (qprice - price); price += (r * range) / 100.; bestprice = LP_bob_competition(&counter,aliceid,price,0); diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index e65d4806a..4e5e9a231 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -235,7 +235,7 @@ uint16_t LP_randpeer(char *destip) numpeers = LP_numpeers(); if ( numpeers > 0 ) { - r = rand() % numpeers; + r = LP_rand() % numpeers; n = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d299b8368..80e056b6a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1070,7 +1070,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - if ( (rand() % 1000) == 0 ) + if ( (LP_rand() % 1000) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->timestamp = (uint32_t)time(NULL); if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2f8a7d5ff..11924e51c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -314,13 +314,13 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; cJSON *LP_assethbla(char *assetid) { char url[1024],*retstr; int32_t n; cJSON *array,*bid=0,*ask=0,*retjson; - sprintf(url,"http://%s:7876/nxt?requestType=getBidOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); + sprintf(url,"http://%s:7876/nxt?requestType=getBidOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[LP_rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { bid = cJSON_Parse(retstr); free(retstr); } - sprintf(url,"http://%s:7876/nxt?requestType=getAskOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); + sprintf(url,"http://%s:7876/nxt?requestType=getAskOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[LP_rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { ask = cJSON_Parse(retstr); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index fee4a1189..0cbcaff3f 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -132,14 +132,14 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) qp->R.quoteid = juint(argjson,"quoteid"); if ( qp->R.requestid == 0 ) { - rid= basilisk_requestid(&qp->R); - //printf("requestid.%u -> %u\n",qp->R.requestid,rid); + rid = basilisk_requestid(&qp->R); + printf("requestid.%u -> %u\n",qp->R.requestid,rid); qp->R.requestid = rid; } if ( qp->R.quoteid == 0 ) { - qid= basilisk_quoteid(&qp->R); - //printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); + qid = basilisk_quoteid(&qp->R); + printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); qp->R.quoteid = qid; } return(0); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index af396cde8..36e6988ca 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -272,7 +272,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) ep = recent_ep; if ( n > 0 ) { - i = (rand() % n); + i = (LP_rand() % n); ep = rbuf[i]; } } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 593bc3330..54d9ddc95 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -186,7 +186,7 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil { if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 10000) == 0 ) + if ( (LP_rand() % 10000) == 0 ) { peer->errors--; if ( peer->errors < LP_MAXPEER_ERRORS ) @@ -195,7 +195,7 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil if ( IAMLP == 0 ) continue; } - if ( now > peer->lastpeers+LP_ORDERBOOK_DURATION*.777 || (rand() % 100000) == 0 ) + if ( now > peer->lastpeers+LP_ORDERBOOK_DURATION*.777 || (LP_rand() % 100000) == 0 ) { if ( strcmp(peer->ipaddr,myipaddr) != 0 ) { @@ -241,7 +241,7 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) { numpeers = LP_numpeers(); - if ( IAMLP != 0 || numpeers < LP_MIN_PEERS || (IAMLP == 0 && (rand() % LP_MAX_PEERS) > numpeers) ) + if ( IAMLP != 0 || numpeers < LP_MIN_PEERS || (IAMLP == 0 && (LP_rand() % LP_MAX_PEERS) > numpeers) ) peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); } if ( peer != 0 ) @@ -395,7 +395,7 @@ void issue_LP_uitem(char *destip,uint16_t destport,char *symbol,char *coinaddr,b ptr = calloc(1,sizeof(*ptr)); ptr->timestamp = (uint32_t)time(NULL); ptr->item = item; - item->cjsonid = rand(); + item->cjsonid = LP_rand(); ptr->cjsonid = item->cjsonid; portable_mutex_lock(&LP_cJSONmutex); DL_APPEND(LP_cJSONlist,ptr); @@ -955,7 +955,7 @@ int32_t _basilisk_rawtx_gen(char *str,uint32_t swapstarted,uint8_t *pubkey33,int { char scriptstr[1024],wifstr[256],coinaddr[64],*signedtx,*rawtxbytes; uint32_t basilisktag; int32_t retval = -1; cJSON *vins,*privkeys,*addresses,*valsobj; struct vin_info *V; init_hexbytes_noT(scriptstr,script,scriptlen); - basilisktag = (uint32_t)rand(); + basilisktag = (uint32_t)LP_rand(); valsobj = cJSON_CreateObject(); jaddstr(valsobj,"coin",rawtx->coin->symbol); jaddstr(valsobj,"spendscript",scriptstr); @@ -1195,7 +1195,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t basilisk_swap_saveupdate(swap); if ( swap->connected == 0 ) basilisk_psockinit(swap,swap->I.iambob != 0); - //if ( (rand() % 30) == 0 ) + //if ( (LP_rand() % 30) == 0 ) printf("E r%u/q%u swapstate.%x otherstate.%x remaining %d\n",swap->I.req.requestid,swap->I.req.quoteid,swap->I.statebits,swap->I.otherstatebits,(int32_t)(swap->I.expiration-time(NULL))); if ( swap->I.iambob != 0 ) { @@ -1369,7 +1369,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t } } } - if ( (rand() % 30) == 0 ) + if ( (LP_rand() % 30) == 0 ) printf("finished swapstate.%x other.%x\n",swap->I.statebits,swap->I.otherstatebits); if ( swap->I.statebits == savestatebits && swap->I.otherstatebits == saveotherbits ) sleep(DEX_SLEEP + (swap->I.iambob == 0)*1); @@ -2792,7 +2792,7 @@ void LP_price_broadcastloop(void *ctx) minprice = LP_pricevol_invert(&basevol,bot->maxprice,bot->totalrelvolume - bot->relsum); printf("simulated trade sell %s/%s minprice %.8f volume %.8f, %.8f %s -> %s price %.8f relvol %.8f\n",bot->rel,bot->base,minprice,basevol,v,bot->base,bot->rel,p,relvol); } - if ( (rand() % 2) == 0 ) + if ( (LP_rand() % 2) == 0 ) { bot->relsum += relvol; bot->basesum += v; @@ -2809,7 +2809,7 @@ void LP_price_broadcastloop(void *ctx) #ifdef FROM_JS int32_t sentbytes,sock,peerind,maxind; if ( (maxind= LP_numpeers()) > 0 ) -peerind = (rand() % maxind) + 1; +peerind = (LP_rand() % maxind) + 1; else peerind = 1; sock = LP_peerindsock(&peerind); if ( sock >= 0 ) @@ -2851,11 +2851,11 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 else { if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind) + 1; + peerind = (LP_rand() % maxind) + 1; else peerind = 1; sock0 = LP_peerindsock(&peerind); if ( (maxind= LP_numpeers()) > 0 ) - peerind = (rand() % maxind) + 1; + peerind = (LP_rand() % maxind) + 1; else peerind = 1; sock1 = LP_peerindsock(&peerind); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 762a5c6bf..ec00553e4 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -324,7 +324,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) printf("try autobuy %s/%s remaining %.8f maxprice %.8f maxrel %.8f\n",bot->base,bot->rel,remaining,bot->maxprice,maxrel); if ( maxrel < remaining ) remaining = maxrel; - tradeid = rand(); + tradeid = LP_rand(); for (i=1; i<=maxiters; i++) { if ( remaining < 0.001 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index d94c1c5b9..59b8b8b8e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -405,7 +405,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co up->SPV = tx->SPV; } char str[65]; - //if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) + if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2498d4da4..fc05779cb 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -848,7 +848,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) else if ( IAMLP == 0 || coin->inactive == 0 ) { //printf("from updates %s\n",coin->symbol); - if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (rand() % 10) == 0 ) + if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (LP_rand() % 10) == 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } } From 146ebb01bd470b5644732c0c9e3256d2fc6e807d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 14:22:17 +0200 Subject: [PATCH 2682/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6725bbf34..9ba577394 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -777,7 +777,7 @@ void LP_pubkeysloop(void *ctx) } if ( time(NULL) > lasttime+LP_ORDERBOOK_DURATION*0.5 ) { -printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); +//printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); lasttime = (uint32_t)time(NULL); } @@ -794,7 +794,7 @@ void LP_privkeysloop(void *ctx) { LP_millistats_update(&LP_privkeysloop_stats); LP_counter += 1000; -printf("LP_privkeysloop %u\n",LP_counter); +//printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); sleep(LP_ORDERBOOK_DURATION * .777); } @@ -810,7 +810,7 @@ void LP_swapsloop(void *ignore) { LP_millistats_update(&LP_swapsloop_stats); LP_counter += 10000; -printf("LP_swapsloop %u\n",LP_counter); +//printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); sleep(600); @@ -845,14 +845,14 @@ void LP_reserved_msgs(void *ignore) if ( num_Reserved_msgs[1] > 0 ) { num_Reserved_msgs[1]--; -printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); +//printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); Reserved_msgs[1][num_Reserved_msgs[1]] = 0; } else if ( num_Reserved_msgs[0] > 0 ) { num_Reserved_msgs[0]--; -printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); +//printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); Reserved_msgs[0][num_Reserved_msgs[0]] = 0; } From 2054f886dcc1c7c11876b7f757596f5212243e38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 14:23:41 +0200 Subject: [PATCH 2683/2732] Test --- iguana/exchanges/LP_signatures.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0cbcaff3f..651e9c0e8 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -133,13 +133,15 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) if ( qp->R.requestid == 0 ) { rid = basilisk_requestid(&qp->R); - printf("requestid.%u -> %u\n",qp->R.requestid,rid); + if ( qp->R.requestid != 0 && qp->R.requestid != rid ) + printf("requestid.%u -> %u\n",qp->R.requestid,rid); qp->R.requestid = rid; } if ( qp->R.quoteid == 0 ) { qid = basilisk_quoteid(&qp->R); - printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); + if ( qp->R.quoteid != 0 && qp->R.quoteid != qid ) + printf("quoteid.%u -> %u\n",qp->R.quoteid,qid); qp->R.quoteid = qid; } return(0); From 0dff7d0e183a7c849029c005e6c2480b9567c46d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 14:45:37 +0200 Subject: [PATCH 2684/2732] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- iguana/exchanges/LP_swap.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 3ad0fe345..2711f7f42 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -572,6 +572,8 @@ char *LP_connectedalice(cJSON *argjson) // alice return(clonestr("{\"result\",\"update stats\"}")); } printf("CONNECTED.(%s) numpending.%d tradeid.%u requestid.%u quoteid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid,Q.R.requestid,Q.R.quoteid); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); + printf("calculated requestid.%u quoteid.%u\n",Q.R.requestid,Q.R.quoteid); if ( LP_pendingswap(Q.R.requestid,Q.R.quoteid) > 0 ) { printf("requestid.%u quoteid.%u is already in progres\n",Q.R.requestid,Q.R.quoteid); @@ -622,7 +624,6 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( bits256_nonz(Q.privkey) != 0 )//&& Q.quotetime >= Q.timestamp-3 ) { retjson = cJSON_CreateObject(); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); if ( (swap= LP_swapinit(0,0,Q.privkey,&Q.R,&Q)) == 0 ) { jaddstr(retjson,"error","couldnt swapinit"); @@ -771,7 +772,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("LP_tradecommand: received %12s aliceid.%22llu %5s/%-5s %12.8f -> %12.8f price %12.8f\n",method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); + printf("(%u-%u): received %12s aliceid.%22llu %5s/%-5s %12.8f -> %12.8f price %12.8f\n",Q.R.requestid,Q.R.quoteid,method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index ba323ae97..23f8d0a39 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1189,7 +1189,7 @@ struct basilisk_swap *LP_swapinit(int32_t iambob,int32_t optionduration,bits256 G.LP_skipstatus[G.LP_numskips] = ((uint64_t)rp->requestid << 32) | rp->quoteid; if ( G.LP_numskips < sizeof(G.LP_skipstatus)/sizeof(*G.LP_skipstatus) ) G.LP_numskips++; - printf("basilisk_thread_start request.%u iambob.%d (%s/%s) quoteid.%u\n",rp->requestid,iambob,rp->src,rp->dest,rp->quoteid); + printf("LP_swapinit request.%u iambob.%d (%s/%s) quoteid.%u\n",rp->requestid,iambob,rp->src,rp->dest,rp->quoteid); bitcoin_pubkey33(swap->ctx,pubkey33,privkey); pubkey25519 = curve25519(privkey,curve25519_basepoint9()); swap->persistent_pubkey = pubkey25519; From 14cafd3da616ea973f415ef4fbd0c441d75db176 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:04:35 +0200 Subject: [PATCH 2685/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_ordermatch.c | 8 +------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9ba577394..2159505ec 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -888,8 +888,9 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha 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; 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(); - printf("Marketmaker %s.%s %s\n",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER); + 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",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER); + printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version))); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2711f7f42..d0641e578 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -587,12 +587,6 @@ char *LP_connectedalice(cJSON *argjson) // alice LP_aliceid(Q.tradeid,Q.aliceid,"error2",0,0); return(clonestr("{\"error\":\"cant find autxo\"}")); } - /*if ( autxo->S.swap != 0 ) - { - printf("ignore duplicate swap\n"); - LP_aliceid(Q.tradeid,Q.aliceid,"error3",0,0); - return(clonestr("{\"error\":\"ignore duplicate swap\"}")); - }*/ LP_aliceid(Q.tradeid,Q.aliceid,"connected",Q.R.requestid,Q.R.quoteid); butxo = &B; memset(butxo,0,sizeof(*butxo)); @@ -772,7 +766,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, LP_quoteparse(&Q,argjson); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); LP_tradecommand_log(argjson); - printf("(%u-%u): received %12s aliceid.%22llu %5s/%-5s %12.8f -> %12.8f price %12.8f\n",Q.R.requestid,Q.R.quoteid,method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); + printf("(%-10u %10u) %12s aliceid.%22llu %5s/%-5s %12.8f -> %12.8f price %12.8f\n",Q.R.requestid,Q.R.quoteid,method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis); retval = 1; autxo = &A; butxo = &B; From 48464283c7d754cb5f082d300a29f83f515692ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:10:56 +0200 Subject: [PATCH 2686/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_swap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2159505ec..00eabb24a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -889,7 +889,7 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha 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(); - sprintf(version,"Marketmaker %s.%s %s",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER); + sprintf(version,"Marketmaker %s.%s %s rsize.%ld",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER,sizeof(struct basilisk_request)); printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version))); LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 23f8d0a39..e1c80d505 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1127,7 +1127,7 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.aliceconfirms = swap->I.alicemaxconfirms; swap->I.bobconfirms *= !swap->I.bobistrusted; swap->I.aliceconfirms *= !swap->I.aliceistrusted; - printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,bobcoin->taddr,alicecoin->taddr); + printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< r.%u q.%u, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,swap->I.req.requestid,swap->I.req.quoteid,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,bobcoin->taddr,alicecoin->taddr); if ( swap->I.iambob != 0 ) { basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,bobcoin,0,0,LP_DEXFEE(swap->I.bobsatoshis) + 0*bobcoin->txfee,0,0,jumblrflag); From 05c5e9078cf7350f505950dba74a71d2eb58b8f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:30:17 +0200 Subject: [PATCH 2687/2732] Test --- iguana/exchanges/LP_signatures.c | 1 + iguana/exchanges/LP_socket.c | 5 ++++- iguana/exchanges/LP_utxos.c | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 651e9c0e8..0d013b68e 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -616,6 +616,7 @@ char *LP_notify_recv(cJSON *argjson) void LP_smartutxos_push(struct iguana_info *coin) { uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; cJSON *array,*item,*req; + return; if ( coin->smartaddr[0] == 0 ) return; //LP_notify_pubkeys(coin->ctx,LP_mypubsock); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 36e6988ca..723a61a92 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -602,7 +602,10 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON printf("%s.%d u.%u/%d t.%ld %s LISTUNSPENT.(%d)\n",coin->symbol,height,ap->unspenttime,ap->unspentheight,time(NULL),addr,(int32_t)strlen(jprint(retjson,0))); updatedflag = 0; if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 ) - LP_postutxos(coin->symbol,addr), updatedflag = 1; + { + //LP_postutxos(coin->symbol,addr); + updatedflag = 1; + } if ( strcmp(addr,coin->smartaddr) == 0 ) { retstr = jprint(retjson,0); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fc05779cb..90e0aafc8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -700,7 +700,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri } } free_json(array); - if ( flag != 0 ) + if ( 0 && flag != 0 ) LP_postutxos(coin->symbol,coin->smartaddr); } if ( values != 0 ) @@ -849,7 +849,9 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) { //printf("from updates %s\n",coin->symbol); if ( LP_privkey_init(pubsock,coin,G.LP_privkey,G.LP_mypub25519) == 0 && (LP_rand() % 10) == 0 ) - LP_postutxos(coin->symbol,coin->smartaddr); + { + //LP_postutxos(coin->symbol,coin->smartaddr); + } } } } From 7ba7a49601e62c8e48a4f78d8af653c35e3f10ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:37:42 +0200 Subject: [PATCH 2688/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3b0734349..9155291fb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,7 +36,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); - //printf("stats_JSON %s\n",method); +printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 00eabb24a..f73c9474f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1216,7 +1216,7 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { -return(calloc(1,len)); +//return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; @@ -1235,9 +1235,9 @@ return(calloc(1,len)); void LP_free(void *ptr) { static uint32_t lasttime,unknown; static int64_t lasttotal; -free(ptr); return; +//free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+1 ) { n = lagging = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) From e8b2923ffcbb893601023034bea777778173804e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:49:52 +0200 Subject: [PATCH 2689/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_signatures.c | 2 +- iguana/exchanges/stats.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f73c9474f..681f8a907 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1216,7 +1216,7 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { -//return(calloc(1,len)); +return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; @@ -1235,7 +1235,7 @@ void *LP_alloc(uint64_t len) void LP_free(void *ptr) { static uint32_t lasttime,unknown; static int64_t lasttotal; -//free(ptr); return; +free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+1 ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0d013b68e..647daa1ba 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -616,7 +616,7 @@ char *LP_notify_recv(cJSON *argjson) void LP_smartutxos_push(struct iguana_info *coin) { uint64_t value; bits256 zero,txid; int32_t i,vout,height,n; cJSON *array,*item,*req; - return; +return; if ( coin->smartaddr[0] == 0 ) return; //LP_notify_pubkeys(coin->ctx,LP_mypubsock); diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 179612c4e..681da52d2 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -32,7 +32,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char char *stats_validmethods[] = { - "psock", "getprices", "listunspent", "notify", "getpeers", "uitem", // from issue_ + "psock", "getprices", "notify", "getpeers", // from issue_ "uitem", "listunspent", "orderbook", "help", "getcoins", "pricearray", "balance", "tradestatus" }; From b89adb55f6634f2e6f735efb2798e4fe5d1b397e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:54:06 +0200 Subject: [PATCH 2690/2732] Test --- iguana/exchanges/LP_commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9155291fb..53ff69f19 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,6 +36,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); + if ( method != 0 && strcmp(method,"uitem") == 0 ) + return(0); printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { From 14b6e3acc7f0894cf2ec3157d9dba8c15a6e35e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 15:57:39 +0200 Subject: [PATCH 2691/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_signatures.c | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 53ff69f19..0ec77c466 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,7 +36,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); - if ( method != 0 && strcmp(method,"uitem") == 0 ) + if ( method != 0 && (strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0) ) return(0); printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 681f8a907..30e1d9753 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1043,7 +1043,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 647daa1ba..0008ee1b5 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -330,6 +330,7 @@ int32_t LP_utxos_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,uint8_t *pub void LP_postutxos(char *symbol,char *coinaddr) { bits256 zero; uint32_t timestamp; bits256 utxoshash; char pubsecpstr[67]; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); +return; if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { //printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr); @@ -362,6 +363,7 @@ struct LP_utxos_qitem { struct queueitem DL; cJSON *argjson; }; char *LP_postutxos_recv(cJSON *argjson) { struct LP_utxos_qitem *uitem; struct iguana_info *coin; char *coinaddr,*symbol; bits256 utxoshash,pubkey; cJSON *obj; struct LP_pubkeyinfo *pubp; +printf("LP_postutxos_recv deprecated\n"); pubkey = jbits256(argjson,"pubkey"); pubp = LP_pubkeyfind(pubkey); if ( pubp != 0 && pubp->numerrors > LP_MAXPUBKEY_ERRORS ) @@ -652,6 +654,7 @@ return; char *LP_uitem_recv(cJSON *argjson) { bits256 txid; int32_t vout,height; uint64_t value; struct iguana_info *coin; char *coinaddr,*symbol; +printf("LP_uitem_recv deprecated\n"); txid = jbits256(argjson,"txid"); vout = jint(argjson,"vout"); height = jint(argjson,"ht"); From e2e6c5091986361c155870bb6f384a8b350078c2 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 16 Nov 2017 17:10:45 +0300 Subject: [PATCH 2692/2732] fix structure alignment issue on Windows (error LP_sendwait pubkeys) structure alignment on Windows should be same as on Unix, when you have to start compiled marketmaker first line should be: Marketmaker 0.1 15000 rsize.248 451196191 rsize = 248. otherwise you will get this error on every swap: waitfor timedout didnt get pubkeys error LP_sendwait pubkeys finish swap.0000008AC93A3100 --- marketmaker.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/marketmaker.vcxproj b/marketmaker.vcxproj index 0dbe62279..7d3862568 100644 --- a/marketmaker.vcxproj +++ b/marketmaker.vcxproj @@ -87,7 +87,7 @@ Level2 Disabled _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_DEBUG;_CONSOLE;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) - 1Byte + 8Bytes .\iguana;%(AdditionalIncludeDirectories) @@ -104,7 +104,7 @@ Level3 Disabled _DEBUG;_CONSOLE;NATIVE_WINDOWS;WIN32;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) - 1Byte + 8Bytes Console @@ -122,7 +122,7 @@ true true _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) - 1Byte + 8Bytes MachineX86 @@ -142,7 +142,7 @@ true true WIN64;_WIN64;_CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;_CONSOLE;NDEBUG;IGUANA_LOG2PACKETSIZE=20;IGUANA_MAXPACKETSIZE=1572864;%(PreprocessorDefinitions) - 1Byte + 8Bytes MultiThreaded From 1e10b2c083800e7f9338f89641ef9eac13ea968e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 16:14:09 +0200 Subject: [PATCH 2693/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0ec77c466..e5f232d4b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,7 +36,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); - if ( method != 0 && (strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0) ) + if ( method != 0 && (strcmp(method,"addr_unspents") == 0 || strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0) ) return(0); printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d0641e578..9dbb4e210 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1046,7 +1046,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i { bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); asatoshis = autxo->S.satoshis; - LP_listunspent_query(base,coinaddr); + //LP_listunspent_query(base,coinaddr); for (j=0; jpubkey,gui)) != 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 80e056b6a..ade6b75f5 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -818,7 +818,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { //printf("bid ping %s %s\n",rel,bids[i]->coinaddr); LP_address(relcoin,bids[i]->coinaddr); - if ( relcoin->electrum == 0 ) + if ( 0 && relcoin->electrum == 0 ) { LP_listunspent_issue(rel,bids[i]->coinaddr,0); //else if ( (tmpjson= LP_listunspent(rel,bids[i]->coinaddr)) != 0 ) @@ -842,7 +842,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) { //printf("ask ping %s %s\n",base,asks[i]->coinaddr); LP_address(basecoin,asks[i]->coinaddr); - if ( basecoin->electrum == 0 ) + if ( 0 && basecoin->electrum == 0 ) { LP_listunspent_issue(base,asks[i]->coinaddr,0); //else if ( (tmpjson= LP_listunspent(base,asks[i]->coinaddr)) != 0 ) From f1dba700fc3a07d57f6b1ca12600291d8fe7590e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 16:21:53 +0200 Subject: [PATCH 2694/2732] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e5f232d4b..d2f72406d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -38,7 +38,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r method = jstr(argjson,"method"); if ( method != 0 && (strcmp(method,"addr_unspents") == 0 || strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0) ) return(0); -printf("stats_JSON %s\n",method); +//printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From 597f9cdafceb291693526750fb0022cfe3c740f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 16:32:30 +0200 Subject: [PATCH 2695/2732] Test --- iguana/exchanges/LP_ordermatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9dbb4e210..f28c779bd 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -126,7 +126,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str { if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { - printf("bob not eligible %s (%.8f %.8f)\n",jprint(LP_quotejson(qp),1),dstr(srcvalue),dstr(srcvalue2)); + //printf("bob not eligible %s (%.8f %.8f)\n",jprint(LP_quotejson(qp),1),dstr(srcvalue),dstr(srcvalue2)); return(-2); } if ( (txout= LP_gettxout(qp->srccoin,qp->coinaddr,qp->txid,qp->vout)) != 0 ) @@ -159,7 +159,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { //alice not eligible 0.36893923 -> dest 0.55020000 1.49130251 (0.61732249 0.00104324) 14b8b74808d2d34a70e5eddd1cad47d855858f8b23cac802576d4d37b5f8af8f/v1 abec6e76169bcb738235ca67fab02cc55390f39e422aa71f1badf8747c290cc4/v1 - char str[65],str2[65]; printf("alice not eligible %.8f -> dest %.8f %.8f (%.8f %.8f) %s/v%d %s/v%d\n",dstr(qp->satoshis),dstr(qp->destsatoshis),(double)qp->destsatoshis/qp->satoshis,dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); + //char str[65],str2[65]; printf("alice not eligible %.8f -> dest %.8f %.8f (%.8f %.8f) %s/v%d %s/v%d\n",dstr(qp->satoshis),dstr(qp->destsatoshis),(double)qp->destsatoshis/qp->satoshis,dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(-3); } if ( (txout= LP_gettxout(qp->destcoin,qp->destaddr,qp->desttxid,qp->destvout)) != 0 ) @@ -321,7 +321,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a } if ( replacei >= 0 ) { - printf("REPLACE bestdist %.8f height %d with dist %.8f height %d\n",dstr(bestdist),bestup->U.height,dstr(utxos[replacei]->U.value - targetval),utxos[replacei]->U.height); + //printf("REPLACE bestdist %.8f height %d with dist %.8f height %d\n",dstr(bestdist),bestup->U.height,dstr(utxos[replacei]->U.value - targetval),utxos[replacei]->U.height); return(replacei); } } @@ -396,7 +396,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb { if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) { - if ( 1 ) + if ( 0 ) { int32_t i; for (i=0; i Date: Thu, 16 Nov 2017 17:32:03 +0200 Subject: [PATCH 2696/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 72f99d81f..7ccde2a10 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "15000" +#define LP_BUILD_NUMBER "15096" #ifdef FROM_JS #include diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 59b8b8b8e..90a6d016e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -999,7 +999,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol strcpy(destaddr,destaddr2); if ( coin != 0 ) { - if ( coin->electrum != 0 ) + /*if ( coin->electrum != 0 ) { if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) { @@ -1022,7 +1022,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol return(0); } } - else + else*/ { if ( (txobj= LP_gettxout(coin->symbol,destaddr,txid,vout)) == 0 ) return(0); From 4b8b1553227da5c9cd0a4827a4c5134185c6e98a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 17:48:46 +0200 Subject: [PATCH 2697/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f28c779bd..0d1590bfc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1126,6 +1126,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel memset(pubkeys,0,sizeof(pubkeys)); LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume; + LP_address_utxo_reset(relcoin); if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); //printf("bestfit selected alice (%.8f %.8f) for %.8f sats %.8f\n",dstr(autxo->payment.value),dstr(autxo->fee.value),dstr(destsatoshis),dstr(autxo->S.satoshis)); From 5c15665ca64091e9ec5e30f4836a6e79c73bb98f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 17:56:47 +0200 Subject: [PATCH 2698/2732] Test --- iguana/exchanges/LP_signatures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0008ee1b5..e729421ad 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -704,7 +704,7 @@ void LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_ jaddnum(reqjson,"timestamp",time(NULL)); msg = jprint(reqjson,1); msg2 = clonestr(msg); - //printf("QUERY.(%s)\n",msg); + printf("QUERY.(%s)\n",msg); memset(&zero,0,sizeof(zero)); portable_mutex_lock(&LP_reservedmutex); if ( num_Reserved_msgs[1] < sizeof(Reserved_msgs[1])/sizeof(*Reserved_msgs[1])-2 ) From 380c7d0ec24d71c982074dd8b11f16860df77f8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:01:04 +0200 Subject: [PATCH 2699/2732] Test --- iguana/exchanges/LP_utxo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 90a6d016e..21e89c92a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -405,7 +405,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co up->SPV = tx->SPV; } char str[65]; - if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) + if ( strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); @@ -464,7 +464,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); } - //printf("added %d from listunspents\n",n); + printf("added %d from listunspents\n",n); } free_json(array); } From 6c24e6c05656cbb5e112906f9d7c3fc2ea0f2592 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:06:18 +0200 Subject: [PATCH 2700/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0d1590bfc..48fea4b1f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -791,6 +791,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, } if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) { + printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { printf("reserved quote validate error %.0f\n",qprice); @@ -807,7 +808,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } LP_aliceid(Q.tradeid,Q.aliceid,"reserved",0,0); - //printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (retstr= LP_quotereceived(argjson)) != 0 ) free(retstr); LP_reserved(ctx,myipaddr,pubsock,&Q); From da4fe5720ad21b6b4abc89da7fcc04773524f782 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:12:07 +0200 Subject: [PATCH 2701/2732] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 48fea4b1f..c00ef313a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -532,9 +532,9 @@ void LP_alicequery_clear() Alice_expiration = 0; } -int32_t LP_alice_eligible() +int32_t LP_alice_eligible(uint32_t quotetime) { - if ( Alice_expiration != 0 && time(NULL) > Alice_expiration ) + if ( Alice_expiration != 0 && quotetime > Alice_expiration ) { printf("time expired for Alice_request\n"); LP_alicequery_clear(); @@ -545,7 +545,7 @@ int32_t LP_alice_eligible() void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) { double price=0.,maxprice = LP_Alicemaxprice; - if ( LP_alice_eligible() > 0 && LP_quotecmp(qp,&LP_Alicequery) == 0 ) + if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) @@ -555,7 +555,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo printf("send CONNECT\n"); LP_query(ctx,myipaddr,mypubsock,"connect",qp); } else printf("LP_reserved price %.8f vs maxprice %.8f\n",price,maxprice*1.005); - } else printf("probably a timeout, reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(),price,maxprice); + } else printf("probably a timeout, reject reserved due to not eligible.%d or mismatched quote price %.8f vs maxprice %.8f\n",LP_alice_eligible(qp->quotetime),price,maxprice); } char *LP_connectedalice(cJSON *argjson) // alice @@ -789,7 +789,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } else printf("got reserved response from destpubkey %s\n",bits256_str(str,Q.srchash)); } - if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && LP_alice_eligible() > 0 ) + if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 && Q.quotetime > time(NULL)-20 && LP_alice_eligible(Q.quotetime) > 0 ) { printf("alice %s received RESERVED.(%s)\n",bits256_str(str,G.LP_mypub25519),jprint(argjson,0)); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) From dc259fe34f9894d027d37d346ead41597beaa8ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:13:25 +0200 Subject: [PATCH 2702/2732] Test --- iguana/exchanges/LP_utxo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 21e89c92a..e9ff90d3a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -405,7 +405,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co up->SPV = tx->SPV; } char str[65]; - if ( strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) + if ( 0 && strcmp(coin->smartaddr,coinaddr) == 0 && strcmp("KMD",coin->symbol) == 0 ) printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); portable_mutex_lock(&coin->addrmutex); DL_APPEND(ap->utxos,up); From 77ffa9bfaa3b64cce3abaefc7fe79da8617cea1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:22:41 +0200 Subject: [PATCH 2703/2732] Test --- crypto777/cJSON.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 901e6fc98..54df964f5 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -56,8 +56,8 @@ static int32_t cJSON_strcasecmp(const char *s1,const char *s2) void *LP_alloc(uint64_t len); void LP_free(void *ptr); -static void *(*cJSON_malloc)(size_t sz) = (void *)LP_alloc; -static void (*cJSON_free)(void *ptr) = LP_free; +static void *(*cJSON_malloc)(size_t sz) = (void *)malloc;//LP_alloc; +static void (*cJSON_free)(void *ptr) = free;//LP_free; static void *cJSON_mallocstr(int32_t len) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 30e1d9753..f73c9474f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1043,7 +1043,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching LP_reserved_msgs for (%s)\n",myipaddr); exit(-1); } - if ( 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)utxosQ_loop,(void *)myipaddr) != 0 ) { printf("error launching utxosQ_loop for (%s)\n",myipaddr); exit(-1); @@ -1216,7 +1216,7 @@ int32_t zeroval() { return(0); } void *LP_alloc(uint64_t len) { -return(calloc(1,len)); +//return(calloc(1,len)); LP_cjson_allocated += len; LP_cjson_total += len; LP_cjson_count++; @@ -1235,7 +1235,7 @@ return(calloc(1,len)); void LP_free(void *ptr) { static uint32_t lasttime,unknown; static int64_t lasttotal; -free(ptr); return; +//free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; if ( (now= (uint32_t)time(NULL)) > lasttime+1 ) { From 5d0933752975bcc44ae8297761e755b57247bcfd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:28:46 +0200 Subject: [PATCH 2704/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c00ef313a..fb294d2dc 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -505,7 +505,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q qp->tradeid = tradeid; LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout, LP_Alicedestpubkey = destpubkey; - char str[65]; printf("LP_trade %s/%s %.8f vol %.8f dest.(%s)\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis),bits256_str(str,LP_Alicedestpubkey)); + char str[65]; printf("LP_trade %s/%s %.8f vol %.8f dest.(%s) maxprice %.8f\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis),bits256_str(str,LP_Alicedestpubkey),maxprice); return(LP_recent_swaps(0)); } @@ -778,7 +778,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"reserved") == 0 ) { bestprice = LP_bob_competition(&counter,aliceid,qprice,1); - //printf("aliceid.%llu price %.8f -> bestprice %.8f\n",(long long)aliceid,qprice,bestprice); + printf("aliceid.%llu price %.8f -> bestprice %.8f Alice max %.8f\n",(long long)aliceid,qprice,bestprice,LP_Alicemaxprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) From d00e0b0e8be5264babf39084d0cc165efc74f799 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:32:07 +0200 Subject: [PATCH 2705/2732] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fb294d2dc..a8d8f98c8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -778,7 +778,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"reserved") == 0 ) { bestprice = LP_bob_competition(&counter,aliceid,qprice,1); - printf("aliceid.%llu price %.8f -> bestprice %.8f Alice max %.8f\n",(long long)aliceid,qprice,bestprice,LP_Alicemaxprice); + printf("%s lag %ld: aliceid.%llu price %.8f -> bestprice %.8f Alice max %.8f\n",jprint(argjson,0),Q.quotetime - (time(NULL)-20),(long long)aliceid,qprice,bestprice,LP_Alicemaxprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) From f3794fe375cff809f3d251e5546b4e875886aaa3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:34:14 +0200 Subject: [PATCH 2706/2732] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a8d8f98c8..0927b5222 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -904,6 +904,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, Q.txid2 = butxo->deposit.txid; Q.vout2 = butxo->deposit.vout; Q.satoshis = butxo->S.satoshis; + Q.quotetime = (uint32_t)time(NULL); printf("found %.8f -> %.8f newprice %.8f vs ask %.8f += %.8f qprice %.8f\n",dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis,ask,price,qprice); } else From 271ef52511e436f219dc12b0a53a3c3ad2d1252c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:34:41 +0200 Subject: [PATCH 2707/2732] Test --- iguana/exchanges/LP_include.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7ccde2a10..e1a8c933d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -24,6 +24,8 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" #define LP_BUILD_NUMBER "15096" +#define LP_BARTERDEX_VERSION 2 +#define LP_MAGICBITS 8 #ifdef FROM_JS #include @@ -38,8 +40,6 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #endif //#define LP_STRICTPEERS -#define LP_BARTERDEX_VERSION 1 -#define LP_MAGICBITS 8 #define LP_MAXVINS 64 #define LP_HTTP_TIMEOUT 3 // 1 is too small due to edge cases of time(NULL) From 367b9b0dfa37cdae981204509bfd666f3183c8df Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:35:21 +0200 Subject: [PATCH 2708/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e1a8c933d..c728dee1f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -180,7 +180,7 @@ struct basilisk_request int64_t srcamount,unused; // 16 to 31 bits256 srchash; // 32 to 63 bits256 desthash; - char src[65],dest[65]; + char src[68],dest[68]; uint64_t destamount; int32_t optionhours,DEXselector; }; From 05e76ee08b8547895ed5e54a5a8cf626c461101e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:36:55 +0200 Subject: [PATCH 2709/2732] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d1b147bc8..5449dc7d7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -204,8 +204,8 @@ int32_t LP_magic_check(uint8_t *msg,int32_t recvlen,char *remoteaddr) vcalc_sha256(0,hash.bytes,msg,recvlen); memcpy(magic.bytes,&msg[recvlen],sizeof(magic)); val = _LP_magic_check(hash,magic); - if ( val != LP_BARTERDEX_VERSION ) - printf("magicval = %x from %s\n",val,remoteaddr); + //if ( val != LP_BARTERDEX_VERSION ) + // printf("magicval = %x from %s\n",val,remoteaddr); return(val == LP_BARTERDEX_VERSION); } return(-1); From ff2c4f62256a7526086ee4b225fb8984687aff21 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:41:38 +0200 Subject: [PATCH 2710/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c728dee1f..f66fcc9c1 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -24,7 +24,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" #define LP_BUILD_NUMBER "15096" -#define LP_BARTERDEX_VERSION 2 +#define LP_BARTERDEX_VERSION 1 #define LP_MAGICBITS 8 #ifdef FROM_JS diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 5449dc7d7..d1b147bc8 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -204,8 +204,8 @@ int32_t LP_magic_check(uint8_t *msg,int32_t recvlen,char *remoteaddr) vcalc_sha256(0,hash.bytes,msg,recvlen); memcpy(magic.bytes,&msg[recvlen],sizeof(magic)); val = _LP_magic_check(hash,magic); - //if ( val != LP_BARTERDEX_VERSION ) - // printf("magicval = %x from %s\n",val,remoteaddr); + if ( val != LP_BARTERDEX_VERSION ) + printf("magicval = %x from %s\n",val,remoteaddr); return(val == LP_BARTERDEX_VERSION); } return(-1); From 070cc756eccb63a296fc4fa14d88eeab2a6b3cd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 18:55:33 +0200 Subject: [PATCH 2711/2732] Test --- iguana/exchanges/LP_ordermatch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0927b5222..6ae82acf0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -778,7 +778,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, if ( strcmp(method,"reserved") == 0 ) { bestprice = LP_bob_competition(&counter,aliceid,qprice,1); - printf("%s lag %ld: aliceid.%llu price %.8f -> bestprice %.8f Alice max %.8f\n",jprint(argjson,0),Q.quotetime - (time(NULL)-20),(long long)aliceid,qprice,bestprice,LP_Alicemaxprice); + //printf("%s lag %ld: aliceid.%llu price %.8f -> bestprice %.8f Alice max %.8f\n",jprint(argjson,0),Q.quotetime - (time(NULL)-20),(long long)aliceid,qprice,bestprice,LP_Alicemaxprice); if ( LP_Alicemaxprice == 0. ) return(retval); if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) @@ -948,9 +948,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, retjson = LP_quotejson(&Q); LP_unavailableset(Q.txid,Q.vout,Q.timestamp + LP_RESERVETIME,Q.desthash); LP_unavailableset(Q.txid2,Q.vout2,Q.timestamp + LP_RESERVETIME,Q.desthash); + if ( Q.quotetime == 0 ) + Q.quotetime = (uint32_t)time(NULL); jaddnum(retjson,"quotetime",Q.quotetime); jaddnum(retjson,"pending",Q.timestamp + LP_RESERVETIME); - jaddbits256(retjson,"desthash",Q.desthash); + //jaddbits256(retjson,"desthash",Q.desthash); jaddstr(retjson,"method","reserved"); msg = jprint(retjson,0); printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",Q.timestamp + LP_RESERVETIME,qprice,ask,msg); From eb3d5667eded61cd05aa66b33c24791680549a3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 19:03:47 +0200 Subject: [PATCH 2712/2732] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6ae82acf0..435e32cb1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -502,7 +502,8 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q memset(qp->txid.bytes,0,sizeof(qp->txid)); qp->txid2 = qp->txid; qp->aliceid = LP_aliceid_calc(qp->desttxid,qp->destvout,qp->feetxid,qp->feevout); - qp->tradeid = tradeid; + if ( (qp->tradeid= tradeid) == 0 ) + qp->tradeid = LP_rand(); LP_query(ctx,myipaddr,mypubsock,"request",qp); LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout, LP_Alicedestpubkey = destpubkey; char str[65]; printf("LP_trade %s/%s %.8f vol %.8f dest.(%s) maxprice %.8f\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis),bits256_str(str,LP_Alicedestpubkey),maxprice); From 1b9d12dd71075c0e859a609edf9aeb9b4d89705f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 19:40:03 +0200 Subject: [PATCH 2713/2732] Test --- iguana/exchanges/LP_ordermatch.c | 32 +++++++++++++++++++------------- iguana/exchanges/LP_tradebots.c | 2 +- iguana/exchanges/LP_utxo.c | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 435e32cb1..60de857a8 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -18,7 +18,7 @@ // LP_ordermatch.c // marketmaker // -struct LP_quoteinfo LP_Alicequery; +struct LP_quoteinfo LP_Alicequery,LP_Alicereserved; double LP_Alicemaxprice; bits256 LP_Alicedestpubkey; uint32_t Alice_expiration; @@ -510,7 +510,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q return(LP_recent_swaps(0)); } -int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) +int32_t LP_quotecmp(int32_t strictflag,struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) { if ( bits256_nonz(LP_Alicedestpubkey) != 0 ) { @@ -520,9 +520,13 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) return(-1); } else printf("dont reject quote from destpubkey\n"); } - if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) //bits256_cmp(qp->srchash,qp2->srchash) == 0 && - return(0); - else return(-1); + if ( bits256_cmp(qp->desthash,qp2->desthash) == 0 && strcmp(qp->srccoin,qp2->srccoin) == 0 && strcmp(qp->destcoin,qp2->destcoin) == 0 && bits256_cmp(qp->desttxid,qp2->desttxid) == 0 && qp->destvout == qp2->destvout && bits256_cmp(qp->feetxid,qp2->feetxid) == 0 && qp->feevout == qp2->feevout && qp->destsatoshis == qp2->destsatoshis && qp->txfee >= qp2->txfee && qp->desttxfee == qp2->desttxfee ) + { + if ( strictflag == 0 || (qp->aliceid == qp2->aliceid && qp->R.requestid == qp2->R.requestid && qp->R.quoteid == qp2->R.quoteid && qp->vout == qp2->vout && qp->vout2 == qp2->vout2 && qp->satoshis == qp2->satoshis && bits256_cmp(qp->txid,qp2->txid) == 0 && bits256_cmp(qp->txid2,qp2->txid2) == 0 && bits256_cmp(qp->srchash,qp2->srchash) == 0) ) + return(0); + else printf("strict compare failure\n"); + } + return(-1); } void LP_alicequery_clear() @@ -546,12 +550,13 @@ int32_t LP_alice_eligible(uint32_t quotetime) void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) { double price=0.,maxprice = LP_Alicemaxprice; - if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) + if ( LP_quotecmp(0,qp,&LP_Alicequery) == 0 ) { price = LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout); if ( LP_pricevalid(price) > 0 && maxprice > SMALLVAL && price <= maxprice ) { qp->tradeid = LP_Alicequery.tradeid; + LP_Alicereserved = *qp; LP_alicequery_clear(); printf("send CONNECT\n"); LP_query(ctx,myipaddr,mypubsock,"connect",qp); @@ -561,7 +566,7 @@ void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; //uint64_t value,value2; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,A,B,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) { LP_aliceid(Q.tradeid,Q.aliceid,"error0",0,0); @@ -572,7 +577,7 @@ char *LP_connectedalice(cJSON *argjson) // alice LP_aliceid(Q.tradeid,Q.aliceid,"error1",0,0); return(clonestr("{\"result\",\"update stats\"}")); } - printf("CONNECTED.(%s) numpending.%d tradeid.%u requestid.%u quoteid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid,Q.R.requestid,Q.R.quoteid); + printf("CONNECTED.(%s) numpending.%d tradeid.%u requestid.%u quoteid.%u\n",jprint(argjson,0),G.LP_pendingswaps,Q.tradeid,Q.R.requestid,Q.R.quoteid); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); printf("calculated requestid.%u quoteid.%u\n",Q.R.requestid,Q.R.quoteid); if ( LP_pendingswap(Q.R.requestid,Q.R.quoteid) > 0 ) @@ -582,16 +587,17 @@ char *LP_connectedalice(cJSON *argjson) // alice jaddstr(retjson,"error","swap already in progress"); return(jprint(retjson,1)); } - if ( (autxo= LP_utxopairfind(0,Q.desttxid,Q.destvout,Q.feetxid,Q.feevout)) == 0 ) + if ( LP_quotecmp(1,&Q,&LP_Alicereserved) == 0 ) { - printf("cant find autxo\n"); - LP_aliceid(Q.tradeid,Q.aliceid,"error2",0,0); - return(clonestr("{\"error\":\"cant find autxo\"}")); + printf("mismatched between reserved and connected\n"); } + memset(&LP_Alicereserved,0,sizeof(LP_Alicereserved)); LP_aliceid(Q.tradeid,Q.aliceid,"connected",Q.R.requestid,Q.R.quoteid); + autxo = &A; butxo = &B; + memset(autxo,0,sizeof(*autxo)); memset(butxo,0,sizeof(*butxo)); - LP_abutxo_set(0,butxo,&Q); + LP_abutxo_set(autxo,butxo,&Q); if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(Q.desttxid,Q.vout); diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index ec00553e4..d4a2fdfd5 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -386,7 +386,7 @@ void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid if ( matched != 0 ) break; } - if ( matched == 0 ) + if ( 0 && matched == 0 ) printf("NO MATCH: bot event tradeid.%u aliceid.%llu (%s) r.%u q.%u\n",tradeid,(long long)aliceid,event,requestid,quoteid); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index e9ff90d3a..8ea1d2db5 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -966,7 +966,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,txfee,threshold=0; cJSON *txobj; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct LP_transaction *tx; struct LP_address_utxo *up; struct iguana_info *coin = LP_coinfind(symbol); + uint64_t val,val2=0,txfee,threshold=0; cJSON *txobj; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); if ( bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 ) { printf("null txid not eligible\n"); From 3174532f3c380659a5e09599ba8244fd738b7bff Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 20:08:36 +0200 Subject: [PATCH 2714/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f73c9474f..6edb2f03d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -624,7 +624,9 @@ void LP_coinsloop(void *_coins) { if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { - printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); + static uint32_t counter; + if ( counter++ < 3 ) + printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); break; } coin->lastscanht++; From c0c36f2076ad4964daddcbaf8e0a268f2933d142 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 12:45:44 +0200 Subject: [PATCH 2715/2732] Test --- iguana/exchanges/LP_cache.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_ordermatch.c | 15 ++++++++++++++- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_socket.c | 21 ++++++++++++++++++--- iguana/exchanges/LP_transaction.c | 2 +- 6 files changed, 37 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index fdc734fe9..fbce9ddff 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -235,7 +235,7 @@ int32_t LP_merkleproof(struct iguana_info *coin,char *coinaddr,struct electrum_i return(0); if ( (tx= LP_transactionfind(coin,txid)) == 0 && strcmp(coinaddr,coin->smartaddr) == 0 ) { - if ( (retjson= electrum_transaction(coin->symbol,ep,&retjson,txid)) != 0 ) + if ( (retjson= electrum_transaction(coin->symbol,ep,&retjson,txid,0)) != 0 ) free_json(retjson); } if ( tx != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6edb2f03d..3ca6cb879 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,11 +17,10 @@ // LP_nativeDEX.c // marketmaker // +// destpubkey // if ( G.LP_pendingswaps != 0 ) return(-1); // bot safe to exit? -// 324744 and 50mb // BCH signing -// single utxo allocations alice // alice waiting for bestprice // // previously, it used to show amount, kmd equiv, perc diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 60de857a8..7e440d990 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -746,10 +746,23 @@ int32_t LP_aliceonly(char *symbol) int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) { - struct electrum_info *ep,*backupep; struct LP_address_utxo *up; struct iguana_info *coin; + struct electrum_info *ep,*backupep; cJSON *txobj; struct LP_address_utxo *up; struct iguana_info *coin; struct LP_transaction *tx; coin = LP_coinfind(symbol); if ( coin != 0 && (ep= coin->electrum) != 0 ) { + if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) == 0 ) + { + if ( (txobj= electrum_transaction(symbol,ep,&txobj,txid,coinaddr)) != 0 ) + free_json(txobj); + if ( (tx= LP_transactionfind(coin,txid)) != 0 ) + { + if ( vout < tx->numvouts && tx->height > 0 ) + LP_address_utxoadd((uint32_t)time(NULL),"LP_validSPV",coin,coinaddr,txid,vout,tx->outpoints[vout].value,tx->height,-1); + if ( tx->SPV <= 0 ) + return(-1); + return(0); + } + } if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) { if ( up->SPV < 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 11924e51c..8639646ee 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -429,7 +429,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) } else { - if ( (retjson= electrum_transaction(symbol,coin->electrum,&retjson,txid)) != 0 ) + if ( (retjson= electrum_transaction(symbol,coin->electrum,&retjson,txid,0)) != 0 ) return(retjson); else printf("failed blockchain.transaction.get %s %s\n",coin->symbol,bits256_str(str,txid)); return(cJSON_Parse("{\"error\":\"no transaction bytes\"}")); @@ -507,7 +507,7 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout) } if ( coinaddr[0] == 0 ) { - if ( (txobj= electrum_transaction(symbol,coin->electrum,&txobj,txid)) != 0 ) + if ( (txobj= electrum_transaction(symbol,coin->electrum,&txobj,txid,0)) != 0 ) { if ( (vouts= jarray(&n,txobj,"vout")) != 0 && n > 0 ) LP_destaddr(coinaddr,jitem(vouts,vout)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 723a61a92..f1a895b38 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -742,12 +742,27 @@ cJSON *_electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjs return(*retjsonp); } -cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid) +cJSON *electrum_transaction(char *symbol,struct electrum_info *ep,cJSON **retjsonp,bits256 txid,char *SPVcheck) { - cJSON *retjson; + cJSON *retjson,*array; struct LP_transaction *tx; struct iguana_info *coin; + coin = LP_coinfind(symbol); if ( ep != 0 ) portable_mutex_lock(&ep->txmutex); retjson = _electrum_transaction(symbol,ep,retjsonp,txid); + if ( ep != 0 && coin != 0 && SPVcheck != 0 && SPVcheck[0] != 0 && (tx= LP_transactionfind(coin,txid)) != 0 ) + { + if ( tx->height <= 0 ) + { + if ( (array= electrum_address_listunspent(symbol,ep,&array,SPVcheck,2)) != 0 ) + { + printf("SPVcheck.%s got %d unspents\n",SPVcheck,cJSON_GetArraySize(array)); + free_json(array); + } + } + if ( tx->height > 0 ) + tx->SPV = LP_merkleproof(coin,SPVcheck,ep,txid,tx->height); + char str[65]; printf("%s %s %s SPV height %d SPV %d\n",coin->symbol,SPVcheck,bits256_str(str,txid),tx->height,tx->SPV); + } if ( ep != 0 ) portable_mutex_unlock(&ep->txmutex); return(retjson); @@ -789,7 +804,7 @@ void electrum_test() decode_hex(hash.bytes,sizeof(hash),"b967a7d55889fe11e993430921574ec6379bc8ce712a652c3fcb66c6be6e925c"); if ( (retjson= electrum_getmerkle(symbol,ep,0,hash,403000)) != 0 ) printf("electrum_getmerkle %s\n",jprint(retjson,1)); - if ( (retjson= electrum_transaction(symbol,ep,0,hash)) != 0 ) + if ( (retjson= electrum_transaction(symbol,ep,0,hash,0)) != 0 ) printf("electrum_transaction %s\n",jprint(retjson,1)); addr = "14NeevLME8UAANiTCVNgvDrynUPk1VcQKb"; if ( (retjson= electrum_address_gethistory(symbol,ep,0,addr)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index f90a87170..133ee6c41 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -118,7 +118,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } else if ( (errstr= jstr(retjson,"error")) != 0 && strcmp(errstr,"timeout") == 0 && coin != 0 && coin->electrum != 0 ) { - if ( totalretries < 10 ) + if ( totalretries < 4 ) { printf("time error with electrum, retry.%d\n",totalretries); totalretries++; From 10dac4ab97796051d8c7c8540348a9b28abc8b2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 15:57:19 +0200 Subject: [PATCH 2716/2732] Add back utxo info --- iguana/exchanges/LP_include.h | 11 +++- iguana/exchanges/LP_nativeDEX.c | 7 +- iguana/exchanges/LP_prices.c | 110 +++++++++++++++++++++++++------ iguana/exchanges/LP_signatures.c | 15 ++++- 4 files changed, 119 insertions(+), 24 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f66fcc9c1..2d928676f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -364,12 +364,21 @@ struct basilisk_swap }; +struct LP_pubkey_quote +{ + struct LP_pubkey_quote *next,*prev; + float price; + uint32_t maxutxo,aveutxo; + uint8_t baseind,relind,numutxos,scale; +}; + #define LP_MAXPRICEINFOS 256 struct LP_pubkeyinfo { UT_hash_handle hh; bits256 pubkey; - float matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; + struct LP_pubkey_quote *quotes; + //float matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; //uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS]; uint32_t timestamp,numerrors,lasttime; int32_t istrusted; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3ca6cb879..5b44da252 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -533,8 +533,6 @@ void LP_coinsloop(void *_coins) { if ( (backupep= ep->prev) == 0 ) backupep = ep; - // skip cLP_address MNZ bXcSsYBiVKtTzYErqxvma4UsojZTEf5L6H - //printf("electrum %s\n",coin->symbol); if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 ) { if ( (retjson= electrum_address_listunspent(coin->symbol,ep,&retjson,ap->coinaddr,1)) != 0 ) @@ -892,6 +890,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu 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)); printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version))); + if ( LP_MAXPRICEINFOS > 256 ) + { + printf("LP_MAXPRICEINFOS %d wont fit in a uint8_t, need to increase the width of the baseind and relind for struct LP_pubkey_quote\n",LP_MAXPRICEINFOS); + exit(-1); + } LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ade6b75f5..4962d2972 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -18,7 +18,7 @@ // marketmaker // -struct LP_orderbookentry { bits256 pubkey; double price; uint64_t minsatoshis,maxsatoshis,depth; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; +struct LP_orderbookentry { bits256 pubkey; double price; uint64_t avesatoshis,maxsatoshis,depth; uint32_t timestamp; int32_t numutxos; char coinaddr[64]; }; struct LP_priceinfo { @@ -48,6 +48,75 @@ struct LP_cacheinfo uint32_t timestamp; } *LP_cacheinfos; + +float LP_pubkey_price(int32_t *numutxosp,int64_t *avesatoshisp,int64_t *maxsatoshisp,struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind) +{ + struct LP_pubkey_quote *pq,*tmp; int32_t scale; int64_t scale64; + *numutxosp = 0; + *avesatoshisp = *maxsatoshisp = 0; + DL_FOREACH_SAFE(pubp->quotes,pq,tmp) + { + if ( baseind == pq->baseind && relind == pq->relind ) + { + if ( (scale= pq->scale) == 0 ) + pq->scale = scale = 6; + scale64 = 1; + while ( scale > 0 ) + { + scale64 *= 10; + scale--; + } + *numutxosp = pq->numutxos; + *avesatoshisp = pq->aveutxo * scale64; + *maxsatoshisp = pq->maxutxo * scale64; + return(pq->price); + } + } + return(0); +} + +void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind,float price,int64_t balance,int32_t numutxos,int64_t minutxo,int64_t maxutxo) +{ + struct LP_pubkey_quote *pq,*tmp; int64_t aveutxo,scale64,ave64,max64; int32_t scale; + DL_FOREACH_SAFE(pubp->quotes,pq,tmp) + { + if ( baseind == pq->baseind && relind == pq->relind ) + break; + pq = 0; + } + if ( pq == 0 ) + { + pq = calloc(1,sizeof(*pq)); + pq->baseind = baseind; + pq->relind = relind; + pq->scale = 6; // millions of SATOSHIS, ie. 0.01 + DL_APPEND(pubp->quotes,pq); // already serialized as only path is via stats_JSON() + } + pq->price = price; + if ( numutxos != 0 ) + { + if ( (scale= pq->scale) == 0 ) + pq->scale = scale = 6; + scale64 = 1; + while ( scale > 0 ) + { + scale64 *= 10; + scale--; + } + if ( numutxos > (1L << sizeof(pq->numutxos)) ) + pq->numutxos = (1L << sizeof(pq->numutxos)) - 1; + else pq->numutxos = numutxos; + aveutxo = balance / numutxos; + if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) + ave64 = (1LL << 32) - 1; + if ( (max64= (maxutxo / scale64)) > (1LL << 32) ) + max64 = (1LL << 32) - 1; + pq->aveutxo = (uint32_t)ave64; + pq->maxutxo = (uint32_t)max64; + printf("scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + } +} + struct LP_priceinfo *LP_priceinfo(int32_t ind) { if ( ind < 0 || ind >= LP_MAXPRICEINFOS ) @@ -272,7 +341,7 @@ uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) { - int32_t baseid,relid; char *base,hexstr[67],hexstr2[67],sigstr[256]; double price; cJSON *item,*array,*obj; + int32_t baseid,relid,numutxos; int64_t avesatoshis,maxsatoshis; char *base,hexstr[67],hexstr2[67],sigstr[256]; double price; cJSON *item,*array,*obj; obj = cJSON_CreateObject(); array = cJSON_CreateArray(); for (baseid=0; baseidmatrix[baseid][relid]; + price = LP_pubkey_price(&numutxos,&avesatoshis,&maxsatoshis,pubp,baseid,relid);//pubp->matrix[baseid][relid]; if ( LP_pricevalid(price) > 0 ) { item = cJSON_CreateArray(); @@ -495,7 +564,8 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) { pubp->timestamp = (uint32_t)time(NULL); - pubp->matrix[basepp->ind][relpp->ind] = price; + LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,0,0,0,0); + //pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); } @@ -671,7 +741,7 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); - jaddnum(item,"minvolume",dstr(op->minsatoshis)*0.8); + jaddnum(item,"avevolume",dstr(op->avesatoshis)*0.8); jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8); jaddnum(item,"depth",dstr(op->depth)*0.8); jaddbits256(item,"pubkey",op->pubkey); @@ -680,7 +750,7 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) return(item); } -struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t minsatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp,uint64_t balance) +struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t avesatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp,uint64_t balance) { struct LP_orderbookentry *op; if ( (op= calloc(1,sizeof(*op))) != 0 ) @@ -688,8 +758,8 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d safecopy(op->coinaddr,address,sizeof(op->coinaddr)); op->price = price; op->numutxos = numutxos; - op->minsatoshis = minsatoshis; - op->maxsatoshis = maxsatoshis; + op->avesatoshis = avesatoshis; + op->maxsatoshis = avesatoshis; op->pubkey = pubkey; op->timestamp = timestamp; op->depth = balance; @@ -718,7 +788,7 @@ void LP_pubkeys_query() int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t minsatoshis,maxsatoshis,balance; + char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; int64_t maxsatoshis,balance,avesatoshis; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); @@ -737,23 +807,23 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * if ( pubp->timestamp < oldest ) continue; bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - minsatoshis = maxsatoshis = n = 0; + avesatoshis = maxsatoshis = n = 0; ap = 0; - if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL )//&& pubp->timestamps[baseid][relid] >= oldest ) + if ( (price= LP_pubkey_price(&n,&avesatoshis,&maxsatoshis,pubp,baseid,relid)) > SMALLVAL ) //pubp->matrix[baseid][relid]) > SMALLVAL )//&& pubp->timestamps[baseid][relid] >= oldest ) { - balance = 0; - if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) + balance = avesatoshis * n; + //if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 ) { - n = LP_address_minmax(&balance,&minsatoshis,&maxsatoshis,ap); + //n = LP_address_minmax(&balance,&minsatoshis,&maxsatoshis,ap); if ( polarity > 0 ) { balance *= price; - minsatoshis *= price; + avesatoshis *= price; maxsatoshis *= price; } //printf("%s/%s %s n.%d ap->n.%d %.8f\n",base,rel,coinaddr,n,ap->n,dstr(ap->total)); } - if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,minsatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,balance)) != 0 ) + if ( (op= LP_orderbookentry(coinaddr,base,rel,polarity > 0 ? price : 1./price,n,avesatoshis,maxsatoshis,pubp->pubkey,pubp->timestamp,balance)) != 0 ) { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; @@ -1036,7 +1106,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i return(retarray); } -void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) +void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,int32_t numutxos,int64_t balance,int64_t minutxo,int64_t maxutxo) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); @@ -1073,9 +1143,11 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) if ( (LP_rand() % 1000) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->timestamp = (uint32_t)time(NULL); - if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) + LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,balance,numutxos,minutxo,maxutxo); + //pubp->depthinfo[basepp->ind][relpp->ind] = LP_depthinfo_compact(); + //if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { - pubp->matrix[basepp->ind][relpp->ind] = price; + //pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; dxblend(&basepp->relvals[relpp->ind],price,0.9); dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index e729421ad..5a7ab184d 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -451,7 +451,8 @@ int32_t LP_price_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,uint8_t *pub char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { - struct iguana_info *basecoin,*relcoin; char pubsecpstr[67]; uint32_t timestamp; uint64_t price64; bits256 zero; cJSON *reqjson = cJSON_CreateObject(); + struct iguana_info *basecoin,*relcoin; struct LP_address *ap; char pubsecpstr[67]; uint32_t numutxos,timestamp; uint64_t price64,balance,minsize,maxsize; bits256 zero; cJSON *reqjson; + reqjson = cJSON_CreateObject(); // LP_addsig if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 )//&& relcoin->electrum == 0 ) { @@ -467,6 +468,16 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddnum(reqjson,"timestamp",timestamp); init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",pubsecpstr); + if ( (ap= LP_address(basecoin,basecoin->smartaddr)) != 0 ) + { + if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,ap)) != 0 ) + { + jaddnum(reqjson,"n",numutxos); + jaddnum(reqjson,"bal",dstr(balance)); + jaddnum(reqjson,"min",dstr(minsize)); + jaddnum(reqjson,"max",dstr(maxsize)); + } + } LP_price_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_pubsecp,G.LP_mypub25519,base,rel,price64); LP_reserved_msg(0,base,rel,zero,jprint(reqjson,1)); return(clonestr("{\"result\":\"success\"}")); @@ -484,7 +495,7 @@ char *LP_postprice_recv(cJSON *argjson) { if ( LP_price_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,base,rel,j64bits(argjson,"price64")) == 0 ) { - LP_pricefeedupdate(pubkey,base,rel,price); + LP_pricefeedupdate(pubkey,base,rel,price,jint(argjson,"n"),jdouble(argjson,"bal")*SATOSHIDEN,jdouble(argjson,"min")*SATOSHIDEN,jdouble(argjson,"max")*SATOSHIDEN); return(clonestr("{\"result\":\"success\"}")); } else return(clonestr("{\"error\":\"sig failure\"}")); } From eb6d6fe7f0d5b11e59ade3c71d1e1d805fdfdae5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:10:25 +0200 Subject: [PATCH 2717/2732] Test --- iguana/exchanges/LP_prices.c | 7 ++++--- iguana/exchanges/LP_signatures.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 4962d2972..4db3df60d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -106,14 +106,15 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin if ( numutxos > (1L << sizeof(pq->numutxos)) ) pq->numutxos = (1L << sizeof(pq->numutxos)) - 1; else pq->numutxos = numutxos; - aveutxo = balance / numutxos; + aveutxo = (balance + (scale64>>1)) / numutxos; if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) ave64 = (1LL << 32) - 1; - if ( (max64= (maxutxo / scale64)) > (1LL << 32) ) + max64 = ((maxutxo + (scale64>>1)) / scale64); + if ( max64 > (1LL << 32) ) max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - printf("scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + printf("base.%s scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); } } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 5a7ab184d..6089e8366 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -472,6 +472,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re { if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,ap)) != 0 ) { + printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); jaddnum(reqjson,"n",numutxos); jaddnum(reqjson,"bal",dstr(balance)); jaddnum(reqjson,"min",dstr(minsize)); From b38e6f678a31bf9dd812c206a3b07928d5be40c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:16:19 +0200 Subject: [PATCH 2718/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_prices.c | 22 +++++++++++----------- iguana/exchanges/LP_signatures.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2d928676f..7d9b1d9ab 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -369,7 +369,7 @@ struct LP_pubkey_quote struct LP_pubkey_quote *next,*prev; float price; uint32_t maxutxo,aveutxo; - uint8_t baseind,relind,numutxos,scale; + uint8_t baseind,relind,numrelutxos,scale; }; #define LP_MAXPRICEINFOS 256 diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 4db3df60d..b058e1c18 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -49,10 +49,10 @@ struct LP_cacheinfo } *LP_cacheinfos; -float LP_pubkey_price(int32_t *numutxosp,int64_t *avesatoshisp,int64_t *maxsatoshisp,struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind) +float LP_pubkey_price(int32_t *numrelutxosp,int64_t *avesatoshisp,int64_t *maxsatoshisp,struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind) { struct LP_pubkey_quote *pq,*tmp; int32_t scale; int64_t scale64; - *numutxosp = 0; + *numrelutxosp = 0; *avesatoshisp = *maxsatoshisp = 0; DL_FOREACH_SAFE(pubp->quotes,pq,tmp) { @@ -66,7 +66,7 @@ float LP_pubkey_price(int32_t *numutxosp,int64_t *avesatoshisp,int64_t *maxsatos scale64 *= 10; scale--; } - *numutxosp = pq->numutxos; + *numrelutxosp = pq->numrelutxos; *avesatoshisp = pq->aveutxo * scale64; *maxsatoshisp = pq->maxutxo * scale64; return(pq->price); @@ -75,7 +75,7 @@ float LP_pubkey_price(int32_t *numutxosp,int64_t *avesatoshisp,int64_t *maxsatos return(0); } -void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind,float price,int64_t balance,int32_t numutxos,int64_t minutxo,int64_t maxutxo) +void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind,float price,int64_t balance,int32_t numrelutxos,int64_t minutxo,int64_t maxutxo) { struct LP_pubkey_quote *pq,*tmp; int64_t aveutxo,scale64,ave64,max64; int32_t scale; DL_FOREACH_SAFE(pubp->quotes,pq,tmp) @@ -93,7 +93,7 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin DL_APPEND(pubp->quotes,pq); // already serialized as only path is via stats_JSON() } pq->price = price; - if ( numutxos != 0 ) + if ( numrelutxos != 0 ) { if ( (scale= pq->scale) == 0 ) pq->scale = scale = 6; @@ -103,9 +103,9 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin scale64 *= 10; scale--; } - if ( numutxos > (1L << sizeof(pq->numutxos)) ) - pq->numutxos = (1L << sizeof(pq->numutxos)) - 1; - else pq->numutxos = numutxos; + if ( numrelutxos > (1L << sizeof(pq->numutxos)) ) + pq->numrelutxos = (1L << sizeof(pq->numutxos)) - 1; + else pq->numrelutxos = numrelutxos; aveutxo = (balance + (scale64>>1)) / numutxos; if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) ave64 = (1LL << 32) - 1; @@ -114,7 +114,7 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - printf("base.%s scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + printf("base.%s numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[relind].symbol,numrelutxos,pq->numrelutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); } } @@ -1107,7 +1107,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i return(retarray); } -void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,int32_t numutxos,int64_t balance,int64_t minutxo,int64_t maxutxo) +void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,int32_t numrelutxos,int64_t balance,int64_t minutxo,int64_t maxutxo) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); @@ -1144,7 +1144,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,int32_t if ( (LP_rand() % 1000) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->timestamp = (uint32_t)time(NULL); - LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,balance,numutxos,minutxo,maxutxo); + LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,balance,numrelutxos,minutxo,maxutxo); //pubp->depthinfo[basepp->ind][relpp->ind] = LP_depthinfo_compact(); //if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 6089e8366..252d19df4 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -468,11 +468,11 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddnum(reqjson,"timestamp",timestamp); init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",pubsecpstr); - if ( (ap= LP_address(basecoin,basecoin->smartaddr)) != 0 ) + if ( (ap= LP_address(relcoin,relcoin->smartaddr)) != 0 ) { if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,ap)) != 0 ) { - printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); + printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",rel,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); jaddnum(reqjson,"n",numutxos); jaddnum(reqjson,"bal",dstr(balance)); jaddnum(reqjson,"min",dstr(minsize)); From 7ee7fbdca53581ee984dbcfc528b0882babce99f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:18:25 +0200 Subject: [PATCH 2719/2732] Test --- iguana/exchanges/LP_prices.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b058e1c18..f1b312de8 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -103,10 +103,10 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin scale64 *= 10; scale--; } - if ( numrelutxos > (1L << sizeof(pq->numutxos)) ) - pq->numrelutxos = (1L << sizeof(pq->numutxos)) - 1; + if ( numrelutxos > (1L << sizeof(pq->numrelutxos)) ) + pq->numrelutxos = (1L << sizeof(pq->numrelutxos)) - 1; else pq->numrelutxos = numrelutxos; - aveutxo = (balance + (scale64>>1)) / numutxos; + aveutxo = (balance + (scale64>>1)) / numrelutxos; if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) ave64 = (1LL << 32) - 1; max64 = ((maxutxo + (scale64>>1)) / scale64); From dd77fb3331a6b7d666b746fe07524b98d3ba25ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:29:15 +0200 Subject: [PATCH 2720/2732] Test --- iguana/exchanges/LP_prices.c | 16 ++++++++-------- iguana/exchanges/LP_signatures.c | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f1b312de8..5042955b1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -75,7 +75,7 @@ float LP_pubkey_price(int32_t *numrelutxosp,int64_t *avesatoshisp,int64_t *maxsa return(0); } -void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind,float price,int64_t balance,int32_t numrelutxos,int64_t minutxo,int64_t maxutxo) +void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind,float price,int64_t balance,char *utxocoin,int32_t numutxos,int64_t minutxo,int64_t maxutxo) { struct LP_pubkey_quote *pq,*tmp; int64_t aveutxo,scale64,ave64,max64; int32_t scale; DL_FOREACH_SAFE(pubp->quotes,pq,tmp) @@ -93,7 +93,7 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin DL_APPEND(pubp->quotes,pq); // already serialized as only path is via stats_JSON() } pq->price = price; - if ( numrelutxos != 0 ) + if ( numutxos != 0 ) { if ( (scale= pq->scale) == 0 ) pq->scale = scale = 6; @@ -103,10 +103,10 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin scale64 *= 10; scale--; } - if ( numrelutxos > (1L << sizeof(pq->numrelutxos)) ) + if ( numutxos > (1L << sizeof(pq->numrelutxos)) ) pq->numrelutxos = (1L << sizeof(pq->numrelutxos)) - 1; - else pq->numrelutxos = numrelutxos; - aveutxo = (balance + (scale64>>1)) / numrelutxos; + else pq->numrelutxos = numutxos; + aveutxo = (balance + (scale64>>1)) / numutxos; if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) ave64 = (1LL << 32) - 1; max64 = ((maxutxo + (scale64>>1)) / scale64); @@ -114,7 +114,7 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - printf("base.%s numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[relind].symbol,numrelutxos,pq->numrelutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + printf("base.%s rel.%s utxocoin.%s numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,numutxos,pq->numrelutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); } } @@ -1107,7 +1107,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i return(retarray); } -void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,int32_t numrelutxos,int64_t balance,int64_t minutxo,int64_t maxutxo) +void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,char *utxocoin,int32_t numrelutxos,int64_t balance,int64_t minutxo,int64_t maxutxo) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); @@ -1144,7 +1144,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,int32_t if ( (LP_rand() % 1000) == 0 ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->timestamp = (uint32_t)time(NULL); - LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,balance,numrelutxos,minutxo,maxutxo); + LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,balance,utxocoin,numrelutxos,minutxo,maxutxo); //pubp->depthinfo[basepp->ind][relpp->ind] = LP_depthinfo_compact(); //if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) { diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 252d19df4..2253bcc09 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -468,11 +468,12 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddnum(reqjson,"timestamp",timestamp); init_hexbytes_noT(pubsecpstr,G.LP_pubsecp,33); jaddstr(reqjson,"pubsecp",pubsecpstr); - if ( (ap= LP_address(relcoin,relcoin->smartaddr)) != 0 ) + if ( (ap= LP_address(basecoin,basecoin->smartaddr)) != 0 ) { if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,ap)) != 0 ) { - printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",rel,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); + printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); + jaddstr(reqjson,"utxocoin",base); jaddnum(reqjson,"n",numutxos); jaddnum(reqjson,"bal",dstr(balance)); jaddnum(reqjson,"min",dstr(minsize)); @@ -496,7 +497,7 @@ char *LP_postprice_recv(cJSON *argjson) { if ( LP_price_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,base,rel,j64bits(argjson,"price64")) == 0 ) { - LP_pricefeedupdate(pubkey,base,rel,price,jint(argjson,"n"),jdouble(argjson,"bal")*SATOSHIDEN,jdouble(argjson,"min")*SATOSHIDEN,jdouble(argjson,"max")*SATOSHIDEN); + LP_pricefeedupdate(pubkey,base,rel,price,jstr(argjson,"utxocoin"),jint(argjson,"n"),jdouble(argjson,"bal")*SATOSHIDEN,jdouble(argjson,"min")*SATOSHIDEN,jdouble(argjson,"max")*SATOSHIDEN); return(clonestr("{\"result\":\"success\"}")); } else return(clonestr("{\"error\":\"sig failure\"}")); } From c4410b76974237ec9ad25622c6fa3e7474edf5ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:30:49 +0200 Subject: [PATCH 2721/2732] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5042955b1..52ec96ee6 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -93,7 +93,7 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin DL_APPEND(pubp->quotes,pq); // already serialized as only path is via stats_JSON() } pq->price = price; - if ( numutxos != 0 ) + if ( utxocoin != 0 && utxocoin[0] != 0 ) { if ( (scale= pq->scale) == 0 ) pq->scale = scale = 6; @@ -565,7 +565,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) { pubp->timestamp = (uint32_t)time(NULL); - LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,0,0,0,0); + LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,0,0,0,0,0); //pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); From f13ac23ce93df70f14f49ebfe39248cbf7402540 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:37:22 +0200 Subject: [PATCH 2722/2732] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_prices.c | 14 +++++++------- iguana/exchanges/LP_signatures.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7d9b1d9ab..2d928676f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -369,7 +369,7 @@ struct LP_pubkey_quote struct LP_pubkey_quote *next,*prev; float price; uint32_t maxutxo,aveutxo; - uint8_t baseind,relind,numrelutxos,scale; + uint8_t baseind,relind,numutxos,scale; }; #define LP_MAXPRICEINFOS 256 diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 52ec96ee6..7245c19b2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -49,10 +49,10 @@ struct LP_cacheinfo } *LP_cacheinfos; -float LP_pubkey_price(int32_t *numrelutxosp,int64_t *avesatoshisp,int64_t *maxsatoshisp,struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind) +float LP_pubkey_price(int32_t *numutxosp,int64_t *avesatoshisp,int64_t *maxsatoshisp,struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relind) { struct LP_pubkey_quote *pq,*tmp; int32_t scale; int64_t scale64; - *numrelutxosp = 0; + *numutxosp = 0; *avesatoshisp = *maxsatoshisp = 0; DL_FOREACH_SAFE(pubp->quotes,pq,tmp) { @@ -66,7 +66,7 @@ float LP_pubkey_price(int32_t *numrelutxosp,int64_t *avesatoshisp,int64_t *maxsa scale64 *= 10; scale--; } - *numrelutxosp = pq->numrelutxos; + *numutxosp = pq->numutxos; *avesatoshisp = pq->aveutxo * scale64; *maxsatoshisp = pq->maxutxo * scale64; return(pq->price); @@ -103,9 +103,9 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin scale64 *= 10; scale--; } - if ( numutxos > (1L << sizeof(pq->numrelutxos)) ) - pq->numrelutxos = (1L << sizeof(pq->numrelutxos)) - 1; - else pq->numrelutxos = numutxos; + if ( numutxos > (1L << sizeof(pq->numutxos)) ) + pq->numutxos = (1L << sizeof(pq->numutxos)) - 1; + else pq->numutxos = numutxos; aveutxo = (balance + (scale64>>1)) / numutxos; if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) ave64 = (1LL << 32) - 1; @@ -114,7 +114,7 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - printf("base.%s rel.%s utxocoin.%s numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,numutxos,pq->numrelutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + //printf("base.%s rel.%s utxocoin.%s numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); } } diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 2253bcc09..6e99495cb 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -472,7 +472,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re { if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,ap)) != 0 ) { - printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); + //printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); jaddstr(reqjson,"utxocoin",base); jaddnum(reqjson,"n",numutxos); jaddnum(reqjson,"bal",dstr(balance)); From 0c5bb4bf96f15e2993bdebe138bf2f30c7b5c33a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:45:24 +0200 Subject: [PATCH 2723/2732] Test --- iguana/exchanges/LP_prices.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7245c19b2..6dcdedb52 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -114,7 +114,11 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - //printf("base.%s rel.%s utxocoin.%s numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + printf("base.%s rel.%s utxocoin.%s balance %.8f numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,dstr(balance),numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + int64_t avesatoshis,maxsatoshis; + price = LP_pubkey_price(&numutxos,&avesatoshis,&maxsatoshis,pubp,baseind,relind); + printf("checkprice %.8f numutxos.%d ave %.8f max %.8f\n",price,numutxos,dstr(avesatoshis),dstr(maxsatoshis)); + } } From 33bf3c8a3cbd6ddf058c1bf3fa9cc45bf1515fb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:51:15 +0200 Subject: [PATCH 2724/2732] Test --- iguana/exchanges/LP_prices.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6dcdedb52..53d3acc34 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -103,22 +103,21 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin scale64 *= 10; scale--; } - if ( numutxos > (1L << sizeof(pq->numutxos)) ) - pq->numutxos = (1L << sizeof(pq->numutxos)) - 1; + if ( numutxos >= 256 ) + pq->numutxos = 255; else pq->numutxos = numutxos; aveutxo = (balance + (scale64>>1)) / numutxos; - if ( (ave64= (aveutxo / scale64)) > (1LL << 32) ) + if ( (ave64= (aveutxo / scale64)) >= (1LL << 32) ) ave64 = (1LL << 32) - 1; max64 = ((maxutxo + (scale64>>1)) / scale64); - if ( max64 > (1LL << 32) ) + if ( max64 >= (1LL << 32) ) max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - printf("base.%s rel.%s utxocoin.%s balance %.8f numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,dstr(balance),numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + printf("price %.8f base.%s rel.%s utxocoin.%s balance %.8f numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",price,LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,dstr(balance),numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); int64_t avesatoshis,maxsatoshis; price = LP_pubkey_price(&numutxos,&avesatoshis,&maxsatoshis,pubp,baseind,relind); printf("checkprice %.8f numutxos.%d ave %.8f max %.8f\n",price,numutxos,dstr(avesatoshis),dstr(maxsatoshis)); - } } From 9e568b10659713d03ba9e1b5c9f7412f2483c0e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 16:53:00 +0200 Subject: [PATCH 2725/2732] Test --- iguana/exchanges/LP_prices.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 53d3acc34..c18403704 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -114,10 +114,10 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin max64 = (1LL << 32) - 1; pq->aveutxo = (uint32_t)ave64; pq->maxutxo = (uint32_t)max64; - printf("price %.8f base.%s rel.%s utxocoin.%s balance %.8f numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",price,LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,dstr(balance),numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); - int64_t avesatoshis,maxsatoshis; - price = LP_pubkey_price(&numutxos,&avesatoshis,&maxsatoshis,pubp,baseind,relind); - printf("checkprice %.8f numutxos.%d ave %.8f max %.8f\n",price,numutxos,dstr(avesatoshis),dstr(maxsatoshis)); + //printf("price %.8f base.%s rel.%s utxocoin.%s balance %.8f numutxos.%u %u scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",price,LP_priceinfos[baseind].symbol,LP_priceinfos[relind].symbol,utxocoin,dstr(balance),numutxos,pq->numutxos,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64); + //int64_t avesatoshis,maxsatoshis; + //price = LP_pubkey_price(&numutxos,&avesatoshis,&maxsatoshis,pubp,baseind,relind); + //printf("checkprice %.8f numutxos.%d ave %.8f max %.8f\n",price,numutxos,dstr(avesatoshis),dstr(maxsatoshis)); } } From df2fd85218add8aca41ea3f639a6428098179eee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 17:04:03 +0200 Subject: [PATCH 2726/2732] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c18403704..7c91647aa 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -763,7 +763,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d op->price = price; op->numutxos = numutxos; op->avesatoshis = avesatoshis; - op->maxsatoshis = avesatoshis; + op->maxsatoshis = maxsatoshis; op->pubkey = pubkey; op->timestamp = timestamp; op->depth = balance; From d30ca25ed7b4fe76c1eced37065e09251d0559a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 17:17:56 +0200 Subject: [PATCH 2727/2732] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7e440d990..d1ad77b2d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -405,7 +405,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s %s\n",dstr(targetval),relvolume,price,dstr(txfee),coin->symbol,coinaddr); } mini = -1; - if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,targetval)) >= 0 ) + if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,coinaddr,utxos,m,targetval+txfee)) >= 0 ) { up = utxos[mini]; utxos[mini] = 0; @@ -1170,7 +1170,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find alice utxo that is small enough\"}")); } - bestsatoshis = LP_basesatoshis(dstr(destsatoshis),maxprice,txfee,desttxfee); + bestsatoshis = 1.001 * LP_basesatoshis(dstr(destsatoshis),maxprice,txfee,desttxfee); memset(&B,0,sizeof(B)); strcpy(B.coin,base); if ( LP_quoteinfoinit(&Q,&B,rel,maxprice,bestsatoshis,destsatoshis) < 0 ) From 746dc87850fdff4128f43147540c20f7dcb41f62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 17:35:39 +0200 Subject: [PATCH 2728/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_remember.c | 6 ++++++ iguana/exchanges/LP_swap.c | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5b44da252..5c10f50ba 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -96,7 +96,7 @@ struct LP_address_utxo *LP_garbage_collector2; //uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; -uint32_t LP_lastnonce,LP_counter; +uint32_t LP_lastnonce,LP_counter,LP_swap_endcritical,LP_swap_critical; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 7889181bf..f5ea3229a 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -456,6 +456,12 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) { cJSON *item,*array; int32_t i; item = cJSON_CreateObject(); + if ( LP_swap_endcritical < LP_swap_critical ) + { + jaddstr(item,"warning","swaps in critical section"); + jaddnum(item,"critical",LP_swap_critical); + jaddnum(item,"endcritical",LP_swap_endcritical); + } jaddnum(item,"expiration",rswap->expiration);// - INSTANTDEX_LOCKTIME*2); jaddnum(item,"tradeid",rswap->tradeid); jaddnum(item,"requestid",rswap->requestid); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e1c80d505..30329c864 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -796,6 +796,7 @@ void LP_bobloop(void *_swap) basilisk_bobdeposit_refund(swap,swap->I.putduration); //printf("depositlen.%d\n",swap->bobdeposit.I.datalen); LP_swapsfp_update(&swap->I.req); + LP_swap_critical = (uint32_t)time(NULL); if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*10,LP_verify_otherfee) < 0 ) printf("error waiting for alicefee\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) == 0 ) @@ -804,6 +805,7 @@ void LP_bobloop(void *_swap) printf("error waiting for alicepayment\n"); else { + LP_swap_critical = (uint32_t)time(NULL); if ( basilisk_bobscripts_set(swap,0,1) < 0 ) printf("error bobscripts payment\n"); else @@ -813,9 +815,11 @@ void LP_bobloop(void *_swap) else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->I.alicestr,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) // sync with alice { + LP_swap_critical = (uint32_t)time(NULL); char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->I.alicestr,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } + LP_swap_critical = (uint32_t)time(NULL); if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x8000,data,maxlen,&swap->bobpayment,0x4000,0) == 0 ) printf("error sending bobpayment\n"); //if ( LP_waitfor(swap->N.pair,swap,10,LP_verify_alicespend) < 0 ) @@ -826,6 +830,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; + LP_swap_endcritical = (uint32_t)time(NULL); LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,LP_atomic_locktime(swap->I.bobstr,swap->I.alicestr)*2,30); } } @@ -857,6 +862,7 @@ void LP_aliceloop(void *_swap) else { LP_swapsfp_update(&swap->I.req); + LP_swap_critical = (uint32_t)time(NULL); if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x80,data,maxlen,&swap->myfee,0x40,0) == 0 ) printf("error sending alicefee\n"); else if ( LP_waitfor(swap->N.pair,swap,1800,LP_verify_bobdeposit) < 0 ) @@ -870,14 +876,17 @@ void LP_aliceloop(void *_swap) else m = swap->I.aliceconfirms; while ( (n= LP_numconfirms(swap->I.alicestr,swap->alicepayment.I.destaddr,swap->alicepayment.I.signedtxid,0,1)) < m ) { + LP_swap_critical = (uint32_t)time(NULL); char str[65];printf("%d wait for alicepayment %s numconfs.%d %s %s\n",n,swap->alicepayment.I.destaddr,m,swap->I.alicestr,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(10); } swap->sentflag = 1; + LP_swap_critical = (uint32_t)time(NULL); if ( LP_waitfor(swap->N.pair,swap,1800,LP_verify_bobpayment) < 0 ) printf("error waiting for bobpayment\n"); else { + LP_swap_endcritical = (uint32_t)time(NULL); while ( (n= LP_numconfirms(swap->I.bobstr,swap->bobpayment.I.destaddr,swap->bobpayment.I.signedtxid,0,1)) < swap->I.bobconfirms ) { char str[65];printf("%d wait for bobpayment %s numconfs.%d %s %s\n",n,swap->bobpayment.I.destaddr,swap->I.bobconfirms,swap->I.bobstr,bits256_str(str,swap->bobpayment.I.signedtxid)); From 547c86257e1ee82b05d47d58ab6a0d32a2f20f2a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 17:53:31 +0200 Subject: [PATCH 2729/2732] Test --- iguana/exchanges/LP_nativeDEX.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5c10f50ba..bc988e680 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,9 +17,6 @@ // LP_nativeDEX.c // marketmaker // -// destpubkey -// if ( G.LP_pendingswaps != 0 ) return(-1); -// bot safe to exit? // BCH signing // alice waiting for bestprice // From c73392d51567a618b3e78195a08315d9f12569e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 17:54:16 +0200 Subject: [PATCH 2730/2732] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2d928676f..163408e7d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -23,7 +23,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "15096" +#define LP_BUILD_NUMBER "15256" #define LP_BARTERDEX_VERSION 1 #define LP_MAGICBITS 8 From ca982683cb04f51a4a3f072d501791fb4768ce11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 17 Nov 2017 19:38:14 +0200 Subject: [PATCH 2731/2732] BCH fix? --- iguana/exchanges/LP_bitcoin.c | 10 +++++++--- iguana/exchanges/LP_nativeDEX.c | 5 ++++- iguana/exchanges/LP_transaction.c | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index a9aa5751b..7c90807b1 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2340,7 +2340,7 @@ int32_t iguana_scriptgen(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,int32_t return(scriptlen); } -int32_t bitcoin_scriptget(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,int32_t *hashtypep,uint32_t *sigsizep,uint32_t *pubkeysizep,uint8_t **userdatap,uint32_t *userdatalenp,struct vin_info *vp,uint8_t *scriptsig,int32_t len,int32_t spendtype) +int32_t bitcoin_scriptget(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint32_t *hashtypep,uint32_t *sigsizep,uint32_t *pubkeysizep,uint8_t **userdatap,uint32_t *userdatalenp,struct vin_info *vp,uint8_t *scriptsig,int32_t len,int32_t spendtype) { int32_t j,n,siglen,plen; uint8_t *p2shscript; j = n = 0; @@ -3248,7 +3248,7 @@ int32_t iguana_vinarray_check(cJSON *vinarray,bits256 txid,int32_t vout) int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,int32_t rwflag,cJSON *json,uint8_t *serialized,int32_t maxsize,struct iguana_msgtx *msg,bits256 *txidp,char *vpnstr,uint8_t *extraspace,int32_t extralen,cJSON *vins,int32_t suppress_pubkeys,int32_t zcash); -bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,uint8_t *serialized,int32_t maxlen,struct iguana_msgtx *msgtx,int32_t vini,uint8_t *spendscript,int32_t spendlen,int32_t hashtype,char *vpnstr,int32_t suppress_pubkeys,int32_t zcash) +bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,uint8_t *serialized,int32_t maxlen,struct iguana_msgtx *msgtx,int32_t vini,uint8_t *spendscript,int32_t spendlen,uint32_t hashtype,char *vpnstr,int32_t suppress_pubkeys,int32_t zcash) { int32_t i,len; bits256 sigtxid,txid,revsigtxid; struct iguana_msgtx dest; dest = *msgtx; @@ -3500,8 +3500,12 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is memset(sigtxid.bytes,0,sizeof(sigtxid)); if ( vins != 0 && jitem(vins,i) != 0 ) { + uint32_t sighash; iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); - sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,sigser,maxsize*2,msg,i,msg->vins[i].spendscript,msg->vins[i].spendlen,SIGHASH_ALL,vpnstr,suppress_pubkeys,zcash); + sighash = SIGHASH_ALL; + if ( zcash == LP_IS_BITCOINCASH ) + sighash |= SIGHASH_FORKID; + sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,sigser,maxsize*2,msg,i,msg->vins[i].spendscript,msg->vins[i].spendlen,sighash,vpnstr,suppress_pubkeys,zcash); //printf("after vini.%d vinscript.%p spendscript.%p spendlen.%d (%s)\n",i,msg->vins[i].vinscript,msg->vins[i].spendscript,msg->vins[i].spendlen,jprint(jitem(vins,i),0)); if ( iguana_vinarray_check(vinarray,msg->vins[i].prev_hash,msg->vins[i].prev_vout) < 0 ) jaddi(vinarray,iguana_vinjson(&msg->vins[i],sigtxid)); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bc988e680..7de806d8a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,9 @@ // // BCH signing // alice waiting for bestprice -// +// MNZ getcoin strangeness +// improve critical section detection when parallel trades +// reduce mem: dont redundant store pubkey utxo info // previously, it used to show amount, kmd equiv, perc // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs @@ -887,6 +889,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu 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)); printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version))); + //test_validate("02000000010e62f95ff5881de8853ce1a5ddbaad731a62879d719367f539103600f1895477010000006b483045022100c684a0871689519bd97f2e61275752124f0f1498360750c87cf99a8acf06fd8c022047e7e62a7bfd481599130e6f40c95833f6ed6f44aa8b6ead7b0ec86a738b98a041210361857e1ba609aadff520a2ca9886fe7548c7154fab2cbe108c3b0e1e7635eb1ffeffffff02a0860100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac1e6f0700000000001976a9147f4b7113f9e26d84b150f2cc6d219baaf27f884488ace6b00700"); if ( LP_MAXPRICEINFOS > 256 ) { printf("LP_MAXPRICEINFOS %d wont fit in a uint8_t, need to increase the width of the baseind and relind for struct LP_pubkey_quote\n",LP_MAXPRICEINFOS); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 133ee6c41..c1c3ab5bb 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -535,7 +535,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ { if ( msgtx->vins[i].p2shlen != 0 ) { - char coinaddr[64]; uint32_t userdatalen,sigsize,pubkeysize; uint8_t *userdata; int32_t j,k,hashtype,type,flag; struct vin_info mvin,mainvin; bits256 zero; + char coinaddr[64]; uint32_t userdatalen,hashtype,sigsize,pubkeysize; uint8_t *userdata; int32_t j,k,type,flag; struct vin_info mvin,mainvin; bits256 zero; memset(zero.bytes,0,sizeof(zero)); coinaddr[0] = 0; sigsize = 0; From 9501c31536bd464972d144906b4292f3c2b89940 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Nov 2017 11:49:26 +0400 Subject: [PATCH 2732/2732] Test --- .gitignore | 4 ++ iguana/exchanges/LP_bitcoin.c | 33 +++++++++ iguana/exchanges/LP_include.h | 4 +- iguana/exchanges/LP_nativeDEX.c | 6 +- iguana/exchanges/LP_ordermatch.c | 6 +- iguana/exchanges/LP_transaction.c | 111 +++++++++++++++++++++++++++++- 6 files changed, 155 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index f6a9cbe17..c7962cf39 100755 --- a/.gitignore +++ b/.gitignore @@ -489,3 +489,7 @@ iguana/DB/PRICES/.tmpmarker iguana/DB/KMD/0/.tmpmarker *.swp + +iguana/myipaddr + +iguana/DB/UNSPENTS/.tmpmarker diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 7c90807b1..1444658c9 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2583,6 +2583,39 @@ int32_t iguana_calcrmd160(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,char *a return(vp->type); } +uint32_t iguana_vinscriptparse(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,struct vin_info *vp,uint32_t *sigsizep,uint32_t *pubkeysizep,uint32_t *p2shsizep,uint32_t *userdatalenp,uint8_t *vinscript,int32_t scriptlen) +{ + uint32_t hashtype; uint8_t *userdata = 0; + *sigsizep = *pubkeysizep = *p2shsizep = *userdatalenp = 0; + if ( bitcoin_scriptget(taddr,pubtype,p2shtype,&hashtype,sigsizep,pubkeysizep,&userdata,userdatalenp,vp,vinscript,scriptlen,0) < 0 ) + { + printf("iguana_vinscriptparse: error parsing vinscript?\n"); + return(-1); + } + if ( userdata != 0 && *userdatalenp > 0 ) + memcpy(vp->userdata,userdata,*userdatalenp); + if ( vp->type == IGUANA_SCRIPT_P2SH ) + { + *p2shsizep = vp->p2shlen + 1 + (vp->p2shlen >= 0xfd)*2; + //printf("P2SHSIZE.%d\n",*p2shsizep); + } + return(hashtype); +} + +/*char *iguana_scriptget(struct iguana_info *coin,char *scriptstr,char *asmstr,int32_t max,int32_t hdrsi,uint32_t unspentind,bits256 txid,int32_t vout,uint8_t *rmd160,int32_t type,uint8_t *pubkey33) +{ + int32_t scriptlen; uint8_t script[IGUANA_MAXSCRIPTSIZE]; struct vin_info V,*vp = &V; + memset(vp,0,sizeof(*vp)); + scriptstr[0] = 0; + if ( asmstr != 0 ) + asmstr[0] = 0; + if ( pubkey33 != 0 && bitcoin_pubkeylen(pubkey33) > 0 ) + memcpy(vp->signers[0].pubkey,pubkey33,33); + scriptlen = iguana_scriptgen(coin,&vp->M,&vp->N,vp->coinaddr,script,asmstr,rmd160,type,(const struct vin_info *)vp,vout); + init_hexbytes_noT(scriptstr,script,scriptlen); + return(scriptstr); +}*/ + cJSON *bitcoin_txscript(char *asmstr,char **vardata,int32_t numvars) { int32_t i; cJSON *scriptjson,*array; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 163408e7d..3bea50380 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -150,8 +150,8 @@ struct vin_signer { bits256 privkey; char coinaddr[64]; uint8_t siglen,sig[80],r struct vin_info { struct iguana_msgvin vin; uint64_t amount; cJSON *extras; bits256 sigtxid; - int32_t M,N,validmask,spendlen,type,p2shlen,numpubkeys,numsigs,height,hashtype,userdatalen,suppress_pubkeys,ignore_cltverr; - uint32_t sequence,unspentind; struct vin_signer signers[16]; char coinaddr[65]; + int32_t M,N,validmask,spendlen,type,p2shlen,numpubkeys,numsigs,height,userdatalen,suppress_pubkeys,ignore_cltverr; + uint32_t sequence,unspentind,hashtype; struct vin_signer signers[16]; char coinaddr[65]; uint8_t rmd160[20],spendscript[10000],p2shscript[10000],userdata[10000]; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7de806d8a..f1b89a40b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,7 +17,7 @@ // LP_nativeDEX.c // marketmaker // -// BCH signing +// BCH signing: FORKID_BCC = 0, FORKID_BTG = 79, // Atomic number AU // alice waiting for bestprice // MNZ getcoin strangeness // improve critical section detection when parallel trades @@ -679,6 +679,8 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) printf("%s ",activecoins[i]); LP_coinfind(activecoins[i]); LP_priceinfoadd(activecoins[i]); + //test_validate("02000000010e62f95ff5881de8853ce1a5ddbaad731a62879d719367f539103600f1895477010000006b483045022100c684a0871689519bd97f2e61275752124f0f1498360750c87cf99a8acf06fd8c022047e7e62a7bfd481599130e6f40c95833f6ed6f44aa8b6ead7b0ec86a738b98a041210361857e1ba609aadff520a2ca9886fe7548c7154fab2cbe108c3b0e1e7635eb1ffeffffff02a0860100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac1e6f0700000000001976a9147f4b7113f9e26d84b150f2cc6d219baaf27f884488ace6b00700"); + //getchar(); if ( (coin= LP_coinfind(activecoins[i])) != 0 ) { if ( LP_getheight(coin) <= 0 ) @@ -889,7 +891,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu 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)); printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version))); - //test_validate("02000000010e62f95ff5881de8853ce1a5ddbaad731a62879d719367f539103600f1895477010000006b483045022100c684a0871689519bd97f2e61275752124f0f1498360750c87cf99a8acf06fd8c022047e7e62a7bfd481599130e6f40c95833f6ed6f44aa8b6ead7b0ec86a738b98a041210361857e1ba609aadff520a2ca9886fe7548c7154fab2cbe108c3b0e1e7635eb1ffeffffff02a0860100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac1e6f0700000000001976a9147f4b7113f9e26d84b150f2cc6d219baaf27f884488ace6b00700"); if ( LP_MAXPRICEINFOS > 256 ) { printf("LP_MAXPRICEINFOS %d wont fit in a uint8_t, need to increase the width of the baseind and relind for struct LP_pubkey_quote\n",LP_MAXPRICEINFOS); @@ -1034,6 +1035,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu exit(-1); } LP_initcoins(ctx,pubsock,coinsjson); + G.waiting = 1; LP_passphrase_init(passphrase,jstr(argjson,"gui")); #ifndef FROM_JS diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d1ad77b2d..bc73ee840 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -757,10 +757,10 @@ int32_t LP_validSPV(char *symbol,char *coinaddr,bits256 txid,int32_t vout) if ( (tx= LP_transactionfind(coin,txid)) != 0 ) { if ( vout < tx->numvouts && tx->height > 0 ) + { + printf("added missing utxo for SPV checking\n"); LP_address_utxoadd((uint32_t)time(NULL),"LP_validSPV",coin,coinaddr,txid,vout,tx->outpoints[vout].value,tx->height,-1); - if ( tx->SPV <= 0 ) - return(-1); - return(0); + } } } if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index c1c3ab5bb..d61940855 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -619,6 +619,100 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ return(complete); } +char *iguana_validaterawtx(void *ctx,struct iguana_info *coin,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,char *rawtx,int32_t mempool,int32_t suppress_pubkeys,int32_t zcash) +{ + bits256 signedtxid; struct iguana_msgvin vin; cJSON *log,*vins,*vouts,*txobj,*retjson; char *signedtx; int32_t plen,height,finalized = 1,i,len,maxsize,numinputs,numoutputs,complete; struct vin_info *V; uint8_t *serialized,*serialized2; uint32_t sigsize,pubkeysize,p2shsize,suffixlen; int64_t inputsum,outputsum; struct iguana_msgvout vout; + char *symbol; uint8_t wiftaddr,taddr,pubtype,p2shtype,isPoS; + height = coin->longestchain; + symbol = coin->symbol; + wiftaddr = coin->wiftaddr; + taddr = coin->taddr; + pubtype = coin->pubtype; + p2shtype = coin->p2shtype; + isPoS = coin->isPoS; + retjson = cJSON_CreateObject(); + inputsum = outputsum = numinputs = numoutputs = 0; + if ( rawtx != 0 && rawtx[0] != 0 ) + { + if ( (strlen(rawtx) & 1) != 0 ) + return(clonestr("{\"error\":\"rawtx hex has odd length\"}")); + memset(msgtx,0,sizeof(*msgtx)); + if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&msgtx->txid,msgtx,rawtx,extraspace,extralen,0,0,suppress_pubkeys,zcash)) != 0 ) + { + maxsize = (int32_t)strlen(rawtx); + serialized = malloc(maxsize); + serialized2 = malloc(maxsize); + V = calloc(numinputs,sizeof(*V)); + if ( (vouts= jarray(&numoutputs,txobj,"vout")) > 0 ) + { + for (i=0; i 0 ) + outputsum += vout.value; + } + } + if ( (vins= jarray(&numinputs,txobj,"vin")) > 0 ) + { + len = 0; + for (i=0; ivins[i].spendscript = V[i].spendscript; + if ( (msgtx->vins[i].spendlen= V[i].spendlen) == 35 ) + { + if ( (plen= bitcoin_pubkeylen(msgtx->vins[i].spendscript+1)) > 0 ) + { + memcpy(V[i].signers[0].pubkey,msgtx->vins[i].spendscript+1,plen); + V[i].suppress_pubkeys = 1; + } + } + V[i].hashtype = iguana_vinscriptparse(taddr,pubtype,p2shtype,&V[i],&sigsize,&pubkeysize,&p2shsize,&suffixlen,msgtx->vins[i].vinscript,msgtx->vins[i].scriptlen); + if ( (V[i].signers[0].siglen= sigsize) > 0 ) + memcpy(V[i].signers[0].sig,msgtx->vins[i].vinscript+1,sigsize); + V[i].userdatalen = suffixlen; + memcpy(V[i].spendscript,msgtx->vins[i].spendscript,msgtx->vins[i].spendlen); + V[i].spendlen = msgtx->vins[i].spendlen; + if ( msgtx->vins[i].sequence < IGUANA_SEQUENCEID_FINAL ) + finalized = 0; + if ( V[i].M == 0 ) + V[i].M = 1; + if ( V[i].N < V[i].M ) + V[i].N = V[i].M; + printf("V %dof%d %.8f (%s) spendscript.[%d] scriptlen.%d\n",V[i].M,V[i].N,dstr(V[i].amount),V[i].coinaddr,V[i].spendlen,V[i].spendlen); + } + complete = bitcoin_verifyvins(ctx,symbol,taddr,pubtype,p2shtype,isPoS,height,&signedtxid,&signedtx,msgtx,serialized2,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys,LP_IS_BITCOINCASH); + msgtx->txid = signedtxid; + log = cJSON_CreateArray(); + if ( iguana_interpreter(ctx,log,0,V,numinputs) < 0 ) + jaddstr(retjson,"error","interpreter rejects tx"); + else complete = 1; + jadd(retjson,"interpreter",log); + jaddnum(retjson,"complete",complete); + free(serialized), free(serialized2); + if ( signedtx != 0 ) + free(signedtx); + free(V); + } + } + //char str[65]; printf("got txid.(%s)\n",bits256_str(str,txid)); + } + msgtx->inputsum = inputsum; + msgtx->numinputs = numinputs; + msgtx->outputsum = outputsum; + msgtx->numoutputs = numoutputs; + msgtx->txfee = (inputsum - outputsum); + return(jprint(retjson,1)); +} + +void test_validate(char *signedtx) +{ + char *retstr; uint8_t extraspace[8192]; int32_t mempool=0; struct iguana_msgtx msgtx; struct iguana_info *coin = LP_coinfind("BTC"); + retstr = iguana_validaterawtx(bitcoin_ctx(),coin,&msgtx,extraspace,sizeof(extraspace),signedtx,mempool,0,coin->zcash); + printf("validate test.(%s)\n",retstr); +} + char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys,int32_t zcash) { char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[8]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin; @@ -933,11 +1027,24 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_ } } if ( dustcombine >= 1 && min0 != 0 && min0->U.value < LP_DUSTCOMBINE_THRESHOLD && (coin->electrum == 0 || min0->SPV > 0) ) - preselected[numpre++] = min0; + { + for (j=0; j= 2 && min1 != 0 && min1->U.value < LP_DUSTCOMBINE_THRESHOLD && (coin->electrum == 0 || min1->SPV > 0) ) - preselected[numpre++] = min1; + { + for (j=0; j

+rV$f1l#-OZ@G? z-;elH)~~~D|4XwU-0A7**0VE_mf=FoV}zy7%*e>F6B7^aBh$J8B>6Sl&Hy<4JBB)2 z+xIp!i~b3)Ggvd4`?0Oy(fChD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